autosync_backend2 1.1.54 → 1.1.55

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
@@ -465,9 +465,9 @@ export declare const app: Elysia<"", {
465
465
  readonly "CrmCpOrderModel.update": import("@sinclair/typebox").TObject<{
466
466
  companyId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
467
467
  isNoat: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>>;
468
- vehicleId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
469
468
  customerId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
470
469
  km: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
470
+ vehicleId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
471
471
  companyBranchId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
472
472
  orderId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
473
473
  state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
@@ -699,24 +699,17 @@ export declare const app: Elysia<"", {
699
699
  authUserId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
700
700
  }>;
701
701
  readonly "CrmInspectionModel.create": import("@sinclair/typebox").TObject<{
702
- employeeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
703
- description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
704
702
  inspection: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
705
703
  type: import("@sinclair/typebox").TString;
706
- values: import("@sinclair/typebox").TObject<{
704
+ values: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
707
705
  question: import("@sinclair/typebox").TString;
708
706
  answer: import("@sinclair/typebox").TString;
709
- description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
710
- }>;
707
+ description: import("@sinclair/typebox").TString;
708
+ }>>;
711
709
  }>>;
712
- experience: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
713
- rank: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
714
710
  licensePlate: import("@sinclair/typebox").TString;
715
- status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
716
- CREATED: "CREATED";
717
- APPROVED: "APPROVED";
718
- CANCELLED: "CANCELLED";
719
- }>>;
711
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
712
+ employeeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
720
713
  }>;
721
714
  readonly "CrmInspectionModel.select": import("@sinclair/typebox").TObject<{
722
715
  search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -727,6 +720,9 @@ export declare const app: Elysia<"", {
727
720
  size: import("@sinclair/typebox").TInteger;
728
721
  }>;
729
722
  }>;
