@lyxa.ai/core 1.3.4 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,6 @@ function getChannel() {
27
27
  return channel;
28
28
  }
29
29
  async function publishEvent(event) {
30
- console.log('taking event', event);
31
30
  const ch = getChannel();
32
31
  const messageBuffer = Buffer.from(JSON.stringify(event.payload));
33
32
  ch.publish(exports.EXCHANGE_NAME, event.eventId, messageBuffer, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;;AASA,oCAKC;AAED,gCAGC;AAED,oCAWC;AAED,4CAiCC;AAED,sCAIC;AAzED,sDAA2B;AAE3B,mEAA+D;AAE/D,IAAI,UAA6B,CAAC;AAClC,IAAI,OAAqB,CAAC;AACb,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,UAAU,CAAC;AAEzC,KAAK,UAAU,YAAY,CAAC,SAAiB;IACnD,UAAU,GAAG,MAAM,iBAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC;IAC3C,MAAM,OAAO,CAAC,cAAc,CAAC,qBAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,0CAA0C,IAAA,8BAAa,GAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAgB,UAAU;IACzB,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACnF,OAAO,OAAO,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,YAAY,CACjC,KAA0B;IAE1B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAEnC,MAAM,EAAE,GAAG,UAAU,EAAE,C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CAAC;AAEM,KAAK,UAAU,aAAa;IAClC,IAAI,OAAO;QAAE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,UAAU;QAAE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAA,8BAAa,GAAE,GAAG,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import amqp from 'amqplib';\nimport { BaseEvent } from './BaseEvent';\nimport { getInstanceId } from '../../utilities/instance.utils';\n\nlet connection: amqp.ChannelModel;\nlet channel: amqp.Channel;\nexport const EXCHANGE_NAME = 'lyxa.events';\nexport const INSTANCE_ROUTE_PREFIX = 'instance'; // routing key: instance.{instanceName}.{eventType}\n\nexport async function initEventBus(rabbitUrl: string) {\n\tconnection = await amqp.connect(rabbitUrl);\n\tchannel = await connection.createChannel();\n\tawait channel.assertExchange(EXCHANGE_NAME, 'topic', { durable: true });\n\tconsole.log(`EventBus initialized with instance ID: ${getInstanceId()}`);\n}\n\nexport function getChannel(): amqp.Channel {\n\tif (!channel) throw new Error('Channel not initialized. Call initEventBus first.');\n\treturn channel;\n}\n\nexport async function publishEvent<TPayload extends Record<string, unknown>>(\n\tevent: BaseEvent<TPayload>\n): Promise<void> {\n\tconsole.log('taking event', event);\n\n\tconst ch = getChannel();\n\tconst messageBuffer = Buffer.from(JSON.stringify(event.payload));\n\tch.publish(EXCHANGE_NAME, event.eventId, messageBuffer, {\n\t\tcontentType: 'application/json',\n\t});\n\t// console.log(`Published event [${event.eventId}] with payload`, event.payload);\n}\n\nexport async function subscribeToEvent(\n\teventId: string,\n\tonMessage: (payload: any) => Promise<void>\n): Promise<void> {\n\tconst ch = getChannel();\n\tconst queueName = `${eventId}`;\n\n\tawait ch.assertQueue(queueName, {\n\t\tdurable: true, // survive broker restart\n\t\texclusive: false, // Allow multiple consumers to attach. Only one connection can use it (each pod has own queue). Set to TRUE if each pod needs it's own queue\n\t\tautoDelete: false, // Queue removed when pod disconnects when set to TRUE\n\t});\n\n\tawait ch.bindQueue(queueName, EXCHANGE_NAME, eventId);\n\n\tawait ch.consume(\n\t\tqueueName,\n\t\tasync msg => {\n\t\t\tif (msg !== null) {\n\t\t\t\tconst payload = JSON.parse(msg.content.toString());\n\t\t\t\ttry {\n\t\t\t\t\tawait onMessage(payload);\n\t\t\t\t\tch.ack(msg);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(`Error handling event [${eventId}] on instance [${getInstanceId()}]`, err);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ noAck: false }\n\t);\n\n\t// console.log(`Subscribed to event [${eventId}] on queue [${queueName}]`);\n\tconsole.log(`Subscribed to event [${eventId}]`);\n}\n\nexport async function closeEventBus(): Promise<void> {\n\tif (channel) await channel.close();\n\tif (connection) await connection.close();\n\tconsole.log(`EventBus closed for instance [${getInstanceId()}]`);\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;;AASA,oCAKC;AAED,gCAGC;AAED,oCAQC;AAED,4CAiCC;AAED,sCAIC;AAtED,sDAA2B;AAE3B,mEAA+D;AAE/D,IAAI,UAA6B,CAAC;AAClC,IAAI,OAAqB,CAAC;AACb,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,UAAU,CAAC;AAEzC,KAAK,UAAU,YAAY,CAAC,SAAiB;IACnD,UAAU,GAAG,MAAM,iBAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC;IAC3C,MAAM,OAAO,CAAC,cAAc,CAAC,qBAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,0CAA0C,IAAA,8BAAa,GAAE,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,SAAgB,UAAU;IACzB,IAAI,CAAC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GAAG,CAAC,CAAC;YAC1F,CAAC;QACF,CAAC;IACF,CAAC,EACD,EAAE,KAAK,EAAE,KAAK,EAAE,CAChB,CAAC;IAGF,OAAO,CAAC,GAAG,CAAC,wBAAwB,OAAO,GAAG,CAAC,CAAC;AACjD,CAAC;AAEM,KAAK,UAAU,aAAa;IAClC,IAAI,OAAO;QAAE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,UAAU;QAAE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAA,8BAAa,GAAE,GAAG,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import amqp from 'amqplib';\nimport { BaseEvent } from './BaseEvent';\nimport { getInstanceId } from '../../utilities/instance.utils';\n\nlet connection: amqp.ChannelModel;\nlet channel: amqp.Channel;\nexport const EXCHANGE_NAME = 'lyxa.events';\nexport const INSTANCE_ROUTE_PREFIX = 'instance'; // routing key: instance.{instanceName}.{eventType}\n\nexport async function initEventBus(rabbitUrl: string) {\n\tconnection = await amqp.connect(rabbitUrl);\n\tchannel = await connection.createChannel();\n\tawait channel.assertExchange(EXCHANGE_NAME, 'topic', { durable: true });\n\tconsole.log(`EventBus initialized with instance ID: ${getInstanceId()}`);\n}\n\nexport function getChannel(): amqp.Channel {\n\tif (!channel) throw new Error('Channel not initialized. Call initEventBus first.');\n\treturn channel;\n}\n\nexport async function publishEvent<TPayload extends Record<string, unknown>>(\n\tevent: BaseEvent<TPayload>\n): Promise<void> {\n\tconst ch = getChannel();\n\tconst messageBuffer = Buffer.from(JSON.stringify(event.payload));\n\tch.publish(EXCHANGE_NAME, event.eventId, messageBuffer, {\n\t\tcontentType: 'application/json',\n\t});\n}\n\nexport async function subscribeToEvent(\n\teventId: string,\n\tonMessage: (payload: any) => Promise<void>\n): Promise<void> {\n\tconst ch = getChannel();\n\tconst queueName = `${eventId}`;\n\n\tawait ch.assertQueue(queueName, {\n\t\tdurable: true, // survive broker restart\n\t\texclusive: false, // Allow multiple consumers to attach. Only one connection can use it (each pod has own queue). Set to TRUE if each pod needs it's own queue\n\t\tautoDelete: false, // Queue removed when pod disconnects when set to TRUE\n\t});\n\n\tawait ch.bindQueue(queueName, EXCHANGE_NAME, eventId);\n\n\tawait ch.consume(\n\t\tqueueName,\n\t\tasync msg => {\n\t\t\tif (msg !== null) {\n\t\t\t\tconst payload = JSON.parse(msg.content.toString());\n\t\t\t\ttry {\n\t\t\t\t\tawait onMessage(payload);\n\t\t\t\t\tch.ack(msg);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(`Error handling event [${eventId}] on instance [${getInstanceId()}]`, err);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ noAck: false }\n\t);\n\n\t// console.log(`Subscribed to event [${eventId}] on queue [${queueName}]`);\n\tconsole.log(`Subscribed to event [${eventId}]`);\n}\n\nexport async function closeEventBus(): Promise<void> {\n\tif (channel) await channel.close();\n\tif (connection) await connection.close();\n\tconsole.log(`EventBus closed for instance [${getInstanceId()}]`);\n}"]}
@@ -26,6 +26,8 @@ export declare class FinanceSettlement extends TimeStamps {
26
26
  secondaryAmountFromDelivery?: number;
27
27
  cashbackAmount?: number;
28
28
  secondaryCashbackAmount?: number;
29
+ companyVat?: number;
30
+ secondaryCompanyVat?: number;
29
31
  paymentIntentId?: string;
30
32
  settleBy?: Ref<Admin>;
31
33
  adminNote?: string;
@@ -40,6 +40,8 @@ let FinanceSettlement = class FinanceSettlement extends defaultClasses_1.TimeSta
40
40
  secondaryAmountFromDelivery;
41
41
  cashbackAmount;
42
42
  secondaryCashbackAmount;
43
+ companyVat;
44
+ secondaryCompanyVat;
43
45
  paymentIntentId;
44
46
  settleBy;
45
47
  adminNote;
@@ -117,6 +119,14 @@ __decorate([
117
119
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
118
120
  __metadata("design:type", Number)
119
121
  ], FinanceSettlement.prototype, "secondaryCashbackAmount", void 0);
122
+ __decorate([
123
+ (0, typegoose_1.prop)({ type: Number, default: 0 }),
124
+ __metadata("design:type", Number)
125
+ ], FinanceSettlement.prototype, "companyVat", void 0);
126
+ __decorate([
127
+ (0, typegoose_1.prop)({ type: Number, default: 0 }),
128
+ __metadata("design:type", Number)
129
+ ], FinanceSettlement.prototype, "secondaryCompanyVat", void 0);
120
130
  __decorate([
121
131
  (0, typegoose_1.prop)({ type: String }),
122
132
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"finance-settlement.model.js","sourceRoot":"/","sources":["libraries/mongo/models/finance-settlement.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,+CAAsC;AACtC,6CAAoC;AACpC,+CAAsC;AACtC,kDAA6F;AAC7F,6CAAoC;AACpC,+CAAsC;AACtC,iDAAwC;AAExC,wBAAyD;AACzD,kEAA6D;AAUtD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAU;IAEzC,YAAY,CAAS;IAGrB,WAAW,CAAe;IAG1B,KAAK,CAAc;IAGnB,OAAO,CAAU;IAGjB,MAAM,CAAe;IAGrB,IAAI,CAAa;IAGjB,QAAQ,CAAY;IAGpB,KAAK,CAAc;IAGnB,IAAI,CAAa;IAGjB,cAAc,CAAkB;IAGhC,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,eAAe,CAAU;IAGzB,wBAAwB,CAAU;IAGlC,kBAAkB,CAAU;IAG5B,2BAA2B,CAAU;IAGrC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,eAAe,CAAU;IAGzB,QAAQ,CAAc;IAGtB,SAAS,CAAU;CAC1B,CAAA;AA/DY,8CAAiB;AAEtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;uDACtB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAA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AC;YAChB,IAAI,CAAC,YAAY,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,WAAW,CAAC,CAAC;QAC7E,CAAC;IACF,CAAC,CAAC;GACW,iBAAiB,CA+D7B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Order } from './order.model';\nimport { Shop } from './shop.model';\nimport { Rider } from './rider.model';\nimport { AccountType, CounterType, ItemType, SettlementType } from '../../../utilities/enum';\nimport { User } from './user.model';\nimport { Admin } from './admin.model';\nimport { Parent } from './parent.model';\nimport { handlePreSaveForUniqueId } from '../utilities/unique-id.hooks';\nimport { CounterModel, FinanceSettlementModel } from '.';\nimport { generateId } from '../../../utilities/id-generator';\n\n@modelOptions({ schemaOptions: { collection: 'financeSettlements' } })\n@index({ settlementType: 1, createdAt: -1 })\n@index({ accountType: 1, settlementType: 1, createdAt: -1 })\n@pre<FinanceSettlement>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.settlementId = await generateId(CounterModel, CounterType.TRANSACTION);\n\t}\n})\nexport class FinanceSettlement extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic settlementId: string;\n\n\t@prop({ required: true, type: String, enum: AccountType })\n\tpublic accountType!: AccountType;\n\n\t@prop({ ref: () => Order, index: true })\n\tpublic order?: Ref<Order>;\n\n\t@prop({ type: String, index: true })\n\tpublic orderId?: string;\n\n\t@prop({ ref: () => Parent, index: true })\n\tpublic parent?: Ref<Parent>;\n\n\t@prop({ ref: () => Shop, index: true })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String, enum: ItemType, index: true })\n\tpublic itemType?: ItemType;\n\n\t@prop({ ref: () => Rider, index: true })\n\tpublic rider?: Ref<Rider>;\n\n\t@prop({ ref: () => User, index: true })\n\tpublic user?: Ref<User>;\n\n\t@prop({ required: true, type: String, enum: SettlementType })\n\tpublic settlementType!: SettlementType;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amountFromItems?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmountFromItems?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amountFromDelivery?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmountFromDelivery?: number;\n\n\t@prop({ type: Number, default: 0 }) // used for deducting cashback when refund order\n\tpublic cashbackAmount?: number;\n\n\t@prop({ type: Number, default: 0 }) // used for deducting cashback when refund order\n\tpublic secondaryCashbackAmount?: number;\n\n\t@prop({ type: String })\n\tpublic paymentIntentId?: string;\n\n\t@prop({ ref: () => Admin })\n\tpublic settleBy?: Ref<Admin>;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic adminNote?: string;\n}\n"]}
1
+ {"version":3,"file":"finance-settlement.model.js","sourceRoot":"/","sources":["libraries/mongo/models/finance-settlement.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,+CAAsC;AACtC,6CAAoC;AACpC,+CAAsC;AACtC,kDAA6F;AAC7F,6CAAoC;AACpC,+CAAsC;AACtC,iDAAwC;AACxC,wBAAiC;AACjC,kEAA6D;AAUtD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAU;IAEzC,YAAY,CAAS;IAGrB,WAAW,CAAe;IAG1B,KAAK,CAAc;IAGnB,OAAO,CAAU;IAGjB,MAAM,CAAe;IAGrB,IAAI,CAAa;IAGjB,QAAQ,CAAY;IAGpB,KAAK,CAAc;IAGnB,IAAI,CAAa;IAGjB,cAAc,CAAkB;IAGhC,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,eAAe,CAAU;IAGzB,wBAAwB,CAAU;IAGlC,kBAAkB,CAAU;IAG5B,2BAA2B,CAAU;IAGrC,cAAc,CAAU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E,CAAC,mBAAK,EAAE,CAAC;;mDACE;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;oDACb;4BApEd,iBAAiB;IAR7B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAAE,CAAC;IACrE,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IAC3C,IAAA,iBAAK,EAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAA,eAAG,EAAoB,MAAM,EAAE,KAAK;QACpC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,YAAY,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,WAAW,CAAC,CAAC;QAC7E,CAAC;IACF,CAAC,CAAC;GACW,iBAAiB,CAqE7B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Order } from './order.model';\nimport { Shop } from './shop.model';\nimport { Rider } from './rider.model';\nimport { AccountType, CounterType, ItemType, SettlementType } from '../../../utilities/enum';\nimport { User } from './user.model';\nimport { Admin } from './admin.model';\nimport { Parent } from './parent.model';\nimport { CounterModel } from '.';\nimport { generateId } from '../../../utilities/id-generator';\n\n@modelOptions({ schemaOptions: { collection: 'financeSettlements' } })\n@index({ settlementType: 1, createdAt: -1 })\n@index({ accountType: 1, settlementType: 1, createdAt: -1 })\n@pre<FinanceSettlement>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.settlementId = await generateId(CounterModel, CounterType.TRANSACTION);\n\t}\n})\nexport class FinanceSettlement extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic settlementId: string;\n\n\t@prop({ required: true, type: String, enum: AccountType })\n\tpublic accountType!: AccountType;\n\n\t@prop({ ref: () => Order, index: true })\n\tpublic order?: Ref<Order>;\n\n\t@prop({ type: String, index: true })\n\tpublic orderId?: string;\n\n\t@prop({ ref: () => Parent, index: true })\n\tpublic parent?: Ref<Parent>;\n\n\t@prop({ ref: () => Shop, index: true })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String, enum: ItemType, index: true })\n\tpublic itemType?: ItemType;\n\n\t@prop({ ref: () => Rider, index: true })\n\tpublic rider?: Ref<Rider>;\n\n\t@prop({ ref: () => User, index: true })\n\tpublic user?: Ref<User>;\n\n\t@prop({ required: true, type: String, enum: SettlementType })\n\tpublic settlementType!: SettlementType;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amountFromItems?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmountFromItems?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic amountFromDelivery?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryAmountFromDelivery?: number;\n\n\t@prop({ type: Number, default: 0 }) // used for removing cashback when refund order\n\tpublic cashbackAmount?: number;\n\n\t@prop({ type: Number, default: 0 }) // used for removing cashback when refund order\n\tpublic secondaryCashbackAmount?: number;\n\n\t@prop({ type: Number, default: 0 }) // used for adding to shop and removing from company VAT when refund order\n\tpublic companyVat?: number;\n \n\t@prop({ type: Number, default: 0 }) // used for adding to shop and removing from company VAT when refund order\n\tpublic secondaryCompanyVat?: number;\n\n\t@prop({ type: String })\n\tpublic paymentIntentId?: string;\n\n\t@prop({ ref: () => Admin })\n\tpublic settleBy?: Ref<Admin>;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic adminNote?: string;\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { Vendor } from './vendor.model';
3
- import { ServicePackage } from './service-package.model';
4
3
  import { ProfessionalStatus, Status } from '../../../utilities/enum';
5
4
  import { TeamMemberWorkHourSetting } from './shared/work-hour.model';
5
+ import { Service } from './service.model';
6
6
  export declare class Professional {
7
7
  name: string;
8
8
  image: string;
@@ -12,7 +12,7 @@ export declare class Professional {
12
12
  nationality?: string;
13
13
  vendor: Ref<Vendor>;
14
14
  availability: TeamMemberWorkHourSetting[];
15
- worksOn: Ref<ServicePackage>[];
15
+ worksOn: Ref<Service>[];
16
16
  avgRating?: number;
17
17
  totalReviews: number;
18
18
  status: Status;
@@ -12,10 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Professional = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const vendor_model_1 = require("./vendor.model");
15
- const service_package_model_1 = require("./service-package.model");
16
15
  const enum_1 = require("../../../utilities/enum");
17
16
  const password_1 = require("../../../utilities/password");
18
17
  const work_hour_model_1 = require("./shared/work-hour.model");
18
+ const service_model_1 = require("./service.model");
19
19
  let Professional = class Professional {
20
20
  name;
21
21
  image;
@@ -65,7 +65,7 @@ __decorate([
65
65
  __metadata("design:type", Array)
66
66
  ], Professional.prototype, "availability", void 0);
67
67
  __decorate([
68
- (0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, default: [] }),
68
+ (0, typegoose_1.prop)({ ref: () => service_model_1.Service, default: [] }),
69
69
  __metadata("design:type", Array)
70
70
  ], Professional.prototype, "worksOn", void 0);
71
71
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AACxC,mEAAyD;AACzD,kDAAqE;AACrE,0DAA2D;AAC3D,8DAAqE;AAS9D,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,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AAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;4CACtD;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAkB,EAAE,OAAO,EAAE,yBAAkB,CAAC,SAAS,EAAE,CAAC;;mDAC9D;uBAtC9B,YAAY;IAPxB,IAAA,eAAG,EAAe,MAAM,EAAE,KAAK,WAAW,IAAI;QAC9C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,YAAY,CAuCxB","sourcesContent":["import { prop, Ref, modelOptions, pre } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport { ProfessionalStatus, Status } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { TeamMemberWorkHourSetting } from './shared/work-hour.model';\n\n@pre<Professional>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\nexport class Professional {\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop()\n\tpublic nationality?: string;\n\n\t@prop({ ref: () => Vendor, required: true })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => TeamMemberWorkHourSetting, default: [] })\n\tpublic availability!: TeamMemberWorkHourSetting[]\n\n\t@prop({ ref: () => ServicePackage, default: [] })\n\tpublic worksOn!: Ref<ServicePackage>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalReviews!: number;\n \n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String, enum: ProfessionalStatus, default: ProfessionalStatus.AVAILABLE })\n\tpublic currentStatus?: ProfessionalStatus;\n}\n"]}
1
+ {"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AAExC,kDAAqE;AACrE,0DAA2D;AAC3D,8DAAqE;AACrE,mDAA0C;AASnC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,YAAY,CAA8B;IAG1C,OAAO,CAAkB;IAGzB,SAAS,CAAU;IAGnB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,aAAa,CAAsB;CAC1C,CAAA;AAvCY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAChB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACH;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EAAe,MAAM,EAAE,KAAK,WAAW,IAAI;QAC9C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,YAAY,CAuCxB","sourcesContent":["import { prop, Ref, modelOptions, pre } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport { ProfessionalStatus, Status } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { TeamMemberWorkHourSetting } from './shared/work-hour.model';\nimport { Service } from './service.model';\n\n@pre<Professional>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\nexport class Professional {\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop()\n\tpublic nationality?: string;\n\n\t@prop({ ref: () => Vendor, required: true })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => TeamMemberWorkHourSetting, default: [] })\n\tpublic availability!: TeamMemberWorkHourSetting[]\n\n\t@prop({ ref: () => Service, default: [] })\n\tpublic worksOn!: Ref<Service>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalReviews!: number;\n \n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String, enum: ProfessionalStatus, default: ProfessionalStatus.AVAILABLE })\n\tpublic currentStatus?: ProfessionalStatus;\n}\n"]}
@@ -98,6 +98,14 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
98
98
  latitude: z.ZodNumber;
99
99
  longitude: z.ZodNumber;
100
100
  zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
101
+ } & {
102
+ addressLabel: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
103
+ apartment: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
104
+ buildingName: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
105
+ deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
106
+ instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
107
+ } & {
108
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
101
109
  }, "strip", z.ZodTypeAny, {
102
110
  location: {
103
111
  type: import("../../../utilities/enum").GeoLocationType;
@@ -105,12 +113,18 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
105
113
  };
106
114
  address: string;
107
115
  country: string;
116
+ _id: import("mongoose").Types.ObjectId;
108
117
  city: string;
109
118
  latitude: number;
110
119
  longitude: number;
120
+ addressLabel: string;
121
+ apartment: string;
122
+ buildingName: string;
111
123
  state?: string | undefined;
112
124
  description?: string | undefined;
113
125
  zone?: import("mongoose").Types.ObjectId | undefined;
126
+ deliveryOption?: string | undefined;
127
+ instructions?: string | undefined;
114
128
  }, {
115
129
  location: {
116
130
  coordinates: [number, number];
@@ -118,12 +132,18 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
118
132
  };
119
133
  address: string;
120
134
  country: string;
135
+ _id: string | import("mongoose").Types.ObjectId;
121
136
  city: string;
122
137
  latitude: number;
123
138
  longitude: number;
139
+ addressLabel: string;
140
+ apartment: string;
141
+ buildingName: string;
124
142
  state?: string | undefined;
125
143
  description?: string | undefined;
126
144
  zone?: string | import("mongoose").Types.ObjectId | undefined;
145
+ deliveryOption?: string | undefined;
146
+ instructions?: string | undefined;
127
147
  }>;
128
148
  paymentSummary: z.ZodObject<{
129
149
  paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
@@ -156,12 +176,18 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
156
176
  };
157
177
  address: string;
158
178
  country: string;
179
+ _id: import("mongoose").Types.ObjectId;
159
180
  city: string;
160
181
  latitude: number;
161
182
  longitude: number;
183
+ addressLabel: string;
184
+ apartment: string;
185
+ buildingName: string;
162
186
  state?: string | undefined;
163
187
  description?: string | undefined;
164
188
  zone?: import("mongoose").Types.ObjectId | undefined;
189
+ deliveryOption?: string | undefined;
190
+ instructions?: string | undefined;
165
191
  };
166
192
  user: {
167
193
  name: string;
@@ -209,12 +235,18 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
209
235
  };
210
236
  address: string;
211
237
  country: string;
238
+ _id: string | import("mongoose").Types.ObjectId;
212
239
  city: string;
213
240
  latitude: number;
214
241
  longitude: number;
242
+ addressLabel: string;
243
+ apartment: string;
244
+ buildingName: string;
215
245
  state?: string | undefined;
216
246
  description?: string | undefined;
217
247
  zone?: string | import("mongoose").Types.ObjectId | undefined;
248
+ deliveryOption?: string | undefined;
249
+ instructions?: string | undefined;
218
250
  };
219
251
  user: {
220
252
  name: string;
@@ -364,6 +396,14 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
364
396
  latitude: z.ZodNumber;
365
397
  longitude: z.ZodNumber;
366
398
  zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
399
+ } & {
400
+ addressLabel: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
401
+ apartment: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
402
+ buildingName: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
403
+ deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
404
+ instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
405
+ } & {
406
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
367
407
  }, "strip", z.ZodTypeAny, {
368
408
  location: {
369
409
  type: import("../../../utilities/enum").GeoLocationType;
@@ -371,12 +411,18 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
371
411
  };
372
412
  address: string;
373
413
  country: string;
414
+ _id: import("mongoose").Types.ObjectId;
374
415
  city: string;
375
416
  latitude: number;
376
417
  longitude: number;
418
+ addressLabel: string;
419
+ apartment: string;
420
+ buildingName: string;
377
421
  state?: string | undefined;
378
422
  description?: string | undefined;
379
423
  zone?: import("mongoose").Types.ObjectId | undefined;
424
+ deliveryOption?: string | undefined;
425
+ instructions?: string | undefined;
380
426
  }, {
381
427
  location: {
382
428
  coordinates: [number, number];
@@ -384,12 +430,18 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
384
430
  };
385
431
  address: string;
386
432
  country: string;
433
+ _id: string | import("mongoose").Types.ObjectId;
387
434
  city: string;
388
435
  latitude: number;
389
436
  longitude: number;
437
+ addressLabel: string;
438
+ apartment: string;
439
+ buildingName: string;
390
440
  state?: string | undefined;
391
441
  description?: string | undefined;
392
442
  zone?: string | import("mongoose").Types.ObjectId | undefined;
443
+ deliveryOption?: string | undefined;
444
+ instructions?: string | undefined;
393
445
  }>;
394
446
  paymentSummary: z.ZodObject<{
395
447
  paymentMethod: z.ZodNativeEnum<typeof PaymentMethod>;
@@ -422,12 +474,18 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
422
474
  };
423
475
  address: string;
424
476
  country: string;
477
+ _id: import("mongoose").Types.ObjectId;
425
478
  city: string;
426
479
  latitude: number;
427
480
  longitude: number;
481
+ addressLabel: string;
482
+ apartment: string;
483
+ buildingName: string;
428
484
  state?: string | undefined;
429
485
  description?: string | undefined;
430
486
  zone?: import("mongoose").Types.ObjectId | undefined;
487
+ deliveryOption?: string | undefined;
488
+ instructions?: string | undefined;
431
489
  };
