@lyxa.ai/core 1.0.225 → 1.0.227
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/map/providers/google-maps.js +8 -8
- package/dist/libraries/map/providers/google-maps.js.map +1 -1
- package/dist/libraries/mongo/models/service-order.model.d.ts +0 -2
- package/dist/libraries/mongo/models/service-order.model.js +0 -6
- package/dist/libraries/mongo/models/service-order.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -49,9 +49,9 @@ class GoogleMapsService {
|
|
|
49
49
|
try {
|
|
50
50
|
const url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude}, ${origin.longitude}&destination=${destination.latitude}, ${destination.longitude}&key=${this._apiKey}&mode=DRIVING`;
|
|
51
51
|
const { data } = await axios_1.default.get(url);
|
|
52
|
-
const legs = data
|
|
53
|
-
const distance = legs
|
|
54
|
-
const duration = legs
|
|
52
|
+
const legs = data?.routes[0]?.legs[0];
|
|
53
|
+
const distance = legs?.distance;
|
|
54
|
+
const duration = legs?.duration;
|
|
55
55
|
return { distance, duration };
|
|
56
56
|
}
|
|
57
57
|
catch (error) {
|
|
@@ -67,9 +67,9 @@ class GoogleMapsService {
|
|
|
67
67
|
const waypointsStr = waypoints.map(point => `${point.latitude},${point.longitude}`).join('|');
|
|
68
68
|
const url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude},${origin.longitude}&destination=${destination.latitude},${destination.longitude}&waypoints=${waypointsStr}&key=${this._apiKey}&mode=DRIVING`;
|
|
69
69
|
const { data } = await axios_1.default.get(url);
|
|
70
|
-
const routes = data
|
|
71
|
-
const overviewPolyline = polyline.decode(routes
|
|
72
|
-
const legs = routes
|
|
70
|
+
const routes = data?.routes[0];
|
|
71
|
+
const overviewPolyline = polyline.decode(routes?.overview_polyline?.points);
|
|
72
|
+
const legs = (routes?.legs ?? []).map((leg) => {
|
|
73
73
|
const overviewPolyline = leg?.steps?.flatMap(step => polyline.decode(step?.polyline?.points));
|
|
74
74
|
return {
|
|
75
75
|
distance: leg.distance,
|
|
@@ -77,12 +77,12 @@ class GoogleMapsService {
|
|
|
77
77
|
overviewPolyline,
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
|
-
const totalDistance = legs
|
|
80
|
+
const totalDistance = legs?.reduce((acc, curr) => acc + curr.distance.value, 0);
|
|
81
81
|
const distance = {
|
|
82
82
|
text: `${(totalDistance / 1000).toFixed(2)} km`,
|
|
83
83
|
value: totalDistance,
|
|
84
84
|
};
|
|
85
|
-
const totalDuration = legs
|
|
85
|
+
const totalDuration = legs?.reduce((acc, curr) => acc + curr.duration.value, 0);
|
|
86
86
|
const duration = {
|
|
87
87
|
text: `${Math.round(totalDuration / 60)} mins`,
|
|
88
88
|
value: totalDuration,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-maps.js","sourceRoot":"/","sources":["libraries/map/providers/google-maps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAU1B,2DAA6C;AAC7C,yCAAyC;AAEzC,MAAa,iBAAiB;IACrB,OAAO,CAAqB;IAEpC,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QACzE,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,+DAA+D,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,gBAAgB,WAAW,CAAC,QAAQ,KAAK,WAAW,CAAC,SAAS,QAAQ,IAAI,CAAC,OAAO,eAAe,CAAC;YAEjN,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEtC,MAAM,IAAI,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"google-maps.js","sourceRoot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,CAAC;YAEF,MAAM,aAAa,GAAG,IAAI,EAAE,MAAM,CACjC,CAAC,GAAQ,EAAE,IAAkC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAC3E,CAAC,CACD,CAAC;YACF,MAAM,QAAQ,GAAG;gBAChB,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC,OAAO;gBAC9C,KAAK,EAAE,aAAa;aACpB,CAAC;YAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;YAC7D,MAAM,IAAI,kBAAS,CAAC;gBACnB,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,qEAAqE;aAC9E,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD;AAjFD,8CAiFC","sourcesContent":["import axios from 'axios';\nimport {\n\tIMapService,\n\tICoordinate,\n\tIDistance,\n\tIDuration,\n\tILeg,\n\tIDistanceInfo,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport * as polyline from '@mapbox/polyline';\nimport { TRPCError } from '@trpc/server';\n\nexport class GoogleMapsService implements IMapService {\n\tprivate _apiKey: string | undefined;\n\n\tconstructor(apiKey: string) {\n\t\tthis._apiKey = apiKey;\n\t}\n\n\tpublic async getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\ttry {\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude}, ${origin.longitude}&destination=${destination.latitude}, ${destination.longitude}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst legs = data?.routes[0]?.legs[0];\n\n\t\t\tconst distance = legs?.distance;\n\t\t\tconst duration = legs?.duration;\n\n\t\t\treturn { distance, duration };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getDistanceInfo: ${error}`);\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Failed to fetch distance information from Google Maps API.',\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: Array<ICoordinate>\n\t): Promise<IWaypointDistanceInfo> {\n\t\ttry {\n\t\t\tconst waypointsStr = waypoints.map(point => `${point.latitude},${point.longitude}`).join('|');\n\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude},${origin.longitude}&destination=${destination.latitude},${destination.longitude}&waypoints=${waypointsStr}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst routes = data?.routes[0];\n\n\t\t\tconst overviewPolyline = polyline.decode(routes?.overview_polyline?.points);\n\n\t\t\tconst legs = (routes?.legs ?? []).map((leg: { steps: any[]; distance: any; duration: any }) => {\n\t\t\t\tconst overviewPolyline = leg?.steps?.flatMap(step => polyline.decode(step?.polyline?.points));\n\n\t\t\t\treturn {\n\t\t\t\t\tdistance: leg.distance,\n\t\t\t\t\tduration: leg.duration,\n\t\t\t\t\toverviewPolyline,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst totalDistance = legs?.reduce(\n\t\t\t\t(acc: any, curr: { distance: { value: any } }) => acc + curr.distance.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst distance = {\n\t\t\t\ttext: `${(totalDistance / 1000).toFixed(2)} km`,\n\t\t\t\tvalue: totalDistance,\n\t\t\t};\n\n\t\t\tconst totalDuration = legs?.reduce(\n\t\t\t\t(acc: any, curr: { duration: { value: any } }) => acc + curr.duration.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst duration = {\n\t\t\t\ttext: `${Math.round(totalDuration / 60)} mins`,\n\t\t\t\tvalue: totalDuration,\n\t\t\t};\n\n\t\t\treturn { distance, duration, legs, overviewPolyline };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getWaypointsDistanceInfo: ${error}`);\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Failed to fetch waypoint distance information from Google Maps API.',\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from "@typegoose/typegoose";
|
|
2
2
|
import { User } from "./user.model";
|
|
3
3
|
import { Vendor } from "./vendor.model";
|
|
4
|
-
import { ServicePackage } from "./service-package.model";
|
|
5
4
|
import { OrderRecurrencePattern, PaymentMethod, ServiceOrderPriority, ServiceOrderStatus } from "../../../utilities/enum";
|
|
6
5
|
import { Professional } from "./professional.model";
|
|
7
6
|
import { ServiceTimer } from "./embedded/service-timer.model";
|
|
@@ -14,7 +13,6 @@ export declare class ServiceOrder {
|
|
|
14
13
|
user: Ref<User>;
|
|
15
14
|
vendor: Ref<Vendor>;
|
|
16
15
|
cart: Ref<ServiceCart>;
|
|
17
|
-
package: Ref<ServicePackage>;
|
|
18
16
|
status: ServiceOrderStatus;
|
|
19
17
|
priority: ServiceOrderPriority;
|
|
20
18
|
timeFrom: Date;
|
|
@@ -13,7 +13,6 @@ exports.ServiceOrder = void 0;
|
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const user_model_1 = require("./user.model");
|
|
15
15
|
const vendor_model_1 = require("./vendor.model");
|
|
16
|
-
const service_package_model_1 = require("./service-package.model");
|
|
17
16
|
const enum_1 = require("../../../utilities/enum");
|
|
18
17
|
const professional_model_1 = require("./professional.model");
|
|
19
18
|
const service_timer_model_1 = require("./embedded/service-timer.model");
|
|
@@ -26,7 +25,6 @@ let ServiceOrder = class ServiceOrder {
|
|
|
26
25
|
user;
|
|
27
26
|
vendor;
|
|
28
27
|
cart;
|
|
29
|
-
package;
|
|
30
28
|
status;
|
|
31
29
|
priority;
|
|
32
30
|
timeFrom;
|
|
@@ -66,10 +64,6 @@ __decorate([
|
|
|
66
64
|
(0, typegoose_1.prop)({ ref: () => service_cart_model_1.ServiceCart, required: true }),
|
|
67
65
|
__metadata("design:type", Object)
|
|
68
66
|
], ServiceOrder.prototype, "cart", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
(0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, required: true }),
|
|
71
|
-
__metadata("design:type", Object)
|
|
72
|
-
], ServiceOrder.prototype, "package", void 0);
|
|
73
67
|
__decorate([
|
|
74
68
|
(0, typegoose_1.prop)({ enum: enum_1.ServiceOrderStatus, default: enum_1.ServiceOrderStatus.PENDING }),
|
|
75
69
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,6CAAoC;AACpC,iDAAwC;
|
|
1
|
+
{"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,6CAAoC;AACpC,iDAAwC;AAExC,kDAA0H;AAC1H,6DAAoD;AACpD,wEAA8D;AAC9D,kFAAuE;AACvE,6DAAmD;AACnD,oFAA0E;AAC1E,wFAA6E;AAOtE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEd,OAAO,CAAS;IAGhB,IAAI,CAAY;IAGhB,MAAM,CAAc;IAGpB,IAAI,CAAmB;IAG9B,MAAM,CAAqB;IAGpB,QAAQ,CAAuB;IAG/B,QAAQ,CAAO;IAGf,MAAM,CAAO;IAGb,aAAa,CAAU;IAGvB,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,oBAAoB,CAAoB;IAGxC,YAAY,CAA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mDACP;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACb,8CAAkB;wDAAC;uBA1EtC,YAAY;IALxB,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,cAAc;SAC7B;KACJ,CAAC;GACW,YAAY,CA4ExB","sourcesContent":["import { modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { User } from \"./user.model\";\nimport { Vendor } from \"./vendor.model\";\nimport { ServicePackage } from \"./service-package.model\";\nimport { OrderRecurrencePattern, PaymentMethod, ServiceOrderPriority, ServiceOrderStatus } from \"../../../utilities/enum\";\nimport { Professional } from \"./professional.model\";\nimport { ServiceTimer } from \"./embedded/service-timer.model\";\nimport { ServiceOrderFlag } from \"./embedded/service-order-flag.model\";\nimport { ServiceCart } from \"./service-cart.model\";\nimport { PaymentInformation } from \"./embedded/payment-infromation.model\";\nimport { ServiceOrderFinance } from \"./embedded/service-order-finance.model\";\n\n@modelOptions({\n schemaOptions: {\n collection: \"serviceOrder\"\n }\n})\nexport class ServiceOrder {\n @prop({ type: String, required: true, unique: true })\n public orderId!: string\n\n @prop({ ref: () => User, required: true })\n public user!: Ref<User>\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>\n\n @prop({ ref: () => ServiceCart, required: true })\n public cart!: Ref<ServiceCart>\n\n @prop({ enum: ServiceOrderStatus, default: ServiceOrderStatus.PENDING })\n status!: ServiceOrderStatus\n\n @prop({ enum: ServiceOrderPriority, default: ServiceOrderPriority.NORMAL })\n public priority!: ServiceOrderPriority\n\n @prop({ required: true })\n public timeFrom!: Date\n\n @prop({ required: true })\n public timeTo!: Date\n\n @prop({ type: Number })\n public hoursRequired?: number;\n\n @prop({ type: String })\n public userNotes?: string;\n\n @prop({ type: String })\n public vendorNotes?: string;\n\n @prop({ ref: () => Professional })\n public assignedProfessional?: Ref<Professional>\n\n @prop({ type: () => ServiceTimer })\n public serviceTimer?: ServiceTimer\n\n @prop({ type: () => ServiceOrderFlag })\n public flag?: ServiceOrderFlag\n\n @prop()\n public confirmedAt?: Date;\n\n @prop()\n public autoConfirmedAt?: Date;\n\n @prop({ default: false })\n public isUrgent!: boolean;\n\n @prop()\n public urgentAt?: Date;\n\n @prop({ default: false })\n public isOverdue!: boolean;\n\n @prop()\n public overdueAt?: Date;\n\n @prop({required: true, type: ServiceOrderFinance })\n public finance: ServiceOrderFinance\n\n @prop({ enum: OrderRecurrencePattern, default: OrderRecurrencePattern.ONETIME })\n public recurrencePattern?: OrderRecurrencePattern\n\n @prop({ default: false })\n public isPaid!: boolean;\n\n @prop({ enum: PaymentMethod, type: String })\n public paymentMethod?: PaymentMethod;\n\n @prop({ type: () => PaymentInformation })\n public paymentInformation?: PaymentInformation;\n\n}"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED