autosync_backend2 1.1.58 → 1.1.60
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/index.d.ts +5 -3
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -488,6 +488,7 @@ export declare const app: Elysia<"", {
|
|
488
488
|
phone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
489
489
|
orderId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
490
490
|
vin: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
491
|
+
vehicleId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
491
492
|
state: import("@sinclair/typebox").TOptional<import("elysia/dist/type-system/types").TUnionEnum<["CREATED", "PROGRESSING", "COMPLETE"]>>;
|
492
493
|
timeCompleted: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
493
494
|
model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -4427,6 +4428,7 @@ export declare const app: Elysia<"", {
|
|
4427
4428
|
phone?: string | undefined;
|
4428
4429
|
licensePlate?: string | undefined;
|
4429
4430
|
vin?: string | undefined;
|
4431
|
+
vehicleId?: string | undefined;
|
4430
4432
|
orderId?: string | undefined;
|
4431
4433
|
state?: "CREATED" | "PROGRESSING" | "COMPLETE" | undefined;
|
4432
4434
|
timeCompleted?: string | undefined;
|
@@ -6498,9 +6500,9 @@ export declare const app: Elysia<"", {
|
|
6498
6500
|
deletedAt: string | null;
|
6499
6501
|
};
|
6500
6502
|
employee: {
|
6501
|
-
firstname: string
|
6502
|
-
|
6503
|
-
};
|
6503
|
+
firstname: string;
|
6504
|
+
lastname: string;
|
6505
|
+
} | null;
|
6504
6506
|
}[];
|
6505
6507
|
};
|
6506
6508
|
422: {
|
package/dist/index.js
CHANGED
@@ -145339,7 +145339,7 @@ var CrmCpOrderLogic;
|
|
145339
145339
|
CrmCpOrderLogic.select = async (query, user2) => {
|
145340
145340
|
const make = alias(techdocVehicleKindTable, "make");
|
145341
145341
|
const model = alias(techdocVehicleKindTable, "model");
|
145342
|
-
const filter = and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), eq(crmCpOrderTable.state, query.state ?? "CREATED").if(query.state), eq(crmCpOrderTable.id, query.id ?? "").if(query.id), gte(sql3`date(${crmCpOrderTable.createdAt})`, query.createdAt).if(query.createdAt), lte(sql3`date(${crmCpOrderTable.createdAt})`, query.timeCompleted).if(query.timeCompleted), softDeletedFilter(crmCpOrderTable), like(crmCpOrderTable.orderId, query.orderId ?? "").if(query.orderId), ilike(model.name, `%${query.model}%`).if(query.model), like(crmVehicleTable.licensePlate, `${query.licensePlate}%`).if(query.licensePlate), ilike(crmVehicleTable.vin, `%${query.vin}%`).if(query.vin), like(crmCustomerTable.phoneNumber, `${query.phone}%`).if(query.phone));
|
145342
|
+
const filter = and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), eq(crmCpOrderTable.state, query.state ?? "CREATED").if(query.state), eq(crmCpOrderTable.id, query.id ?? "").if(query.id), gte(sql3`date(${crmCpOrderTable.createdAt})`, query.createdAt).if(query.createdAt), lte(sql3`date(${crmCpOrderTable.createdAt})`, query.timeCompleted).if(query.timeCompleted), softDeletedFilter(crmCpOrderTable), like(crmCpOrderTable.orderId, query.orderId ?? "").if(query.orderId), eq(crmCpOrderTable.vehicleId, query.vehicleId ?? "").if(query.vehicleId), ilike(model.name, `%${query.model}%`).if(query.model), like(crmVehicleTable.licensePlate, `${query.licensePlate}%`).if(query.licensePlate), ilike(crmVehicleTable.vin, `%${query.vin}%`).if(query.vin), like(crmCustomerTable.phoneNumber, `${query.phone}%`).if(query.phone));
|
145343
145343
|
const baseQuery = db_default.select({
|
145344
145344
|
totalCount: totalCountSql,
|
145345
145345
|
order: crmCpOrderTable,
|
@@ -145382,7 +145382,7 @@ var CrmCpOrderLogic;
|
|
145382
145382
|
...content
|
145383
145383
|
};
|
145384
145384
|
};
|
145385
|
-
CrmCpOrderLogic.create = async (body, user2
|
145385
|
+
CrmCpOrderLogic.create = async (body, user2) => {
|
145386
145386
|
return db_default.transaction(async (db2) => {
|
145387
145387
|
let customerId;
|
145388
145388
|
if (body.phone) {
|
@@ -145918,7 +145918,8 @@ var CrmCpOrderModel;
|
|
145918
145918
|
timeCompleted: t.String({ format: "date" }),
|
145919
145919
|
vin: t.String(),
|
145920
145920
|
orderId: t.String(),
|
145921
|
-
licensePlate: t.Transform(t.String()).Decode((value) => value.toUpperCase()).Encode((value) => value)
|
145921
|
+
licensePlate: t.Transform(t.String()).Decode((value) => value.toUpperCase()).Encode((value) => value),
|
145922
|
+
vehicleId: t.String({ format: "uuid" })
|
145922
145923
|
}))
|
145923
145924
|
]);
|
145924
145925
|
CrmCpOrderModel.complete = t.Object({
|
@@ -146214,7 +146215,7 @@ var CrmInspectionLogic;
|
|
146214
146215
|
totalCount: totalCountSql,
|
146215
146216
|
employee: {
|
146216
146217
|
firstname: companyEmployeeTable.firstname,
|
146217
|
-
|
146218
|
+
lastname: companyEmployeeTable.lastname
|
146218
146219
|
}
|
146219
146220
|
}).from(crmInspectionTable).where(CrmInspectionLogic.getFilter(query, user2)).orderBy(desc(crmInspectionTable.createdAt)).innerJoin(crmVehicleTable, eq(crmInspectionTable.vehicleId, crmVehicleTable.id)).leftJoin(companyEmployeeTable, eq(crmInspectionTable.employeeId, companyEmployeeTable.id)).$dynamic();
|
146220
146221
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
@@ -146257,7 +146258,7 @@ var CrmInspectionLogic;
|
|
146257
146258
|
}
|
146258
146259
|
const cpOrder = await logic_default12.create({
|
146259
146260
|
licensePlate: inspection.licensePlate
|
146260
|
-
}, user2
|
146261
|
+
}, user2);
|
146261
146262
|
if ("code" in cpOrder) {
|
146262
146263
|
return cpOrder;
|
146263
146264
|
}
|