432
490
  user: {
433
491
  name: string;
@@ -475,12 +533,18 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
475
533
  };
476
534
  address: string;
477
535
  country: string;
536
+ _id: string | import("mongoose").Types.ObjectId;
478
537
  city: string;
479
538
  latitude: number;
480
539
  longitude: number;
540
+ addressLabel: string;
541
+ apartment: string;
542
+ buildingName: string;
481
543
  state?: string | undefined;
482
544
  description?: string | undefined;
483
545
  zone?: string | import("mongoose").Types.ObjectId | undefined;
546
+ deliveryOption?: string | undefined;
547
+ instructions?: string | undefined;
484
548
  };
485
549
  user: {
486
550
  name: string;
@@ -54,7 +54,7 @@ exports.OrderActionsOutputSchema = zod_1.z.object({
54
54
  user: OrderUserSchema,
55
55
  lineItems: validation_1.ZodValidation.array(ItemSchema, 'items'),
56
56
  canceledLineItems: validation_1.ZodValidation.array(ItemSchema, 'canceledItems').optional(),
57
- address: validation_1.AddressSchema,
57
+ address: validation_1.RegularOrderAddressSchema,
58
58
  paymentSummary: OrderPaymentSummarySchema,
59
59
  preparationTimeMinutes: validation_1.ZodValidation.number('Preparation Time (minutes)', {
60
60
  isNonnegative: true,
@@ -1 +1 @@
1
- {"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAmF;AACnF,sDAAsF;AACtF,kDAA6F;AAC7F,wDAAqD;AAErD,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;AAC5B,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,WAAW,CAAC;IACvC,WAAW,EAAE,0BAAa,CAAC,MAAM,CAAC,aAAa,EAAE;QAChD,aAAa,EAAE,IAAI;KACnB,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,EAAE,0BAAa,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC5C,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,WAAW,EAAE,0BAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC3D,UAAU,EAAE,0BAAa,CAAC,KAAK,CAAC,0BAAa,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClE,YAAY,EAAE,0BAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC7D,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,UAAU,EAAE,EAA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ent":["import { z } from 'zod';\nimport { AddressSchema, DTO, ZodValidation } from '../../../utilities/validation/';\nimport { roundBaseCurrency, roundSecondaryCurrency } from '../../../utilities/shared';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n\tordersCount: ZodValidation.number('ordersCount', {\n\t\tisNonnegative: true,\n\t}),\n});\n\nconst ItemSchema = z.object({\n\t_id: ZodValidation.objectId('Order Item ID'),\n\tname: ZodValidation.string('Name'),\n\tdescription: ZodValidation.string('Description').optional(),\n\tattributes: ZodValidation.array(ZodValidation.string()).optional(),\n\tinstructions: ZodValidation.string('instructions').optional(),\n\tquantity: ZodValidation.number('quantity', { isPositive: true }),\n\tprice: ZodValidation.number('price', { isNonnegative: true }).transform(v => roundBaseCurrency(v)),\n\tsecondaryPrice: ZodValidation.number('Secondary Item Price', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n});\n\nconst OrderPaymentSummarySchema = z.object({\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tsubtotal: ZodValidation.number('Subtotal', { isNonnegative: true }).transform(v => roundBaseCurrency(v)),\n\tsecondarySubtotal: ZodValidation.number('Secondary Subtotal', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n\n\ttotalAmount: ZodValidation.number('Total Amount', { isNonnegative: true }).transform(v =>\n\t\troundBaseCurrency(v)\n\t),\n\tsecondaryTotalAmount: ZodValidation.number('Secondary Total Amount', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\tlineItems: ZodValidation.array(ItemSchema, 'items'),\n\tcanceledLineItems: ZodValidation.array(ItemSchema, 'canceledItems').optional(),\n\taddress: AddressSchema,\n\tpaymentSummary: OrderPaymentSummarySchema,\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tplacedAt: ZodValidation.coerce.date('placedAt'),\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n});\n\nexport const OrderActionsInputSchema = z.object({\n\tshopId: ZodValidation.objectId('shopId'),\n});\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t};\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tsuper(SocketEventType.ORDER_ACTIONS, OrderActionsSocketEvent.schemas, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
1
+ {"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAMwC;AACxC,sDAAsF;AACtF,kDAA6F;AAC7F,wDAAqD;AAErD,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;AAC5B,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,MAAM,eA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4B,EAAE;QAC1E,aAAa,EAAE,IAAI;KACnB,CAAC;IACF,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,yBAAkB,EAAE,QAAQ,CAAC;IACjE,WAAW,EAAE,0BAAa,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;CAC/D,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;CACxC,CAAC,CAAC;AAKH,MAAa,uBAAwB,SAAQ,iCAG5C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,+BAAuB;QAC9B,MAAM,EAAE,gCAAwB;KAChC,CAAC;IAEF,YAAY,OAAmC;QAC9C,KAAK,CAAC,sBAAe,CAAC,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAfF,0DAgBC","sourcesContent":["import { z } from 'zod';\nimport {\n\tAddressSchema,\n\tDTO,\n\tRegularOrderAddressSchema,\n\tUserAddressSchema,\n\tZodValidation,\n} from '../../../utilities/validation/';\nimport { roundBaseCurrency, roundSecondaryCurrency } from '../../../utilities/shared';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n\tordersCount: ZodValidation.number('ordersCount', {\n\t\tisNonnegative: true,\n\t}),\n});\n\nconst ItemSchema = z.object({\n\t_id: ZodValidation.objectId('Order Item ID'),\n\tname: ZodValidation.string('Name'),\n\tdescription: ZodValidation.string('Description').optional(),\n\tattributes: ZodValidation.array(ZodValidation.string()).optional(),\n\tinstructions: ZodValidation.string('instructions').optional(),\n\tquantity: ZodValidation.number('quantity', { isPositive: true }),\n\tprice: ZodValidation.number('price', { isNonnegative: true }).transform(v => roundBaseCurrency(v)),\n\tsecondaryPrice: ZodValidation.number('Secondary Item Price', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n});\n\nconst OrderPaymentSummarySchema = z.object({\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tsubtotal: ZodValidation.number('Subtotal', { isNonnegative: true }).transform(v => roundBaseCurrency(v)),\n\tsecondarySubtotal: ZodValidation.number('Secondary Subtotal', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n\n\ttotalAmount: ZodValidation.number('Total Amount', { isNonnegative: true }).transform(v =>\n\t\troundBaseCurrency(v)\n\t),\n\tsecondaryTotalAmount: ZodValidation.number('Secondary Total Amount', {\n\t\tisNonnegative: true,\n\t})\n\t\t.transform(v => roundSecondaryCurrency(v))\n\t\t.optional(),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\tlineItems: ZodValidation.array(ItemSchema, 'items'),\n\tcanceledLineItems: ZodValidation.array(ItemSchema, 'canceledItems').optional(),\n\taddress: RegularOrderAddressSchema,\n\tpaymentSummary: OrderPaymentSummarySchema,\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tplacedAt: ZodValidation.coerce.date('placedAt'),\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n});\n\nexport const OrderActionsInputSchema = z.object({\n\tshopId: ZodValidation.objectId('shopId'),\n});\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t};\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tsuper(SocketEventType.ORDER_ACTIONS, OrderActionsSocketEvent.schemas, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.4
25
+ Version: 1.3.7
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.4",
3
+ "version": "1.3.7",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.4",
3
+ "version": "1.3.7",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",