File size: 1,633 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | import type { ResponseCart, ResponseCartProduct } from './types';
export function getEmptyResponseCart(): ResponseCart {
return {
blog_id: 0,
cart_generated_at_timestamp: 0,
cart_key: 'no-site',
products: [],
total_tax: '0',
total_tax_integer: 0,
total_tax_breakdown: [],
total_cost: 0,
total_cost_integer: 0,
coupon_savings_total_integer: 0,
sub_total_with_taxes_integer: 0,
sub_total_integer: 0,
currency: 'USD',
credits_integer: 0,
allowed_payment_methods: [],
coupon: '',
is_coupon_applied: false,
has_auto_renew_coupon_been_automatically_applied: false,
locale: 'en-us',
tax: { location: {}, display_taxes: false },
is_signup: false,
next_domain_is_free: false,
next_domain_condition: '',
};
}
export function getEmptyResponseCartProduct(): ResponseCartProduct {
return {
time_added_to_cart: Date.now(),
product_name: 'Replace me',
product_name_en: 'Replace me',
product_slug: 'replace-me',
currency: 'USD',
extra: {},
meta: '',
product_id: 1,
cart_item_id: 'replace-me',
volume: 1,
quantity: null,
current_quantity: null,
item_original_cost_integer: 0,
item_original_cost_for_quantity_one_integer: 0,
item_original_monthly_cost_integer: 0,
item_subtotal_integer: 0,
item_original_subtotal_integer: 0,
is_included_for_100yearplan: false,
is_domain_registration: false,
is_bundled: false,
is_sale_coupon_applied: false,
bill_period: '365',
months_per_bill_period: null,
uuid: 'product001',
cost: 0,
item_tax: 0,
product_type: 'test',
included_domain_purchase_amount: 0,
product_variants: [],
cost_overrides: [],
};
}
|