v3计划内容上传

This commit is contained in:
2026-07-04 20:36:26 +08:00
parent def3ed5175
commit 743d242d52
23 changed files with 291 additions and 53 deletions
+2 -2
View File
@@ -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);
}