Fix upsert billing (#24)
This commit updates the product_id and variant_id in both the subscription_items and order_items in the billing tests. Updates also include adding new checks to verify these changes. Changes are reflected in corresponding SQL files for personal and team billing subscriptions/orders tests.
This commit is contained in:
committed by
GitHub
parent
fe86b04d95
commit
4e50094808
@@ -1645,9 +1645,12 @@ on conflict (
|
||||
item_data
|
||||
on conflict (id)
|
||||
do update set
|
||||
product_id = excluded.product_id,
|
||||
variant_id = excluded.variant_id,
|
||||
price_amount = excluded.price_amount,
|
||||
quantity = excluded.quantity,
|
||||
interval = excluded.interval,
|
||||
type = excluded.type,
|
||||
interval_count = excluded.interval_count;
|
||||
|
||||
return new_subscription;
|
||||
@@ -2018,6 +2021,8 @@ on conflict (
|
||||
on conflict (id)
|
||||
do update set
|
||||
price_amount = excluded.price_amount,
|
||||
product_id = excluded.product_id,
|
||||
variant_id = excluded.variant_id,
|
||||
quantity = excluded.quantity;
|
||||
|
||||
return new_order;
|
||||
@@ -2486,7 +2491,9 @@ returns table (
|
||||
primary_owner_user_id uuid,
|
||||
subscription_status public.subscription_status,
|
||||
permissions public.app_permissions[]
|
||||
) as $$
|
||||
)
|
||||
set search_path to ''
|
||||
as $$
|
||||
begin
|
||||
return QUERY
|
||||
select
|
||||
|
||||
Reference in New Issue
Block a user