forked from wangziqi/gongxue-base
feat: enforce public bank SaaS scopes
This commit is contained in:
@@ -2121,15 +2121,26 @@ async function main() {
|
||||
values (
|
||||
$1, $2, 'starter_yearly', 'active',
|
||||
'2026-06-21T00:00:00Z', '2027-06-21T00:00:00Z',
|
||||
'yearly', 980000, '{"source":"smoke-seed"}'::jsonb
|
||||
'yearly', 980000,
|
||||
jsonb_build_object(
|
||||
'source', 'smoke-seed',
|
||||
'publicQuestionBankAccess', jsonb_build_object(
|
||||
'mode', 'limited_regions',
|
||||
'allowedRegionIds', jsonb_build_array($3::text)
|
||||
)
|
||||
)
|
||||
)
|
||||
on conflict (id)
|
||||
do update set status = excluded.status,
|
||||
do update set plan_code = excluded.plan_code,
|
||||
status = excluded.status,
|
||||
starts_at = excluded.starts_at,
|
||||
expires_at = excluded.expires_at,
|
||||
billing_cycle = excluded.billing_cycle,
|
||||
amount_cents = excluded.amount_cents,
|
||||
metadata = excluded.metadata,
|
||||
updated_at = now()
|
||||
`,
|
||||
[ids.partnerSubscription, ids.partnerTenant],
|
||||
[ids.partnerSubscription, ids.partnerTenant, ids.region],
|
||||
);
|
||||
|
||||
await client.query(
|
||||
|
||||
Reference in New Issue
Block a user