'use strict';
import { createBaseResourceProperties } from '../utils/base-resource-properties.js';
import { createOrder, createOrderItem, createOrderTransaction } from './order-db.js';
import { workspaceConstants } from '../../../fd-toolbox/server/constants/workspace-constants.js';
import { customerIds } from '../customers/customer-master-data.js';
import { storeIds } from '../store/store-master-data.js';
import { productIds } from '../products/product-master-data.js';
import { orderStatuses } from '../../common/orders/order-enums.js';
import { userIds } from '../../common/dev/constants/user-ids.js';
import { toolboxUserConstants } from '../../meta/constants/toolbox-users.js';

var __defProp=Object['defineProperty'],__name=(_0x4ac6e2,_0x313812)=>__defProp(_0x4ac6e2,'name',{'value':_0x313812,'configurable':!![]});const orderIds={'timFirstOrderId':'04364fb7-5d61-40b1-953a-1e4ac6881484','timSecondOrderId':'14cb2348-a7eb-4b7d-bda8-fe0cad6507ff','timThirdOrderId':'7fbc8c39-8a4d-47b0-92df-d83e1a6709b3','timFourthOrderId':'ecb45a28-3d22-4d6a-9f6f-780c4f8c2b54','workerBotOrderId':'de8b5feb-4f18-4aaa-88d1-b39c414dd77b'};const orderItemIds={'phoneOrderItemId':'5f0d688f-ce29-4a5c-aa39-135b3c11f9d7','tvOrderItemId':'36e19b26-492f-45d0-b389-47ce1c936c56','laptopOrderItemId':'3550c73c-8259-48ea-a75d-7be9c413b9c6'};const orderTransactionIds={'timFirstOrderTransactionId':'ce64f9df-9385-4afe-a2ce-1a45057967ea','timSecondOrderTransactionId':'0ef7c31c-406d-4676-a223-951f50ff1cdc','workerBotOrderTransactionId':'2cb32916-4d57-4d93-beda-07212d7778f0'};const paymentTransactionIds={'timFirst':'1894c197-8b80-48f3-86a2-4f4c5f36e06c','timSecond':'e8bb9163-4d4b-4de0-a6a0-21f115a3b2b7','workerBot':'06e3b026-f852-4046-b038-86f3ce3aad5c'};async function seedOrders(){const _0x4f0d0f=workspaceConstants['defaultWorkspaceId'];for(const _0x306b6f of ordersToSeed){await seedOrder(_0x306b6f['id'],_0x4f0d0f,_0x306b6f['customerId'],storeIds['techStoreId'],_0x306b6f['status'],_0x306b6f['name'],_0x306b6f['userId']);}for(const _0xcbef2b of orderItemsToSeed){await seedOrderItem(_0xcbef2b['id'],_0x4f0d0f,_0xcbef2b['orderId'],_0xcbef2b['productId'],_0xcbef2b['quantity'],_0xcbef2b['price'],_0xcbef2b['name']);}for(const _0x1f15b1 of orderTransactionsToSeed){await seedOrderTransaction(_0x1f15b1['id'],_0x4f0d0f,_0x1f15b1['orderId'],_0x1f15b1['paymentTransactionId'],_0x1f15b1['amount'],_0x1f15b1['name']);}}__name(seedOrders,'seedOrders');async function seedOrder(_0x2f18f9,_0x3b8f2d,_0x28401b,_0x2f426d,_0x1a764c,_0x571392,_0x47bf94){const _0x20d6da={...createBaseResourceProperties(_0x2f18f9),'workspaceId':_0x3b8f2d,'customerId':_0x28401b,'storeId':_0x2f426d,'status':_0x1a764c,'name':_0x571392,'userId':_0x47bf94};return createOrder(_0x20d6da);}__name(seedOrder,'seedOrder');async function seedOrderItem(_0x42864e,_0x40a76f,_0x2532f2,_0x3496d4,_0x274f07,_0x20c65d,_0x4c31eb){const _0x4ca10d={...createBaseResourceProperties(_0x42864e),'workspaceId':_0x40a76f,'orderId':_0x2532f2,'productId':_0x3496d4,'quantity':_0x274f07,'price':_0x20c65d,'name':_0x4c31eb};return createOrderItem(_0x4ca10d);}__name(seedOrderItem,'seedOrderItem');async function seedOrderTransaction(_0x2d81f9,_0x2751be,_0x266dda,_0x510329,_0x29023b,_0x4dd0b3){const _0x5c873f={...createBaseResourceProperties(_0x2d81f9),'workspaceId':_0x2751be,'orderId':_0x266dda,'paymentTransactionId':_0x510329,'amount':_0x29023b,'name':_0x4dd0b3};return createOrderTransaction(_0x5c873f);}__name(seedOrderTransaction,'seedOrderTransaction');const ordersToSeed=[{'id':orderIds['timFirstOrderId'],'customerId':customerIds['timCustomerId'],'status':orderStatuses['draft'],'name':'Tim\x20Order','userId':userIds['timWId']},{'id':orderIds['timSecondOrderId'],'customerId':customerIds['colinCustomerId'],'status':orderStatuses['submitted'],'name':'Colin\x20Second\x20Order','userId':userIds['colinBId']},{'id':orderIds['timThirdOrderId'],'customerId':customerIds['colinCustomerId'],'status':orderStatuses['shipped'],'name':'Colin\x20Third\x20Order','userId':userIds['colinBId']},{'id':orderIds['timFourthOrderId'],'customerId':customerIds['colinCustomerId'],'status':orderStatuses['OutForDelivery'],'name':'Colin\x20Fourth\x20Order','userId':userIds['colinBId']},{'id':orderIds['workerBotOrderId'],'customerId':customerIds['workerBotCustomerId'],'status':orderStatuses['delivered'],'name':'Worker\x20Bot\x20Order','userId':toolboxUserConstants['workerBotId']}],orderItemsToSeed=[{'id':orderItemIds['phoneOrderItemId'],'orderId':orderIds['timFirstOrderId'],'productId':productIds['smartphoneId'],'quantity':0x1,'price':0x3e7,'name':'Tim\x20Phone\x20Order'},{'id':orderItemIds['tvOrderItemId'],'orderId':orderIds['timSecondOrderId'],'productId':productIds['smartTvId'],'quantity':0x2,'price':0xfa0,'name':'Tim\x20TV\x20Order'},{'id':orderItemIds['laptopOrderItemId'],'orderId':orderIds['workerBotOrderId'],'productId':productIds['gamingLaptopId'],'quantity':0x1,'price':0x7d0,'name':'Worker\x20Laptop\x20Order'}],orderTransactionsToSeed=[{'id':orderTransactionIds['timFirstOrderTransactionId'],'orderId':orderIds['timFirstOrderId'],'paymentTransactionId':paymentTransactionIds['timFirst'],'amount':0x1,'name':'Tim\x20First\x20Order\x20Transaction'},{'id':orderTransactionIds['timSecondOrderTransactionId'],'orderId':orderIds['timSecondOrderId'],'paymentTransactionId':paymentTransactionIds['timSecond'],'amount':0x1,'name':'Tim\x20Second\x20Order\x20Transaction'},{'id':orderTransactionIds['workerBotOrderTransactionId'],'orderId':orderIds['workerBotOrderId'],'paymentTransactionId':paymentTransactionIds['workerBot'],'amount':0x1,'name':'Worker\x20Bot\x20Order\x20Transaction'}];

export { orderIds, orderItemIds, orderTransactionIds, paymentTransactionIds, seedOrders };
