autosync_backend2 1.2.56 → 1.2.63
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 +429 -96
- package/dist/index.js +269 -75
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1141,9 +1141,9 @@ export declare const app: Elysia<"", {
|
|
|
1141
1141
|
oldId?: number | null | undefined;
|
|
1142
1142
|
description?: string | null | undefined;
|
|
1143
1143
|
quantity?: number | undefined;
|
|
1144
|
+
order?: number | undefined;
|
|
1144
1145
|
shelfNumber?: string | null | undefined;
|
|
1145
1146
|
isOrdered?: boolean | undefined;
|
|
1146
|
-
order?: number | undefined;
|
|
1147
1147
|
productId: string;
|
|
1148
1148
|
warehouseId: string;
|
|
1149
1149
|
safetyStock: number;
|
|
@@ -1160,12 +1160,12 @@ export declare const app: Elysia<"", {
|
|
|
1160
1160
|
oldId: number | null;
|
|
1161
1161
|
description: string | null;
|
|
1162
1162
|
quantity: number;
|
|
1163
|
+
order: number;
|
|
1163
1164
|
productId: string;
|
|
1164
1165
|
warehouseId: string;
|
|
1165
1166
|
safetyStock: number;
|
|
1166
1167
|
shelfNumber: string | null;
|
|
1167
1168
|
isOrdered: boolean;
|
|
1168
|
-
order: number;
|
|
1169
1169
|
};
|
|
1170
1170
|
401: "Токен олдсонгүй";
|
|
1171
1171
|
403: "Хандах эрхгүй байна.";
|
|
@@ -1189,9 +1189,9 @@ export declare const app: Elysia<"", {
|
|
|
1189
1189
|
oldId?: number | null | undefined;
|
|
1190
1190
|
description?: string | null | undefined;
|
|
1191
1191
|
quantity?: number | undefined;
|
|
1192
|
+
order?: number | undefined;
|
|
1192
1193
|
shelfNumber?: string | null | undefined;
|
|
1193
1194
|
isOrdered?: boolean | undefined;
|
|
1194
|
-
order?: number | undefined;
|
|
1195
1195
|
productId: string;
|
|
1196
1196
|
warehouseId: string;
|
|
1197
1197
|
safetyStock: number;
|
|
@@ -1412,12 +1412,12 @@ export declare const app: Elysia<"", {
|
|
|
1412
1412
|
deletedAt?: string | null | undefined;
|
|
1413
1413
|
oldId?: number | null | undefined;
|
|
1414
1414
|
description?: string | null | undefined;
|
|
1415
|
+
order?: number | undefined;
|
|
1415
1416
|
productId?: string | undefined;
|
|
1416
1417
|
warehouseId?: string | undefined;
|
|
1417
1418
|
safetyStock?: number | undefined;
|
|
1418
1419
|
shelfNumber?: string | null | undefined;
|
|
1419
1420
|
isOrdered?: boolean | undefined;
|
|
1420
|
-
order?: number | undefined;
|
|
1421
1421
|
};
|
|
1422
1422
|
params: {
|
|
1423
1423
|
id: string;
|
|
@@ -3088,23 +3088,65 @@ export declare const app: Elysia<"", {
|
|
|
3088
3088
|
totalCount: number;
|
|
3089
3089
|
totalPage: number;
|
|
3090
3090
|
result: Omit<{
|
|
3091
|
+
invoice: {
|
|
3092
|
+
companyId: string;
|
|
3093
|
+
billingPlanId: string;
|
|
3094
|
+
periodStart: string;
|
|
3095
|
+
periodEnd: string;
|
|
3096
|
+
carCount: number;
|
|
3097
|
+
basePrice: number;
|
|
3098
|
+
status: "PENDING" | "PAID" | "OVERDUE" | "CANCELLED";
|
|
3099
|
+
issuedAt: string;
|
|
3100
|
+
paidAt: string | null;
|
|
3101
|
+
dueAt: string;
|
|
3102
|
+
note: string | null;
|
|
3103
|
+
id: string;
|
|
3104
|
+
createdAt: string;
|
|
3105
|
+
updatedAt: string;
|
|
3106
|
+
deletedAt: string | null;
|
|
3107
|
+
oldId: number | null;
|
|
3108
|
+
};
|
|
3109
|
+
billingPlan: {
|
|
3110
|
+
companyId: string;
|
|
3111
|
+
billingPeriod: "MONTHLY" | "ANNUAL" | "YEARLY";
|
|
3112
|
+
basePrice: number;
|
|
3113
|
+
maxCarCount: number | null;
|
|
3114
|
+
active: boolean;
|
|
3115
|
+
note: string | null;
|
|
3116
|
+
id: string;
|
|
3117
|
+
createdAt: string;
|
|
3118
|
+
updatedAt: string;
|
|
3119
|
+
deletedAt: string | null;
|
|
3120
|
+
oldId: number | null;
|
|
3121
|
+
} | null;
|
|
3122
|
+
company: {
|
|
3123
|
+
name: string;
|
|
3124
|
+
regNumber: string;
|
|
3125
|
+
phone: string;
|
|
3126
|
+
email: string;
|
|
3127
|
+
serviceName: string;
|
|
3128
|
+
logoUrl: string;
|
|
3129
|
+
province: string | null;
|
|
3130
|
+
district: string | null;
|
|
3131
|
+
khoroo: string | null;
|
|
3132
|
+
street: string | null;
|
|
3133
|
+
socialUrls: string[] | null;
|
|
3134
|
+
ceoName: string | null;
|
|
3135
|
+
webUrl: string | null;
|
|
3136
|
+
googleMapUrl: string | null;
|
|
3137
|
+
isContract: boolean;
|
|
3138
|
+
isNoat: boolean;
|
|
3139
|
+
isNexus: boolean;
|
|
3140
|
+
isActive: boolean;
|
|
3141
|
+
branchCount: number;
|
|
3142
|
+
type: "AutoService" | "MiningFleet" | "UrbanTransportFleet" | "Long-haul/Logistics" | "Emergency/Medical/Police" | "CorporateFleet";
|
|
3143
|
+
id: string;
|
|
3144
|
+
createdAt: string;
|
|
3145
|
+
updatedAt: string;
|
|
3146
|
+
deletedAt: string | null;
|
|
3147
|
+
oldId: number | null;
|
|
3148
|
+
} | null;
|
|
3091
3149
|
totalCount: number;
|
|
3092
|
-
companyId: string;
|
|
3093
|
-
billingPlanId: string;
|
|
3094
|
-
periodStart: string;
|
|
3095
|
-
periodEnd: string;
|
|
3096
|
-
carCount: number;
|
|
3097
|
-
basePrice: number;
|
|
3098
|
-
status: "PENDING" | "PAID" | "OVERDUE" | "CANCELLED";
|
|
3099
|
-
issuedAt: string;
|
|
3100
|
-
paidAt: string | null;
|
|
3101
|
-
dueAt: string;
|
|
3102
|
-
note: string | null;
|
|
3103
|
-
id: string;
|
|
3104
|
-
createdAt: string;
|
|
3105
|
-
updatedAt: string;
|
|
3106
|
-
deletedAt: string | null;
|
|
3107
|
-
oldId: number | null;
|
|
3108
3150
|
}, "totalCount">[];
|
|
3109
3151
|
};
|
|
3110
3152
|
401: "Токен олдсонгүй";
|
|
@@ -3168,59 +3210,6 @@ export declare const app: Elysia<"", {
|
|
|
3168
3210
|
};
|
|
3169
3211
|
};
|
|
3170
3212
|
};
|
|
3171
|
-
} & {
|
|
3172
|
-
invoice: {
|
|
3173
|
-
post: {
|
|
3174
|
-
body: {
|
|
3175
|
-
oldId?: number | null | undefined;
|
|
3176
|
-
note?: string | null | undefined;
|
|
3177
|
-
status?: "PENDING" | "PAID" | "OVERDUE" | "CANCELLED" | undefined;
|
|
3178
|
-
paidAt?: string | null | undefined;
|
|
3179
|
-
companyId: string;
|
|
3180
|
-
basePrice: number;
|
|
3181
|
-
billingPlanId: string;
|
|
3182
|
-
periodStart: string;
|
|
3183
|
-
periodEnd: string;
|
|
3184
|
-
carCount: number;
|
|
3185
|
-
issuedAt: string;
|
|
3186
|
-
dueAt: string;
|
|
3187
|
-
};
|
|
3188
|
-
params: {};
|
|
3189
|
-
query: {};
|
|
3190
|
-
headers: {};
|
|
3191
|
-
response: {
|
|
3192
|
-
200: {
|
|
3193
|
-
id: string;
|
|
3194
|
-
createdAt: string;
|
|
3195
|
-
updatedAt: string;
|
|
3196
|
-
companyId: string;
|
|
3197
|
-
deletedAt: string | null;
|
|
3198
|
-
oldId: number | null;
|
|
3199
|
-
basePrice: number;
|
|
3200
|
-
note: string | null;
|
|
3201
|
-
billingPlanId: string;
|
|
3202
|
-
periodStart: string;
|
|
3203
|
-
periodEnd: string;
|
|
3204
|
-
carCount: number;
|
|
3205
|
-
status: "PENDING" | "PAID" | "OVERDUE" | "CANCELLED";
|
|
3206
|
-
issuedAt: string;
|
|
3207
|
-
paidAt: string | null;
|
|
3208
|
-
dueAt: string;
|
|
3209
|
-
};
|
|
3210
|
-
401: "Токен олдсонгүй";
|
|
3211
|
-
403: "Хандах эрхгүй байна." | "Төлбөрийн баримт үүсгэх эрхгүй байна.";
|
|
3212
|
-
422: {
|
|
3213
|
-
type: "validation";
|
|
3214
|
-
on: string;
|
|
3215
|
-
summary?: string;
|
|
3216
|
-
message?: string;
|
|
3217
|
-
found?: unknown;
|
|
3218
|
-
property?: string;
|
|
3219
|
-
expected?: string;
|
|
3220
|
-
};
|
|
3221
|
-
};
|
|
3222
|
-
};
|
|
3223
|
-
};
|
|
3224
3213
|
} & {
|
|
3225
3214
|
invoice: {
|
|
3226
3215
|
":id": {
|
|
@@ -10484,17 +10473,43 @@ export declare const app: Elysia<"", {
|
|
|
10484
10473
|
totalCount: number;
|
|
10485
10474
|
totalPage: number;
|
|
10486
10475
|
result: Omit<{
|
|
10476
|
+
product: {
|
|
10477
|
+
pmPlanId: string;
|
|
10478
|
+
productKindId: string;
|
|
10479
|
+
uomId: string;
|
|
10480
|
+
quantity: number | null;
|
|
10481
|
+
pmQuantity: string | null;
|
|
10482
|
+
id: string;
|
|
10483
|
+
createdAt: string;
|
|
10484
|
+
updatedAt: string;
|
|
10485
|
+
deletedAt: string | null;
|
|
10486
|
+
oldId: number | null;
|
|
10487
|
+
};
|
|
10488
|
+
productKind: {
|
|
10489
|
+
productCategoryId: string;
|
|
10490
|
+
name: string;
|
|
10491
|
+
description: string | null;
|
|
10492
|
+
id: string;
|
|
10493
|
+
createdAt: string;
|
|
10494
|
+
updatedAt: string;
|
|
10495
|
+
deletedAt: string | null;
|
|
10496
|
+
oldId: number | null;
|
|
10497
|
+
} | null;
|
|
10498
|
+
uom: {
|
|
10499
|
+
uomCategoryId: string;
|
|
10500
|
+
code: string | null;
|
|
10501
|
+
name: string;
|
|
10502
|
+
description: string | null;
|
|
10503
|
+
symbol: string | null;
|
|
10504
|
+
isBaseUnit: boolean;
|
|
10505
|
+
baseFactor: number | null;
|
|
10506
|
+
id: string;
|
|
10507
|
+
createdAt: string;
|
|
10508
|
+
updatedAt: string;
|
|
10509
|
+
deletedAt: string | null;
|
|
10510
|
+
oldId: number | null;
|
|
10511
|
+
} | null;
|
|
10487
10512
|
totalCount: number;
|
|
10488
|
-
pmPlanId: string;
|
|
10489
|
-
productKindId: string;
|
|
10490
|
-
uomId: string;
|
|
10491
|
-
quantity: number | null;
|
|
10492
|
-
pmQuantity: string;
|
|
10493
|
-
id: string;
|
|
10494
|
-
createdAt: string;
|
|
10495
|
-
updatedAt: string;
|
|
10496
|
-
deletedAt: string | null;
|
|
10497
|
-
oldId: number | null;
|
|
10498
10513
|
}, "totalCount">[];
|
|
10499
10514
|
};
|
|
10500
10515
|
401: "Токен олдсонгүй";
|
|
@@ -10516,10 +10531,10 @@ export declare const app: Elysia<"", {
|
|
|
10516
10531
|
body: {
|
|
10517
10532
|
oldId?: number | null | undefined;
|
|
10518
10533
|
quantity?: number | null | undefined;
|
|
10534
|
+
pmQuantity?: string | null | undefined;
|
|
10519
10535
|
uomId: string;
|
|
10520
10536
|
productKindId: string;
|
|
10521
10537
|
pmPlanId: string;
|
|
10522
|
-
pmQuantity: string;
|
|
10523
10538
|
};
|
|
10524
10539
|
params: {};
|
|
10525
10540
|
query: unknown;
|
|
@@ -10545,10 +10560,10 @@ export declare const app: Elysia<"", {
|
|
|
10545
10560
|
body: {
|
|
10546
10561
|
oldId?: number | null | undefined;
|
|
10547
10562
|
quantity?: number | null | undefined;
|
|
10563
|
+
pmQuantity?: string | null | undefined;
|
|
10548
10564
|
uomId: string;
|
|
10549
10565
|
productKindId: string;
|
|
10550
10566
|
pmPlanId: string;
|
|
10551
|
-
pmQuantity: string;
|
|
10552
10567
|
}[];
|
|
10553
10568
|
params: {};
|
|
10554
10569
|
query: unknown;
|
|
@@ -10564,7 +10579,7 @@ export declare const app: Elysia<"", {
|
|
|
10564
10579
|
uomId: string;
|
|
10565
10580
|
productKindId: string;
|
|
10566
10581
|
pmPlanId: string;
|
|
10567
|
-
pmQuantity: string;
|
|
10582
|
+
pmQuantity: string | null;
|
|
10568
10583
|
}[];
|
|
10569
10584
|
400: "Бүтээгдэхүүний мэдээлэл оруулах мэдээлэл байхгүй байна.";
|
|
10570
10585
|
401: "Токен олдсонгүй";
|
|
@@ -10591,7 +10606,7 @@ export declare const app: Elysia<"", {
|
|
|
10591
10606
|
uomId?: string | undefined;
|
|
10592
10607
|
productKindId?: string | undefined;
|
|
10593
10608
|
pmPlanId?: string | undefined;
|
|
10594
|
-
pmQuantity?: string | undefined;
|
|
10609
|
+
pmQuantity?: string | null | undefined;
|
|
10595
10610
|
};
|
|
10596
10611
|
params: {
|
|
10597
10612
|
id: string;
|
|
@@ -10687,22 +10702,17 @@ export declare const app: Elysia<"", {
|
|
|
10687
10702
|
plan: {
|
|
10688
10703
|
post: {
|
|
10689
10704
|
body: {
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
dateStart?: Date | null | undefined;
|
|
10693
|
-
dateEnd?: Date | null | undefined;
|
|
10694
|
-
name: string;
|
|
10695
|
-
companyId: string;
|
|
10705
|
+
machineId: string;
|
|
10706
|
+
pmTemplateId: string;
|
|
10696
10707
|
};
|
|
10697
10708
|
params: {};
|
|
10698
10709
|
query: unknown;
|
|
10699
10710
|
headers: unknown;
|
|
10700
10711
|
response: {
|
|
10701
|
-
|
|
10702
|
-
id: string;
|
|
10703
|
-
};
|
|
10712
|
+
400: "Ажилтны мэдээлэл шаардлагатай." | "Машины төрөл хэрэглэгчийн машин төрөлтэй тэнцүү байхгүй.";
|
|
10704
10713
|
401: "Токен олдсонгүй";
|
|
10705
10714
|
403: "Хандах эрхгүй байна.";
|
|
10715
|
+
404: "Pm Template олдсонгүй." | "Машин олдсонгүй.";
|
|
10706
10716
|
422: {
|
|
10707
10717
|
type: "validation";
|
|
10708
10718
|
on: string;
|
|
@@ -10917,6 +10927,34 @@ export declare const app: Elysia<"", {
|
|
|
10917
10927
|
query: unknown;
|
|
10918
10928
|
headers: unknown;
|
|
10919
10929
|
response: {
|
|
10930
|
+
200: {
|
|
10931
|
+
companyId: string | null;
|
|
10932
|
+
machineKindId: string;
|
|
10933
|
+
customerId: string | null;
|
|
10934
|
+
name: string | null;
|
|
10935
|
+
assetCode: string | null;
|
|
10936
|
+
vin: string | null;
|
|
10937
|
+
licensePlate: string | null;
|
|
10938
|
+
color: string | null;
|
|
10939
|
+
engineCc: string | null;
|
|
10940
|
+
cylinder: string | null;
|
|
10941
|
+
gasType: string | null;
|
|
10942
|
+
transmissionType: string | null;
|
|
10943
|
+
vehicleType: string | null;
|
|
10944
|
+
yearManufacture: number | null;
|
|
10945
|
+
yearImport: number | null;
|
|
10946
|
+
steering: string | null;
|
|
10947
|
+
engineCode: string | null;
|
|
10948
|
+
transmissionCode: string | null;
|
|
10949
|
+
driveTrain: string | null;
|
|
10950
|
+
km: number;
|
|
10951
|
+
customData: unknown;
|
|
10952
|
+
id: string;
|
|
10953
|
+
createdAt: string;
|
|
10954
|
+
updatedAt: string;
|
|
10955
|
+
deletedAt: string | null;
|
|
10956
|
+
oldId: number | null;
|
|
10957
|
+
};
|
|
10920
10958
|
401: "Токен олдсонгүй";
|
|
10921
10959
|
422: {
|
|
10922
10960
|
type: "validation";
|
|
@@ -11200,6 +11238,301 @@ export declare const app: Elysia<"", {
|
|
|
11200
11238
|
};
|
|
11201
11239
|
};
|
|
11202
11240
|
};
|
|
11241
|
+
} & {
|
|
11242
|
+
fleet: {
|
|
11243
|
+
"work-order": {};
|
|
11244
|
+
} & {
|
|
11245
|
+
"work-order": {
|
|
11246
|
+
task: {};
|
|
11247
|
+
} & {
|
|
11248
|
+
task: {
|
|
11249
|
+
get: {
|
|
11250
|
+
body: unknown;
|
|
11251
|
+
params: {};
|
|
11252
|
+
query: {
|
|
11253
|
+
pagination: {
|
|
11254
|
+
size: number;
|
|
11255
|
+
page: number;
|
|
11256
|
+
};
|
|
11257
|
+
};
|
|
11258
|
+
headers: unknown;
|
|
11259
|
+
response: {
|
|
11260
|
+
200: {
|
|
11261
|
+
totalCount: number;
|
|
11262
|
+
totalPage: number;
|
|
11263
|
+
result: Omit<{
|
|
11264
|
+
totalCount: number;
|
|
11265
|
+
workOrderId: string;
|
|
11266
|
+
templateId: string;
|
|
11267
|
+
serviceKindId: string;
|
|
11268
|
+
description: string | null;
|
|
11269
|
+
manHour: number | null;
|
|
11270
|
+
state: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED";
|
|
11271
|
+
id: string;
|
|
11272
|
+
createdAt: string;
|
|
11273
|
+
updatedAt: string;
|
|
11274
|
+
deletedAt: string | null;
|
|
11275
|
+
oldId: number | null;
|
|
11276
|
+
}, "totalCount">[];
|
|
11277
|
+
};
|
|
11278
|
+
401: "Токен олдсонгүй";
|
|
11279
|
+
422: {
|
|
11280
|
+
type: "validation";
|
|
11281
|
+
on: string;
|
|
11282
|
+
summary?: string;
|
|
11283
|
+
message?: string;
|
|
11284
|
+
found?: unknown;
|
|
11285
|
+
property?: string;
|
|
11286
|
+
expected?: string;
|
|
11287
|
+
};
|
|
11288
|
+
};
|
|
11289
|
+
};
|
|
11290
|
+
};
|
|
11291
|
+
} & {
|
|
11292
|
+
task: {
|
|
11293
|
+
post: {
|
|
11294
|
+
body: {
|
|
11295
|
+
description?: string | undefined;
|
|
11296
|
+
state?: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED" | undefined;
|
|
11297
|
+
manHour?: number | undefined;
|
|
11298
|
+
serviceKindId: string;
|
|
11299
|
+
templateId: string;
|
|
11300
|
+
workOrderId: string;
|
|
11301
|
+
};
|
|
11302
|
+
params: {};
|
|
11303
|
+
query: unknown;
|
|
11304
|
+
headers: unknown;
|
|
11305
|
+
response: {
|
|
11306
|
+
200: {
|
|
11307
|
+
id: string;
|
|
11308
|
+
createdAt: string;
|
|
11309
|
+
updatedAt: string;
|
|
11310
|
+
deletedAt: string | null;
|
|
11311
|
+
oldId: number | null;
|
|
11312
|
+
description: string | null;
|
|
11313
|
+
serviceKindId: string;
|
|
11314
|
+
state: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED";
|
|
11315
|
+
templateId: string;
|
|
11316
|
+
workOrderId: string;
|
|
11317
|
+
manHour: number | null;
|
|
11318
|
+
};
|
|
11319
|
+
401: "Токен олдсонгүй";
|
|
11320
|
+
422: {
|
|
11321
|
+
type: "validation";
|
|
11322
|
+
on: string;
|
|
11323
|
+
summary?: string;
|
|
11324
|
+
message?: string;
|
|
11325
|
+
found?: unknown;
|
|
11326
|
+
property?: string;
|
|
11327
|
+
expected?: string;
|
|
11328
|
+
};
|
|
11329
|
+
};
|
|
11330
|
+
};
|
|
11331
|
+
};
|
|
11332
|
+
} & {
|
|
11333
|
+
task: {
|
|
11334
|
+
":id": {
|
|
11335
|
+
put: {
|
|
11336
|
+
body: {
|
|
11337
|
+
oldId?: number | null | undefined;
|
|
11338
|
+
description?: string | null | undefined;
|
|
11339
|
+
serviceKindId?: string | undefined;
|
|
11340
|
+
state?: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED" | undefined;
|
|
11341
|
+
templateId?: string | undefined;
|
|
11342
|
+
workOrderId?: string | undefined;
|
|
11343
|
+
manHour?: number | null | undefined;
|
|
11344
|
+
};
|
|
11345
|
+
params: {
|
|
11346
|
+
id: string;
|
|
11347
|
+
};
|
|
11348
|
+
query: unknown;
|
|
11349
|
+
headers: unknown;
|
|
11350
|
+
response: {
|
|
11351
|
+
401: "Токен олдсонгүй";
|
|
11352
|
+
422: {
|
|
11353
|
+
type: "validation";
|
|
11354
|
+
on: string;
|
|
11355
|
+
summary?: string;
|
|
11356
|
+
message?: string;
|
|
11357
|
+
found?: unknown;
|
|
11358
|
+
property?: string;
|
|
11359
|
+
expected?: string;
|
|
11360
|
+
};
|
|
11361
|
+
};
|
|
11362
|
+
};
|
|
11363
|
+
};
|
|
11364
|
+
};
|
|
11365
|
+
} & {
|
|
11366
|
+
task: {
|
|
11367
|
+
":id": {
|
|
11368
|
+
delete: {
|
|
11369
|
+
body: unknown;
|
|
11370
|
+
params: {
|
|
11371
|
+
id: string;
|
|
11372
|
+
};
|
|
11373
|
+
query: unknown;
|
|
11374
|
+
headers: unknown;
|
|
11375
|
+
response: {
|
|
11376
|
+
401: "Токен олдсонгүй";
|
|
11377
|
+
422: {
|
|
11378
|
+
type: "validation";
|
|
11379
|
+
on: string;
|
|
11380
|
+
summary?: string;
|
|
11381
|
+
message?: string;
|
|
11382
|
+
found?: unknown;
|
|
11383
|
+
property?: string;
|
|
11384
|
+
expected?: string;
|
|
11385
|
+
};
|
|
11386
|
+
};
|
|
11387
|
+
};
|
|
11388
|
+
};
|
|
11389
|
+
};
|
|
11390
|
+
};
|
|
11391
|
+
} & {
|
|
11392
|
+
"work-order": {
|
|
11393
|
+
get: {
|
|
11394
|
+
body: unknown;
|
|
11395
|
+
params: {};
|
|
11396
|
+
query: {
|
|
11397
|
+
pagination: {
|
|
11398
|
+
size: number;
|
|
11399
|
+
page: number;
|
|
11400
|
+
};
|
|
11401
|
+
};
|
|
11402
|
+
headers: unknown;
|
|
11403
|
+
response: {
|
|
11404
|
+
200: {
|
|
11405
|
+
totalCount: number;
|
|
11406
|
+
totalPage: number;
|
|
11407
|
+
result: Omit<{
|
|
11408
|
+
totalCount: number;
|
|
11409
|
+
machineId: string;
|
|
11410
|
+
sourceType: string | null;
|
|
11411
|
+
type: "CORRECTIVE" | "PREVENTIVE";
|
|
11412
|
+
piority: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "PLANNED";
|
|
11413
|
+
state: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED";
|
|
11414
|
+
dateClosed: Date | null;
|
|
11415
|
+
id: string;
|
|
11416
|
+
createdAt: string;
|
|
11417
|
+
updatedAt: string;
|
|
11418
|
+
deletedAt: string | null;
|
|
11419
|
+
oldId: number | null;
|
|
11420
|
+
}, "totalCount">[];
|
|
11421
|
+
};
|
|
11422
|
+
401: "Токен олдсонгүй";
|
|
11423
|
+
422: {
|
|
11424
|
+
type: "validation";
|
|
11425
|
+
on: string;
|
|
11426
|
+
summary?: string;
|
|
11427
|
+
message?: string;
|
|
11428
|
+
found?: unknown;
|
|
11429
|
+
property?: string;
|
|
11430
|
+
expected?: string;
|
|
11431
|
+
};
|
|
11432
|
+
};
|
|
11433
|
+
};
|
|
11434
|
+
};
|
|
11435
|
+
} & {
|
|
11436
|
+
"work-order": {
|
|
11437
|
+
post: {
|
|
11438
|
+
body: {
|
|
11439
|
+
oldId?: number | null | undefined;
|
|
11440
|
+
state?: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED" | undefined;
|
|
11441
|
+
sourceType?: string | null | undefined;
|
|
11442
|
+
dateClosed?: Date | null | undefined;
|
|
11443
|
+
type: "CORRECTIVE" | "PREVENTIVE";
|
|
11444
|
+
machineId: string;
|
|
11445
|
+
piority: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "PLANNED";
|
|
11446
|
+
};
|
|
11447
|
+
params: {};
|
|
11448
|
+
query: unknown;
|
|
11449
|
+
headers: unknown;
|
|
11450
|
+
response: {
|
|
11451
|
+
200: {
|
|
11452
|
+
type: "CORRECTIVE" | "PREVENTIVE";
|
|
11453
|
+
id: string;
|
|
11454
|
+
createdAt: string;
|
|
11455
|
+
updatedAt: string;
|
|
11456
|
+
deletedAt: string | null;
|
|
11457
|
+
oldId: number | null;
|
|
11458
|
+
state: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED";
|
|
11459
|
+
machineId: string;
|
|
11460
|
+
piority: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "PLANNED";
|
|
11461
|
+
sourceType: string | null;
|
|
11462
|
+
dateClosed: Date | null;
|
|
11463
|
+
};
|
|
11464
|
+
401: "Токен олдсонгүй";
|
|
11465
|
+
422: {
|
|
11466
|
+
type: "validation";
|
|
11467
|
+
on: string;
|
|
11468
|
+
summary?: string;
|
|
11469
|
+
message?: string;
|
|
11470
|
+
found?: unknown;
|
|
11471
|
+
property?: string;
|
|
11472
|
+
expected?: string;
|
|
11473
|
+
};
|
|
11474
|
+
};
|
|
11475
|
+
};
|
|
11476
|
+
};
|
|
11477
|
+
} & {
|
|
11478
|
+
"work-order": {
|
|
11479
|
+
":id": {
|
|
11480
|
+
put: {
|
|
11481
|
+
body: {
|
|
11482
|
+
type?: "CORRECTIVE" | "PREVENTIVE" | undefined;
|
|
11483
|
+
oldId?: number | null | undefined;
|
|
11484
|
+
state?: "IN_PROGRESS" | "COMPLETED" | "OPEN" | "CLOSED" | undefined;
|
|
11485
|
+
machineId?: string | undefined;
|
|
11486
|
+
piority?: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "PLANNED" | undefined;
|
|
11487
|
+
sourceType?: string | null | undefined;
|
|
11488
|
+
dateClosed?: Date | null | undefined;
|
|
11489
|
+
};
|
|
11490
|
+
params: {
|
|
11491
|
+
id: string;
|
|
11492
|
+
};
|
|
11493
|
+
query: unknown;
|
|
11494
|
+
headers: unknown;
|
|
11495
|
+
response: {
|
|
11496
|
+
401: "Токен олдсонгүй";
|
|
11497
|
+
422: {
|
|
11498
|
+
type: "validation";
|
|
11499
|
+
on: string;
|
|
11500
|
+
summary?: string;
|
|
11501
|
+
message?: string;
|
|
11502
|
+
found?: unknown;
|
|
11503
|
+
property?: string;
|
|
11504
|
+
expected?: string;
|
|
11505
|
+
};
|
|
11506
|
+
};
|
|
11507
|
+
};
|
|
11508
|
+
};
|
|
11509
|
+
};
|
|
11510
|
+
} & {
|
|
11511
|
+
"work-order": {
|
|
11512
|
+
":id": {
|
|
11513
|
+
delete: {
|
|
11514
|
+
body: unknown;
|
|
11515
|
+
params: {
|
|
11516
|
+
id: string;
|
|
11517
|
+
};
|
|
11518
|
+
query: unknown;
|
|
11519
|
+
headers: unknown;
|
|
11520
|
+
response: {
|
|
11521
|
+
401: "Токен олдсонгүй";
|
|
11522
|
+
422: {
|
|
11523
|
+
type: "validation";
|
|
11524
|
+
on: string;
|
|
11525
|
+
summary?: string;
|
|
11526
|
+
message?: string;
|
|
11527
|
+
found?: unknown;
|
|
11528
|
+
property?: string;
|
|
11529
|
+
expected?: string;
|
|
11530
|
+
};
|
|
11531
|
+
};
|
|
11532
|
+
};
|
|
11533
|
+
};
|
|
11534
|
+
};
|
|
11535
|
+
};
|
|
11203
11536
|
};
|
|
11204
11537
|
} & {
|
|
11205
11538
|
api: {
|
package/dist/index.js
CHANGED
|
@@ -142638,6 +142638,12 @@ function drizzle(...params) {
|
|
|
142638
142638
|
// src/lib/db/schema/index.ts
|
|
142639
142639
|
var exports_schema = {};
|
|
142640
142640
|
__export(exports_schema, {
|
|
142641
|
+
workOrderTypeEnum: () => workOrderTypeEnum,
|
|
142642
|
+
workOrderTaskTable: () => workOrderTaskTable,
|
|
142643
|
+
workOrderTable: () => workOrderTable,
|
|
142644
|
+
workOrderStateEnum: () => workOrderStateEnum,
|
|
142645
|
+
workOrderSchema: () => workOrderSchema,
|
|
142646
|
+
workOrderPiorityEnum: () => workOrderPiorityEnum,
|
|
142641
142647
|
weekDayEnum: () => weekDayEnum,
|
|
142642
142648
|
warehouseWarehouseTable: () => warehouseWarehouseTable,
|
|
142643
142649
|
warehouseTransferTable: () => warehouseTransferTable,
|
|
@@ -143446,7 +143452,7 @@ var pmPlanMachineTable = pmSchema.table("plan_machine", {
|
|
|
143446
143452
|
pmTemplateId: uuid5().notNull(),
|
|
143447
143453
|
machineId: uuid5().notNull(),
|
|
143448
143454
|
employeeCreatedId: uuid5().notNull(),
|
|
143449
|
-
userCreatedId:
|
|
143455
|
+
userCreatedId: text().notNull(),
|
|
143450
143456
|
note: text()
|
|
143451
143457
|
});
|
|
143452
143458
|
var pmPlanProductTable = pmSchema.table("plan_product", {
|
|
@@ -143455,7 +143461,7 @@ var pmPlanProductTable = pmSchema.table("plan_product", {
|
|
|
143455
143461
|
productKindId: uuid5().notNull(),
|
|
143456
143462
|
uomId: uuid5().notNull(),
|
|
143457
143463
|
quantity: numeric({ mode: "number" }),
|
|
143458
|
-
pmQuantity: uuid5()
|
|
143464
|
+
pmQuantity: uuid5()
|
|
143459
143465
|
});
|
|
143460
143466
|
var maintenanceServiceSchema = pgSchema("maintenance_service");
|
|
143461
143467
|
var maintenanceServiceRecordTable = maintenanceServiceSchema.table("record", {
|
|
@@ -143476,6 +143482,42 @@ var maintenanceServiceRecordProductTable = maintenanceServiceSchema.table("recor
|
|
|
143476
143482
|
uomId: uuid5().notNull(),
|
|
143477
143483
|
quantity: numeric({ mode: "number" })
|
|
143478
143484
|
});
|
|
143485
|
+
var workOrderSchema = pgSchema("work_order");
|
|
143486
|
+
var workOrderTypeEnum = workOrderSchema.enum("type", [
|
|
143487
|
+
"CORRECTIVE",
|
|
143488
|
+
"PREVENTIVE"
|
|
143489
|
+
]);
|
|
143490
|
+
var workOrderPiorityEnum = workOrderSchema.enum("piority", [
|
|
143491
|
+
"CRITICAL",
|
|
143492
|
+
"HIGH",
|
|
143493
|
+
"MEDIUM",
|
|
143494
|
+
"LOW",
|
|
143495
|
+
"PLANNED"
|
|
143496
|
+
]);
|
|
143497
|
+
var workOrderStateEnum = workOrderSchema.enum("state", [
|
|
143498
|
+
"OPEN",
|
|
143499
|
+
"IN_PROGRESS",
|
|
143500
|
+
"COMPLETED",
|
|
143501
|
+
"CLOSED"
|
|
143502
|
+
]);
|
|
143503
|
+
var workOrderTable = workOrderSchema.table("order", {
|
|
143504
|
+
...base_schema_helper_default,
|
|
143505
|
+
machineId: uuid5().notNull(),
|
|
143506
|
+
sourceType: varchar(),
|
|
143507
|
+
type: workOrderTypeEnum().notNull(),
|
|
143508
|
+
piority: workOrderPiorityEnum().notNull(),
|
|
143509
|
+
state: workOrderStateEnum().notNull().default("OPEN"),
|
|
143510
|
+
dateClosed: timestamp({ withTimezone: true })
|
|
143511
|
+
});
|
|
143512
|
+
var workOrderTaskTable = workOrderSchema.table("task", {
|
|
143513
|
+
...base_schema_helper_default,
|
|
143514
|
+
workOrderId: uuid5().notNull(),
|
|
143515
|
+
templateId: uuid5().notNull(),
|
|
143516
|
+
serviceKindId: uuid5().notNull(),
|
|
143517
|
+
description: text(),
|
|
143518
|
+
manHour: numeric({ mode: "number" }),
|
|
143519
|
+
state: workOrderStateEnum().notNull().default("OPEN")
|
|
143520
|
+
});
|
|
143479
143521
|
// src/lib/db/schema/techdoc.schema.ts
|
|
143480
143522
|
var techdocSchema = pgSchema("techdoc");
|
|
143481
143523
|
var techdocVehicleKindEnum = pgEnum("vehicle_kind_enum", [
|
|
@@ -147596,20 +147638,14 @@ var CompanyInvoiceLogic;
|
|
|
147596
147638
|
}).where(and(eq(companyInvoiceTable.status, "PENDING"), lte(sql3`${companyInvoiceTable.dueAt}`, now))).returning();
|
|
147597
147639
|
return result;
|
|
147598
147640
|
};
|
|
147599
|
-
CompanyInvoiceLogic.create = async (body, user2) => {
|
|
147600
|
-
if (user2.kind !== "ADMIN" && user2.companyId !== body.companyId) {
|
|
147601
|
-
return status("Forbidden", "\u0422\u04E9\u043B\u0431\u04E9\u0440\u0438\u0439\u043D \u0431\u0430\u0440\u0438\u043C\u0442 \u04AF\u04AF\u0441\u0433\u044D\u0445 \u044D\u0440\u0445\u0433\u04AF\u0439 \u0431\u0430\u0439\u043D\u0430.");
|
|
147602
|
-
}
|
|
147603
|
-
const [invoice] = await db_default.insert(companyInvoiceTable).values(body).returning();
|
|
147604
|
-
return invoice;
|
|
147605
|
-
};
|
|
147606
147641
|
CompanyInvoiceLogic.select = async (query, user2) => {
|
|
147607
147642
|
const filter = and(eq(companyInvoiceTable.companyId, query.companyId ?? "").if(query.companyId && user2.kind === "ADMIN"), eq(companyInvoiceTable.companyId, user2.companyId).if(user2.kind !== "ADMIN"), eq(companyInvoiceTable.status, query.status).if(query.status !== undefined), eq(companyInvoiceTable.billingPlanId, query.billingPlanId).if(query.billingPlanId), softDeletedFilter(companyInvoiceTable));
|
|
147608
|
-
const columns = getTableColumns(companyInvoiceTable);
|
|
147609
147643
|
const baseQuery = db_default.select({
|
|
147610
|
-
|
|
147644
|
+
invoice: companyInvoiceTable,
|
|
147645
|
+
billingPlan: companyBillingPlanTable,
|
|
147646
|
+
company: companyCompanyTable,
|
|
147611
147647
|
totalCount: totalCountSql
|
|
147612
|
-
}).from(companyInvoiceTable).where(filter).$dynamic();
|
|
147648
|
+
}).from(companyInvoiceTable).leftJoin(companyBillingPlanTable, eq(companyInvoiceTable.billingPlanId, companyBillingPlanTable.id)).leftJoin(companyCompanyTable, eq(companyInvoiceTable.companyId, companyCompanyTable.id)).where(filter).$dynamic();
|
|
147613
147649
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
147614
147650
|
return getPaginationContent(result, query.pagination.size);
|
|
147615
147651
|
};
|
|
@@ -147636,7 +147672,11 @@ var CompanyInvoiceModel;
|
|
|
147636
147672
|
const createSchema = createInsertSchema2(companyInvoiceTable);
|
|
147637
147673
|
const updateSchema = createUpdateSchema(companyInvoiceTable);
|
|
147638
147674
|
const selectSchema = createSelectSchema(companyInvoiceTable);
|
|
147639
|
-
CompanyInvoiceModel.create = OmitBaseSchema(createSchema)
|
|
147675
|
+
CompanyInvoiceModel.create = t.Omit(OmitBaseSchema(createSchema), [
|
|
147676
|
+
"periodEnd",
|
|
147677
|
+
"issuedAt",
|
|
147678
|
+
"dueAt"
|
|
147679
|
+
]);
|
|
147640
147680
|
CompanyInvoiceModel.update = OmitBaseSchema(updateSchema);
|
|
147641
147681
|
CompanyInvoiceModel.select = t.Composite([
|
|
147642
147682
|
t.Partial(selectSchema),
|
|
@@ -147797,9 +147837,6 @@ var invoiceRoutes = new Elysia({
|
|
|
147797
147837
|
}).post("/generate", async ({ body, user: user2 }) => await logic_default5.generate(body, user2), {
|
|
147798
147838
|
body: model_default6.generate,
|
|
147799
147839
|
userKind: "ADMIN"
|
|
147800
|
-
}).post("/", async ({ body, user: user2 }) => await logic_default5.create(body, user2), {
|
|
147801
|
-
body: model_default6.create,
|
|
147802
|
-
userKind: "ADMIN"
|
|
147803
147840
|
}).guard({
|
|
147804
147841
|
params: IdSchema
|
|
147805
147842
|
}).put("/:id", async ({ params: { id }, body, user: user2 }) => await logic_default5.update(id, body, user2), {
|
|
@@ -155498,7 +155535,7 @@ var inspection_default2 = inspectionRoutes2;
|
|
|
155498
155535
|
var MachineLogic;
|
|
155499
155536
|
((MachineLogic) => {
|
|
155500
155537
|
MachineLogic.select = async (query, user2) => {
|
|
155501
|
-
const filter = and(
|
|
155538
|
+
const filter = and(eq(companyMachineTable.companyId, user2.companyId).if(user2.kind !== "ADMIN"), eq(companyMachineTable.id, query.id).if(query.id), softDeletedFilter(companyMachineTable));
|
|
155502
155539
|
const columns = getTableColumns(companyMachineTable);
|
|
155503
155540
|
const baseQuery = db_default.select({
|
|
155504
155541
|
...columns,
|
|
@@ -155514,9 +155551,10 @@ var MachineLogic;
|
|
|
155514
155551
|
});
|
|
155515
155552
|
};
|
|
155516
155553
|
MachineLogic.update = async (id, body, user2) => {
|
|
155517
|
-
await db_default.update(companyMachineTable).set({
|
|
155554
|
+
const [result] = await db_default.update(companyMachineTable).set({
|
|
155518
155555
|
...body
|
|
155519
|
-
}).where(and(eq(companyMachineTable.id, id), eq(companyMachineTable.companyId, user2.companyId).if(user2.kind !== "ADMIN")));
|
|
155556
|
+
}).where(and(eq(companyMachineTable.id, id), eq(companyMachineTable.companyId, user2.companyId).if(user2.kind !== "ADMIN"))).returning();
|
|
155557
|
+
return result;
|
|
155520
155558
|
};
|
|
155521
155559
|
MachineLogic.remove = async (id, user2) => {
|
|
155522
155560
|
await db_default.update(companyMachineTable).set({
|
|
@@ -155680,13 +155718,47 @@ var PmPlanLogic;
|
|
|
155680
155718
|
return getPaginationContent(result, query.pagination.size);
|
|
155681
155719
|
};
|
|
155682
155720
|
PmPlanLogic.create = async (body, user2) => {
|
|
155683
|
-
|
|
155684
|
-
|
|
155685
|
-
|
|
155686
|
-
|
|
155687
|
-
id
|
|
155721
|
+
if (!user2.employeeId) {
|
|
155722
|
+
return status("Bad Request", "\u0410\u0436\u0438\u043B\u0442\u043D\u044B \u043C\u044D\u0434\u044D\u044D\u043B\u044D\u043B \u0448\u0430\u0430\u0440\u0434\u043B\u0430\u0433\u0430\u0442\u0430\u0439.");
|
|
155723
|
+
}
|
|
155724
|
+
const [[template], [machine]] = await Promise.all([
|
|
155725
|
+
db_default.select().from(pmTemplateTable).where(eq(pmTemplateTable.id, body.pmTemplateId)).limit(1),
|
|
155726
|
+
db_default.select().from(companyMachineTable).where(eq(companyMachineTable.id, body.machineId)).limit(1)
|
|
155727
|
+
]);
|
|
155728
|
+
if (!template) {
|
|
155729
|
+
return status("Not Found", "Pm Template \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
|
|
155730
|
+
}
|
|
155731
|
+
if (!machine) {
|
|
155732
|
+
return status("Not Found", "\u041C\u0430\u0448\u0438\u043D \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
|
|
155733
|
+
}
|
|
155734
|
+
if (template.machineKindId !== machine.machineKindId) {
|
|
155735
|
+
return status("Bad Request", "\u041C\u0430\u0448\u0438\u043D\u044B \u0442\u04E9\u0440\u04E9\u043B \u0445\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447\u0438\u0439\u043D \u043C\u0430\u0448\u0438\u043D \u0442\u04E9\u0440\u04E9\u043B\u0442\u044D\u0439 \u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445\u0433\u04AF\u0439.");
|
|
155736
|
+
}
|
|
155737
|
+
const products = await db_default.select().from(pmTemplateProductTable).where(eq(pmTemplateProductTable.pmTemplateId, template.id));
|
|
155738
|
+
return db_default.transaction(async (db2) => {
|
|
155739
|
+
const [plan] = await db2.insert(pmPlanTable).values({
|
|
155740
|
+
companyId: user2.companyId,
|
|
155741
|
+
name: template.name,
|
|
155742
|
+
description: template.description
|
|
155743
|
+
}).returning({
|
|
155744
|
+
id: pmPlanTable.id
|
|
155745
|
+
});
|
|
155746
|
+
await db2.insert(pmPlanMachineTable).values({
|
|
155747
|
+
pmPlanId: plan.id,
|
|
155748
|
+
pmTemplateId: template.id,
|
|
155749
|
+
machineId: machine.id,
|
|
155750
|
+
employeeCreatedId: user2.employeeId,
|
|
155751
|
+
userCreatedId: user2.id
|
|
155752
|
+
});
|
|
155753
|
+
if (products.length > 0) {
|
|
155754
|
+
await db2.insert(pmPlanProductTable).values(products.map((product) => ({
|
|
155755
|
+
pmPlanId: plan.id,
|
|
155756
|
+
productKindId: product.productKindId,
|
|
155757
|
+
uomId: product.uomId,
|
|
155758
|
+
quantity: product.quantity
|
|
155759
|
+
})));
|
|
155760
|
+
}
|
|
155688
155761
|
});
|
|
155689
|
-
return result;
|
|
155690
155762
|
};
|
|
155691
155763
|
PmPlanLogic.update = async (id, body, user2) => {
|
|
155692
155764
|
await db_default.update(pmPlanTable).set({
|
|
@@ -155783,16 +155855,30 @@ var machineRoutes2 = new Elysia({
|
|
|
155783
155855
|
}).delete("/:id", async ({ params: { id } }) => logic_default41.remove(id));
|
|
155784
155856
|
var machine_default2 = machineRoutes2;
|
|
155785
155857
|
|
|
155858
|
+
// src/routes/fleet/pm/plan/model.ts
|
|
155859
|
+
var PmPlanModel;
|
|
155860
|
+
((PmPlanModel) => {
|
|
155861
|
+
const updateSchema = createUpdateSchema(pmPlanTable);
|
|
155862
|
+
PmPlanModel.create = t.Object({
|
|
155863
|
+
pmTemplateId: t.String({ format: "uuid" }),
|
|
155864
|
+
machineId: t.String({ format: "uuid" })
|
|
155865
|
+
});
|
|
155866
|
+
PmPlanModel.update = OmitBaseSchema(updateSchema);
|
|
155867
|
+
PmPlanModel.select = t.Composite([PaginationSchema]);
|
|
155868
|
+
})(PmPlanModel ||= {});
|
|
155869
|
+
var model_default41 = PmPlanModel;
|
|
155870
|
+
|
|
155786
155871
|
// src/routes/fleet/pm/plan/product/logic.ts
|
|
155787
155872
|
var PmPlanProductLogic;
|
|
155788
155873
|
((PmPlanProductLogic) => {
|
|
155789
155874
|
PmPlanProductLogic.select = async (query) => {
|
|
155790
155875
|
const filter = and(eq(pmPlanProductTable.pmPlanId, query.pmPlanId), softDeletedFilter(pmPlanProductTable));
|
|
155791
|
-
const columns = getTableColumns(pmPlanProductTable);
|
|
155792
155876
|
const baseQuery = db_default.select({
|
|
155793
|
-
|
|
155877
|
+
product: pmPlanProductTable,
|
|
155878
|
+
productKind: techdocProductKindTable,
|
|
155879
|
+
uom: uomTable,
|
|
155794
155880
|
totalCount: totalCountSql
|
|
155795
|
-
}).from(pmPlanProductTable).where(filter).$dynamic();
|
|
155881
|
+
}).from(pmPlanProductTable).leftJoin(techdocProductKindTable, eq(techdocProductKindTable.id, pmPlanProductTable.productKindId)).leftJoin(uomTable, eq(uomTable.id, pmPlanProductTable.uomId)).where(filter).$dynamic();
|
|
155796
155882
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
155797
155883
|
return getPaginationContent(result, query.pagination.size);
|
|
155798
155884
|
};
|
|
@@ -155836,7 +155922,7 @@ var PmPlanProductModel;
|
|
|
155836
155922
|
]);
|
|
155837
155923
|
PmPlanProductModel.createMany = t.Array(OmitBaseSchema(createSchema));
|
|
155838
155924
|
})(PmPlanProductModel ||= {});
|
|
155839
|
-
var
|
|
155925
|
+
var model_default42 = PmPlanProductModel;
|
|
155840
155926
|
|
|
155841
155927
|
// src/routes/fleet/pm/plan/product/index.ts
|
|
155842
155928
|
var productRoutes5 = new Elysia({
|
|
@@ -155845,29 +155931,18 @@ var productRoutes5 = new Elysia({
|
|
|
155845
155931
|
}).use(better_auth_default).guard({
|
|
155846
155932
|
auth: true
|
|
155847
155933
|
}).get("/", async ({ query }) => logic_default42.select(query), {
|
|
155848
|
-
query:
|
|
155934
|
+
query: model_default42.select
|
|
155849
155935
|
}).post("/", async ({ body }) => logic_default42.create(body), {
|
|
155850
|
-
body:
|
|
155936
|
+
body: model_default42.create
|
|
155851
155937
|
}).post("/many", async ({ body }) => logic_default42.createMany(body), {
|
|
155852
|
-
body:
|
|
155938
|
+
body: model_default42.createMany
|
|
155853
155939
|
}).guard({
|
|
155854
155940
|
params: IdSchema
|
|
155855
155941
|
}).put("/:id", async ({ body, params: { id } }) => logic_default42.update(id, body), {
|
|
155856
|
-
body:
|
|
155942
|
+
body: model_default42.update
|
|
155857
155943
|
}).delete("/:id", async ({ params: { id } }) => logic_default42.remove(id));
|
|
155858
155944
|
var product_default5 = productRoutes5;
|
|
155859
155945
|
|
|
155860
|
-
// src/routes/fleet/pm/plan/model.ts
|
|
155861
|
-
var PmPlanModel;
|
|
155862
|
-
((PmPlanModel) => {
|
|
155863
|
-
const createSchema = createInsertSchema2(pmPlanTable);
|
|
155864
|
-
const updateSchema = createUpdateSchema(pmPlanTable);
|
|
155865
|
-
PmPlanModel.create = OmitBaseSchema(createSchema);
|
|
155866
|
-
PmPlanModel.update = OmitBaseSchema(updateSchema);
|
|
155867
|
-
PmPlanModel.select = t.Composite([PaginationSchema]);
|
|
155868
|
-
})(PmPlanModel ||= {});
|
|
155869
|
-
var model_default42 = PmPlanModel;
|
|
155870
|
-
|
|
155871
155946
|
// src/routes/fleet/pm/plan/index.ts
|
|
155872
155947
|
var planRoutes = new Elysia({
|
|
155873
155948
|
prefix: "/plan",
|
|
@@ -155875,13 +155950,13 @@ var planRoutes = new Elysia({
|
|
|
155875
155950
|
}).use(better_auth_default).use(machine_default2).use(product_default5).guard({
|
|
155876
155951
|
userKind: "COMPANY_ADMIN"
|
|
155877
155952
|
}).get("/", async ({ query, user: user2 }) => logic_default40.select(query, user2), {
|
|
155878
|
-
query:
|
|
155953
|
+
query: model_default41.select
|
|
155879
155954
|
}).post("/", async ({ body, user: user2 }) => logic_default40.create(body, user2), {
|
|
155880
|
-
body:
|
|
155955
|
+
body: model_default41.create
|
|
155881
155956
|
}).guard({
|
|
155882
155957
|
params: IdSchema
|
|
155883
155958
|
}).put("/:id", async ({ body, params: { id }, user: user2 }) => logic_default40.update(id, body, user2), {
|
|
155884
|
-
body:
|
|
155959
|
+
body: model_default41.update
|
|
155885
155960
|
}).delete("/:id", async ({ params: { id }, user: user2 }) => logic_default40.remove(id, user2));
|
|
155886
155961
|
var plan_default = planRoutes;
|
|
155887
155962
|
|
|
@@ -156018,8 +156093,127 @@ var pmRoutes = new Elysia({
|
|
|
156018
156093
|
}).use(template_default2).use(plan_default);
|
|
156019
156094
|
var pm_default = pmRoutes;
|
|
156020
156095
|
|
|
156096
|
+
// src/routes/fleet/work-order/logic.ts
|
|
156097
|
+
var WorkOrderLogic;
|
|
156098
|
+
((WorkOrderLogic) => {
|
|
156099
|
+
WorkOrderLogic.select = async (query) => {
|
|
156100
|
+
const filter = softDeletedFilter(workOrderTable);
|
|
156101
|
+
const columns = getTableColumns(workOrderTable);
|
|
156102
|
+
const baseQuery = db_default.select({
|
|
156103
|
+
...columns,
|
|
156104
|
+
totalCount: totalCountSql
|
|
156105
|
+
}).from(workOrderTable).where(filter).$dynamic();
|
|
156106
|
+
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
156107
|
+
return getPaginationContent(result, query.pagination.size);
|
|
156108
|
+
};
|
|
156109
|
+
WorkOrderLogic.create = async (body) => {
|
|
156110
|
+
const [result] = await db_default.insert(workOrderTable).values(body).returning();
|
|
156111
|
+
return result;
|
|
156112
|
+
};
|
|
156113
|
+
WorkOrderLogic.update = async (id, body) => {
|
|
156114
|
+
await db_default.update(workOrderTable).set(body).where(eq(workOrderTable.id, id));
|
|
156115
|
+
};
|
|
156116
|
+
WorkOrderLogic.remove = async (id) => {
|
|
156117
|
+
await db_default.update(workOrderTable).set({
|
|
156118
|
+
deletedAt: nowSql_helper_default
|
|
156119
|
+
}).where(eq(workOrderTable.id, id));
|
|
156120
|
+
};
|
|
156121
|
+
})(WorkOrderLogic ||= {});
|
|
156122
|
+
var logic_default45 = WorkOrderLogic;
|
|
156123
|
+
|
|
156124
|
+
// src/routes/fleet/work-order/model.ts
|
|
156125
|
+
var WorkOrderModel;
|
|
156126
|
+
((WorkOrderModel) => {
|
|
156127
|
+
const createSchema = createInsertSchema2(workOrderTable);
|
|
156128
|
+
const updateSchema = createUpdateSchema(workOrderTable);
|
|
156129
|
+
WorkOrderModel.create = OmitBaseSchema(createSchema);
|
|
156130
|
+
WorkOrderModel.update = OmitBaseSchema(updateSchema);
|
|
156131
|
+
WorkOrderModel.select = t.Composite([PaginationSchema]);
|
|
156132
|
+
})(WorkOrderModel ||= {});
|
|
156133
|
+
var model_default45 = WorkOrderModel;
|
|
156134
|
+
|
|
156135
|
+
// src/routes/fleet/work-order/task/logic.ts
|
|
156136
|
+
var WorkOrderTaskLogic;
|
|
156137
|
+
((WorkOrderTaskLogic) => {
|
|
156138
|
+
WorkOrderTaskLogic.select = async (query, user2) => {
|
|
156139
|
+
const filter = softDeletedFilter(workOrderTaskTable);
|
|
156140
|
+
const columns = getTableColumns(workOrderTaskTable);
|
|
156141
|
+
const baseQuery = db_default.select({
|
|
156142
|
+
...columns,
|
|
156143
|
+
totalCount: totalCountSql
|
|
156144
|
+
}).from(workOrderTaskTable).where(filter).$dynamic();
|
|
156145
|
+
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
156146
|
+
return getPaginationContent(result, query.pagination.size);
|
|
156147
|
+
};
|
|
156148
|
+
WorkOrderTaskLogic.create = async (body, user2) => {
|
|
156149
|
+
const [result] = await db_default.insert(workOrderTaskTable).values({
|
|
156150
|
+
...body,
|
|
156151
|
+
state: body.state ?? "OPEN"
|
|
156152
|
+
}).returning();
|
|
156153
|
+
return result;
|
|
156154
|
+
};
|
|
156155
|
+
WorkOrderTaskLogic.update = async (id, body, user2) => {
|
|
156156
|
+
await db_default.update(workOrderTaskTable).set({
|
|
156157
|
+
...body
|
|
156158
|
+
}).where(eq(workOrderTaskTable.id, id));
|
|
156159
|
+
};
|
|
156160
|
+
WorkOrderTaskLogic.remove = async (id, user2) => {
|
|
156161
|
+
await db_default.update(workOrderTaskTable).set({
|
|
156162
|
+
deletedAt: nowSql_helper_default
|
|
156163
|
+
}).where(eq(workOrderTaskTable.id, id));
|
|
156164
|
+
};
|
|
156165
|
+
})(WorkOrderTaskLogic ||= {});
|
|
156166
|
+
var logic_default46 = WorkOrderTaskLogic;
|
|
156167
|
+
|
|
156168
|
+
// src/routes/fleet/work-order/task/model.ts
|
|
156169
|
+
var WorkOrderTaskModel;
|
|
156170
|
+
((WorkOrderTaskModel) => {
|
|
156171
|
+
const updateSchema = createUpdateSchema(workOrderTaskTable);
|
|
156172
|
+
WorkOrderTaskModel.create = t.Object({
|
|
156173
|
+
workOrderId: t.String({ format: "uuid" }),
|
|
156174
|
+
templateId: t.String({ format: "uuid" }),
|
|
156175
|
+
serviceKindId: t.String({ format: "uuid" }),
|
|
156176
|
+
description: t.Optional(t.String()),
|
|
156177
|
+
manHour: t.Optional(t.Number()),
|
|
156178
|
+
state: t.Optional(StringEnum(["OPEN", "IN_PROGRESS", "COMPLETED", "CLOSED"]))
|
|
156179
|
+
});
|
|
156180
|
+
WorkOrderTaskModel.update = OmitBaseSchema(updateSchema);
|
|
156181
|
+
WorkOrderTaskModel.select = t.Composite([PaginationSchema]);
|
|
156182
|
+
})(WorkOrderTaskModel ||= {});
|
|
156183
|
+
var model_default46 = WorkOrderTaskModel;
|
|
156184
|
+
|
|
156185
|
+
// src/routes/fleet/work-order/task/index.ts
|
|
156186
|
+
var workOrderTaskRoutes = new Elysia({
|
|
156187
|
+
prefix: "/task",
|
|
156188
|
+
tags: ["WorkOrderTask"]
|
|
156189
|
+
}).use(better_auth_default).guard({ auth: true }).get("/", async ({ query, user: user2 }) => logic_default46.select(query, user2), {
|
|
156190
|
+
query: model_default46.select
|
|
156191
|
+
}).post("/", async ({ body, user: user2 }) => logic_default46.create(body, user2), {
|
|
156192
|
+
body: model_default46.create
|
|
156193
|
+
}).guard({
|
|
156194
|
+
params: IdSchema
|
|
156195
|
+
}).put("/:id", async ({ body, params: { id }, user: user2 }) => logic_default46.update(id, body, user2), {
|
|
156196
|
+
body: model_default46.update
|
|
156197
|
+
}).delete("/:id", async ({ params: { id }, user: user2 }) => logic_default46.remove(id, user2));
|
|
156198
|
+
var task_default = workOrderTaskRoutes;
|
|
156199
|
+
|
|
156200
|
+
// src/routes/fleet/work-order/index.ts
|
|
156201
|
+
var workOrderRoutes = new Elysia({
|
|
156202
|
+
prefix: "/work-order",
|
|
156203
|
+
tags: ["WorkOrder"]
|
|
156204
|
+
}).use(better_auth_default).use(task_default).guard({ auth: true }).get("/", async ({ query }) => logic_default45.select(query), {
|
|
156205
|
+
query: model_default45.select
|
|
156206
|
+
}).post("/", async ({ body }) => logic_default45.create(body), {
|
|
156207
|
+
body: model_default45.create
|
|
156208
|
+
}).guard({
|
|
156209
|
+
params: IdSchema
|
|
156210
|
+
}).put("/:id", async ({ body, params: { id } }) => logic_default45.update(id, body), {
|
|
156211
|
+
body: model_default45.update
|
|
156212
|
+
}).delete("/:id", async ({ params: { id } }) => logic_default45.remove(id));
|
|
156213
|
+
var work_order_default = workOrderRoutes;
|
|
156214
|
+
|
|
156021
156215
|
// src/routes/fleet/index.ts
|
|
156022
|
-
var fleetRoutes = new Elysia({ prefix: "/fleet" }).use(inspection_default2).use(pm_default).use(machine_default).use(ms_default);
|
|
156216
|
+
var fleetRoutes = new Elysia({ prefix: "/fleet" }).use(inspection_default2).use(pm_default).use(machine_default).use(ms_default).use(work_order_default);
|
|
156023
156217
|
var fleet_default = fleetRoutes;
|
|
156024
156218
|
|
|
156025
156219
|
// src/routes/uom/category/logic.ts
|
|
@@ -156053,7 +156247,7 @@ var UomCategoryLogic;
|
|
|
156053
156247
|
}).where(and(eq(uomCategoryTable.id, id)));
|
|
156054
156248
|
};
|
|
156055
156249
|
})(UomCategoryLogic ||= {});
|
|
156056
|
-
var
|
|
156250
|
+
var logic_default47 = UomCategoryLogic;
|
|
156057
156251
|
|
|
156058
156252
|
// src/routes/uom/category/model.ts
|
|
156059
156253
|
var UomCategoryModel;
|
|
@@ -156064,7 +156258,7 @@ var UomCategoryModel;
|
|
|
156064
156258
|
UomCategoryModel.update = OmitBaseSchema(updateSchema);
|
|
156065
156259
|
UomCategoryModel.select = t.Composite([PaginationSchema]);
|
|
156066
156260
|
})(UomCategoryModel ||= {});
|
|
156067
|
-
var
|
|
156261
|
+
var model_default47 = UomCategoryModel;
|
|
156068
156262
|
|
|
156069
156263
|
// src/routes/uom/category/index.ts
|
|
156070
156264
|
var categoryRoutes = new Elysia({
|
|
@@ -156072,15 +156266,15 @@ var categoryRoutes = new Elysia({
|
|
|
156072
156266
|
tags: ["UomCategory"]
|
|
156073
156267
|
}).use(better_auth_default).guard({
|
|
156074
156268
|
auth: true
|
|
156075
|
-
}).get("/", async ({ query }) =>
|
|
156076
|
-
query:
|
|
156077
|
-
}).post("/", async ({ body }) =>
|
|
156078
|
-
body:
|
|
156269
|
+
}).get("/", async ({ query }) => logic_default47.select(query), {
|
|
156270
|
+
query: model_default47.select
|
|
156271
|
+
}).post("/", async ({ body }) => logic_default47.create(body), {
|
|
156272
|
+
body: model_default47.create
|
|
156079
156273
|
}).guard({
|
|
156080
156274
|
params: IdSchema
|
|
156081
|
-
}).put("/:id", async ({ body, params: { id } }) =>
|
|
156082
|
-
body:
|
|
156083
|
-
}).delete("/:id", async ({ params: { id } }) =>
|
|
156275
|
+
}).put("/:id", async ({ body, params: { id } }) => logic_default47.update(id, body), {
|
|
156276
|
+
body: model_default47.update
|
|
156277
|
+
}).delete("/:id", async ({ params: { id } }) => logic_default47.remove(id));
|
|
156084
156278
|
var category_default = categoryRoutes;
|
|
156085
156279
|
|
|
156086
156280
|
// src/routes/uom/conversion/logic.ts
|
|
@@ -156114,7 +156308,7 @@ var UomConversionLogic;
|
|
|
156114
156308
|
}).where(and(eq(uomConversionTable.id, id)));
|
|
156115
156309
|
};
|
|
156116
156310
|
})(UomConversionLogic ||= {});
|
|
156117
|
-
var
|
|
156311
|
+
var logic_default48 = UomConversionLogic;
|
|
156118
156312
|
|
|
156119
156313
|
// src/routes/uom/conversion/model.ts
|
|
156120
156314
|
var UomConversionModel;
|
|
@@ -156131,7 +156325,7 @@ var UomConversionModel;
|
|
|
156131
156325
|
})
|
|
156132
156326
|
]);
|
|
156133
156327
|
})(UomConversionModel ||= {});
|
|
156134
|
-
var
|
|
156328
|
+
var model_default48 = UomConversionModel;
|
|
156135
156329
|
|
|
156136
156330
|
// src/routes/uom/conversion/index.ts
|
|
156137
156331
|
var conversionRoutes = new Elysia({
|
|
@@ -156139,15 +156333,15 @@ var conversionRoutes = new Elysia({
|
|
|
156139
156333
|
tags: ["UomConversion"]
|
|
156140
156334
|
}).use(better_auth_default).guard({
|
|
156141
156335
|
auth: true
|
|
156142
|
-
}).get("/", async ({ query }) =>
|
|
156143
|
-
query:
|
|
156144
|
-
}).post("/", async ({ body }) =>
|
|
156145
|
-
body:
|
|
156336
|
+
}).get("/", async ({ query }) => logic_default48.select(query), {
|
|
156337
|
+
query: model_default48.select
|
|
156338
|
+
}).post("/", async ({ body }) => logic_default48.create(body), {
|
|
156339
|
+
body: model_default48.create
|
|
156146
156340
|
}).guard({
|
|
156147
156341
|
params: IdSchema
|
|
156148
|
-
}).put("/:id", async ({ body, params: { id } }) =>
|
|
156149
|
-
body:
|
|
156150
|
-
}).delete("/:id", async ({ params: { id } }) =>
|
|
156342
|
+
}).put("/:id", async ({ body, params: { id } }) => logic_default48.update(id, body), {
|
|
156343
|
+
body: model_default48.update
|
|
156344
|
+
}).delete("/:id", async ({ params: { id } }) => logic_default48.remove(id));
|
|
156151
156345
|
var conversion_default = conversionRoutes;
|
|
156152
156346
|
|
|
156153
156347
|
// src/routes/uom/logic.ts
|
|
@@ -156181,7 +156375,7 @@ var UomLogic;
|
|
|
156181
156375
|
}).where(and(eq(uomTable.id, id)));
|
|
156182
156376
|
};
|
|
156183
156377
|
})(UomLogic ||= {});
|
|
156184
|
-
var
|
|
156378
|
+
var logic_default49 = UomLogic;
|
|
156185
156379
|
|
|
156186
156380
|
// src/routes/uom/model.ts
|
|
156187
156381
|
var UomModel;
|
|
@@ -156197,7 +156391,7 @@ var UomModel;
|
|
|
156197
156391
|
})
|
|
156198
156392
|
]);
|
|
156199
156393
|
})(UomModel ||= {});
|
|
156200
|
-
var
|
|
156394
|
+
var model_default49 = UomModel;
|
|
156201
156395
|
|
|
156202
156396
|
// src/routes/uom/index.ts
|
|
156203
156397
|
var uomSchemaRoutes = new Elysia({
|
|
@@ -156205,15 +156399,15 @@ var uomSchemaRoutes = new Elysia({
|
|
|
156205
156399
|
}).use(better_auth_default).use(category_default).use(conversion_default).guard({
|
|
156206
156400
|
userKind: "ADMIN",
|
|
156207
156401
|
tags: ["Uom"]
|
|
156208
|
-
}).get("/", async ({ query }) =>
|
|
156209
|
-
query:
|
|
156210
|
-
}).post("/", async ({ body }) =>
|
|
156211
|
-
body:
|
|
156402
|
+
}).get("/", async ({ query }) => logic_default49.select(query), {
|
|
156403
|
+
query: model_default49.select
|
|
156404
|
+
}).post("/", async ({ body }) => logic_default49.create(body), {
|
|
156405
|
+
body: model_default49.create
|
|
156212
156406
|
}).guard({
|
|
156213
156407
|
params: IdSchema
|
|
156214
|
-
}).put("/:id", async ({ body, params: { id } }) =>
|
|
156215
|
-
body:
|
|
156216
|
-
}).delete("/:id", async ({ params: { id } }) =>
|
|
156408
|
+
}).put("/:id", async ({ body, params: { id } }) => logic_default49.update(id, body), {
|
|
156409
|
+
body: model_default49.update
|
|
156410
|
+
}).delete("/:id", async ({ params: { id } }) => logic_default49.remove(id));
|
|
156217
156411
|
var uom_default = uomSchemaRoutes;
|
|
156218
156412
|
|
|
156219
156413
|
// src/routes/index.ts
|