v3计划内容上传
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
|--------|-------------------|--------|
|
||||
| **iam** | User, UserAddress, … | jacy-dukang |
|
||||
| **catalog** | CommonCity, CommonProductItem, … | jacy-dukang |
|
||||
| **store** | Store, Partner | 刘京尧 |
|
||||
| **store** | Store, Partner | 刘景尧 |
|
||||
| **trade** | Order, OrderDelivery | jacy-dukang |
|
||||
| **benefit** | BenefitCoupon | jacy-dukang |
|
||||
| **redeem** | RedeemRecord, StoreRating | 刘京尧 |
|
||||
| **redeem** | RedeemRecord, StoreRating | 刘景尧 |
|
||||
| **settlement** | StorePayout, PartnerBill | jacy-dukang |
|
||||
| **ops** | 只读聚合 | jacy-dukang |
|
||||
| **analytics** | LogUserAnalytics | jacy-dukang |
|
||||
|
||||
@@ -34,7 +34,7 @@ export class RedeemService {
|
||||
});
|
||||
if (!coupon) throw new NotFoundException('券不存在');
|
||||
const balance = Number(coupon.balance);
|
||||
const check = validateRedeemAmount(balance, body.amount);
|
||||
const check = validateRedeemAmount(balance, body.amount, balance);
|
||||
if (!check.ok) throw new BadRequestException(check.message);
|
||||
allocations = [{ couponId: coupon.id.toString(), amount: body.amount }];
|
||||
} else {
|
||||
@@ -115,7 +115,7 @@ export class RedeemService {
|
||||
where: { id: BigInt(alloc.couponId) },
|
||||
});
|
||||
if (!coupon) throw new BadRequestException('券不存在');
|
||||
const check = validateRedeemAmount(Number(coupon.balance), alloc.amount);
|
||||
const check = validateRedeemAmount(Number(coupon.balance), alloc.amount, Number(coupon.balance));
|
||||
if (!check.ok) throw new BadRequestException(check.message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user