feat(checkout): implement wizard and admin actions
All checks were successful
Staging Build / build (push) Successful in 3m11s
All checks were successful
Staging Build / build (push) Successful in 3m11s
This commit is contained in:
@@ -182,8 +182,9 @@ export async function checkoutAction(params: {
|
||||
items: any[];
|
||||
endCustomerId: string;
|
||||
customerProfile?: any;
|
||||
lastLicenseDate?: string | null;
|
||||
}) {
|
||||
const { items, endCustomerId, customerProfile } = params;
|
||||
const { items, endCustomerId, customerProfile, lastLicenseDate } = params;
|
||||
const supabase = await createClient();
|
||||
|
||||
// 1. Session & Auth Check
|
||||
@@ -256,7 +257,8 @@ export async function checkoutAction(params: {
|
||||
products,
|
||||
categories,
|
||||
type === 'purchase' ? 'one_time' : 'monthly',
|
||||
item.moduleQuantities
|
||||
item.moduleQuantities,
|
||||
type === 'purchase' ? lastLicenseDate : null
|
||||
);
|
||||
const itemsWithDevice = itemSnapshot.items.map(i => ({
|
||||
...i,
|
||||
@@ -273,7 +275,8 @@ export async function checkoutAction(params: {
|
||||
total: total,
|
||||
tax_rate: 19,
|
||||
tax_amount: Math.round(total * 0.19 * 100) / 100,
|
||||
subtotal: Math.round((total / 1.19) * 100) / 100
|
||||
subtotal: Math.round((total / 1.19) * 100) / 100,
|
||||
last_license_date: type === 'purchase' ? lastLicenseDate : null
|
||||
};
|
||||
|
||||
const orderNumber = generateOrderNumber(type === 'purchase' ? 'AE' : 'BE');
|
||||
|
||||
Reference in New Issue
Block a user