|
|
|
module.exports = [{
|
|
|
|
mapId: 'orderMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'number',
|
|
|
|
'start_time'
|
|
|
|
],
|
|
|
|
associations: [
|
|
|
|
{name: 'user', mapId: 'userMap', columnPrefix: 'user_'},
|
|
|
|
{name: 'address', mapId: 'addressMap', columnPrefix: 'address_'},
|
|
|
|
{name: 'delivery', mapId: 'deliveryMap', columnPrefix: 'delivery_'}
|
|
|
|
],
|
|
|
|
collections: [
|
|
|
|
{name: 'transactions', mapId: 'transactionMap', columnPrefix: 'transaction_'}
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'transactionMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'start_time',
|
|
|
|
'completion_time',
|
|
|
|
'payment_state',
|
|
|
|
'item_total_price',
|
|
|
|
'coupon_effective_discount',
|
|
|
|
'shipping_price',
|
|
|
|
'tax_price',
|
|
|
|
'has_preorder',
|
|
|
|
'preorder_fulfill_date',
|
|
|
|
'preorder_ready_to_ship'
|
|
|
|
],
|
|
|
|
associations: [
|
|
|
|
{name: 'cart', mapId: 'cartMap', columnPrefix: 'cart_'},
|
|
|
|
{name: 'coupon', mapId: 'couponMap', columnPrefix: 'coupon_'}
|
|
|
|
],
|
|
|
|
collections: [
|
|
|
|
{name: 'payments', mapId: 'paymentMap', columnPrefix: 'payment_'}
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'addressMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'name',
|
|
|
|
'company',
|
|
|
|
'street1',
|
|
|
|
'street2',
|
|
|
|
'city',
|
|
|
|
'state',
|
|
|
|
'zip',
|
|
|
|
'country',
|
|
|
|
'phone',
|
|
|
|
'easypost_id',
|
|
|
|
'verified'
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'couponMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'code',
|
|
|
|
'valid_until',
|
|
|
|
'free_shipping',
|
|
|
|
'number_allowed_uses',
|
|
|
|
'flat_discount_cents',
|
|
|
|
'percent_discount',
|
|
|
|
'per_sock_discount_cents',
|
|
|
|
'number_of_socks_free'
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'paymentMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'type',
|
|
|
|
'time',
|
|
|
|
'value_cents',
|
|
|
|
'recipient_email'
|
|
|
|
],
|
|
|
|
associations: [
|
|
|
|
{name: 'stripe', mapId: 'paymentStripeMap', columnPrefix: 'stripe_'}
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'paymentStripeMap',
|
|
|
|
idProperty: 'payment_intent_id',
|
|
|
|
properties: [
|
|
|
|
'receipt_email'
|
|
|
|
]
|
|
|
|
},{
|
|
|
|
mapId: 'deliveryMap',
|
|
|
|
idProperty: 'uuid',
|
|
|
|
properties: [
|
|
|
|
'type',
|
|
|
|
'tracking_number',
|
|
|
|
'price_cents',
|
|
|
|
'date_shipped',
|
|
|
|
'easypost_id',
|
|
|
|
'description',
|
|
|
|
'date_delivered'
|
|
|
|
]
|
|
|
|
}]
|