autosync_backend2 1.2.24 → 1.2.26
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 +109 -0
- package/dist/index.js +86 -25
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1021,6 +1021,7 @@ export declare const app: Elysia<"", {
|
|
|
1021
1021
|
shelfNumber: string | null;
|
|
1022
1022
|
description: string | null;
|
|
1023
1023
|
isOrdered: boolean;
|
|
1024
|
+
order: number;
|
|
1024
1025
|
id: string;
|
|
1025
1026
|
createdAt: string;
|
|
1026
1027
|
updatedAt: string;
|
|
@@ -1097,6 +1098,7 @@ export declare const app: Elysia<"", {
|
|
|
1097
1098
|
quantity?: number | undefined;
|
|
1098
1099
|
shelfNumber?: string | null | undefined;
|
|
1099
1100
|
isOrdered?: boolean | undefined;
|
|
1101
|
+
order?: number | undefined;
|
|
1100
1102
|
productId: string;
|
|
1101
1103
|
warehouseId: string;
|
|
1102
1104
|
safetyStock: number;
|
|
@@ -1118,6 +1120,7 @@ export declare const app: Elysia<"", {
|
|
|
1118
1120
|
safetyStock: number;
|
|
1119
1121
|
shelfNumber: string | null;
|
|
1120
1122
|
isOrdered: boolean;
|
|
1123
|
+
order: number;
|
|
1121
1124
|
};
|
|
1122
1125
|
422: {
|
|
1123
1126
|
type: "validation";
|
|
@@ -1141,6 +1144,7 @@ export declare const app: Elysia<"", {
|
|
|
1141
1144
|
quantity?: number | undefined;
|
|
1142
1145
|
shelfNumber?: string | null | undefined;
|
|
1143
1146
|
isOrdered?: boolean | undefined;
|
|
1147
|
+
order?: number | undefined;
|
|
1144
1148
|
productId: string;
|
|
1145
1149
|
warehouseId: string;
|
|
1146
1150
|
safetyStock: number;
|
|
@@ -1235,6 +1239,7 @@ export declare const app: Elysia<"", {
|
|
|
1235
1239
|
shelfNumber: string | null;
|
|
1236
1240
|
description: string | null;
|
|
1237
1241
|
isOrdered: boolean;
|
|
1242
|
+
order: number;
|
|
1238
1243
|
id: string;
|
|
1239
1244
|
createdAt: string;
|
|
1240
1245
|
updatedAt: string;
|
|
@@ -1308,6 +1313,7 @@ export declare const app: Elysia<"", {
|
|
|
1308
1313
|
shelfNumber: string | null;
|
|
1309
1314
|
description: string | null;
|
|
1310
1315
|
isOrdered: boolean;
|
|
1316
|
+
order: number;
|
|
1311
1317
|
id: string;
|
|
1312
1318
|
createdAt: string;
|
|
1313
1319
|
updatedAt: string;
|
|
@@ -1342,6 +1348,7 @@ export declare const app: Elysia<"", {
|
|
|
1342
1348
|
safetyStock?: number | undefined;
|
|
1343
1349
|
shelfNumber?: string | null | undefined;
|
|
1344
1350
|
isOrdered?: boolean | undefined;
|
|
1351
|
+
order?: number | undefined;
|
|
1345
1352
|
};
|
|
1346
1353
|
params: {
|
|
1347
1354
|
id: string;
|
|
@@ -1357,6 +1364,7 @@ export declare const app: Elysia<"", {
|
|
|
1357
1364
|
shelfNumber: string | null;
|
|
1358
1365
|
description: string | null;
|
|
1359
1366
|
isOrdered: boolean;
|
|
1367
|
+
order: number;
|
|
1360
1368
|
id: string;
|
|
1361
1369
|
createdAt: string;
|
|
1362
1370
|
updatedAt: string;
|
|
@@ -7142,8 +7150,12 @@ export declare const app: Elysia<"", {
|
|
|
7142
7150
|
employeeId?: string | undefined;
|
|
7143
7151
|
phoneNumber?: string | undefined;
|
|
7144
7152
|
licensePlate?: string | undefined;
|
|
7153
|
+
partNumber?: string | undefined;
|
|
7154
|
+
productName?: string | undefined;
|
|
7145
7155
|
startDate?: string | undefined;
|
|
7146
7156
|
endDate?: string | undefined;
|
|
7157
|
+
orderType?: "Service" | "ProductSell" | undefined;
|
|
7158
|
+
serviceKindName?: string | undefined;
|
|
7147
7159
|
pagination: {
|
|
7148
7160
|
size: number;
|
|
7149
7161
|
page: number;
|
|
@@ -8131,6 +8143,103 @@ export declare const app: Elysia<"", {
|
|
|
8131
8143
|
};
|
|
8132
8144
|
};
|
|
8133
8145
|
};
|
|
8146
|
+
} & {
|
|
8147
|
+
inspection: {};
|
|
8148
|
+
} & {
|
|
8149
|
+
inspection: {
|
|
8150
|
+
get: {
|
|
8151
|
+
body: unknown;
|
|
8152
|
+
params: {};
|
|
8153
|
+
query: {
|
|
8154
|
+
state?: "CREATED" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED" | undefined;
|
|
8155
|
+
templateId?: string | undefined;
|
|
8156
|
+
machineId?: string | undefined;
|
|
8157
|
+
startDate?: string | undefined;
|
|
8158
|
+
endDate?: string | undefined;
|
|
8159
|
+
pagination: {
|
|
8160
|
+
size: number;
|
|
8161
|
+
page: number;
|
|
8162
|
+
};
|
|
8163
|
+
};
|
|
8164
|
+
headers: unknown;
|
|
8165
|
+
response: {
|
|
8166
|
+
200: {
|
|
8167
|
+
totalCount: number;
|
|
8168
|
+
totalPage: number;
|
|
8169
|
+
result: Omit<{
|
|
8170
|
+
inspection: {
|
|
8171
|
+
machineId: string;
|
|
8172
|
+
templateId: string;
|
|
8173
|
+
employeeInspectedId: string;
|
|
8174
|
+
userInspectedId: string;
|
|
8175
|
+
hours: number | null;
|
|
8176
|
+
mileageKm: number | null;
|
|
8177
|
+
state: "CREATED" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED";
|
|
8178
|
+
stateResult: "FAILED" | "NOT_INSPECTED" | "PASSED" | "RETURNED" | "WAIVED" | null;
|
|
8179
|
+
timeScheduled: Date;
|
|
8180
|
+
timeStarted: Date;
|
|
8181
|
+
timeCompleted: Date;
|
|
8182
|
+
note: string | null;
|
|
8183
|
+
id: string;
|
|
8184
|
+
createdAt: string;
|
|
8185
|
+
updatedAt: string;
|
|
8186
|
+
deletedAt: string | null;
|
|
8187
|
+
oldId: number | null;
|
|
8188
|
+
};
|
|
8189
|
+
totalCount: number;
|
|
8190
|
+
template: {
|
|
8191
|
+
name: string;
|
|
8192
|
+
} | null;
|
|
8193
|
+
}, "totalCount">[];
|
|
8194
|
+
};
|
|
8195
|
+
401: "Session not found";
|
|
8196
|
+
422: {
|
|
8197
|
+
type: "validation";
|
|
8198
|
+
on: string;
|
|
8199
|
+
summary?: string;
|
|
8200
|
+
message?: string;
|
|
8201
|
+
found?: unknown;
|
|
8202
|
+
property?: string;
|
|
8203
|
+
expected?: string;
|
|
8204
|
+
};
|
|
8205
|
+
};
|
|
8206
|
+
};
|
|
8207
|
+
};
|
|
8208
|
+
} & {
|
|
8209
|
+
inspection: {
|
|
8210
|
+
post: {
|
|
8211
|
+
body: {
|
|
8212
|
+
oldId?: number | null | undefined;
|
|
8213
|
+
state?: "CREATED" | "SCHEDULED" | "IN_PROGRESS" | "COMPLETED" | undefined;
|
|
8214
|
+
note?: string | null | undefined;
|
|
8215
|
+
hours?: number | null | undefined;
|
|
8216
|
+
mileageKm?: number | null | undefined;
|
|
8217
|
+
stateResult?: "FAILED" | "NOT_INSPECTED" | "PASSED" | "RETURNED" | "WAIVED" | null | undefined;
|
|
8218
|
+
timeCompleted: Date;
|
|
8219
|
+
templateId: string;
|
|
8220
|
+
machineId: string;
|
|
8221
|
+
employeeInspectedId: string;
|
|
8222
|
+
userInspectedId: string;
|
|
8223
|
+
timeScheduled: Date;
|
|
8224
|
+
timeStarted: Date;
|
|
8225
|
+
};
|
|
8226
|
+
params: {};
|
|
8227
|
+
query: unknown;
|
|
8228
|
+
headers: unknown;
|
|
8229
|
+
response: {
|
|
8230
|
+
401: "Session not found";
|
|
8231
|
+
422: {
|
|
8232
|
+
type: "validation";
|
|
8233
|
+
on: string;
|
|
8234
|
+
summary?: string;
|
|
8235
|
+
message?: string;
|
|
8236
|
+
found?: unknown;
|
|
8237
|
+
property?: string;
|
|
8238
|
+
expected?: string;
|
|
8239
|
+
};
|
|
8240
|
+
};
|
|
8241
|
+
};
|
|
8242
|
+
};
|
|
8134
8243
|
};
|
|
8135
8244
|
};
|
|
8136
8245
|
}, {
|
package/dist/index.js
CHANGED
|
@@ -143146,7 +143146,8 @@ var warehouseItemTable = warehouseSchema.table("item", {
|
|
|
143146
143146
|
safetyStock: numeric({ mode: "number" }).notNull(),
|
|
143147
143147
|
shelfNumber: varchar(),
|
|
143148
143148
|
description: text(),
|
|
143149
|
-
isOrdered: boolean4().notNull().default(false)
|
|
143149
|
+
isOrdered: boolean4().notNull().default(false),
|
|
143150
|
+
order: numeric({ mode: "number" }).notNull().default(1)
|
|
143150
143151
|
}, (t2) => [unique().on(t2.warehouseId, t2.productId)]);
|
|
143151
143152
|
var warehouseTransactionTypeEnum = warehouseSchema.enum("transaction_type", ["IN", "OUT"]);
|
|
143152
143153
|
var warehouseTransactionKindEnum = warehouseSchema.enum("transaction_kind", ["TRANSFER", "RETURN", "ADJUSTMENT", "REJECTION", "ORDER", "SALES"]);
|
|
@@ -151063,13 +151064,13 @@ var CrmCpOrderLogic;
|
|
|
151063
151064
|
paidAmount: sql3`
|
|
151064
151065
|
COALESCE((select sum(${crmCpOrderPaymentTable.amount}) from ${crmCpOrderPaymentTable} where ${crmCpOrderPaymentTable.cpOrderId} = ${crmCpOrderTable.id} and ${crmCpOrderPaymentTable.state} = 'PAID' and ${crmCpOrderPaymentTable.deletedAt} is null), 0)
|
|
151065
151066
|
`.mapWith(Number).as("paid_amount")
|
|
151066
|
-
}).from(crmCpOrderTable).leftJoin(crmVehicleTable, eq(crmVehicleTable.id, crmCpOrderTable.vehicleId)).leftJoin(crmCustomerTable, eq(crmCustomerTable.id, crmCpOrderTable.customerId)).leftJoin(model, eq(model.id, crmVehicleTable.vehicleKindId)).leftJoin(make, eq(make.id, model.parentId)).where(filter).
|
|
151067
|
+
}).from(crmCpOrderTable).leftJoin(crmVehicleTable, eq(crmVehicleTable.id, crmCpOrderTable.vehicleId)).leftJoin(crmCustomerTable, eq(crmCustomerTable.id, crmCpOrderTable.customerId)).leftJoin(model, eq(model.id, crmVehicleTable.vehicleKindId)).leftJoin(make, eq(make.id, model.parentId)).where(filter).having((t2) => query.isPaid === undefined ? undefined : query.isPaid ? sql3`${t2.totalAmount} - ${t2.paidAmount} = 0` : sql3`${t2.totalAmount} - ${t2.paidAmount} != 0`).groupBy((t2) => [
|
|
151067
151068
|
t2.order.id,
|
|
151068
151069
|
t2.vehicle.id,
|
|
151069
151070
|
t2.make.id,
|
|
151070
151071
|
t2.model.id,
|
|
151071
151072
|
t2.customer.id
|
|
151072
|
-
]).$dynamic();
|
|
151073
|
+
]).orderBy(desc(crmCpOrderTable.createdAt), desc(crmCpOrderItemTable.createdAt)).$dynamic();
|
|
151073
151074
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
151074
151075
|
const content = {
|
|
151075
151076
|
totalCount: result[0]?.totalCount ?? 0,
|
|
@@ -152675,7 +152676,7 @@ var CrmReportsLogic;
|
|
|
152675
152676
|
totalPrice: sql3`CASE WHEN ${crmCpOrderTable.isNoat} = FALSE THEN ${crmCpOrderItemTable.priceTotal} ELSE 0 END`.as("total_price"),
|
|
152676
152677
|
totalPriceNoat: sql3`CASE WHEN ${crmCpOrderTable.isNoat} = TRUE THEN ${crmCpOrderItemTable.priceTotal} * 1.1 ELSE 0 END`.as("total_price_noat"),
|
|
152677
152678
|
totalCount: totalCountSql
|
|
152678
|
-
}).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) => [
|
|
152679
|
+
}).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), eq(crmCpOrderTable.type, query.orderType).if(query.orderType), ilike(warehouseProductTable.partNumber, `%${query.partNumber}%`).if(query.partNumber), ilike(companyServiceKindTable.name, `%${query.serviceKindName}%`).if(query.serviceKindName), ilike(warehouseProductTable.name, `%${query.productName}%`).if(query.productName))).orderBy(desc(crmCpOrderTable.createdAt), desc(crmCpOrderItemTable.createdAt)).groupBy((t2) => [
|
|
152679
152680
|
t2.createdAt,
|
|
152680
152681
|
t2.orderId,
|
|
152681
152682
|
t2.phone,
|
|
@@ -152688,7 +152689,8 @@ var CrmReportsLogic;
|
|
|
152688
152689
|
t2.priceAfterDiscount,
|
|
152689
152690
|
t2.discount,
|
|
152690
152691
|
t2.totalPrice,
|
|
152691
|
-
t2.totalPriceNoat
|
|
152692
|
+
t2.totalPriceNoat,
|
|
152693
|
+
crmCpOrderItemTable.createdAt
|
|
152692
152694
|
]).$dynamic();
|
|
152693
152695
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
152694
152696
|
return getPaginationContent(result, query.pagination.size);
|
|
@@ -152784,7 +152786,13 @@ var CrmReportsModel;
|
|
|
152784
152786
|
startDate: t.String({ format: "date" }),
|
|
152785
152787
|
endDate: t.String({ format: "date" }),
|
|
152786
152788
|
phoneNumber: t.String(),
|
|
152787
|
-
licensePlate: t.String()
|
|
152789
|
+
licensePlate: t.String(),
|
|
152790
|
+
orderType: t.UnionEnum(crmCpOrderTable.type.enumValues, {
|
|
152791
|
+
default: undefined
|
|
152792
|
+
}),
|
|
152793
|
+
partNumber: t.String(),
|
|
152794
|
+
productName: t.String(),
|
|
152795
|
+
serviceKindName: t.String()
|
|
152788
152796
|
})),
|
|
152789
152797
|
PaginationSchema
|
|
152790
152798
|
]);
|
|
@@ -154123,6 +154131,55 @@ var fieldGroupRoutes = new Elysia({
|
|
|
154123
154131
|
}).delete("/:id", async ({ params: { id } }) => logic_default26.remove(id)).get("/:id/field", async ({ params: { id } }) => logic_default25.select(id));
|
|
154124
154132
|
var fieldGroup_default = fieldGroupRoutes;
|
|
154125
154133
|
|
|
154134
|
+
// src/routes/fleet/inspection/logic.ts
|
|
154135
|
+
var InspectionLogic;
|
|
154136
|
+
((InspectionLogic) => {
|
|
154137
|
+
InspectionLogic.select = async (query, user2) => {
|
|
154138
|
+
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));
|
|
154139
|
+
const baseQuery = db_default.select({
|
|
154140
|
+
inspection: inspectionTable,
|
|
154141
|
+
totalCount: totalCountSql,
|
|
154142
|
+
template: {
|
|
154143
|
+
name: inspectionTemplateTable.name
|
|
154144
|
+
}
|
|
154145
|
+
}).from(inspectionTable).leftJoin(inspectionTemplateTable, eq(inspectionTemplateTable.id, inspectionTable.templateId)).where(filter).$dynamic();
|
|
154146
|
+
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
154147
|
+
return getPaginationContent(result, query.pagination.size);
|
|
154148
|
+
};
|
|
154149
|
+
InspectionLogic.create = async (body) => {
|
|
154150
|
+
await db_default.insert(inspectionTable).values(body);
|
|
154151
|
+
};
|
|
154152
|
+
InspectionLogic.update = async (id, body) => {
|
|
154153
|
+
await db_default.update(inspectionTable).set(body).where(eq(inspectionTable.id, id));
|
|
154154
|
+
};
|
|
154155
|
+
InspectionLogic.remove = async (id) => {
|
|
154156
|
+
await db_default.delete(inspectionTable).where(eq(inspectionTable.id, id));
|
|
154157
|
+
};
|
|
154158
|
+
})(InspectionLogic ||= {});
|
|
154159
|
+
var logic_default27 = InspectionLogic;
|
|
154160
|
+
|
|
154161
|
+
// src/routes/fleet/inspection/model.ts
|
|
154162
|
+
var InspectionModel;
|
|
154163
|
+
((InspectionModel) => {
|
|
154164
|
+
const createSchema = createInsertSchema2(inspectionTable);
|
|
154165
|
+
const updateSchema = createUpdateSchema(inspectionTable);
|
|
154166
|
+
InspectionModel.create = OmitBaseSchema(createSchema);
|
|
154167
|
+
InspectionModel.update = OmitBaseSchema(updateSchema);
|
|
154168
|
+
InspectionModel.select = t.Composite([
|
|
154169
|
+
PaginationSchema,
|
|
154170
|
+
t.Partial(t.Object({
|
|
154171
|
+
machineId: t.String({ format: "uuid" }),
|
|
154172
|
+
templateId: t.String({ format: "uuid" }),
|
|
154173
|
+
state: t.UnionEnum(inspectionTable.state.enumValues, {
|
|
154174
|
+
default: undefined
|
|
154175
|
+
}),
|
|
154176
|
+
startDate: t.String({ format: "date" }),
|
|
154177
|
+
endDate: t.String({ format: "date" })
|
|
154178
|
+
}))
|
|
154179
|
+
]);
|
|
154180
|
+
})(InspectionModel ||= {});
|
|
154181
|
+
var model_default27 = InspectionModel;
|
|
154182
|
+
|
|
154126
154183
|
// src/routes/fleet/inspection/schedule/logic.ts
|
|
154127
154184
|
var InspectionScheduleLogic;
|
|
154128
154185
|
((InspectionScheduleLogic) => {
|
|
@@ -154151,7 +154208,7 @@ var InspectionScheduleLogic;
|
|
|
154151
154208
|
}).where(and(eq(inspectionScheduleTable.id, id), eq(inspectionScheduleTable.companyId, user2.companyId)));
|
|
154152
154209
|
};
|
|
154153
154210
|
})(InspectionScheduleLogic ||= {});
|
|
154154
|
-
var
|
|
154211
|
+
var logic_default28 = InspectionScheduleLogic;
|
|
154155
154212
|
|
|
154156
154213
|
// src/routes/fleet/inspection/schedule/model.ts
|
|
154157
154214
|
var InspectionScheduleModel;
|
|
@@ -154162,18 +154219,18 @@ var InspectionScheduleModel;
|
|
|
154162
154219
|
InspectionScheduleModel.update = OmitBaseSchema(updateSchema);
|
|
154163
154220
|
InspectionScheduleModel.select = t.Composite([PaginationSchema]);
|
|
154164
154221
|
})(InspectionScheduleModel ||= {});
|
|
154165
|
-
var
|
|
154222
|
+
var model_default28 = InspectionScheduleModel;
|
|
154166
154223
|
|
|
154167
154224
|
// src/routes/fleet/inspection/schedule/index.ts
|
|
154168
154225
|
var scheduleRoutes = new Elysia({
|
|
154169
154226
|
prefix: "/schedule"
|
|
154170
|
-
}).use(better_auth_default).guard({ auth: true }).get("/", async ({ query, user: user2 }) =>
|
|
154171
|
-
query:
|
|
154172
|
-
}).post("/", async ({ body, user: user2 }) =>
|
|
154173
|
-
body:
|
|
154227
|
+
}).use(better_auth_default).guard({ auth: true }).get("/", async ({ query, user: user2 }) => logic_default28.select(query, user2), {
|
|
154228
|
+
query: model_default28.select
|
|
154229
|
+
}).post("/", async ({ body, user: user2 }) => logic_default28.create(body, user2), {
|
|
154230
|
+
body: model_default28.create
|
|
154174
154231
|
}).guard({
|
|
154175
154232
|
params: IdSchema
|
|
154176
|
-
}).put("/:id", async ({ body, params: { id }, user: user2 }) =>
|
|
154233
|
+
}).put("/:id", async ({ body, params: { id }, user: user2 }) => logic_default28.update(id, body, user2), { body: model_default28.update }).delete("/:id", async ({ params: { id }, user: user2 }) => logic_default28.remove(id, user2));
|
|
154177
154234
|
var schedule_default = scheduleRoutes;
|
|
154178
154235
|
|
|
154179
154236
|
// src/routes/fleet/inspection/template/logic.ts
|
|
@@ -154232,7 +154289,7 @@ var InspectionTemplateLogic;
|
|
|
154232
154289
|
}).where(eq(inspectionTemplateFieldTable.id, id));
|
|
154233
154290
|
};
|
|
154234
154291
|
})(InspectionTemplateLogic ||= {});
|
|
154235
|
-
var
|
|
154292
|
+
var logic_default29 = InspectionTemplateLogic;
|
|
154236
154293
|
|
|
154237
154294
|
// src/routes/fleet/inspection/template/model.ts
|
|
154238
154295
|
var InspectionTemplateModel;
|
|
@@ -154247,7 +154304,7 @@ var InspectionTemplateModel;
|
|
|
154247
154304
|
"templateId"
|
|
154248
154305
|
]);
|
|
154249
154306
|
})(InspectionTemplateModel ||= {});
|
|
154250
|
-
var
|
|
154307
|
+
var model_default29 = InspectionTemplateModel;
|
|
154251
154308
|
|
|
154252
154309
|
// src/routes/fleet/inspection/template/index.ts
|
|
154253
154310
|
var templateRoutes = new Elysia({
|
|
@@ -154255,23 +154312,27 @@ var templateRoutes = new Elysia({
|
|
|
154255
154312
|
tags: ["InspectionTemplate"]
|
|
154256
154313
|
}).use(better_auth_default).guard({
|
|
154257
154314
|
userKind: "COMPANY_ADMIN"
|
|
154258
|
-
}).get("/", async ({ query, user: user2 }) =>
|
|
154259
|
-
query:
|
|
154260
|
-
}).post("/", async ({ body, user: user2 }) =>
|
|
154261
|
-
body:
|
|
154315
|
+
}).get("/", async ({ query, user: user2 }) => logic_default29.select(query, user2), {
|
|
154316
|
+
query: model_default29.select
|
|
154317
|
+
}).post("/", async ({ body, user: user2 }) => logic_default29.create(body, user2), {
|
|
154318
|
+
body: model_default29.create
|
|
154262
154319
|
}).guard({
|
|
154263
154320
|
params: IdSchema
|
|
154264
|
-
}).get("/:id", async ({ params: { id }, user: user2 }) =>
|
|
154265
|
-
body:
|
|
154266
|
-
}).delete("/:id", async ({ params: { id }, user: user2 }) =>
|
|
154267
|
-
body:
|
|
154268
|
-
}).delete("/field/:id", async ({ params: { id } }) =>
|
|
154321
|
+
}).get("/:id", async ({ params: { id }, user: user2 }) => logic_default29.selectById(id, user2)).put("/:id", async ({ body, params: { id }, user: user2 }) => logic_default29.update(id, body, user2), {
|
|
154322
|
+
body: model_default29.update
|
|
154323
|
+
}).delete("/:id", async ({ params: { id }, user: user2 }) => logic_default29.remove(id, user2)).get("/:id/field", async ({ params: { id } }) => logic_default29.selectField(id)).post("/:id/field", async ({ body, params: { id } }) => logic_default29.addField(id, body), {
|
|
154324
|
+
body: model_default29.createField
|
|
154325
|
+
}).delete("/field/:id", async ({ params: { id } }) => logic_default29.removeField(id));
|
|
154269
154326
|
var template_default = templateRoutes;
|
|
154270
154327
|
|
|
154271
154328
|
// src/routes/fleet/inspection/index.ts
|
|
154272
154329
|
var inspectionRoutes2 = new Elysia({
|
|
154273
154330
|
prefix: "/inspection"
|
|
154274
|
-
}).use(fieldGroup_default).use(field_default).use(template_default).use(schedule_default)
|
|
154331
|
+
}).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), {
|
|
154332
|
+
query: model_default27.select
|
|
154333
|
+
}).post("/", async ({ body }) => logic_default27.create(body), {
|
|
154334
|
+
body: model_default27.create
|
|
154335
|
+
});
|
|
154275
154336
|
var inspection_default2 = inspectionRoutes2;
|
|
154276
154337
|
|
|
154277
154338
|
// src/routes/fleet/index.ts
|