723
+ readonly "CrmInspectionModel.selectUbCab": import("@sinclair/typebox").TObject<{
724
+ licensePlate: import("@sinclair/typebox").TString;
725
+ }>;
730
726
  readonly "TechdocSupplierModel.select": import("@sinclair/typebox").TObject<{
731
727
  pagination: import("@sinclair/typebox").TObject<{
732
728
  page: import("@sinclair/typebox").TInteger;
@@ -4730,9 +4726,9 @@ export declare const app: Elysia<"", {
4730
4726
  body: {
4731
4727
  companyId?: string | undefined;
4732
4728
  isNoat?: boolean | null | undefined;
4733
- vehicleId?: string | undefined;
4734
4729
  customerId?: string | null | undefined;
4735
4730
  km?: number | undefined;
4731
+ vehicleId?: string | undefined;
4736
4732
  companyBranchId?: string | undefined;
4737
4733
  orderId?: string | undefined;
4738
4734
  state?: "CREATED" | "PROGRESSING" | "COMPLETE" | undefined;
@@ -5545,24 +5541,10 @@ export declare const app: Elysia<"", {
5545
5541
  fleet: {
5546
5542
  post: {
5547
5543
  body: {
5548
- companyId?: string | null | undefined;
5549
- licensePlate?: string | null | undefined;
5550
- customerId?: string | null | undefined;
5551
- vin?: string | null | undefined;
5552
- color?: string | null | undefined;
5553
- engineCc?: string | null | undefined;
5554
- cylinder?: string | null | undefined;
5555
- gasType?: string | null | undefined;
5556
- transmissionType?: string | null | undefined;
5557
- vehicleType?: string | null | undefined;
5558
- yearManufacture?: number | null | undefined;
5559
- yearImport?: number | null | undefined;
5560
- steering?: string | null | undefined;
5561
- engineCode?: string | null | undefined;
5562
- transmissionCode?: string | null | undefined;
5563
- driveTrain?: string | null | undefined;
5564
- km?: number | undefined;
5565
- vehicleKindId: string;
5544
+ licensePlate?: string | undefined;
5545
+ customerId?: string | undefined;
5546
+ vehicleKindId?: string | undefined;
5547
+ vin?: string | undefined;
5566
5548
  };
5567
5549
  params: {};
5568
5550
  query: unknown;
@@ -5592,6 +5574,8 @@ export declare const app: Elysia<"", {
5592
5574
  driveTrain: string | null;
5593
5575
  km: number;
5594
5576
  };
5577
+ 502: string;
5578
+ 400: "Машины дугаар болон VIN хоёроос нэгийг нь оруулна уу." | "Машины VIN оруулсан бол машины төрөл оруулна уу.";
5595
5579
  422: {
5596
5580
  type: "validation";
5597
5581
  on: string;
@@ -6386,6 +6370,65 @@ export declare const app: Elysia<"", {
6386
6370
  } & {
6387
6371
  crm: {
6388
6372
  inspection: {};
6373
+ } & {
6374
+ inspection: {
6375
+ ubcab: {
6376
+ get: {
6377
+ body: unknown;
6378
+ params: {};
6379
+ query: {
6380
+ licensePlate: string;
6381
+ };
6382
+ headers: unknown;
6383
+ response: {
6384
+ 200: {
6385
+ inspection: {
6386
+ companyId: string;
6387
+ branchId: string;
6388
+ vehicleId: string;
6389
+ inspection: {
6390
+ type: string;
6391
+ values: {
6392
+ description: string;
6393
+ question: string;
6394
+ answer: string;
6395
+ }[];
6396
+ }[] | null;
6397
+ employeeId: string | null;
6398
+ expireAt: Date;
6399
+ experience: string | null;
6400
+ rank: string | null;
6401
+ licensePlate: string;
6402
+ description: string | null;
6403
+ status: "CREATED" | "APPROVED" | "CANCELLED";
6404
+ id: string;
6405
+ createdAt: string;
6406
+ updatedAt: string;
6407
+ deletedAt: string | null;
6408
+ };
6409
+ company: {
6410
+ id: string;
6411
+ name: string;
6412
+ logo: string;
6413
+ };
6414
+ branch: {
6415
+ id: string;
6416
+ name: string;
6417
+ };
6418
+ }[];
6419
+ 422: {
6420
+ type: "validation";
6421
+ on: string;
6422
+ summary?: string;
6423
+ message?: string;
6424
+ found?: unknown;
6425
+ property?: string;
6426
+ expected?: string;
6427
+ };
6428
+ };
6429
+ };
6430
+ };
6431
+ };
6389
6432
  } & {
6390
6433
  inspection: {
6391
6434
  get: {
@@ -6413,10 +6456,10 @@ export declare const app: Elysia<"", {
6413
6456
  inspection: {
6414
6457
  type: string;
6415
6458
  values: {
6416
- description?: string | undefined;
6459
+ description: string;
6417
6460
  question: string;
6418
6461
  answer: string;
6419
- };
6462
+ }[];
6420
6463
  }[] | null;
6421
6464
  employeeId: string | null;
6422
6465
  expireAt: Date;
@@ -6448,18 +6491,15 @@ export declare const app: Elysia<"", {
6448
6491
  inspection: {
6449
6492
  post: {
6450
6493
  body: {
6451
- employeeId?: string | null | undefined;
6452
- description?: string | null | undefined;
6453
- experience?: string | null | undefined;
6454
- rank?: string | null | undefined;
6455
- status?: "CREATED" | "APPROVED" | "CANCELLED" | undefined;
6494
+ employeeId?: string | undefined;
6495
+ description?: string | undefined;
6456
6496
  inspection: {
6457
6497
  type: string;
6458
6498
  values: {
6459
- description?: string | undefined;
6499
+ description: string;
6460
6500
  question: string;
6461
6501
  answer: string;
6462
- };
6502
+ }[];
6463
6503
  }[];
6464
6504
  licensePlate: string;
6465
6505
  };
@@ -6476,20 +6516,20 @@ export declare const app: Elysia<"", {
6476
6516
  employeeId: string | null;
6477
6517
  deletedAt: string | null;
6478
6518
  description: string | null;
6479
- vehicleId: string;
6480
6519
  inspection: {
6481
6520
  type: string;
6482
6521
  values: {
6483
- description?: string | undefined;
6522
+ description: string;
6484
6523
  question: string;
6485
6524
  answer: string;
6486
- };
6525
+ }[];
6487
6526
  }[] | null;
6527
+ licensePlate: string;
6528
+ status: "CREATED" | "APPROVED" | "CANCELLED";
6529
+ vehicleId: string;
6488
6530
  expireAt: Date;
6489
6531
  experience: string | null;
6490
6532
  rank: string | null;
6491
- licensePlate: string;
6492
- status: "CREATED" | "APPROVED" | "CANCELLED";
6493
6533
  };
6494
6534
  502: string;
6495
6535
  400: "Машины дугаар болон VIN хоёроос нэгийг нь оруулна уу." | "Машины VIN оруулсан бол машины төрөл оруулна уу.";
@@ -6523,10 +6563,10 @@ export declare const app: Elysia<"", {
6523
6563
  inspection: {
6524
6564
  type: string;
6525
6565
  values: {
6526
- description?: string | undefined;
6566
+ description: string;
6527
6567
  question: string;
6528
6568
  answer: string;
6529
- };
6569
+ }[];
6530
6570
  }[] | null;
6531
6571
  employeeId: string | null;
6532
6572
  expireAt: Date;
package/dist/index.js CHANGED
@@ -141540,10 +141540,6 @@ var updateConditions = {
141540
141540
  optional: () => true,
141541
141541
  nullable: (column) => !column.notNull
141542
141542
  };
141543
- var createInsertSchema = (entity, refine) => {
141544
- const columns = getColumns(entity);
141545
- return handleColumns(columns, refine ?? {}, insertConditions);
141546
- };
141547
141543
  function createSchemaFactory(options) {
141548
141544
  const createSelectSchema = (entity, refine) => {
141549
141545
  if (isPgEnum2(entity)) {
@@ -141552,7 +141548,7 @@ function createSchemaFactory(options) {
141552
141548
  const columns = getColumns(entity);
141553
141549
  return handleColumns(columns, refine ?? {}, selectConditions, options);
141554
141550
  };
141555
- const createInsertSchema2 = (entity, refine) => {
141551
+ const createInsertSchema = (entity, refine) => {
141556
141552
  const columns = getColumns(entity);
141557
141553
  return handleColumns(columns, refine ?? {}, insertConditions, options);
141558
141554
  };
@@ -141560,11 +141556,11 @@ function createSchemaFactory(options) {
141560
141556
  const columns = getColumns(entity);
141561
141557
  return handleColumns(columns, refine ?? {}, updateConditions, options);
141562
141558
  };
141563
- return { createSelectSchema, createInsertSchema: createInsertSchema2, createUpdateSchema };
141559
+ return { createSelectSchema, createInsertSchema, createUpdateSchema };
141564
141560
  }
141565
141561
 
141566
141562
  // src/lib/validation-factory.ts
141567
- var { createSelectSchema, createUpdateSchema, createInsertSchema: createInsertSchema2 } = createSchemaFactory({
141563
+ var { createSelectSchema, createUpdateSchema, createInsertSchema } = createSchemaFactory({
141568
141564
  typeboxInstance: t
141569
141565
  });
141570
141566
 
@@ -141572,7 +141568,7 @@ var { createSelectSchema, createUpdateSchema, createInsertSchema: createInsertSc
141572
141568
  var phoneRegex = /^\d{8}$/;
141573
141569
  var CompanyBranchModel;
141574
141570
  ((CompanyBranchModel) => {
141575
- const createSchema = createInsertSchema2(companyBranchTable, {
141571
+ const createSchema = createInsertSchema(companyBranchTable, {
141576
141572
  phone: (schema5) => t.RegExp(phoneRegex, { ...schema5 }),
141577
141573
  email: (schema5) => t.String({ ...schema5, format: "email" }),
141578
141574
  merchantId: (schema5) => t.Optional(schema5)
@@ -141614,7 +141610,7 @@ var branch_default = branchRoutes;
141614
141610
  // src/routes/company/company/model.ts
141615
141611
  var CompanyCompanyModel;
141616
141612
  ((CompanyCompanyModel) => {
141617
- const createSchema = createInsertSchema2(companyCompanyTable);
141613
+ const createSchema = createInsertSchema(companyCompanyTable);
141618
141614
  const updateSchema = createUpdateSchema(companyCompanyTable);
141619
141615
  const selectSchema = createSelectSchema(companyCompanyTable, {
141620
141616
  phone: t.RegExp(/^\d{8}$/),
@@ -141663,7 +141659,7 @@ var company_default = companyRoutes;
141663
141659
  // src/routes/company/employee/model.ts
141664
141660
  var CompanyEmployeeModel;
141665
141661
  ((CompanyEmployeeModel) => {
141666
- const createSchema = createInsertSchema2(companyEmployeeTable);
141662
+ const createSchema = createInsertSchema(companyEmployeeTable);
141667
141663
  const updateSchema = createUpdateSchema(companyEmployeeTable);
141668
141664
  const selectSchema = createSelectSchema(companyEmployeeTable, {
141669
141665
  phone: t.RegExp(/^\d{8}$/),
@@ -141701,7 +141697,7 @@ var employee_default = companyRoutes2;
141701
141697
  // src/routes/company/package/model.ts
141702
141698
  var CompanyPackageModel;
141703
141699
  ((CompanyPackageModel) => {
141704
- const createSchema = createInsertSchema2(companyPackageTable);
141700
+ const createSchema = createInsertSchema(companyPackageTable);
141705
141701
  const updateSchema = createUpdateSchema(companyPackageTable);
141706
141702
  CompanyPackageModel.create = OmitBaseSchema(createSchema);
141707
141703
  CompanyPackageModel.update = OmitBaseSchema(updateSchema);
@@ -141782,7 +141778,7 @@ var logic_default2 = CompanyServiceKindLogic;
141782
141778
  // src/routes/company/serviceKind/model.ts
141783
141779
  var CompanyServiceKindModel;
141784
141780
  ((CompanyServiceKindModel) => {
141785
- const createSchema = createInsertSchema2(companyServiceKindTable);
141781
+ const createSchema = createInsertSchema(companyServiceKindTable);
141786
141782
  const updateSchema = createUpdateSchema(companyServiceKindTable);
141787
141783
  const selectSchema = createSelectSchema(companyServiceKindTable);
141788
141784
  CompanyServiceKindModel.create = t.Omit(OmitBaseSchema(createSchema), ["companyId"]);
@@ -144572,19 +144568,11 @@ var CrmVehicleLogic;
144572
144568
  };
144573
144569
  };
144574
144570
  CrmVehicleLogic.create = async (body, user2) => {
144575
- const [result] = await db_default.insert(crmVehicleTable).values({
144576
- ...body,
144571
+ const vehicle = await CrmVehicleLogic.findOrCreate(body);
144572
+ await db_default.update(crmVehicleTable).set({
144577
144573
  companyId: user2.companyId
144578
- }).returning();
144579
- if (result.licensePlate) {
144580
- await redis_client_default.set(`crm_vehicle.licensePlate:${result.licensePlate}`, result, { ex: CACHE_TTL });
144581
- }
144582
- if (result.vin) {
144583
- await redis_client_default.set(`crm_vehicle.vin:${result.vin}`, result, {
144584
- ex: CACHE_TTL
144585
- });
144586
- }
144587
- return result;
144574
+ });
144575
+ return vehicle;
144588
144576
  };
144589
144577
  CrmVehicleLogic.update = async (id, body, user2) => {
144590
144578
  const [result] = await db_default.update(crmVehicleTable).set(body).where(and(eq(crmVehicleTable.id, id), eq(crmVehicleTable.companyId, user2.companyId), softDeletedFilter(crmVehicleTable))).returning();
@@ -145835,7 +145823,7 @@ var logic_default11 = DiscountLogic;
145835
145823
  // src/routes/crm/cpOrder/item/model.ts
145836
145824
  var CrmCpOrderItemModel;
145837
145825
  ((CrmCpOrderItemModel) => {
145838
- const createSchema = createInsertSchema2(crmCpOrderItemTable);
145826
+ const createSchema = createInsertSchema(crmCpOrderItemTable);
145839
145827
  const updateSchema = createUpdateSchema(crmCpOrderItemTable);
145840
145828
  CrmCpOrderItemModel.create = t.Composite([
145841
145829
  t.Pick(OmitBaseSchema(createSchema), [
@@ -145943,7 +145931,7 @@ var model_default7 = CrmCpOrderModel;
145943
145931
  // src/routes/crm/cpOrder/payment/model.ts
145944
145932
  var CrmCpOrderPaymentModel;
145945
145933
  ((CrmCpOrderPaymentModel) => {
145946
- const createSchema = createInsertSchema2(crmCpOrderPaymentTable);
145934
+ const createSchema = createInsertSchema(crmCpOrderPaymentTable);
145947
145935
  CrmCpOrderPaymentModel.create = t.Omit(OmitBaseSchema(createSchema), ["invoiceNumber"]);
145948
145936
  CrmCpOrderPaymentModel.storepay = t.Composite([
145949
145937
  t.Omit(CrmCpOrderPaymentModel.create, ["paymentMethod", "paymentChannel", "state"]),
@@ -146068,7 +146056,7 @@ var cpOrder_default = cpOrderRoutes;
146068
146056
  // src/routes/crm/customer/model.ts
146069
146057
  var CrmCustomerModel;
146070
146058
  ((CrmCustomerModel) => {
146071
- const createSchema = createInsertSchema2(crmCustomerTable);
146059
+ const createSchema = createInsertSchema(crmCustomerTable);
146072
146060
  CrmCustomerModel.create = OmitBaseSchema(createSchema);
146073
146061
  const updateSchema = createUpdateSchema(crmCustomerTable);
146074
146062
  CrmCustomerModel.update = OmitBaseSchema(updateSchema);
@@ -146095,7 +146083,7 @@ var customer_default = customerRoutes;
146095
146083
  // src/routes/crm/discount/model.ts
146096
146084
  var DiscountModel;
146097
146085
  ((DiscountModel) => {
146098
- const createSchema = createInsertSchema2(crmDiscountTable);
146086
+ const createSchema = createInsertSchema(crmDiscountTable);
146099
146087
  const updateSchema = createUpdateSchema(crmDiscountTable);
146100
146088
  DiscountModel.create = OmitBaseSchema(createSchema);
146101
146089
  DiscountModel.update = OmitBaseSchema(updateSchema);
@@ -146156,7 +146144,7 @@ var DiscountModel;
146156
146144
  ], {
146157
146145
  description: "Condition value based on the condition type selected"
146158
146146
  });
146159
- const createConditionSchema = createInsertSchema2(crmDiscountConditionTable);
146147
+ const createConditionSchema = createInsertSchema(crmDiscountConditionTable);
146160
146148
  const updateConditionSchema = createUpdateSchema(crmDiscountConditionTable);
146161
146149
  DiscountModel.createCondition = t.Composite([
146162
146150
  OmitBaseSchema(createConditionSchema),
@@ -146170,7 +146158,7 @@ var DiscountModel;
146170
146158
  conditionValue: ConditionValueUnion
146171
146159
  }))
146172
146160
  ]);
146173
- const createApplySchema = createInsertSchema2(crmDiscountApplyTable);
146161
+ const createApplySchema = createInsertSchema(crmDiscountApplyTable);
146174
146162
  DiscountModel.createApply = t.Omit(OmitBaseSchema(createApplySchema), [
146175
146163
  "authUserId",
146176
146164
  "employeeId"
@@ -146297,31 +146285,40 @@ var CrmInspectionLogic;
146297
146285
  retry: 3
146298
146286
  });
146299
146287
  };
146288
+ CrmInspectionLogic.selectUbCab = async (licensePlate) => {
146289
+ const inspections = await db_default.select({
146290
+ inspection: crmInspectionTable,
146291
+ company: {
146292
+ id: companyCompanyTable.id,
146293
+ name: companyCompanyTable.name,
146294
+ logo: companyCompanyTable.logoUrl
146295
+ },
146296
+ branch: {
146297
+ id: companyBranchTable.id,
146298
+ name: companyBranchTable.name
146299
+ }
146300
+ }).from(crmInspectionTable).innerJoin(companyCompanyTable, eq(crmInspectionTable.companyId, companyCompanyTable.id)).innerJoin(companyBranchTable, eq(crmInspectionTable.branchId, companyBranchTable.id)).where(eq(crmInspectionTable.licensePlate, licensePlate));
146301
+ return inspections;
146302
+ };
146300
146303
  })(CrmInspectionLogic ||= {});
146301
146304
  var logic_default13 = CrmInspectionLogic;
146302
146305
 
146303
146306
  // src/routes/crm/inspection/model.ts
146304
146307
  var CrmInspectionModel;
146305
146308
  ((CrmInspectionModel) => {
146306
- const inspectionSchema = t.Object({
146307
- type: t.String(),
146308
- values: t.Object({
146309
- question: t.String(),
146310
- answer: t.String(),
146311
- description: t.Optional(t.String())
146312
- })
146313
- });
146314
- const createSchema = createInsertSchema(crmInspectionTable, {
146315
- inspection: t.Array(inspectionSchema, {
146316
- minItems: 1
146317
- })
146309
+ CrmInspectionModel.create = t.Object({
146310
+ inspection: t.Array(t.Object({
146311
+ type: t.String(),
146312
+ values: t.Array(t.Object({
146313
+ question: t.String(),
146314
+ answer: t.String(),
146315
+ description: t.String()
146316
+ }))
146317
+ })),
146318
+ licensePlate: t.String(),
146319
+ description: t.Optional(t.String()),
146320
+ employeeId: t.Optional(t.String({ format: "uuid" }))
146318
146321
  });
146319
- CrmInspectionModel.create = t.Omit(OmitBaseSchema(createSchema), [
146320
- "expireAt",
146321
- "companyId",
146322
- "branchId",
146323
- "vehicleId"
146324
- ]);
146325
146322
  CrmInspectionModel.select = t.Composite([
146326
146323
  t.Partial(t.Object({
146327
146324
  search: t.String(),
@@ -146330,6 +146327,9 @@ var CrmInspectionModel;
146330
146327
  })),
146331
146328
  PaginationSchema
146332
146329
  ]);
146330
+ CrmInspectionModel.selectUbCab = t.Object({
146331
+ licensePlate: t.String()
146332
+ });
146333
146333
  })(CrmInspectionModel ||= {});
146334
146334
  var model_default11 = CrmInspectionModel;
146335
146335
 
@@ -146337,7 +146337,10 @@ var model_default11 = CrmInspectionModel;
146337
146337
  var inspectionRoutes = new Elysia({
146338
146338
  prefix: "/inspection",
146339
146339
  tags: ["CrmInspection"]
146340
- }).use(better_auth_default).guard({ auth: true }).model(prefix_model_default("CrmInspectionModel", model_default11)).get("/", async ({ query, user: user2 }) => logic_default13.select(query, user2), {
146340
+ }).use(better_auth_default).model(prefix_model_default("CrmInspectionModel", model_default11)).get("/ubcab", async ({ query: { licensePlate } }) => logic_default13.selectUbCab(licensePlate), {
146341
+ query: "CrmInspectionModel.selectUbCab",
146342
+ auth: false
146343
+ }).guard({ auth: true }).get("/", async ({ query, user: user2 }) => logic_default13.select(query, user2), {
146341
146344
  query: "CrmInspectionModel.select"
146342
146345
  }).post("/", async ({ body, user: user2 }) => logic_default13.create(body, user2), {
146343
146346
  body: "CrmInspectionModel.create"
@@ -146349,7 +146352,7 @@ var inspection_default = inspectionRoutes;
146349
146352
  // src/routes/crm/spPackage/model.ts
146350
146353
  var CrmSpPackageModel;
146351
146354
  ((CrmSpPackageModel) => {
146352
- const createSchema = createInsertSchema2(crmSpPackageTable);
146355
+ const createSchema = createInsertSchema(crmSpPackageTable);
146353
146356
  const updateSchema = createUpdateSchema(crmSpPackageTable);
146354
146357
  const selectSchema = createSelectSchema(crmSpPackageTable);
146355
146358
  CrmSpPackageModel.create = t.Omit(OmitBaseSchema(createSchema), ["companyId"]);
@@ -146410,7 +146413,7 @@ var logic_default14 = CrmSpPackageProductLogic;
146410
146413
  // src/routes/crm/spPackage/product/model.ts
146411
146414
  var CrmSpPackageProductModel;
146412
146415
  ((CrmSpPackageProductModel) => {
146413
- const createSchema = createInsertSchema2(crmSpPackageProductTable);
146416
+ const createSchema = createInsertSchema(crmSpPackageProductTable);
146414
146417
  const updateSchema = createUpdateSchema(crmSpPackageProductTable);
146415
146418
  const selectSchema = createSelectSchema(crmSpPackageProductTable);
146416
146419
  CrmSpPackageProductModel.create = t.Omit(OmitBaseSchema(createSchema), ["priceTotal"]);
@@ -146483,7 +146486,7 @@ var logic_default15 = CrmSpPackageServiceLogic;
146483
146486
  // src/routes/crm/spPackage/service/model.ts
146484
146487
  var CrmSpPackageServiceModel;
146485
146488
  ((CrmSpPackageServiceModel) => {
146486
- const createSchema = createInsertSchema2(crmSpPackageServiceTable);
146489
+ const createSchema = createInsertSchema(crmSpPackageServiceTable);
146487
146490
  const updateSchema = createUpdateSchema(crmSpPackageServiceTable);
146488
146491
  const selectSchema = createSelectSchema(crmSpPackageServiceTable);
146489
146492
  CrmSpPackageServiceModel.create = OmitBaseSchema(createSchema);
@@ -146529,8 +146532,12 @@ var spPackage_default = spPackageRoutes;
146529
146532
  // src/routes/crm/vehicle/model.ts
146530
146533
  var CrmVehicleModel;
146531
146534
  ((CrmVehicleModel) => {
146532
- const createSchema = createInsertSchema(crmVehicleTable);
146533
- CrmVehicleModel.create = OmitBaseSchema(createSchema);
146535
+ CrmVehicleModel.create = t.Object({
146536
+ vin: t.Optional(t.String()),
146537
+ licensePlate: t.Optional(t.String()),
146538
+ vehicleKindId: t.Optional(t.String({ format: "uuid" })),
146539
+ customerId: t.Optional(t.String())
146540
+ });
146534
146541
  const updateSchema = createUpdateSchema(crmVehicleTable);
146535
146542
  CrmVehicleModel.update = t.Partial(OmitBaseSchema(updateSchema));
146536
146543
  CrmVehicleModel.select = t.Composite([
@@ -146842,7 +146849,7 @@ var logic_default16 = PermissionLogic;
146842
146849
  // src/routes/permission/model.ts
146843
146850
  var PermissionModel;
146844
146851
  ((PermissionModel) => {
146845
- const createSchema = createInsertSchema2(permissionGroupTable);
146852
+ const createSchema = createInsertSchema(permissionGroupTable);
146846
146853
  const updateSchema = createUpdateSchema(permissionGroupTable);
146847
146854
  PermissionModel.create = OmitBaseSchema(createSchema);
146848
146855
  PermissionModel.update = OmitBaseSchema(updateSchema);
@@ -146939,7 +146946,7 @@ var TechdocSupplierModel;
146939
146946
  byCompany: t.Boolean()
146940
146947
  }))
146941
146948
  ]);
146942
- const createSchema = createInsertSchema2(techdocSupplierTable);
146949
+ const createSchema = createInsertSchema(techdocSupplierTable);
146943
146950
  TechdocSupplierModel.create = OmitBaseSchema(createSchema);
146944
146951
  const updateSchema = createUpdateSchema(techdocSupplierTable);
146945
146952
  TechdocSupplierModel.update = OmitBaseSchema(updateSchema);
@@ -147179,7 +147186,7 @@ var logic_default18 = UserLogic;
147179
147186
 
147180
147187
  // src/routes/user/schema.ts
147181
147188
  var select = createSelectSchema(user);
147182
- var create2 = createInsertSchema2(user);
147189
+ var create2 = createInsertSchema(user);
147183
147190
  var update = createUpdateSchema(user);
147184
147191
  var selectUserSchema = t.Composite([
147185
147192
  PaginationSchema,
@@ -147231,7 +147238,7 @@ var user_default2 = userRoutes;
147231
147238
  // src/routes/warehouse/product/model.ts
147232
147239
  var WarehouseProductModel;
147233
147240
  ((WarehouseProductModel) => {
147234
- const createSchema = createInsertSchema2(warehouseProductTable);
147241
+ const createSchema = createInsertSchema(warehouseProductTable);
147235
147242
  const updateSchema = createUpdateSchema(warehouseProductTable);
147236
147243
  WarehouseProductModel.create = t.Omit(OmitBaseSchema(createSchema), ["companyId"]);
147237
147244
  WarehouseProductModel.update = OmitBaseSchema(updateSchema);
@@ -147257,7 +147264,7 @@ var model_default19 = WarehouseProductModel;
147257
147264
  // src/routes/warehouse/item/model.ts
147258
147265
  var WarehouseItemModel;
147259
147266
  ((WarehouseItemModel) => {
147260
- const createSchema = createInsertSchema2(warehouseItemTable);
147267
+ const createSchema = createInsertSchema(warehouseItemTable);
147261
147268
  const updateSchema = createUpdateSchema(warehouseItemTable);
147262
147269
  WarehouseItemModel.create = OmitBaseSchema(createSchema);
147263
147270
  WarehouseItemModel.update = t.Omit(OmitBaseSchema(updateSchema), ["quantity"]);
@@ -147292,7 +147299,7 @@ var WarehouseItemModel;
147292
147299
  maxQuantity: t.Number({ minimum: 0 })
147293
147300
  }))
147294
147301
  ]);
147295
- const createTransactionSchema = createInsertSchema2(warehouseItemTransactionTable);
147302
+ const createTransactionSchema = createInsertSchema(warehouseItemTransactionTable);
147296
147303
  const transactionDetails = t.Pick(createTransactionSchema, [
147297
147304
  "transactionType",
147298
147305
  "transactionKind",
@@ -147395,7 +147402,7 @@ var logic_default19 = WarehouseWarehouseLogic;
147395
147402
  // src/routes/warehouse/warehouse/model.ts
147396
147403
  var WarehouseWarehouseModel;
147397
147404
  ((WarehouseWarehouseModel) => {
147398
- const createSchema = createInsertSchema2(warehouseWarehouseTable);
147405
+ const createSchema = createInsertSchema(warehouseWarehouseTable);
147399
147406
  const updateSchema = createUpdateSchema(warehouseWarehouseTable);
147400
147407
  WarehouseWarehouseModel.create = t.Omit(OmitBaseSchema(createSchema), ["companyId"]);
147401
147408
  WarehouseWarehouseModel.update = t.Omit(OmitBaseSchema(updateSchema), [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.1.54",
3
+ "version": "1.1.55",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",