autosync_backend2 1.1.66 → 1.1.68

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +450 -20
  2. package/dist/index.js +477 -132
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -984,7 +984,6 @@ export declare const app: Elysia<"", {
984
984
  type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
985
985
  id?: string | undefined;
986
986
  search?: string | undefined;
987
- branchId?: string | undefined;
988
987
  supplierId?: string | undefined;
989
988
  productId?: string | undefined;
990
989
  priceSell?: number | undefined;
@@ -1028,7 +1027,7 @@ export declare const app: Elysia<"", {
1028
1027
  createdAt: string;
1029
1028
  updatedAt: string;
1030
1029
  deletedAt: string | null;
1031
- };
1030
+ } | null;
1032
1031
  }[];
1033
1032
  };
1034
1033
  422: {
@@ -1142,7 +1141,6 @@ export declare const app: Elysia<"", {
1142
1141
  type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
1143
1142
  id?: string | undefined;
1144
1143
  search?: string | undefined;
1145
- branchId?: string | undefined;
1146
1144
  supplierId?: string | undefined;
1147
1145
  productId?: string | undefined;
1148
1146
  priceSell?: number | undefined;
@@ -1381,7 +1379,6 @@ export declare const app: Elysia<"", {
1381
1379
  type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
1382
1380
  id?: string | undefined;
1383
1381
  search?: string | undefined;
1384
- branchId?: string | undefined;
1385
1382
  supplierId?: string | undefined;
1386
1383
  productId?: string | undefined;
1387
1384
  priceSell?: number | undefined;
@@ -1426,7 +1423,7 @@ export declare const app: Elysia<"", {
1426
1423
  createdAt: string;
1427
1424
  updatedAt: string;
1428
1425
  deletedAt: string | null;
1429
- };
1426
+ } | null;
1430
1427
  product: {
1431
1428
  supplierId: string;
1432
1429
  productId: string | null;
@@ -1544,7 +1541,6 @@ export declare const app: Elysia<"", {
1544
1541
  type?: "Сэлбэг" | "Тос" | "Дугуй" | "Будаг" | "Аккумлятор" | undefined;
1545
1542
  id?: string | undefined;
1546
1543
  search?: string | undefined;
1547
- branchId?: string | undefined;
1548
1544
  supplierId?: string | undefined;
1549
1545
  productId?: string | undefined;
1550
1546
  priceSell?: number | undefined;
@@ -3017,6 +3013,139 @@ export declare const app: Elysia<"", {
3017
3013
  } & {
3018
3014
  "cp-order": {
3019
3015
  item: {};
3016
+ } & {
3017
+ item: {
3018
+ employee: {};
3019
+ } & {
3020
+ employee: {
3021
+ get: {
3022
+ body: unknown;
3023
+ params: {};
3024
+ query: {
3025
+ cpOrderItemId: string;
3026
+ };
3027
+ headers: unknown;
3028
+ response: {
3029
+ 200: {
3030
+ cpOrderItemId: string;
3031
+ employeeId: string;
3032
+ amount: number;
3033
+ id: string;
3034
+ createdAt: string;
3035
+ updatedAt: string;
3036
+ deletedAt: string | null;
3037
+ }[];
3038
+ 422: {
3039
+ type: "validation";
3040
+ on: string;
3041
+ summary?: string;
3042
+ message?: string;
3043
+ found?: unknown;
3044
+ property?: string;
3045
+ expected?: string;
3046
+ };
3047
+ };
3048
+ };
3049
+ };
3050
+ } & {
3051
+ employee: {
3052
+ post: {
3053
+ body: {
3054
+ amount?: number | undefined;
3055
+ employeeId: string;
3056
+ cpOrderItemId: string;
3057
+ };
3058
+ params: {};
3059
+ query: unknown;
3060
+ headers: unknown;
3061
+ response: {
3062
+ 200: {
3063
+ id: string;
3064
+ createdAt: string;
3065
+ updatedAt: string;
3066
+ employeeId: string;
3067
+ deletedAt: string | null;
3068
+ cpOrderItemId: string;
3069
+ amount: number;
3070
+ };
3071
+ 400: "Энэ үйлчилгээнд ажилтан аль хэдийн хуваарилагдсан байна.";
3072
+ 422: {
3073
+ type: "validation";
3074
+ on: string;
3075
+ summary?: string;
3076
+ message?: string;
3077
+ found?: unknown;
3078
+ property?: string;
3079
+ expected?: string;
3080
+ };
3081
+ };
3082
+ };
3083
+ };
3084
+ } & {
3085
+ employee: {
3086
+ ":id": {
3087
+ put: {
3088
+ body: {
3089
+ amount?: number | undefined;
3090
+ };
3091
+ params: {
3092
+ id: string;
3093
+ };
3094
+ query: unknown;
3095
+ headers: unknown;
3096
+ response: {
3097
+ 200: {
3098
+ cpOrderItemId: string;
3099
+ employeeId: string;
3100
+ amount: number;
3101
+ id: string;
3102
+ createdAt: string;
3103
+ updatedAt: string;
3104
+ deletedAt: string | null;
3105
+ };
3106
+ 404: "Ажилтны мэдээлэл олдсонгүй.";
3107
+ 422: {
3108
+ type: "validation";
3109
+ on: string;
3110
+ summary?: string;
3111
+ message?: string;
3112
+ found?: unknown;
3113
+ property?: string;
3114
+ expected?: string;
3115
+ };
3116
+ };
3117
+ };
3118
+ };
3119
+ };
3120
+ } & {
3121
+ employee: {
3122
+ ":id": {
3123
+ delete: {
3124
+ body: unknown;
3125
+ params: {
3126
+ id: string;
3127
+ };
3128
+ query: unknown;
3129
+ headers: unknown;
3130
+ response: {
3131
+ 200: {
3132
+ id: string;
3133
+ };
3134
+ 404: "Ажилтны мэдээлэл олдсонгүй.";
3135
+ 422: {
3136
+ type: "validation";
3137
+ on: string;
3138
+ summary?: string;
3139
+ message?: string;
3140
+ found?: unknown;
3141
+ property?: string;
3142
+ expected?: string;
3143
+ };
3144
+ };
3145
+ };
3146
+ };
3147
+ };
3148
+ };
3020
3149
  } & {
3021
3150
  item: {
3022
3151
  get: {
@@ -3238,9 +3367,9 @@ export declare const app: Elysia<"", {
3238
3367
  paymentPackageId?: string | null | undefined;
3239
3368
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3240
3369
  cpOrderId: string;
3370
+ amount: number;
3241
3371
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3242
3372
  paymentChannel: string;
3243
- amount: number;
3244
3373
  };
3245
3374
  params: {};
3246
3375
  query: unknown;
@@ -3253,10 +3382,10 @@ export declare const app: Elysia<"", {
3253
3382
  deletedAt: string | null;
3254
3383
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3255
3384
  cpOrderId: string;
3385
+ amount: number;
3256
3386
  paymentPackageId: string | null;
3257
3387
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3258
3388
  paymentChannel: string;
3259
- amount: number;
3260
3389
  invoiceNumber: string | null;
3261
3390
  };
3262
3391
  422: {
@@ -3317,10 +3446,10 @@ export declare const app: Elysia<"", {
3317
3446
  deletedAt: string | null;
3318
3447
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3319
3448
  cpOrderId: string;
3449
+ amount: number;
3320
3450
  paymentPackageId: string | null;
3321
3451
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3322
3452
  paymentChannel: string;
3323
- amount: number;
3324
3453
  invoiceNumber: string | null;
3325
3454
  };
3326
3455
  404: "Төлбөрийн тохиргоо олдсонгүй.";
@@ -3377,9 +3506,9 @@ export declare const app: Elysia<"", {
3377
3506
  paymentPackageId?: string | null | undefined;
3378
3507
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3379
3508
  cpOrderId: string;
3509
+ amount: number;
3380
3510
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3381
3511
  paymentChannel: string;
3382
- amount: number;
3383
3512
  };
3384
3513
  params: {};
3385
3514
  query: unknown;
@@ -3393,10 +3522,10 @@ export declare const app: Elysia<"", {
3393
3522
  deletedAt: string | null;
3394
3523
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3395
3524
  cpOrderId: string;
3525
+ amount: number;
3396
3526
  paymentPackageId: string | null;
3397
3527
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3398
3528
  paymentChannel: string;
3399
- amount: number;
3400
3529
  invoiceNumber: string | null;
3401
3530
  };
3402
3531
  404: "Төлбөрийн тохиргоо олдсонгүй.";
@@ -3483,9 +3612,9 @@ export declare const app: Elysia<"", {
3483
3612
  paymentPackageId?: string | null | undefined;
3484
3613
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3485
3614
  cpOrderId: string;
3615
+ amount: number;
3486
3616
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3487
3617
  paymentChannel: string;
3488
- amount: number;
3489
3618
  };
3490
3619
  params: {};
3491
3620
  query: unknown;
@@ -3499,10 +3628,10 @@ export declare const app: Elysia<"", {
3499
3628
  deletedAt: string | null;
3500
3629
  state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3501
3630
  cpOrderId: string;
3631
+ amount: number;
3502
3632
  paymentPackageId: string | null;
3503
3633
  paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
3504
3634
  paymentChannel: string;
3505
- amount: number;
3506
3635
  invoiceNumber: string | null;
3507
3636
  };
3508
3637
  404: "Төлбөрийн тохиргоо олдсонгүй.";
@@ -3601,10 +3730,10 @@ export declare const app: Elysia<"", {
3601
3730
  payment: {
3602
3731
  info: {
3603
3732
  post: {
3604
- body: {
3733
+ body: ({
3605
3734
  branchId?: string | undefined;
3606
3735
  companyId: string;
3607
- } & ({
3736
+ } & {
3608
3737
  type: "StorePay";
3609
3738
  sub: {
3610
3739
  password: string;
@@ -3613,13 +3742,19 @@ export declare const app: Elysia<"", {
3613
3742
  appPassword: string;
3614
3743
  storeId: string;
3615
3744
  };
3616
- } | {
3745
+ }) | ({
3746
+ branchId?: string | undefined;
3747
+ companyId: string;
3748
+ } & {
3617
3749
  type: "UbPay";
3618
3750
  sub: {
3619
3751
  clientId: string;
3620
3752
  clientSecret: string;
3621
3753
  };
3622
- } | {
3754
+ }) | ({
3755
+ branchId?: string | undefined;
3756
+ companyId: string;
3757
+ } & {
3623
3758
  type: "Qpay";
3624
3759
  sub: {
3625
3760
  password: string;
@@ -5555,8 +5690,8 @@ export declare const app: Elysia<"", {
5555
5690
  apply: {
5556
5691
  post: {
5557
5692
  body: {
5558
- discountId?: string | null | undefined;
5559
5693
  cpOrderItemId?: string | null | undefined;
5694
+ discountId?: string | null | undefined;
5560
5695
  note?: string | null | undefined;
5561
5696
  cpOrderId: string;
5562
5697
  valueApplied: number;
@@ -5574,8 +5709,8 @@ export declare const app: Elysia<"", {
5574
5709
  employeeId: string;
5575
5710
  deletedAt: string | null;
5576
5711
  cpOrderId: string;
5577
- discountId: string | null;
5578
5712
  cpOrderItemId: string | null;
5713
+ discountId: string | null;
5579
5714
  valueApplied: number;
5580
5715
  priceBeforeDiscount: number;
5581
5716
  priceAfterDiscount: number;
@@ -5604,8 +5739,8 @@ export declare const app: Elysia<"", {
5604
5739
  body: {
5605
5740
  employeeId?: string | undefined;
5606
5741
  cpOrderId?: string | undefined;
5607
- discountId?: string | null | undefined;
5608
5742
  cpOrderItemId?: string | null | undefined;
5743
+ discountId?: string | null | undefined;
5609
5744
  valueApplied?: number | undefined;
5610
5745
  priceBeforeDiscount?: number | undefined;
5611
5746
  priceAfterDiscount?: number | undefined;
@@ -6041,6 +6176,301 @@ export declare const app: Elysia<"", {
6041
6176
  };
6042
6177
  };
6043
6178
  };
6179
+ } & {
6180
+ crm: {
6181
+ reports: {};
6182
+ } & {
6183
+ reports: {
6184
+ sales: {
6185
+ get: {
6186
+ body: unknown;
6187
+ params: {};
6188
+ query: {
6189
+ employeeId?: string | undefined;
6190
+ companyBranchId?: string | undefined;
6191
+ state?: "CREATED" | "PROGRESSING" | "COMPLETE" | undefined;
6192
+ startDate?: string | undefined;
6193
+ endDate?: string | undefined;
6194
+ includeItems?: boolean | undefined;
6195
+ includePayments?: boolean | undefined;
6196
+ pagination: {
6197
+ size: number;
6198
+ page: number;
6199
+ };
6200
+ };
6201
+ headers: unknown;
6202
+ response: {
6203
+ 200: {
6204
+ totalCount: number;
6205
+ order: {
6206
+ companyId: string;
6207
+ companyBranchId: string;
6208
+ customerId: string | null;
6209
+ vehicleId: string;
6210
+ orderId: string;
6211
+ state: "CREATED" | "PROGRESSING" | "COMPLETE";
6212
+ isNoat: boolean | null;
6213
+ timeCompleted: string | null;
6214
+ km: number;
6215
+ id: string;
6216
+ createdAt: string;
6217
+ updatedAt: string;
6218
+ deletedAt: string | null;
6219
+ };
6220
+ customer: {
6221
+ companyId: string | null;
6222
+ firstname: string | null;
6223
+ lastname: string | null;
6224
+ phoneNumber: string;
6225
+ email: string | null;
6226
+ regNum: string | null;
6227
+ id: string;
6228
+ createdAt: string;
6229
+ updatedAt: string;
6230
+ deletedAt: string | null;
6231
+ } | null;
6232
+ vehicle: {
6233
+ customerId: string | null;
6234
+ vehicleKindId: string;
6235
+ vin: string | null;
6236
+ licensePlate: string | null;
6237
+ color: string | null;
6238
+ engineCc: string | null;
6239
+ cylinder: string | null;
6240
+ gasType: string | null;
6241
+ transmissionType: string | null;
6242
+ vehicleType: string | null;
6243
+ yearManufacture: number | null;
6244
+ yearImport: number | null;
6245
+ steering: string | null;
6246
+ engineCode: string | null;
6247
+ transmissionCode: string | null;
6248
+ driveTrain: string | null;
6249
+ km: number;
6250
+ companyId: string | null;
6251
+ id: string;
6252
+ createdAt: string;
6253
+ updatedAt: string;
6254
+ deletedAt: string | null;
6255
+ } | null;
6256
+ vehicleKind: {
6257
+ vehicleKindEnum: "MAKE" | "MODEL_GROUP" | "MODEL";
6258
+ parentId: string | null;
6259
+ name: string;
6260
+ description: string | null;
6261
+ yearStart: number | null;
6262
+ yearEnd: number | null;
6263
+ imagePath: string | null;
6264
+ id: string;
6265
+ createdAt: string;
6266
+ updatedAt: string;
6267
+ deletedAt: string | null;
6268
+ } | null;
6269
+ totalAmount: number;
6270
+ paidAmount: number;
6271
+ }[];
6272
+ 422: {
6273
+ type: "validation";
6274
+ on: string;
6275
+ summary?: string;
6276
+ message?: string;
6277
+ found?: unknown;
6278
+ property?: string;
6279
+ expected?: string;
6280
+ };
6281
+ };
6282
+ };
6283
+ };
6284
+ };
6285
+ } & {
6286
+ reports: {
6287
+ sales: {
6288
+ summary: {
6289
+ get: {
6290
+ body: unknown;
6291
+ params: {};
6292
+ query: {
6293
+ companyBranchId?: string | undefined;
6294
+ startDate?: string | undefined;
6295
+ endDate?: string | undefined;
6296
+ };
6297
+ headers: unknown;
6298
+ response: {
6299
+ 200: {
6300
+ totalOrders: number;
6301
+ totalRevenue: number;
6302
+ totalPaidAmount: number;
6303
+ totalPendingAmount: number;
6304
+ averageOrderValue: number;
6305
+ ordersCompleted: number;
6306
+ ordersPending: number;
6307
+ ordersCancelled: number;
6308
+ };
6309
+ 422: {
6310
+ type: "validation";
6311
+ on: string;
6312
+ summary?: string;
6313
+ message?: string;
6314
+ found?: unknown;
6315
+ property?: string;
6316
+ expected?: string;
6317
+ };
6318
+ };
6319
+ };
6320
+ };
6321
+ };
6322
+ };
6323
+ } & {
6324
+ reports: {
6325
+ sales: {
6326
+ "by-period": {
6327
+ get: {
6328
+ body: unknown;
6329
+ params: {};
6330
+ query: {
6331
+ companyBranchId?: string | undefined;
6332
+ startDate?: string | undefined;
6333
+ endDate?: string | undefined;
6334
+ groupBy: "day" | "week" | "month" | "year";
6335
+ };
6336
+ headers: unknown;
6337
+ response: {
6338
+ 200: {
6339
+ totalOrders: number;
6340
+ totalRevenue: number;
6341
+ totalPaidAmount: number;
6342
+ period: string;
6343
+ }[];
6344
+ 422: {
6345
+ type: "validation";
6346
+ on: string;
6347
+ summary?: string;
6348
+ message?: string;
6349
+ found?: unknown;
6350
+ property?: string;
6351
+ expected?: string;
6352
+ };
6353
+ };
6354
+ };
6355
+ };
6356
+ };
6357
+ };
6358
+ } & {
6359
+ reports: {
6360
+ sales: {
6361
+ "by-employee": {
6362
+ get: {
6363
+ body: unknown;
6364
+ params: {};
6365
+ query: {
6366
+ companyBranchId?: string | undefined;
6367
+ startDate?: string | undefined;
6368
+ endDate?: string | undefined;
6369
+ pagination: {
6370
+ size: number;
6371
+ page: number;
6372
+ };
6373
+ };
6374
+ headers: unknown;
6375
+ response: {
6376
+ 200: {
6377
+ totalCount: number;
6378
+ employeeId: string;
6379
+ employeeName: string;
6380
+ totalOrders: number;
6381
+ totalRevenue: number;
6382
+ totalCommission: number;
6383
+ }[];
6384
+ 422: {
6385
+ type: "validation";
6386
+ on: string;
6387
+ summary?: string;
6388
+ message?: string;
6389
+ found?: unknown;
6390
+ property?: string;
6391
+ expected?: string;
6392
+ };
6393
+ };
6394
+ };
6395
+ };
6396
+ };
6397
+ };
6398
+ } & {
6399
+ reports: {
6400
+ payments: {
6401
+ get: {
6402
+ body: unknown;
6403
+ params: {};
6404
+ query: {
6405
+ method?: string | undefined;
6406
+ companyBranchId?: string | undefined;
6407
+ state?: string | undefined;
6408
+ startDate?: string | undefined;
6409
+ endDate?: string | undefined;
6410
+ pagination: {
6411
+ size: number;
6412
+ page: number;
6413
+ };
6414
+ };
6415
+ headers: unknown;
6416
+ response: {
6417
+ 200: {
6418
+ totalCount: number;
6419
+ payment: {
6420
+ cpOrderId: string;
6421
+ paymentPackageId: string | null;
6422
+ paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE" | "CARD";
6423
+ paymentChannel: string;
6424
+ amount: number;
6425
+ state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
6426
+ invoiceNumber: string | null;
6427
+ id: string;
6428
+ createdAt: string;
6429
+ updatedAt: string;
6430
+ deletedAt: string | null;
6431
+ };
6432
+ order: {
6433
+ companyId: string;
6434
+ companyBranchId: string;
6435
+ customerId: string | null;
6436
+ vehicleId: string;
6437
+ orderId: string;
6438
+ state: "CREATED" | "PROGRESSING" | "COMPLETE";
6439
+ isNoat: boolean | null;
6440
+ timeCompleted: string | null;
6441
+ km: number;
6442
+ id: string;
6443
+ createdAt: string;
6444
+ updatedAt: string;
6445
+ deletedAt: string | null;
6446
+ };
6447
+ customer: {
6448
+ companyId: string | null;
6449
+ firstname: string | null;
6450
+ lastname: string | null;
6451
+ phoneNumber: string;
6452
+ email: string | null;
6453
+ regNum: string | null;
6454
+ id: string;
6455
+ createdAt: string;
6456
+ updatedAt: string;
6457
+ deletedAt: string | null;
6458
+ } | null;
6459
+ }[];
6460
+ 422: {
6461
+ type: "validation";
6462
+ on: string;
6463
+ summary?: string;
6464
+ message?: string;
6465
+ found?: unknown;
6466
+ property?: string;
6467
+ expected?: string;
6468
+ };
6469
+ };
6470
+ };
6471
+ };
6472
+ };
6473
+ };
6044
6474
  };
6045
6475
  } & {
6046
6476
  api: {