fix(partner): drop pickup store and reorder promo on proxy order
CI / verify (pull_request) Has been cancelled
CI / verify (pull_request) Has been cancelled
On-site pickup no longer requires a store; move optional promo above fulfillment mode. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,9 +65,8 @@ export class PartnerProxyOrderCreateDto {
|
||||
@IsBoolean()
|
||||
autoReceive?: boolean;
|
||||
|
||||
@ValidateIf((o: PartnerProxyOrderCreateDto) => o.deliveryMode === 'ON_SITE_PICKUP')
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
storeId?: string;
|
||||
|
||||
@IsOptional()
|
||||
|
||||
@@ -1228,17 +1228,12 @@ export class TradeService {
|
||||
let commissionDistrict = receiverDistrict;
|
||||
|
||||
if (body.deliveryMode === 'ON_SITE_PICKUP') {
|
||||
if (!body.storeId?.trim()) throw new BadRequestException('请选择提货门店');
|
||||
const store = await this.prisma.store.findFirst({
|
||||
where: { id: BigInt(body.storeId.trim()), partnerAccountId: primary.id },
|
||||
});
|
||||
if (!store) throw new BadRequestException('门店不存在或不属于当前合伙人');
|
||||
receiverName = store.name;
|
||||
receiverProvince = store.province;
|
||||
receiverCity = store.cityName;
|
||||
receiverDistrict = store.district;
|
||||
receiverAddress = `现场提货·${store.name}·${store.province}${store.cityName}${store.district}${store.address}`;
|
||||
commissionDistrict = store.district;
|
||||
receiverName = body.receiverName?.trim() || `用户${normalizedPhone.slice(-4)}`;
|
||||
receiverProvince = '现场';
|
||||
receiverCity = '现场';
|
||||
receiverDistrict = '取货';
|
||||
receiverAddress = '现场提货';
|
||||
commissionDistrict = '';
|
||||
} else {
|
||||
if (!receiverProvince || !receiverCity || !receiverDistrict) {
|
||||
throw new BadRequestException('请选择省市区');
|
||||
|
||||
Reference in New Issue
Block a user