@sortsys/v2-client 0.1.25 → 0.1.27

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 (2) hide show
  1. package/dist/index.d.ts +261 -69
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1769,6 +1769,9 @@ declare const ROLES: readonly [
1769
1769
  "view:users",
1770
1770
  "manage:users",
1771
1771
  "delete:users",
1772
+ "view:userWorkHours",
1773
+ "manage:userWorkHours",
1774
+ "delete:userWorkHours",
1772
1775
  "view:projects",
1773
1776
  "manage:projects",
1774
1777
  "delete:projects",
@@ -2101,7 +2104,7 @@ declare const appRouter: BuiltRouter<{
2101
2104
  createdAt: Date;
2102
2105
  expiresAt: Date;
2103
2106
  };
2104
- roles: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
2107
+ roles: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:userWorkHours" | "manage:userWorkHours" | "delete:userWorkHours" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
2105
2108
  tenant: {
2106
2109
  companyName: string | null;
2107
2110
  };
@@ -2807,6 +2810,60 @@ declare const appRouter: BuiltRouter<{
2807
2810
  meta: object;
2808
2811
  }>;
2809
2812
  }>>;
2813
+ costs: BuiltRouter<{
2814
+ ctx: TrpcContext;
2815
+ meta: object;
2816
+ errorShape: DefaultErrorShape | {
2817
+ message: string;
2818
+ data: {
2819
+ httpCode: error.http.StatusCodeCode;
2820
+ code: TRPC_ERROR_CODE_KEY;
2821
+ httpStatus: number;
2822
+ path?: string;
2823
+ stack?: string;
2824
+ };
2825
+ code: TRPC_ERROR_CODE_NUMBER;
2826
+ };
2827
+ transformer: true;
2828
+ }, DecorateCreateRouterOptions<{
2829
+ get: QueryProcedure<{
2830
+ input: {
2831
+ projectId: string;
2832
+ from?: unknown;
2833
+ to?: unknown;
2834
+ };
2835
+ output: {
2836
+ deliveryNotes: {
2837
+ noteId: string;
2838
+ effectiveTimestamp: Date;
2839
+ totalCost: number;
2840
+ }[];
2841
+ products: {
2842
+ productId: string;
2843
+ quantity: number;
2844
+ totalCost: number;
2845
+ priceRecord: {
2846
+ id: string;
2847
+ productId: string;
2848
+ vendorId: string | null;
2849
+ timestamp: Date;
2850
+ price: number;
2851
+ isRealPurchase: boolean;
2852
+ comment: string | null;
2853
+ } | null;
2854
+ }[];
2855
+ workHours: {
2856
+ id: string;
2857
+ userId: string;
2858
+ day: Date;
2859
+ hours: number;
2860
+ costPerHour: number | null;
2861
+ totalCost: number;
2862
+ }[];
2863
+ };
2864
+ meta: object;
2865
+ }>;
2866
+ }>>;
2810
2867
  }>>;
2811
2868
  contacts: BuiltRouter<{
2812
2869
  ctx: TrpcContext;
@@ -3247,7 +3304,7 @@ declare const appRouter: BuiltRouter<{
3247
3304
  productId: string;
3248
3305
  vendorId: string | null;
3249
3306
  timestamp: Date;
3250
- pricePerBaseUnit: number;
3307
+ price: number;
3251
3308
  isRealPurchase: boolean;
3252
3309
  comment: string | null;
3253
3310
  }[];
@@ -3294,7 +3351,101 @@ declare const appRouter: BuiltRouter<{
3294
3351
  meta: object;
3295
3352
  }>;
3296
3353
  }>>;
