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:
@@ -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 },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user