autosync_backend2 1.2.33 → 1.2.34
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 +1 -0
- package/dist/index.js +5 -4
- 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;
|
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,7 +154295,7 @@ 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
154301
|
totalCount: totalCountSql,
|
|
@@ -154344,7 +154344,8 @@ var InspectionModel;
|
|
|
154344
154344
|
default: undefined
|
|
154345
154345
|
}),
|
|
154346
154346
|
startDate: t.String({ format: "date" }),
|
|
154347
|
-
endDate: t.String({ format: "date" })
|
|
154347
|
+
endDate: t.String({ format: "date" }),
|
|
154348
|
+
id: t.String({ format: "uuid" })
|
|
154348
154349
|
}))
|
|
154349
154350
|
]);
|
|
154350
154351
|
})(InspectionModel ||= {});
|
|
@@ -154500,7 +154501,7 @@ var inspectionRoutes2 = new Elysia({
|
|
|
154500
154501
|
prefix: "/inspection"
|
|
154501
154502
|
}).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
154503
|
query: model_default27.select
|
|
154503
|
-
}).post("/", async ({ body, user: user2 }) => logic_default27.create(body, user2), {
|
|
154504
|
+
}).post("/", async ({ body, user: user2 }) => logic_default27.create(body, user2).catch((err2) => console.error(err2)), {
|
|
154504
154505
|
body: model_default27.create
|
|
154505
154506
|
});
|
|
154506
154507
|
var inspection_default2 = inspectionRoutes2;
|