autosync_backend2 1.2.42 → 1.2.43
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 +7 -0
- package/dist/index.js +41 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1958,6 +1958,7 @@ export declare const app: Elysia<"", {
|
|
|
1958
1958
|
totalCount: number;
|
|
1959
1959
|
totalPage: number;
|
|
1960
1960
|
result: Omit<{
|
|
1961
|
+
type: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet";
|
|
1961
1962
|
name: string;
|
|
1962
1963
|
id: string;
|
|
1963
1964
|
email: string;
|
|
@@ -2003,6 +2004,7 @@ export declare const app: Elysia<"", {
|
|
|
2003
2004
|
company: {
|
|
2004
2005
|
post: {
|
|
2005
2006
|
body: {
|
|
2007
|
+
type?: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet" | undefined;
|
|
2006
2008
|
oldId?: number | null | undefined;
|
|
2007
2009
|
isActive?: boolean | undefined;
|
|
2008
2010
|
province?: string | null | undefined;
|
|
@@ -2029,6 +2031,7 @@ export declare const app: Elysia<"", {
|
|
|
2029
2031
|
headers: {};
|
|
2030
2032
|
response: {
|
|
2031
2033
|
200: {
|
|
2034
|
+
type: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet";
|
|
2032
2035
|
name: string;
|
|
2033
2036
|
id: string;
|
|
2034
2037
|
email: string;
|
|
@@ -2072,6 +2075,7 @@ export declare const app: Elysia<"", {
|
|
|
2072
2075
|
":id": {
|
|
2073
2076
|
put: {
|
|
2074
2077
|
body: {
|
|
2078
|
+
type?: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet" | undefined;
|
|
2075
2079
|
name?: string | undefined;
|
|
2076
2080
|
email?: string | undefined;
|
|
2077
2081
|
oldId?: number | null | undefined;
|
|
@@ -2100,6 +2104,7 @@ export declare const app: Elysia<"", {
|
|
|
2100
2104
|
headers: {};
|
|
2101
2105
|
response: {
|
|
2102
2106
|
200: {
|
|
2107
|
+
type: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet";
|
|
2103
2108
|
name: string;
|
|
2104
2109
|
id: string;
|
|
2105
2110
|
email: string;
|
|
@@ -4272,6 +4277,7 @@ export declare const app: Elysia<"", {
|
|
|
4272
4277
|
isNexus: boolean;
|
|
4273
4278
|
isActive: boolean;
|
|
4274
4279
|
branchCount: number;
|
|
4280
|
+
type: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet";
|
|
4275
4281
|
id: string;
|
|
4276
4282
|
createdAt: string;
|
|
4277
4283
|
updatedAt: string;
|
|
@@ -9955,6 +9961,7 @@ export declare const app: Elysia<"", {
|
|
|
9955
9961
|
body: unknown;
|
|
9956
9962
|
params: {};
|
|
9957
9963
|
query: {
|
|
9964
|
+
id?: string | undefined;
|
|
9958
9965
|
pagination: {
|
|
9959
9966
|
size: number;
|
|
9960
9967
|
page: number;
|
package/dist/index.js
CHANGED
|
@@ -142480,6 +142480,9 @@ __export(exports_schema, {
|
|
|
142480
142480
|
pmPlanMachineTable: () => pmPlanMachineTable,
|
|
142481
142481
|
permissionTable: () => permissionTable,
|
|
142482
142482
|
permissionGroupTable: () => permissionGroupTable,
|
|
142483
|
+
maintenanceServiceSchema: () => maintenanceServiceSchema,
|
|
142484
|
+
maintenanceServiceRecordTable: () => maintenanceServiceRecordTable,
|
|
142485
|
+
maintenanceServiceRecordProductTable: () => maintenanceServiceRecordProductTable,
|
|
142483
142486
|
logTable: () => logTable,
|
|
142484
142487
|
inspectionTemplateTable: () => inspectionTemplateTable,
|
|
142485
142488
|
inspectionTemplateMachineKindTable: () => inspectionTemplateMachineKindTable,
|
|
@@ -142524,6 +142527,7 @@ __export(exports_schema, {
|
|
|
142524
142527
|
crmCpOrderItemTable: () => crmCpOrderItemTable,
|
|
142525
142528
|
crmCpOrderItemEmployeeTable: () => crmCpOrderItemEmployeeTable,
|
|
142526
142529
|
companyWorkScheduleTable: () => companyWorkScheduleTable,
|
|
142530
|
+
companyTypeEnum: () => companyTypeEnum,
|
|
142527
142531
|
companyServiceKindTable: () => companyServiceKindTable,
|
|
142528
142532
|
companyServiceBookingTable: () => companyServiceBookingTable,
|
|
142529
142533
|
companySchema: () => companySchema,
|
|
@@ -142669,6 +142673,14 @@ var uomConversionTable = pgTable("uom_conversion", {
|
|
|
142669
142673
|
});
|
|
142670
142674
|
// src/lib/db/schema/company.schema.ts
|
|
142671
142675
|
var companySchema = pgSchema("company");
|
|
142676
|
+
var companyTypeEnum = companySchema.enum("company_type", [
|
|
142677
|
+
"AutoService",
|
|
142678
|
+
"MiningFleet",
|
|
142679
|
+
"UrbanTransportFleet",
|
|
142680
|
+
"Long-haul/Logistics",
|
|
142681
|
+
"Emergency/Medical/Police",
|
|
142682
|
+
"CorporateFleet"
|
|
142683
|
+
]);
|
|
142672
142684
|
var companyCompanyTable = companySchema.table("company", {
|
|
142673
142685
|
...base_schema_helper_default,
|
|
142674
142686
|
name: varchar().notNull(),
|
|
@@ -142689,7 +142701,8 @@ var companyCompanyTable = companySchema.table("company", {
|
|
|
142689
142701
|
isNoat: boolean4().notNull().default(false),
|
|
142690
142702
|
isNexus: boolean4().notNull().default(false),
|
|
142691
142703
|
isActive: boolean4().notNull().default(true),
|
|
142692
|
-
branchCount: integer2().notNull().default(1)
|
|
142704
|
+
branchCount: integer2().notNull().default(1),
|
|
142705
|
+
type: companyTypeEnum().notNull().default("AutoService")
|
|
142693
142706
|
});
|
|
142694
142707
|
var companyBranchTable = companySchema.table("branch", {
|
|
142695
142708
|
...base_schema_helper_default,
|
|
@@ -143203,6 +143216,25 @@ var pmPlanProductTable = pmSchema.table("plan_product", {
|
|
|
143203
143216
|
quantity: numeric({ mode: "number" }),
|
|
143204
143217
|
pmQuantity: uuid5().notNull()
|
|
143205
143218
|
});
|
|
143219
|
+
var maintenanceServiceSchema = pgSchema("maintenance_service");
|
|
143220
|
+
var maintenanceServiceRecordTable = maintenanceServiceSchema.table("record", {
|
|
143221
|
+
...base_schema_helper_default,
|
|
143222
|
+
machineId: uuid5().notNull(),
|
|
143223
|
+
serviceKindId: uuid5().notNull(),
|
|
143224
|
+
pmPlanId: uuid5(),
|
|
143225
|
+
pmPlanMachineId: uuid5(),
|
|
143226
|
+
employeeTechnicianId: uuid5().notNull(),
|
|
143227
|
+
state: varchar().notNull(),
|
|
143228
|
+
note: text(),
|
|
143229
|
+
timeCompleted: timestamp({ withTimezone: true })
|
|
143230
|
+
});
|
|
143231
|
+
var maintenanceServiceRecordProductTable = maintenanceServiceSchema.table("record_product", {
|
|
143232
|
+
...base_schema_helper_default,
|
|
143233
|
+
msRecordId: uuid5().notNull(),
|
|
143234
|
+
companyProductId: uuid5().notNull(),
|
|
143235
|
+
uomId: uuid5().notNull(),
|
|
143236
|
+
quantity: numeric({ mode: "number" })
|
|
143237
|
+
});
|
|
143206
143238
|
// src/lib/db/schema/techdoc.schema.ts
|
|
143207
143239
|
var techdocSchema = pgSchema("techdoc");
|
|
143208
143240
|
var techdocVehicleKindEnum = pgEnum("vehicle_kind_enum", [
|
|
@@ -147317,7 +147349,7 @@ var WarehouseProductLogic;
|
|
|
147317
147349
|
((WarehouseProductLogic) => {
|
|
147318
147350
|
WarehouseProductLogic.getFilter = (query, user2) => {
|
|
147319
147351
|
const ilikeSearch = `%${query.search}%`;
|
|
147320
|
-
return and(softDeletedFilter(warehouseProductTable), eq(warehouseProductTable.companyId, user2.companyId), or(ilike(warehouseProductTable.name, ilikeSearch), ilike(warehouseProductTable.barCode, ilikeSearch), ilike(warehouseProductTable.oen, ilikeSearch), ilike(warehouseProductTable.partNumber, ilikeSearch), ilike(warehouseProductTable.alias, ilikeSearch))?.if(!!query.search), eq(warehouseProductTable.priceSell, query.priceSell ?? 0).if(query.priceSell), eq(warehouseProductTable.productId, query.productId ?? "").if(query.productId), eq(warehouseProductTable.supplierId, query.supplierId ?? "").if(query.supplierId), eq(warehouseProductTable.id, query.id ?? "").if(query.id), inArray(warehouseProductTable.id, query.ids ?? []).if(query.ids?.length), ...query.type ? [eq(warehouseProductTable.type, query.type)] : []);
|
|
147352
|
+
return and(softDeletedFilter(warehouseProductTable), eq(warehouseProductTable.companyId, user2.companyId), or(ilike(warehouseProductTable.name, `%${ilikeSearch}%`), ilike(warehouseProductTable.barCode, `%${ilikeSearch}%`), ilike(warehouseProductTable.oen, `%${ilikeSearch}%`), ilike(warehouseProductTable.partNumber, `%${ilikeSearch}%`), ilike(warehouseProductTable.alias, `%${ilikeSearch}%`))?.if(!!query.search), eq(warehouseProductTable.priceSell, query.priceSell ?? 0).if(query.priceSell), eq(warehouseProductTable.productId, query.productId ?? "").if(query.productId), eq(warehouseProductTable.supplierId, query.supplierId ?? "").if(query.supplierId), eq(warehouseProductTable.id, query.id ?? "").if(query.id), inArray(warehouseProductTable.id, query.ids ?? []).if(query.ids?.length), ...query.type ? [eq(warehouseProductTable.type, query.type)] : []);
|
|
147321
147353
|
};
|
|
147322
147354
|
WarehouseProductLogic.select = async (query, user2) => {
|
|
147323
147355
|
const baseQuery = db_default.select({
|
|
@@ -154852,7 +154884,7 @@ var inspection_default2 = inspectionRoutes2;
|
|
|
154852
154884
|
var MachineLogic;
|
|
154853
154885
|
((MachineLogic) => {
|
|
154854
154886
|
MachineLogic.select = async (query, user2) => {
|
|
154855
|
-
const filter = and(or(isNull2(companyMachineTable.companyId), eq(companyMachineTable.companyId, user2.companyId).if(user2.kind !== "ADMIN")), softDeletedFilter(companyMachineTable));
|
|
154887
|
+
const filter = and(or(isNull2(companyMachineTable.companyId), eq(companyMachineTable.companyId, user2.companyId).if(user2.kind !== "ADMIN")), eq(companyMachineTable.id, query.id).if(query.id), softDeletedFilter(companyMachineTable));
|
|
154856
154888
|
const columns = getTableColumns(companyMachineTable);
|
|
154857
154889
|
const baseQuery = db_default.select({
|
|
154858
154890
|
...columns,
|
|
@@ -154887,7 +154919,12 @@ var MachineModel;
|
|
|
154887
154919
|
const updateSchema = createUpdateSchema(companyMachineTable);
|
|
154888
154920
|
MachineModel.create = OmitBaseSchema(createSchema);
|
|
154889
154921
|
MachineModel.update = OmitBaseSchema(updateSchema);
|
|
154890
|
-
MachineModel.select = t.Composite([
|
|
154922
|
+
MachineModel.select = t.Composite([
|
|
154923
|
+
PaginationSchema,
|
|
154924
|
+
t.Partial(t.Object({
|
|
154925
|
+
id: t.String({ format: "uuid" })
|
|
154926
|
+
}))
|
|
154927
|
+
]);
|
|
154891
154928
|
})(MachineModel ||= {});
|
|
154892
154929
|
var model_default34 = MachineModel;
|
|
154893
154930
|
|