autosync_backend2 1.2.22 → 1.2.23
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 +6 -1
- package/dist/index.js +9 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7045,7 +7045,12 @@ export declare const app: Elysia<"", {
|
|
|
7045
7045
|
body: unknown;
|
|
7046
7046
|
params: {};
|
|
7047
7047
|
query: {
|
|
7048
|
-
type
|
|
7048
|
+
type?: "Service" | "Product" | undefined;
|
|
7049
|
+
employeeId?: string | undefined;
|
|
7050
|
+
phoneNumber?: string | undefined;
|
|
7051
|
+
licensePlate?: string | undefined;
|
|
7052
|
+
startDate?: string | undefined;
|
|
7053
|
+
endDate?: string | undefined;
|
|
7049
7054
|
pagination: {
|
|
7050
7055
|
size: number;
|
|
7051
7056
|
page: number;
|
package/dist/index.js
CHANGED
|
@@ -152568,7 +152568,7 @@ var CrmReportsLogic;
|
|
|
152568
152568
|
totalPrice: sql3`CASE WHEN ${crmCpOrderTable.isNoat} = FALSE THEN ${crmCpOrderItemTable.priceTotal} ELSE 0 END`.as("total_price"),
|
|
152569
152569
|
totalPriceNoat: sql3`CASE WHEN ${crmCpOrderTable.isNoat} = TRUE THEN ${crmCpOrderItemTable.priceTotal} * 1.1 ELSE 0 END`.as("total_price_noat"),
|
|
152570
152570
|
totalCount: totalCountSql
|
|
152571
|
-
}).from(crmCpOrderItemTable).leftJoin(crmCpOrderTable, eq(crmCpOrderTable.id, crmCpOrderItemTable.cpOrderId)).leftJoin(crmCustomerTable, eq(crmCustomerTable.id, crmCpOrderTable.customerId)).leftJoin(crmVehicleTable, eq(crmVehicleTable.id, crmCpOrderTable.vehicleId)).leftJoin(warehouseProductTable, eq(warehouseProductTable.id, crmCpOrderItemTable.companyProductId)).leftJoin(companyServiceKindTable, eq(companyServiceKindTable.id, crmCpOrderItemTable.companyServiceKindId)).leftJoin(crmCpOrderItemEmployeeTable, eq(crmCpOrderItemEmployeeTable.cpOrderItemId, crmCpOrderItemTable.id)).leftJoin(companyEmployeeTable, eq(companyEmployeeTable.id, crmCpOrderItemEmployeeTable.employeeId)).leftJoin(crmDiscountApplyTable, eq(crmDiscountApplyTable.cpOrderItemId, crmCpOrderItemTable.id)).where(and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), isNotNull(crmCpOrderItemTable.companyProductId).if(query.type === "Product"), isNotNull(crmCpOrderItemTable.companyServiceKindId).if(query.type === "Service"))).groupBy((t2) => [
|
|
152571
|
+
}).from(crmCpOrderItemTable).leftJoin(crmCpOrderTable, eq(crmCpOrderTable.id, crmCpOrderItemTable.cpOrderId)).leftJoin(crmCustomerTable, eq(crmCustomerTable.id, crmCpOrderTable.customerId)).leftJoin(crmVehicleTable, eq(crmVehicleTable.id, crmCpOrderTable.vehicleId)).leftJoin(warehouseProductTable, eq(warehouseProductTable.id, crmCpOrderItemTable.companyProductId)).leftJoin(companyServiceKindTable, eq(companyServiceKindTable.id, crmCpOrderItemTable.companyServiceKindId)).leftJoin(crmCpOrderItemEmployeeTable, eq(crmCpOrderItemEmployeeTable.cpOrderItemId, crmCpOrderItemTable.id)).leftJoin(companyEmployeeTable, eq(companyEmployeeTable.id, crmCpOrderItemEmployeeTable.employeeId)).leftJoin(crmDiscountApplyTable, eq(crmDiscountApplyTable.cpOrderItemId, crmCpOrderItemTable.id)).where(and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), isNotNull(crmCpOrderItemTable.companyProductId).if(query.type === "Product"), isNotNull(crmCpOrderItemTable.companyServiceKindId).if(query.type === "Service"), eq(crmCpOrderItemEmployeeTable.employeeId, query.employeeId).if(query.employeeId), gte(crmCpOrderTable.createdAt, query.startDate).if(query.startDate), lte(crmCpOrderTable.createdAt, query.endDate).if(query.endDate), eq(crmCustomerTable.phoneNumber, query.phoneNumber).if(query.phoneNumber), eq(crmVehicleTable.licensePlate, query.licensePlate).if(query.licensePlate))).groupBy((t2) => [
|
|
152572
152572
|
t2.createdAt,
|
|
152573
152573
|
t2.orderId,
|
|
152574
152574
|
t2.phone,
|
|
@@ -152671,14 +152671,16 @@ var CrmReportsModel;
|
|
|
152671
152671
|
})
|
|
152672
152672
|
});
|
|
152673
152673
|
CrmReportsModel.cpOrderReport = t.Composite([
|
|
152674
|
-
t.Object({
|
|
152675
|
-
type: t.UnionEnum(["Product", "Service"])
|
|
152676
|
-
|
|
152674
|
+
t.Partial(t.Object({
|
|
152675
|
+
type: t.UnionEnum(["Product", "Service"]),
|
|
152676
|
+
employeeId: t.String({ format: "uuid" }),
|
|
152677
|
+
startDate: t.String({ format: "date" }),
|
|
152678
|
+
endDate: t.String({ format: "date" }),
|
|
152679
|
+
phoneNumber: t.String(),
|
|
152680
|
+
licensePlate: t.String()
|
|
152681
|
+
})),
|
|
152677
152682
|
PaginationSchema
|
|
152678
152683
|
]);
|
|
152679
|
-
CrmReportsModel.cpOrderEmployeeReport = t.Object({
|
|
152680
|
-
employeeId: t.String({ format: "uuid" })
|
|
152681
|
-
});
|
|
152682
152684
|
})(CrmReportsModel ||= {});
|
|
152683
152685
|
var model_default14 = CrmReportsModel;
|
|
152684
152686
|
|