fix(trade): on-site pickup pay success marks order COMPLETED
This commit is contained in:
@@ -288,8 +288,9 @@ export class TradeService {
|
||||
order.cityId,
|
||||
order.receiverDistrict,
|
||||
);
|
||||
// 现场提货:支付即完成(PRD SC-02 / REQ-U-008)
|
||||
const toStatus =
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'PENDING_RECEIVE' : 'PENDING_SHIP';
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'COMPLETED' : 'PENDING_SHIP';
|
||||
|
||||
await this.prisma.$transaction(async (tx) => {
|
||||
await tx.order.update({
|
||||
@@ -400,8 +401,9 @@ export class TradeService {
|
||||
order.cityId,
|
||||
order.receiverDistrict,
|
||||
);
|
||||
// 现场提货:支付即完成(PRD SC-02 / REQ-U-008)
|
||||
const toStatus =
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'PENDING_RECEIVE' : 'PENDING_SHIP';
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'COMPLETED' : 'PENDING_SHIP';
|
||||
await this.prisma.$transaction(async (tx) => {
|
||||
const current = await tx.order.findUnique({ where: { id: order.id } });
|
||||
if (!current || current.payStatus === 'PAID') return;
|
||||
@@ -1812,8 +1814,9 @@ export class TradeService {
|
||||
order.cityId,
|
||||
order.receiverDistrict,
|
||||
);
|
||||
// 现场提货:支付即完成(代下单同 C 端 PRD)
|
||||
const toStatus =
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'PENDING_RECEIVE' : 'PENDING_SHIP';
|
||||
order.deliveryType === 'ON_SITE_PICKUP' ? 'COMPLETED' : 'PENDING_SHIP';
|
||||
|
||||
await this.prisma.$transaction(async (tx) => {
|
||||
await tx.order.update({
|
||||
|
||||
Reference in New Issue
Block a user