@lyxa.ai/core 1.4.253-alpha.10 → 1.4.253-alpha.11
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,6 +27,7 @@ let Payout = class Payout extends defaultClasses_1.TimeStamps {
|
|
|
27
27
|
dueDate;
|
|
28
28
|
revokedReason;
|
|
29
29
|
bobTransactions;
|
|
30
|
+
settledViaBoB;
|
|
30
31
|
};
|
|
31
32
|
exports.Payout = Payout;
|
|
32
33
|
__decorate([
|
|
@@ -57,6 +58,10 @@ __decorate([
|
|
|
57
58
|
(0, typegoose_1.prop)({ ref: () => _1.BOBFinance }),
|
|
58
59
|
__metadata("design:type", Array)
|
|
59
60
|
], Payout.prototype, "bobTransactions", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typegoose_1.prop)({ type: Boolean }),
|
|
63
|
+
__metadata("design:type", Boolean)
|
|
64
|
+
], Payout.prototype, "settledViaBoB", void 0);
|
|
60
65
|
exports.Payout = Payout = __decorate([
|
|
61
66
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'payouts', discriminatorKey: 'payoutType' } }),
|
|
62
67
|
(0, typegoose_1.Index)({ createdAt: -1, invoiceNumber: -1, deletedAt: 1 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAAgF;AAChF,4DAAmD;AACnD,kDAA0B;AAC1B,wBAA6C;AA4BtC,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,aAAa,CAAU;IAGvB,UAAU,CAAc;IAGxB,MAAM,CAAgB;IAGtB,aAAa,CAAY;IAGzB,OAAO,CAAQ;IAGf,aAAa,CAAU;IAGvB,eAAe,CAAqB;
|
|
1
|
+
{"version":3,"file":"payout.model.js","sourceRoot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AM,EAAE,IAAI,EAAE,CAC3B,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QAErE,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,MAAM,CAwBlB","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, PayoutStatus, PayoutType } from '../../../utilities/enum';\nimport { Duration } from './shared/duration.model';\nimport dayjs from 'dayjs';\nimport { BOBFinance, CounterModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'payouts', discriminatorKey: 'payoutType' } })\n@Index({ createdAt: -1, invoiceNumber: -1, deletedAt: 1 })\n@Index({ shop: 1, deletedAt: 1 })\n@Index({ rider: 1, deletedAt: 1 })\n@Index({ vendor: 1, deletedAt: 1 })\n@Index({ payoutType: 1, deletedAt: 1 })\n@Index({ invoiceNumber: 1 }, { unique: true })\n@pre<Payout>('save', async function (next) {\n\tif (this.invoiceNumber) return next(); // Skip if already has invoice number\n\n\tconst now = dayjs();\n\tconst year = now.format('YY'); // last two digits\n\tconst month = now.format('MM');\n\tconst key = `${month}${year}`;\n\n\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t{ counterType: CounterType.PAYOUT },\n\t\t{ $inc: { value: 1 } },\n\t\t{ new: true, upsert: true }\n\t);\n\n\tconst sequence = counter.value;\n\tthis.invoiceNumber = `${key}${sequence.toString().padStart(4, '0')}`;\n\n\tnext();\n})\nexport class Payout extends TimeStamps {\n\t@prop({ type: String })\n\tpublic invoiceNumber!: string;\n\n\t@prop({ type: String, enum: PayoutType, default: PayoutType.SHOP })\n\tpublic payoutType?: PayoutType;\n\n\t@prop({ type: String, enum: PayoutStatus, default: PayoutStatus.UNPAID }) // overdue status handling on-fly, when due date passes\n\tpublic status?: PayoutStatus;\n\n\t@prop({ required: true, type: Duration })\n\tpublic billingPeriod!: Duration;\n\n\t@prop({ required: true, type: Date })\n\tpublic dueDate!: Date;\n\n\t@prop({ type: String })\n\tpublic revokedReason?: string;\n\n\t@prop({ ref: () => BOBFinance })\n\tpublic bobTransactions?: Ref<BOBFinance>[];\n\n\t@prop({ type: Boolean })\n\tpublic settledViaBoB?: boolean;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/types",
|
|
3
|
-
"version": "1.4.253-alpha.
|
|
3
|
+
"version": "1.4.253-alpha.11",
|
|
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