feat(store): benefit coupon usage rules and show env photos on store detail
CI / verify (pull_request) Has been cancelled

Add benefitUsageRule on store create/edit (HQ + partner) and C-end detail between intro and env gallery.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-27 23:25:18 +08:00
parent ea8152ebf3
commit fc03905777
10 changed files with 119 additions and 6 deletions
@@ -214,6 +214,9 @@ export class AdminStoresService {
...(dto.name !== undefined ? { name: dto.name } : {}),
...(dto.phone !== undefined ? { phone: dto.phone } : {}),
...(dto.intro !== undefined ? { intro: dto.intro } : {}),
...(dto.benefitUsageRule !== undefined
? { benefitUsageRule: String(dto.benefitUsageRule).trim() || null }
: {}),
...(dto.address !== undefined ? { address: dto.address } : {}),
...(dto.district !== undefined ? { district: dto.district } : {}),
...(dto.settlementRate !== undefined ? { settlementRate: dto.settlementRate } : {}),
@@ -305,6 +308,15 @@ export class AdminStoresService {
]);
if (!hoursCheck.ok) throw new BadRequestException(hoursCheck.message);
const intro = dto.intro?.trim() || null;
if (intro && (intro.length < 2 || intro.length > 500)) {
throw new BadRequestException('门店简介须为 2~500 字');
}
const benefitUsageRule = dto.benefitUsageRule?.trim() || null;
if (benefitUsageRule && benefitUsageRule.length > 1000) {
throw new BadRequestException('好客权益券使用规则最多 1000 字');
}
const store = await this.prisma.store.create({
data: {
cityId: city.id,
@@ -317,7 +329,8 @@ export class AdminStoresService {
cityName: dto.city ?? city.name,
district: dto.district ?? '',
address: dto.address,
intro: dto.intro ?? null,
intro,
benefitUsageRule,
avgPrice: dto.avgPrice ?? null,
openTime,
closeTime,