autosync_backend2 1.1.59 → 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 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;
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, tdb = db_default) => {
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({
@@ -146257,7 +146258,7 @@ var CrmInspectionLogic;
146257
146258
  }
146258
146259
  const cpOrder = await logic_default12.create({
146259
146260
  licensePlate: inspection.licensePlate
146260
- }, user2, db_default);
146261
+ }, user2);
146261
146262
  if ("code" in cpOrder) {
146262
146263
  return cpOrder;
146263
146264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.1.59",
3
+ "version": "1.1.60",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",