Initial commit: backend, storefront, vendor-panel added

This commit is contained in:
2025-08-01 11:05:32 +08:00
commit 08174125d2
2958 changed files with 310810 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
import { z } from 'zod'
const TaxBreakdownObject = z.object({
amount: z.number(),
taxable_amount: z.number(),
sourcing: z.string(),
tax_rate_details: z.array(
z.object({
display_name: z.string(),
percentage_decimal: z.string(),
tax_type: z.string()
})
)
})
export const StripeTaxCalculationResponseValidator = z.object({
id: z.string(),
line_items: z.object({
has_more: z.boolean(),
total_count: z.number(),
data: z.array(
z.object({
reference: z.string(),
amount: z.number(),
amount_tax: z.number(),
tax_behavior: z.string(),
tax_breakdown: z.array(TaxBreakdownObject),
tax_code: z.string(),
quantity: z.number()
})
)
}),
shipping_cost: z.object({
amount: z.number(),
amount_tax: z.number(),
tax_code: z.string(),
tax_behavior: z.string(),
tax_breakdown: z.array(TaxBreakdownObject)
})
})
export type StripeTaxCalculationResponse = z.infer<
typeof StripeTaxCalculationResponseValidator
>