autosync_backend2 1.2.35 → 1.2.37

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
@@ -3661,6 +3661,22 @@ export declare const app: Elysia<"", {
3661
3661
  deletedAt: string | null;
3662
3662
  oldId: number | null;
3663
3663
  } | null;
3664
+ discount_apply: {
3665
+ discountId: string | null;
3666
+ cpOrderId: string;
3667
+ cpOrderItemId: string | null;
3668
+ valueApplied: number;
3669
+ priceBeforeDiscount: number;
3670
+ priceAfterDiscount: number;
3671
+ note: string | null;
3672
+ authUserId: string;
3673
+ employeeId: string;
3674
+ id: string;
3675
+ createdAt: string;
3676
+ updatedAt: string;
3677
+ deletedAt: string | null;
3678
+ oldId: number | null;
3679
+ } | null;
3664
3680
  product: {
3665
3681
  supplierId: string;
3666
3682
  productId: string | null;
@@ -9048,19 +9064,63 @@ export declare const app: Elysia<"", {
9048
9064
  totalCount: number;
9049
9065
  totalPage: number;
9050
9066
  result: Omit<{
9067
+ template: {
9068
+ machineKindId: string;
9069
+ companyId: string | null;
9070
+ operationAmount: number | null;
9071
+ uomId: string;
9072
+ serviceKindId: string;
9073
+ name: string;
9074
+ description: string | null;
9075
+ id: string;
9076
+ createdAt: string;
9077
+ updatedAt: string;
9078
+ deletedAt: string | null;
9079
+ oldId: number | null;
9080
+ };
9081
+ machineKind: {
9082
+ vehicleKindEnum: "MAKE" | "MODEL_GROUP" | "MODEL";
9083
+ parentId: string | null;
9084
+ name: string;
9085
+ description: string | null;
9086
+ yearStart: number | null;
9087
+ yearEnd: number | null;
9088
+ imagePath: string | null;
9089
+ id: string;
9090
+ createdAt: string;
9091
+ updatedAt: string;
9092
+ deletedAt: string | null;
9093
+ oldId: number | null;
9094
+ } | null;
9095
+ uom: {
9096
+ uomCategoryId: string;
9097
+ code: string | null;
9098
+ name: string;
9099
+ description: string | null;
9100
+ symbol: string | null;
9101
+ isBaseUnit: boolean;
9102
+ baseFactor: number | null;
9103
+ id: string;
9104
+ createdAt: string;
9105
+ updatedAt: string;
9106
+ deletedAt: string | null;
9107
+ oldId: number | null;
9108
+ } | null;
9109
+ serviceKind: {
9110
+ serviceKindId: string | null;
9111
+ companyId: string;
9112
+ branchId: string | null;
9113
+ name: string;
9114
+ description: string | null;
9115
+ enabled: boolean;
9116
+ price: number;
9117
+ id: string;
9118
+ createdAt: string;
9119
+ updatedAt: string;
9120
+ deletedAt: string | null;
9121
+ oldId: number | null;
9122
+ } | null;
9051
9123
  totalCount: number;
9052
- machineKindId: string;
9053
- companyId: string | null;
9054
- operationAmount: number | null;
9055
- uomId: string;
9056
- serviceKindId: string;
9057
- name: string;
9058
- description: string | null;
9059
- id: string;
9060
- createdAt: string;
9061
- updatedAt: string;
9062
- deletedAt: string | null;
9063
- oldId: number | null;
9064
9124
  }, "totalCount">[];
9065
9125
  };
9066
9126
  422: {
package/dist/index.js CHANGED
@@ -147584,7 +147584,7 @@ var CrmCpOrderItemLogic;
147584
147584
  ((CrmCpOrderItemLogic) => {
147585
147585
  CrmCpOrderItemLogic.select = async ({ cpOrderId }) => {
147586
147586
  const filter = and(eq(crmCpOrderItemTable.cpOrderId, cpOrderId), softDeletedFilter(crmCpOrderItemTable));
147587
- const rows = await db_default.select().from(crmCpOrderItemTable).leftJoin(companyServiceKindTable, eq(companyServiceKindTable.id, crmCpOrderItemTable.companyServiceKindId)).leftJoin(warehouseProductTable, eq(warehouseProductTable.id, crmCpOrderItemTable.companyProductId)).leftJoin(crmCpOrderItemEmployeeTable, eq(crmCpOrderItemEmployeeTable.cpOrderItemId, crmCpOrderItemTable.id)).leftJoin(companyEmployeeTable, eq(companyEmployeeTable.id, crmCpOrderItemEmployeeTable.employeeId)).leftJoin(crmCpOrderSpPackageTable, eq(crmCpOrderSpPackageTable.id, crmCpOrderItemTable.cpOrderSpPackageId)).leftJoin(crmSpPackageTable, eq(crmSpPackageTable.id, crmCpOrderSpPackageTable.spPackageId)).where(filter);
147587
+ const rows = await db_default.select().from(crmCpOrderItemTable).leftJoin(companyServiceKindTable, eq(companyServiceKindTable.id, crmCpOrderItemTable.companyServiceKindId)).leftJoin(warehouseProductTable, eq(warehouseProductTable.id, crmCpOrderItemTable.companyProductId)).leftJoin(crmCpOrderItemEmployeeTable, eq(crmCpOrderItemEmployeeTable.cpOrderItemId, crmCpOrderItemTable.id)).leftJoin(companyEmployeeTable, eq(companyEmployeeTable.id, crmCpOrderItemEmployeeTable.employeeId)).leftJoin(crmCpOrderSpPackageTable, eq(crmCpOrderSpPackageTable.id, crmCpOrderItemTable.cpOrderSpPackageId)).leftJoin(crmSpPackageTable, eq(crmSpPackageTable.id, crmCpOrderSpPackageTable.spPackageId)).leftJoin(crmDiscountApplyTable, eq(crmDiscountApplyTable.cpOrderItemId, crmCpOrderItemTable.id)).where(filter);
147588
147588
  const result = rows.reduce((acc, row) => {
147589
147589
  if (!acc[row.cp_order_item.id]) {
147590
147590
  acc[row.cp_order_item.id] = {
@@ -154572,11 +154572,13 @@ var PmTemplateLogic;
154572
154572
  ((PmTemplateLogic) => {
154573
154573
  PmTemplateLogic.select = async (query, user2) => {
154574
154574
  const filter = and(or(isNull2(pmTemplateTable.companyId), eq(pmTemplateTable.companyId, user2.companyId).if(user2.kind !== "ADMIN")));
154575
- const columns = getTableColumns(pmTemplateTable);
154576
154575
  const baseQuery = db_default.select({
154577
- ...columns,
154576
+ template: pmTemplateTable,
154577
+ machineKind: techdocVehicleKindTable,
154578
+ uom: uomTable,
154579
+ serviceKind: companyServiceKindTable,
154578
154580
  totalCount: totalCountSql
154579
- }).from(pmTemplateTable).where(filter).$dynamic();
154581
+ }).from(pmTemplateTable).leftJoin(techdocVehicleKindTable, eq(techdocVehicleKindTable.id, pmTemplateTable.machineKindId)).leftJoin(uomTable, eq(uomTable.id, pmTemplateTable.uomId)).leftJoin(companyServiceKindTable, eq(companyServiceKindTable.id, pmTemplateTable.serviceKindId)).where(filter).$dynamic();
154580
154582
  const result = await pagination_helper_default(baseQuery, query.pagination);
154581
154583
  return getPaginationContent(result, query.pagination.size);
154582
154584
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.2.35",
3
+ "version": "1.2.37",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",