feat(ops): add global test whitelist and exclude test accounts from settlement

Unify product/store visibility on HQ whitelist, mark isTest snapshots, and fix SUPER_ADMIN access for the new module.
This commit is contained in:
2026-08-07 15:46:23 +08:00
parent 10fa361983
commit b626db5d84
47 changed files with 1823 additions and 308 deletions
@@ -218,6 +218,11 @@ export class TradeService {
const promoCodeId =
attribution?.promoCode?.status === 'ACTIVE' ? attribution.promoCodeId : undefined;
const buyer = await this.prisma.user.findUnique({
where: { id: userId },
select: { isTest: true },
});
const order = await this.prisma.$transaction(async (tx) => {
const created = await tx.order.create({
data: {
@@ -258,6 +263,7 @@ export class TradeService {
benefitAmount: preview.benefitAmount,
payExpireAt,
promoCodeId,
isTest: !!buyer?.isTest,
},
include: { product: true, imageResource: true },
});