@lyxa.ai/core 1.3.5 → 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.
- package/dist/libraries/event/index.js +0 -1
- package/dist/libraries/event/index.js.map +1 -1
- package/dist/libraries/mongo/models/finance-settlement.model.d.ts +2 -0
- package/dist/libraries/mongo/models/finance-settlement.model.js +10 -0
- package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/professional.model.d.ts +2 -2
- package/dist/libraries/mongo/models/professional.model.js +2 -2
- package/dist/libraries/mongo/models/professional.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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;IAC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,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC;gBACJ,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;gBACzB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO,CAAC,KAAK,CAAC,yBAAyB,OAAO,kBAAkB,IAAA,8BAAa,GAAE,GAAG,EAAE,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;
|
|
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,6CA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CAAC,EAAE,CAAC;;yDACJ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kEACK;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0DACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,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<
|
|
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: () =>
|
|
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;
|
|
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,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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';\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"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED