@lyxa.ai/core 1.4.21 → 1.4.23
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/mongo/models/embedded/service-line-item.model.d.ts +1 -0
- package/dist/libraries/mongo/models/embedded/service-line-item.model.js +5 -0
- package/dist/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/utilities/dayjs/dayjs.d.ts +1 -0
- package/dist/utilities/dayjs/dayjs.js +4 -0
- package/dist/utilities/dayjs/dayjs.js.map +1 -1
- package/package.json +2 -2
|
@@ -21,6 +21,7 @@ class LineItemSnap {
|
|
|
21
21
|
description;
|
|
22
22
|
duration;
|
|
23
23
|
materialCost;
|
|
24
|
+
secondaryMaterialCost;
|
|
24
25
|
}
|
|
25
26
|
exports.LineItemSnap = LineItemSnap;
|
|
26
27
|
__decorate([
|
|
@@ -43,6 +44,10 @@ __decorate([
|
|
|
43
44
|
(0, typegoose_1.prop)({ type: Number }),
|
|
44
45
|
__metadata("design:type", Number)
|
|
45
46
|
], LineItemSnap.prototype, "materialCost", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], LineItemSnap.prototype, "secondaryMaterialCost", void 0);
|
|
46
51
|
class ServiceLineItem {
|
|
47
52
|
lineItemType;
|
|
48
53
|
servicePackage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAiE;AACjE,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AAEvD,MAAa,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,QAAQ,CAAiB;IAGzB,YAAY,CAAU;
|
|
1
|
+
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAiE;AACjE,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AAEvD,MAAa,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,QAAQ,CAAiB;IAGzB,YAAY,CAAU;IAGtB,qBAAqB,CAAU;CACtC;AAlBD,oCAkBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACF;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oCAAa,EAAE,CAAC;8BACZ,oCAAa;8CAAC;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DACe;AAevC,MAAa,eAAe;IAEpB,YAAY,CAAuB;IAGnC,cAAc,CAAuB;IAGrC,KAAK,CAAqB;IAG1B,KAAK,CAAU;IAGf,QAAQ,CAAU;IAIlB,YAAY,CAAgB;IAG5B,cAAc,CAAU;IAGxB,eAAe,CAAU;IAGzB,wBAAwB,CAAU;CACzC;AA5BD,0CA4BC;AA1BO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAAmB,EAAE,CAAC;;qDACxB;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;;uDACQ;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;8CACD;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;iDACtB;AAIlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACnB,YAAY;qDAAC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iEACkB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { ServiceLineItemType } from '../../../../utilities/enum';\nimport { ServicePackage } from '../service-package.model';\nimport { ServiceAddon } from '../service-addon.model';\nimport { PreparingTime } from './preparing-time.model';\n\nexport class LineItemSnap {\n\t@prop({ type: String })\n\tpublic name?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: PreparingTime })\n\tpublic duration?: PreparingTime;\n\n\t@prop({ type: Number })\n\tpublic materialCost?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryMaterialCost?: number;\n}\n\n/**\n * A single line item in the service cart.\n *\n * Each line item is either a PACKAGE or an ADDON — never both.\n * The `lineItemType` field is the discriminator:\n *\n * - lineItemType = PACKAGE → `servicePackage` + `lineItemSnap` are set; addon field is absent.\n * - lineItemType = ADDON → `addon` + `lineItemSnap` are set; servicePackage field is absent.\n *\n * `price` — unit price of the item (package price or addon price).\n * `quantity` — how many units of this item are being booked.\n */\nexport class ServiceLineItem {\n\t@prop({ required: true, type: String, enum: ServiceLineItemType })\n\tpublic lineItemType!: ServiceLineItemType;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ServiceAddon })\n\tpublic addon?: Ref<ServiceAddon>;\n\n\t@prop({ required: true, type: Number })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic quantity!: number;\n\n\t// Add these fileds when cart will be submitted\n\t@prop({ type: LineItemSnap, _id: false })\n\tpublic lineItemSnap?: LineItemSnap;\n\n\t@prop({ type: Number })\n\tpublic secondaryPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic discountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryDiscountedPrice?: number;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -9,5 +9,6 @@ type DayjsWithTimezone = {
|
|
|
9
9
|
} & typeof dayjs;
|
|
10
10
|
declare const dayjsWithTimezone: DayjsWithTimezone;
|
|
11
11
|
export declare const _setTimezone: (timezone: string) => void;
|
|
12
|
+
export declare function isSameDay(date1: Date, date2: Date): boolean;
|
|
12
13
|
export type { Dayjs };
|
|
13
14
|
export default dayjsWithTimezone;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports._setTimezone = void 0;
|
|
7
|
+
exports.isSameDay = isSameDay;
|
|
7
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
9
|
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
9
10
|
const minMax_1 = __importDefault(require("dayjs/plugin/minMax"));
|
|
@@ -37,5 +38,8 @@ const _setTimezone = (timezone) => {
|
|
|
37
38
|
DEFAULT_TIMEZONE = timezone;
|
|
38
39
|
};
|
|
39
40
|
exports._setTimezone = _setTimezone;
|
|
41
|
+
function isSameDay(date1, date2) {
|
|
42
|
+
return dayjs_1.default.utc(date1).isSame(dayjs_1.default.utc(date2), 'day');
|
|
43
|
+
}
|
|
40
44
|
exports.default = dayjsWithTimezone;
|
|
41
45
|
//# sourceMappingURL=dayjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs.js","sourceRoot":"/","sources":["utilities/dayjs/dayjs.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"dayjs.js","sourceRoot":"/","sources":["utilities/dayjs/dayjs.ts"],"names":[],"mappings":";;;;;;AAoDA,8BAEC;AAtDD,kDAAqC;AACrC,2DAAmC;AACnC,iEAAyC;AACzC,qEAA6C;AAC7C,qEAA6C;AAC7C,kCAAmD;AAEnD,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AACvB,eAAK,CAAC,MAAM,CAAC,gBAAM,CAAC,CAAC;AACrB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEvB,IAAI,gBAAgB,GAAG,aAAa,CAAC;AAWrC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAU,EAAE,MAAY,EAAE,EAAW,EAAE,EAAE;IACpE,MAAM,cAAc,GAAG,EAAE,IAAI,gBAAgB,CAAC;IAE9C,IAAA,+BAAwB,EAAC,cAAc,CAAC,CAAC;IAEzC,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,IAAA,eAAK,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC,CAAsB,CAAC;AAExB,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;IAC/B,iBAAyB,CAAC,GAAG,CAAC,GAAI,eAAa,CAAC,GAAG,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACpD,gBAAgB,GAAG,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAEvD,iBAAiB,CAAC,GAAG,GAAG,eAAK,CAAC,GAAG,CAAC;AAClC,iBAAiB,CAAC,GAAG,GAAG,eAAK,CAAC,GAAG,CAAC;AAClC,iBAAiB,CAAC,QAAQ,GAAG,eAAK,CAAC,QAAQ,CAAC;AAErC,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,EAAE;IAChD,gBAAgB,GAAG,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,SAAgB,SAAS,CAAC,KAAW,EAAE,KAAW;IACjD,OAAO,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC;AAGD,kBAAe,iBAAiB,CAAC","sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport minMax from 'dayjs/plugin/minMax';\nimport timezone from 'dayjs/plugin/timezone';\nimport duration from 'dayjs/plugin/duration';\nimport { _setLyxaTimezoneVariable } from '../time';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(minMax);\ndayjs.extend(duration);\n\nlet DEFAULT_TIMEZONE = 'Asia/Beirut';\n\ntype DayjsWithTimezone = {\n\t(date?: any, format?: any, tz?: string): Dayjs;\n\tsetTimezone(timezone: string): void;\n\tgetTimezone(): string;\n\tmax(...dates: (Dayjs | undefined)[]): Dayjs;\n\tmin(...dates: (Dayjs | undefined)[]): Dayjs;\n\tduration: typeof dayjs.duration;\n} & typeof dayjs;\n\nconst dayjsWithTimezone = ((date?: any, format?: any, tz?: string) => {\n\tconst targetTimezone = tz || DEFAULT_TIMEZONE;\n\n\t_setLyxaTimezoneVariable(targetTimezone);\n\n\tif (format) {\n\t\treturn dayjs(date, format).tz(targetTimezone);\n\t}\n\treturn dayjs(date).tz(targetTimezone);\n}) as DayjsWithTimezone;\n\nObject.keys(dayjs).forEach(key => {\n\t(dayjsWithTimezone as any)[key] = (dayjs as any)[key];\n});\n\ndayjsWithTimezone.setTimezone = (timezone: string) => {\n\tDEFAULT_TIMEZONE = timezone;\n};\n\ndayjsWithTimezone.getTimezone = () => DEFAULT_TIMEZONE;\n\ndayjsWithTimezone.max = dayjs.max;\ndayjsWithTimezone.min = dayjs.min;\ndayjsWithTimezone.duration = dayjs.duration;\n\nexport const _setTimezone = (timezone: string) => {\n\tDEFAULT_TIMEZONE = timezone;\n};\n\nexport function isSameDay(date1: Date, date2: Date): boolean {\n\treturn dayjs.utc(date1).isSame(dayjs.utc(date2), 'day');\n}\n\nexport type { Dayjs };\nexport default dayjsWithTimezone;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.23",
|
|
4
4
|
"description": "The Core system of the Lyxa services.",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
"@types/ws": "^8.18.1",
|
|
69
69
|
"prettier": "3.5.3"
|
|
70
70
|
}
|
|
71
|
-
}
|
|
71
|
+
}
|