代下单功能

This commit is contained in:
2026-07-12 11:40:04 +08:00
parent d949301bc1
commit de01d36cdb
46 changed files with 2657 additions and 253 deletions
@@ -0,0 +1,83 @@
import { Type } from 'class-transformer';
import { IsIn, IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
import { PromoCodeScene, PromoCodeStatus } from '@dukang/shared-types';
export class PromoCodeListQueryDto {
@IsOptional()
@Type(() => Number)
page?: number;
@IsOptional()
@Type(() => Number)
pageSize?: number;
@IsOptional()
@IsString()
name?: string;
@IsOptional()
@IsString()
code?: string;
@IsOptional()
@IsIn(['ACTIVE', 'DISABLED'])
status?: PromoCodeStatus;
@IsOptional()
@IsIn(['ONLINE_LINK', 'OFFLINE_PICKUP', 'PARTNER_CHANNEL', 'EVENT', 'OTHER'])
scene?: PromoCodeScene;
@IsOptional()
@IsString()
ownerUserId?: string;
}
export class CreatePromoCodeDto {
@IsString()
@IsNotEmpty()
@MaxLength(128)
name: string;
@IsOptional()
@IsString()
@MaxLength(32)
code?: string;
@IsOptional()
@IsIn(['ONLINE_LINK', 'OFFLINE_PICKUP', 'PARTNER_CHANNEL', 'EVENT', 'OTHER'])
scene?: PromoCodeScene;
@IsOptional()
@IsString()
ownerUserId?: string;
@IsOptional()
@IsString()
@MaxLength(256)
remark?: string;
}
export class UpdatePromoCodeDto {
@IsOptional()
@IsString()
@MaxLength(128)
name?: string;
@IsOptional()
@IsIn(['ONLINE_LINK', 'OFFLINE_PICKUP', 'PARTNER_CHANNEL', 'EVENT', 'OTHER'])
scene?: PromoCodeScene;
@IsOptional()
@IsString()
ownerUserId?: string | null;
@IsOptional()
@IsString()
@MaxLength(256)
remark?: string | null;
}
export class UpdatePromoCodeStatusDto {
@IsIn(['ACTIVE', 'DISABLED'])
status: PromoCodeStatus;
}