3297
- deliveryNotes: BuiltRouter<{
3354
+ suggestNextCustomId: QueryProcedure<{
3355
+ input: void;
3356
+ output: number;
3357
+ meta: object;
3358
+ }>;
3359
+ }>>;
3360
+ deliveryNotes: BuiltRouter<{
3361
+ ctx: TrpcContext;
3362
+ meta: object;
3363
+ errorShape: DefaultErrorShape | {
3364
+ message: string;
3365
+ data: {
3366
+ httpCode: error.http.StatusCodeCode;
3367
+ code: TRPC_ERROR_CODE_KEY;
3368
+ httpStatus: number;
3369
+ path?: string;
3370
+ stack?: string;
3371
+ };
3372
+ code: TRPC_ERROR_CODE_NUMBER;
3373
+ };
3374
+ transformer: true;
3375
+ }, DecorateCreateRouterOptions<{
3376
+ list: QueryProcedure<{
3377
+ input: {
3378
+ projectId?: string | null | undefined;
3379
+ createdByUserId?: string | null | undefined;
3380
+ };
3381
+ output: {
3382
+ id: string;
3383
+ autoId: number;
3384
+ projectId: string;
3385
+ comment: string | null;
3386
+ createdByUserId: string | null;
3387
+ createdAt: Date;
3388
+ effectiveTimestamp: Date;
3389
+ records: {
3390
+ id: string;
3391
+ noteId: string;
3392
+ productId: string;
3393
+ quantity: number;
3394
+ comment: string | null;
3395
+ }[];
3396
+ }[];
3397
+ meta: object;
3398
+ }>;
3399
+ create: MutationProcedure<{
3400
+ input: {
3401
+ projectId: string;
3402
+ records: {
3403
+ productId: string;
3404
+ quantity: number;
3405
+ comment?: string | null | undefined;
3406
+ }[];
3407
+ effectiveTimestamp?: Date | null | undefined;
3408
+ comment?: string | null | undefined;
3409
+ };
3410
+ output: {
3411
+ id: string;
3412
+ };
3413
+ meta: object;
3414
+ }>;
3415
+ get: QueryProcedure<{
3416
+ input: {
3417
+ id: string;
3418
+ } | {
3419
+ autoId: unknown;
3420
+ };
3421
+ output: {
3422
+ id: string;
3423
+ autoId: number;
3424
+ projectId: string;
3425
+ comment: string | null;
3426
+ createdByUserId: string | null;
3427
+ createdAt: Date;
3428
+ effectiveTimestamp: Date;
3429
+ records: {
3430
+ id: string;
3431
+ noteId: string;
3432
+ productId: string;
3433
+ quantity: number;
3434
+ comment: string | null;
3435
+ }[];
3436
+ };
3437
+ meta: object;
3438
+ }>;
3439
+ delete: MutationProcedure<{
3440
+ input: {
3441
+ id: string;
3442
+ };
3443
+ output: {
3444
+ success: true;
3445
+ };
3446
+ meta: object;
3447
+ }>;
3448
+ costs: BuiltRouter<{
3298
3449
  ctx: TrpcContext;
3299
3450
  meta: object;
3300
3451
  errorShape: DefaultErrorShape | {
@@ -3310,82 +3461,31 @@ declare const appRouter: BuiltRouter<{
3310
3461
  };
3311
3462
  transformer: true;
3312
3463
  }, DecorateCreateRouterOptions<{
3313
- list: QueryProcedure<{
3314
- input: {
3315
- projectId?: string | null | undefined;
3316
- createdByUserId?: string | null | undefined;
3317
- };
3318
- output: {
3319
- id: string;
3320
- autoId: number;
3321
- projectId: string;
3322
- comment: string | null;
3323
- createdByUserId: string | null;
3324
- createdAt: Date;
3325
- effectiveTimestamp: Date;
3326
- records: {
3327
- id: string;
3328
- noteId: string;
3329
- productId: string;
3330
- quantity: number;
3331
- comment: string | null;
3332
- }[];
3333
- }[];
3334
- meta: object;
3335
- }>;
3336
- create: MutationProcedure<{
3337
- input: {
3338
- projectId: string;
3339
- records: {
3340
- productId: string;
3341
- quantity: number;
3342
- comment?: string | null | undefined;
3343
- }[];
3344
- effectiveTimestamp?: Date | null | undefined;
3345
- comment?: string | null | undefined;
3346
- };
3347
- output: {
3348
- id: string;
3349
- };
3350
- meta: object;
3351
- }>;
3352
3464
  get: QueryProcedure<{
3353
3465
  input: {
3354
3466
  id: string;
3355
3467
  };
3356
3468
  output: {
3357
- id: string;
3358
- autoId: number;
3359
- projectId: string;
3360
- comment: string | null;
3361
- createdByUserId: string | null;
3362
- createdAt: Date;
3363
- effectiveTimestamp: Date;
3469
+ noteId: string;
3470
+ totalCost: number;
3364
3471
  records: {
3365
- id: string;
3366
- noteId: string;
3472
+ recordId: string;
3367
3473
  productId: string;
3368
3474
  quantity: number;
3369
- comment: string | null;
3475
+ priceRecord: {
3476
+ id: string;
3477
+ productId: string;
3478
+ vendorId: string | null;
3479
+ timestamp: Date;
3480
+ price: number;
3481
+ isRealPurchase: boolean;
3482
+ comment: string | null;
3483
+ } | null;
3370
3484
  }[];
3371
3485
  };
3372
3486
  meta: object;
3373
3487
  }>;
3374
- delete: MutationProcedure<{
3375
- input: {
3376
- id: string;
3377
- };
3378
- output: {
3379
- success: true;
3380
- };
3381
- meta: object;
3382
- }>;
3383
3488
  }>>;
3384
- suggestNextCustomId: QueryProcedure<{
3385
- input: void;
3386
- output: number;
3387
- meta: object;
3388
- }>;
3389
3489
  }>>;
3390
3490
  users: BuiltRouter<{
3391
3491
  ctx: TrpcContext;
@@ -3418,6 +3518,7 @@ declare const appRouter: BuiltRouter<{
3418
3518
  email: string | null;
3419
3519
  phone: string | null;
3420
3520
  contractType: "internal" | "external" | "subcontractor";
3521
+ costPerHour: number | null;
3421
3522
  createdAt: Date;
3422
3523
  modifiedAt: Date;
3423
3524
  deactivatedAt: Date | null;
@@ -3438,6 +3539,7 @@ declare const appRouter: BuiltRouter<{
3438
3539
  email: string | null;
3439
3540
  phone: string | null;
3440
3541
  contractType: "internal" | "external" | "subcontractor";
3542
+ costPerHour: number | null;
3441
3543
  createdAt: Date;
3442
3544
  modifiedAt: Date;
3443
3545
  deactivatedAt: Date | null;
@@ -3453,6 +3555,7 @@ declare const appRouter: BuiltRouter<{
3453
3555
  email?: string | null | undefined;
3454
3556
  phone?: string | null | undefined;
3455
3557
  contractType?: "internal" | "external" | "subcontractor" | undefined;
3558
+ costPerHour?: number | null | undefined;
3456
3559
  };
3457
3560
  output: {
3458
3561
  id: string;
@@ -3469,6 +3572,7 @@ declare const appRouter: BuiltRouter<{
3469
3572
  email?: string | null | undefined;
3470
3573
  phone?: string | null | undefined;
3471
3574
  contractType?: "internal" | "external" | "subcontractor" | null | undefined;
3575
+ costPerHour?: number | null | undefined;
3472
3576
  };
3473
3577
  };
3474
3578
  output: {
@@ -3521,6 +3625,94 @@ declare const appRouter: BuiltRouter<{
3521
3625
  };
3522
3626
  meta: object;
3523
3627
  }>;
3628
+ workHours: BuiltRouter<{
3629
+ ctx: TrpcContext;
3630
+ meta: object;
3631
+ errorShape: DefaultErrorShape | {
3632
+ message: string;
3633
+ data: {
3634
+ httpCode: error.http.StatusCodeCode;
3635
+ code: TRPC_ERROR_CODE_KEY;
3636
+ httpStatus: number;
3637
+ path?: string;
3638
+ stack?: string;
3639
+ };
3640
+ code: TRPC_ERROR_CODE_NUMBER;
3641
+ };
3642
+ transformer: true;
3643
+ }, DecorateCreateRouterOptions<{
3644
+ list: QueryProcedure<{
3645
+ input: {
3646
+ userId?: string | null | undefined;
3647
+ projectId?: string | null | undefined;
3648
+ dayFrom?: unknown;
3649
+ dayTo?: unknown;
3650
+ limit?: number | undefined;
3651
+ offset?: number | undefined;
3652
+ };
3653
+ output: {
3654
+ id: string;
3655
+ userId: string;
3656
+ projectId: string;
3657
+ day: Date;
3658
+ hours: number;
3659
+ createdAt: Date;
3660
+ modifiedAt: Date;
3661
+ }[];
3662
+ meta: object;
3663
+ }>;
3664
+ get: QueryProcedure<{
3665
+ input: {
3666
+ id: string;
3667
+ };
3668
+ output: {
3669
+ id: string;
3670
+ userId: string;
3671
+ projectId: string;
3672
+ day: Date;
3673
+ hours: number;
3674
+ createdAt: Date;
3675
+ modifiedAt: Date;
3676
+ };
3677
+ meta: object;
3678
+ }>;
3679
+ create: MutationProcedure<{
3680
+ input: {
3681
+ userId: string;
3682
+ projectId: string;
3683
+ hours: number;
3684
+ day?: unknown;
3685
+ };
3686
+ output: {
3687
+ id: string;
3688
+ };
3689
+ meta: object;
3690
+ }>;
3691
+ update: MutationProcedure<{
3692
+ input: {
3693
+ id: string;
3694
+ data: {
3695
+ userId?: string | null | undefined;
3696
+ projectId?: string | null | undefined;
3697
+ day?: unknown;
3698
+ hours?: number | null | undefined;
3699
+ };
3700
+ };
3701
+ output: {
3702
+ success: true;
3703
+ };
3704
+ meta: object;
3705
+ }>;
3706
+ delete: MutationProcedure<{
3707
+ input: {
3708
+ id: string;
3709
+ };
3710
+ output: {
3711
+ success: true;
3712
+ };
3713
+ meta: object;
3714
+ }>;
3715
+ }>>;
3524
3716
  roles: BuiltRouter<{
3525
3717
  ctx: TrpcContext;
3526
3718
  meta: object;
@@ -3539,20 +3731,20 @@ declare const appRouter: BuiltRouter<{
3539
3731
  }, DecorateCreateRouterOptions<{
3540
3732
  list: QueryProcedure<{
3541
3733
  input: void;
3542
- output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
3734
+ output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:userWorkHours" | "manage:userWorkHours" | "delete:userWorkHours" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
3543
3735
  meta: object;
3544
3736
  }>;
3545
3737
  get: QueryProcedure<{
3546
3738
  input: {
3547
3739
  userId: string;
3548
3740
  };
3549
- output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
3741
+ output: (":admin" | "view:users" | "manage:users" | "delete:users" | "view:userWorkHours" | "manage:userWorkHours" | "delete:userWorkHours" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers")[];
3550
3742
  meta: object;
3551
3743
  }>;
3552
3744
  set: MutationProcedure<{
3553
3745
  input: {
3554
3746
  userId: string;
3555
- assignments: Record<":admin" | "view:users" | "manage:users" | "delete:users" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers", boolean | null | undefined>;
3747
+ assignments: Record<":admin" | "view:users" | "manage:users" | "delete:users" | "view:userWorkHours" | "manage:userWorkHours" | "delete:userWorkHours" | "view:projects" | "manage:projects" | "delete:projects" | "view:projectDeployments" | "manage:projectDeployments" | "delete:projectDeployments" | "view:tools" | "manage:tools" | "delete:tools" | "view:toolTrackings" | "manage:toolTrackings" | "delete:toolTrackings" | "view:toolInventories" | "manage:toolInventories" | "delete:toolInventories" | "view:products" | "manage:products" | "delete:products" | "view:deliveryNotes" | "manage:deliveryNotes" | "delete:deliveryNotes" | "view:productVendors" | "manage:productVendors" | "delete:productVendors" | "view:contacts" | "manage:contacts" | "delete:contacts" | "view:productPriceRecords" | "manage:productPriceRecords" | "delete:productPriceRecords" | "view:customers" | "manage:customers" | "delete:customers", boolean | null | undefined>;
3556
3748
  };
3557
3749
  output: {
3558
3750
  success: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sortsys/v2-client",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "main": "dist/index.js",
5
5
  "devDependencies": {
6
6
  "dts-bundle-generator": "^9.5.1"