autosync_backend2 1.2.33 → 1.2.35
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 +29 -0
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8785,6 +8785,7 @@ export declare const app: Elysia<"", {
|
|
|
8785
8785
|
body: unknown;
|
|
8786
8786
|
params: {};
|
|
8787
8787
|
query: {
|
|
8788
|
+
id?: string | undefined;
|
|
8788
8789
|
state?: "CREATED" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED" | undefined;
|
|
8789
8790
|
templateId?: string | undefined;
|
|
8790
8791
|
machineId?: string | undefined;
|
|
@@ -8819,6 +8820,34 @@ export declare const app: Elysia<"", {
|
|
|
8819
8820
|
deletedAt: string | null;
|
|
8820
8821
|
oldId: number | null;
|
|
8821
8822
|
};
|
|
8823
|
+
machine: {
|
|
8824
|
+
companyId: string | null;
|
|
8825
|
+
machineKindId: string;
|
|
8826
|
+
customerId: string | null;
|
|
8827
|
+
name: string | null;
|
|
8828
|
+
assetCode: string | null;
|
|
8829
|
+
vin: string | null;
|
|
8830
|
+
licensePlate: string | null;
|
|
8831
|
+
color: string | null;
|
|
8832
|
+
engineCc: string | null;
|
|
8833
|
+
cylinder: string | null;
|
|
8834
|
+
gasType: string | null;
|
|
8835
|
+
transmissionType: string | null;
|
|
8836
|
+
vehicleType: string | null;
|
|
8837
|
+
yearManufacture: number | null;
|
|
8838
|
+
yearImport: number | null;
|
|
8839
|
+
steering: string | null;
|
|
8840
|
+
engineCode: string | null;
|
|
8841
|
+
transmissionCode: string | null;
|
|
8842
|
+
driveTrain: string | null;
|
|
8843
|
+
km: number;
|
|
8844
|
+
customData: unknown;
|
|
8845
|
+
id: string;
|
|
8846
|
+
createdAt: string;
|
|
8847
|
+
updatedAt: string;
|
|
8848
|
+
deletedAt: string | null;
|
|
8849
|
+
oldId: number | null;
|
|
8850
|
+
} | null;
|
|
8822
8851
|
totalCount: number;
|
|
8823
8852
|
template: {
|
|
8824
8853
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -143119,7 +143119,7 @@ var inspectionTable = inspectionSchema.table("inspection", {
|
|
|
143119
143119
|
machineId: uuid5().notNull(),
|
|
143120
143120
|
templateId: uuid5().notNull(),
|
|
143121
143121
|
employeeInspectedId: uuid5().notNull(),
|
|
143122
|
-
userInspectedId:
|
|
143122
|
+
userInspectedId: text().notNull(),
|
|
143123
143123
|
hours: numeric({ mode: "number" }),
|
|
143124
143124
|
mileageKm: numeric({ mode: "number" }),
|
|
143125
143125
|
state: inspectionStateEnum().notNull().default("CREATED"),
|
|
@@ -154295,14 +154295,15 @@ var fieldGroup_default = fieldGroupRoutes;
|
|
|
154295
154295
|
var InspectionLogic;
|
|
154296
154296
|
((InspectionLogic) => {
|
|
154297
154297
|
InspectionLogic.select = async (query, user2) => {
|
|
154298
|
-
const filter = and(eq(inspectionTable.machineId, query.machineId).if(query.machineId), eq(inspectionTable.templateId, query.templateId).if(query.templateId), eq(inspectionTable.state, query.state).if(query.state), gte(inspectionTable.createdAt, query.startDate).if(query.startDate), lte(inspectionTable.createdAt, query.endDate).if(query.endDate), eq(inspectionTemplateTable.companyId, user2.companyId));
|
|
154298
|
+
const filter = and(eq(inspectionTable.machineId, query.machineId).if(query.machineId), eq(inspectionTable.templateId, query.templateId).if(query.templateId), eq(inspectionTable.state, query.state).if(query.state), gte(inspectionTable.createdAt, query.startDate).if(query.startDate), lte(inspectionTable.createdAt, query.endDate).if(query.endDate), eq(inspectionTable.id, query.id).if(query.id), or(eq(inspectionTemplateTable.companyId, user2.companyId), isNull2(inspectionTemplateTable.companyId)));
|
|
154299
154299
|
const baseQuery = db_default.select({
|
|
154300
154300
|
inspection: inspectionTable,
|
|
154301
|
+
machine: companyMachineTable,
|
|
154301
154302
|
totalCount: totalCountSql,
|
|
154302
154303
|
template: {
|
|
154303
154304
|
name: inspectionTemplateTable.name
|
|
154304
154305
|
}
|
|
154305
|
-
}).from(inspectionTable).leftJoin(inspectionTemplateTable, eq(inspectionTemplateTable.id, inspectionTable.templateId)).where(filter).$dynamic();
|
|
154306
|
+
}).from(inspectionTable).leftJoin(inspectionTemplateTable, eq(inspectionTemplateTable.id, inspectionTable.templateId)).leftJoin(companyMachineTable, eq(companyMachineTable.id, inspectionTable.machineId)).where(filter).$dynamic();
|
|
154306
154307
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
154307
154308
|
return getPaginationContent(result, query.pagination.size);
|
|
154308
154309
|
};
|
|
@@ -154344,7 +154345,8 @@ var InspectionModel;
|
|
|
154344
154345
|
default: undefined
|
|
154345
154346
|
}),
|
|
154346
154347
|
startDate: t.String({ format: "date" }),
|
|
154347
|
-
endDate: t.String({ format: "date" })
|
|
154348
|
+
endDate: t.String({ format: "date" }),
|
|
154349
|
+
id: t.String({ format: "uuid" })
|
|
154348
154350
|
}))
|
|
154349
154351
|
]);
|
|
154350
154352
|
})(InspectionModel ||= {});
|
|
@@ -154500,7 +154502,7 @@ var inspectionRoutes2 = new Elysia({
|
|
|
154500
154502
|
prefix: "/inspection"
|
|
154501
154503
|
}).use(fieldGroup_default).use(field_default).use(template_default).use(schedule_default).use(better_auth_default).guard({ auth: true }).get("/", async ({ query, user: user2 }) => logic_default27.select(query, user2), {
|
|
154502
154504
|
query: model_default27.select
|
|
154503
|
-
}).post("/", async ({ body, user: user2 }) => logic_default27.create(body, user2), {
|
|
154505
|
+
}).post("/", async ({ body, user: user2 }) => logic_default27.create(body, user2).catch((err2) => console.error(err2)), {
|
|
154504
154506
|
body: model_default27.create
|
|
154505
154507
|
});
|
|
154506
154508
|
var inspection_default2 = inspectionRoutes2;
|