@mestra-dev/contract 0.0.284 → 0.0.286

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 +651 -17
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -53,6 +53,10 @@ type AiUnavailableReason =
53
53
  /** The workspace has AI switched off in its own settings. */
54
54
  | "workspace_disabled";
55
55
  type GrowthDirection = "positive" | "negative" | "none";
56
+ type ResourceAttributeValue = string | number | boolean | string[] | null;
57
+ type BranchDeleteBlock = "last" | "default" | "hasWarehouses";
58
+ type WarehouseArchiveBlock = "last" | "default" | "hasStock";
59
+ type StockTransferBlock = "unavailableWarehouse" | "noProduct" | "exceedsAvailable";
56
60
  type Variables = JwtVariables;
57
61
  /** Shared error body for middleware / HTTPException responses (typed into AppType). */
58
62
  export type ApiError = {
@@ -2053,6 +2057,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
2053
2057
  dealStatus: string | null;
2054
2058
  preferredPaymentMethod: string | null;
2055
2059
  preferredCurrency: string | null;
2060
+ mortgageBank: string | null;
2061
+ mortgageApprovedAmount: number | null;
2062
+ mortgageDownPayment: number | null;
2063
+ maternityCapital: number | null;
2056
2064
  childrenCount: number | null;
2057
2065
  hasPets: boolean | null;
2058
2066
  carsCount: number | null;
@@ -2632,6 +2640,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
2632
2640
  active: boolean | null;
2633
2641
  price: number | null;
2634
2642
  created_by: string | null;
2643
+ renovation: string | null;
2635
2644
  fullPayment: boolean | null;
2636
2645
  mortgagePayment: boolean | null;
2637
2646
  installmentPayment: boolean | null;
@@ -2670,11 +2679,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
2670
2679
  bedroomsCount: number | null;
2671
2680
  totalArea: number | null;
2672
2681
  livingArea: number | null;
2682
+ kitchenArea: number | null;
2673
2683
  ceilingHeight: number | null;
2674
2684
  floor: number | null;
2675
2685
  totalFloors: number | null;
2676
2686
  yearBuilt: string | null;
2677
- renovation: string | null;
2678
2687
  developerName: string | null;
2679
2688
  city: string | null;
2680
2689
  district: string | null;
@@ -2697,8 +2706,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
2697
2706
  active: boolean | null;
2698
2707
  price: number | null;
2699
2708
  created_by: string | null;
2700
- currency: string | null;
2701
2709
  stock: number | null;
2710
+ currency: string | null;
2702
2711
  qrCode: string | null;
2703
2712
  }[];
2704
2713
  };
@@ -2780,6 +2789,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
2780
2789
  bedroomsCount: number | null;
2781
2790
  totalArea: number | null;
2782
2791
  livingArea: number | null;
2792
+ kitchenArea: number | null;
2783
2793
  ceilingHeight: number | null;
2784
2794
  floor: number | null;
2785
2795
  totalFloors: number | null;
@@ -2901,6 +2911,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
2901
2911
  bedroomsCount: number | null;
2902
2912
  totalArea: number | null;
2903
2913
  livingArea: number | null;
2914
+ kitchenArea: number | null;
2904
2915
  ceilingHeight: number | null;
2905
2916
  floor: number | null;
2906
2917
  totalFloors: number | null;
@@ -3051,6 +3062,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3051
3062
  bedroomsCount: number | null;
3052
3063
  totalArea: number | null;
3053
3064
  livingArea: number | null;
3065
+ kitchenArea: number | null;
3054
3066
  ceilingHeight: number | null;
3055
3067
  floor: number | null;
3056
3068
  totalFloors: number | null;
@@ -3190,9 +3202,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
3190
3202
  email: string | null;
3191
3203
  phone: string | null;
3192
3204
  created_by: string | null;
3193
- companyName: string | null;
3194
3205
  telegram: string | null;
3195
3206
  whatsapp: string | null;
3207
+ companyName: string | null;
3196
3208
  instagram: string | null;
3197
3209
  vk: string | null;
3198
3210
  igSynapseId: string | null;
@@ -3222,6 +3234,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
3222
3234
  dealStatus: string | null;
3223
3235
  preferredPaymentMethod: string | null;
3224
3236
  preferredCurrency: string | null;
3237
+ mortgageBank: string | null;
3238
+ mortgageApprovedAmount: number | null;
3239
+ mortgageDownPayment: number | null;
3240
+ maternityCapital: number | null;
3225
3241
  childrenCount: number | null;
3226
3242
  hasPets: boolean | null;
3227
3243
  carsCount: number | null;
@@ -3242,11 +3258,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
3242
3258
  email: string | null;
3243
3259
  phone: string | null;
3244
3260
  created_by: string | null;
3261
+ address: string | null;
3245
3262
  website: string | null;
3246
3263
  birthDate: string | null;
3247
3264
  companyPhone: string | null;
3248
3265
  companyAddress: string | null;
3249
- address: string | null;
3250
3266
  utmSource: string | null;
3251
3267
  }[];
3252
3268
  };
@@ -3345,6 +3361,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
3345
3361
  dealStatus: string | null;
3346
3362
  preferredPaymentMethod: string | null;
3347
3363
  preferredCurrency: string | null;
3364
+ mortgageBank: string | null;
3365
+ mortgageApprovedAmount: number | null;
3366
+ mortgageDownPayment: number | null;
3367
+ maternityCapital: number | null;
3348
3368
  childrenCount: number | null;
3349
3369
  hasPets: boolean | null;
3350
3370
  carsCount: number | null;
@@ -3485,6 +3505,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
3485
3505
  dealStatus: string | null;
3486
3506
  preferredPaymentMethod: string | null;
3487
3507
  preferredCurrency: string | null;
3508
+ mortgageBank: string | null;
3509
+ mortgageApprovedAmount: number | null;
3510
+ mortgageDownPayment: number | null;
3511
+ maternityCapital: number | null;
3488
3512
  childrenCount: number | null;
3489
3513
  hasPets: boolean | null;
3490
3514
  carsCount: number | null;
@@ -3646,6 +3670,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
3646
3670
  dealStatus: string | null;
3647
3671
  preferredPaymentMethod: string | null;
3648
3672
  preferredCurrency: string | null;
3673
+ mortgageBank: string | null;
3674
+ mortgageApprovedAmount: number | null;
3675
+ mortgageDownPayment: number | null;
3676
+ maternityCapital: number | null;
3649
3677
  childrenCount: number | null;
3650
3678
  hasPets: boolean | null;
3651
3679
  carsCount: number | null;
@@ -3798,7 +3826,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3798
3826
  workspace: string;
3799
3827
  customerId: string;
3800
3828
  relatedCustomerId: string;
3801
- type: "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee" | "other";
3829
+ type: "other" | "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee";
3802
3830
  };
3803
3831
  };
3804
3832
  output: {
@@ -3813,7 +3841,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3813
3841
  workspace: string;
3814
3842
  customerId: string;
3815
3843
  relatedCustomerId: string;
3816
- type: "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee" | "other";
3844
+ type: "other" | "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee";
3817
3845
  };
3818
3846
  };
3819
3847
  output: {
@@ -3828,7 +3856,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3828
3856
  workspace: string;
3829
3857
  customerId: string;
3830
3858
  relatedCustomerId: string;
3831
- type: "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee" | "other";
3859
+ type: "other" | "friend" | "spouse" | "father" | "mother" | "parent" | "child" | "sibling" | "relative" | "colleague" | "co_buyer" | "lawyer" | "client" | "payer" | "payee";
3832
3860
  };
3833
3861
  };
3834
3862
  output: {
@@ -3979,6 +4007,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3979
4007
  status: string;
3980
4008
  created_by: string;
3981
4009
  customerId: string;
4010
+ date: string;
3982
4011
  fullPayment: boolean | null;
3983
4012
  installment: boolean | null;
3984
4013
  notes: string | null;
@@ -3988,7 +4017,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
3988
4017
  invoiceDiscount: number;
3989
4018
  discount: number;
3990
4019
  SellerFinanceAccountId: string;
3991
- date: string;
3992
4020
  language: string;
3993
4021
  vatOption: string;
3994
4022
  unitName: string;
@@ -4114,6 +4142,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4114
4142
  status: string;
4115
4143
  created_by: string;
4116
4144
  customerId: string;
4145
+ date: string;
4117
4146
  fullPayment: boolean | null;
4118
4147
  installment: boolean | null;
4119
4148
  notes: string | null;
@@ -4123,7 +4152,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
4123
4152
  invoiceDiscount: number;
4124
4153
  discount: number;
4125
4154
  SellerFinanceAccountId: string;
4126
- date: string;
4127
4155
  language: string;
4128
4156
  vatOption: string;
4129
4157
  unitName: string;
@@ -4303,6 +4331,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4303
4331
  status: string;
4304
4332
  created_by: string;
4305
4333
  customerId: string;
4334
+ date: string;
4306
4335
  fullPayment: boolean | null;
4307
4336
  installment: boolean | null;
4308
4337
  notes: string | null;
@@ -4312,7 +4341,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
4312
4341
  invoiceDiscount: number;
4313
4342
  discount: number;
4314
4343
  SellerFinanceAccountId: string;
4315
- date: string;
4316
4344
  language: string;
4317
4345
  vatOption: string;
4318
4346
  unitName: string;
@@ -4446,9 +4474,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
4446
4474
  suspended_at: string | null;
4447
4475
  created_by: string;
4448
4476
  customerId: string;
4477
+ date: string;
4449
4478
  notes: string | null;
4450
4479
  serviceId: string;
4451
- date: string;
4452
4480
  }[];
4453
4481
  };
4454
4482
  outputFormat: "json";
@@ -9315,7 +9343,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9315
9343
  input: {
9316
9344
  query: {
9317
9345
  accountId?: string | undefined;
9318
- type?: "" | "refund" | "income" | "expense" | "transfer" | undefined;
9346
+ type?: "" | "transfer" | "refund" | "income" | "expense" | undefined;
9319
9347
  };
9320
9348
  } & {
9321
9349
  param: {
@@ -9425,7 +9453,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9425
9453
  collaboratorId?: string | null | undefined;
9426
9454
  taskId?: string | null | undefined;
9427
9455
  workspace: string;
9428
- type: "refund" | "income" | "expense" | "transfer";
9456
+ type: "transfer" | "refund" | "income" | "expense";
9429
9457
  customerId?: string | undefined;
9430
9458
  serviceId?: string | undefined;
9431
9459
  accountId?: string | undefined;
@@ -9455,7 +9483,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9455
9483
  collaboratorId?: string | null | undefined;
9456
9484
  taskId?: string | null | undefined;
9457
9485
  workspace: string;
9458
- type: "refund" | "income" | "expense" | "transfer";
9486
+ type: "transfer" | "refund" | "income" | "expense";
9459
9487
  customerId?: string | undefined;
9460
9488
  serviceId?: string | undefined;
9461
9489
  accountId?: string | undefined;
@@ -9515,7 +9543,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9515
9543
  taskId?: string | null | undefined;
9516
9544
  transactionId: string;
9517
9545
  workspace: string;
9518
- type?: "refund" | "income" | "expense" | "transfer" | undefined;
9546
+ type?: "transfer" | "refund" | "income" | "expense" | undefined;
9519
9547
  customerId?: string | undefined;
9520
9548
  serviceId?: string | undefined;
9521
9549
  accountId?: string | undefined;
@@ -9546,7 +9574,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9546
9574
  taskId?: string | null | undefined;
9547
9575
  transactionId: string;
9548
9576
  workspace: string;
9549
- type?: "refund" | "income" | "expense" | "transfer" | undefined;
9577
+ type?: "transfer" | "refund" | "income" | "expense" | undefined;
9550
9578
  customerId?: string | undefined;
9551
9579
  serviceId?: string | undefined;
9552
9580
  accountId?: string | undefined;
@@ -9725,7 +9753,613 @@ declare const routes: import("hono/hono-base").HonoBase<{
9725
9753
  status: 200;
9726
9754
  };
9727
9755
  };
9728
- }, "/finance">, "/", "/">;
9756
+ }, "/finance"> | import("hono/types").MergeSchemaPath<{
9757
+ "/:workspace": {
9758
+ $get: {
9759
+ input: {
9760
+ param: {
9761
+ workspace: string;
9762
+ };
9763
+ };
9764
+ output: {
9765
+ success: true;
9766
+ branches: {
9767
+ id: string;
9768
+ workspaceId: string;
9769
+ name: string;
9770
+ type: string;
9771
+ franchiseeId: string | null;
9772
+ status: string;
9773
+ openedAt: string | null;
9774
+ isDefault: boolean;
9775
+ address: string;
9776
+ phone: string;
9777
+ telegram: string;
9778
+ whatsapp: string;
9779
+ managerId: string | null;
9780
+ memberIds: string[];
9781
+ hours: {
9782
+ weekday: number;
9783
+ open: boolean;
9784
+ start: string;
9785
+ end: string;
9786
+ }[];
9787
+ timeZone: string;
9788
+ useWorkspaceLegal: boolean;
9789
+ attributes: {
9790
+ [x: string]: ResourceAttributeValue;
9791
+ };
9792
+ createdAt: string;
9793
+ }[];
9794
+ places: {
9795
+ id: string;
9796
+ workspaceId: string;
9797
+ branchId: string;
9798
+ name: string;
9799
+ zone: string | null;
9800
+ type: string;
9801
+ capacity: number | null;
9802
+ durationMinutes: number;
9803
+ color: string;
9804
+ linkedMemberIds: string[];
9805
+ active: boolean;
9806
+ attributes: {
9807
+ [x: string]: ResourceAttributeValue;
9808
+ };
9809
+ position: number;
9810
+ createdAt: string;
9811
+ }[];
9812
+ warehouses: {
9813
+ id: string;
9814
+ workspaceId: string;
9815
+ branchId: string;
9816
+ name: string;
9817
+ address: string | null;
9818
+ isDefault: boolean;
9819
+ responsibleId: string | null;
9820
+ archivedAt: string | null;
9821
+ attributes: {
9822
+ [x: string]: ResourceAttributeValue;
9823
+ };
9824
+ createdAt: string;
9825
+ }[];
9826
+ stock: {
9827
+ id: string;
9828
+ workspaceId: string;
9829
+ warehouseId: string;
9830
+ productName: string;
9831
+ variant: string | null;
9832
+ sku: string;
9833
+ quantity: number;
9834
+ minStock: number;
9835
+ }[];
9836
+ movements: {
9837
+ id: string;
9838
+ workspaceId: string;
9839
+ reason: string;
9840
+ sku: string;
9841
+ productName: string;
9842
+ variant: string | null;
9843
+ fromWarehouseId: string;
9844
+ toWarehouseId: string;
9845
+ quantity: number;
9846
+ date: string;
9847
+ comment: string | null;
9848
+ userId: string | null;
9849
+ userName: string | null;
9850
+ createdAt: string;
9851
+ }[];
9852
+ };
9853
+ outputFormat: "json";
9854
+ status: 200;
9855
+ };
9856
+ };
9857
+ } & {
9858
+ "/branches/save": {
9859
+ $post: {
9860
+ input: {
9861
+ json: {
9862
+ workspace: string;
9863
+ branch: {
9864
+ id?: string | undefined;
9865
+ name: string;
9866
+ type: "own" | "franchise";
9867
+ franchiseeId: string | null;
9868
+ status: "active" | "renovation" | "searching" | "closed";
9869
+ openedAt: string | null;
9870
+ address: string;
9871
+ phone: string;
9872
+ telegram: string;
9873
+ whatsapp: string;
9874
+ managerId: string | null;
9875
+ memberIds: string[];
9876
+ hours: {
9877
+ weekday: number;
9878
+ open: boolean;
9879
+ start: string;
9880
+ end: string;
9881
+ }[];
9882
+ timeZone: string;
9883
+ useWorkspaceLegal: boolean;
9884
+ attributes: {
9885
+ [x: string]: string | number | boolean | string[] | null;
9886
+ };
9887
+ };
9888
+ places: {
9889
+ id?: string | undefined;
9890
+ name: string;
9891
+ zone: string | null;
9892
+ type: "room" | "hall" | "table" | "seat" | "bed" | "court" | "bay" | "line" | "showroom" | "other";
9893
+ capacity: number | null;
9894
+ durationMinutes: number;
9895
+ color: "blue" | "green" | "amber" | "red" | "violet" | "teal";
9896
+ linkedMemberIds: string[];
9897
+ active: boolean;
9898
+ attributes: {
9899
+ [x: string]: string | number | boolean | string[] | null;
9900
+ };
9901
+ }[];
9902
+ };
9903
+ };
9904
+ output: {
9905
+ success: false;
9906
+ error: string;
9907
+ };
9908
+ outputFormat: "json";
9909
+ status: 404;
9910
+ } | {
9911
+ input: {
9912
+ json: {
9913
+ workspace: string;
9914
+ branch: {
9915
+ id?: string | undefined;
9916
+ name: string;
9917
+ type: "own" | "franchise";
9918
+ franchiseeId: string | null;
9919
+ status: "active" | "renovation" | "searching" | "closed";
9920
+ openedAt: string | null;
9921
+ address: string;
9922
+ phone: string;
9923
+ telegram: string;
9924
+ whatsapp: string;
9925
+ managerId: string | null;
9926
+ memberIds: string[];
9927
+ hours: {
9928
+ weekday: number;
9929
+ open: boolean;
9930
+ start: string;
9931
+ end: string;
9932
+ }[];
9933
+ timeZone: string;
9934
+ useWorkspaceLegal: boolean;
9935
+ attributes: {
9936
+ [x: string]: string | number | boolean | string[] | null;
9937
+ };
9938
+ };
9939
+ places: {
9940
+ id?: string | undefined;
9941
+ name: string;
9942
+ zone: string | null;
9943
+ type: "room" | "hall" | "table" | "seat" | "bed" | "court" | "bay" | "line" | "showroom" | "other";
9944
+ capacity: number | null;
9945
+ durationMinutes: number;
9946
+ color: "blue" | "green" | "amber" | "red" | "violet" | "teal";
9947
+ linkedMemberIds: string[];
9948
+ active: boolean;
9949
+ attributes: {
9950
+ [x: string]: string | number | boolean | string[] | null;
9951
+ };
9952
+ }[];
9953
+ };
9954
+ };
9955
+ output: {
9956
+ success: true;
9957
+ branch: {
9958
+ type: string;
9959
+ id: string;
9960
+ workspaceId: string;
9961
+ name: string;
9962
+ createdAt: string;
9963
+ status: string;
9964
+ phone: string;
9965
+ franchiseeId: string | null;
9966
+ openedAt: string | null;
9967
+ isDefault: boolean;
9968
+ address: string;
9969
+ telegram: string;
9970
+ whatsapp: string;
9971
+ managerId: string | null;
9972
+ memberIds: string[];
9973
+ hours: {
9974
+ weekday: number;
9975
+ open: boolean;
9976
+ start: string;
9977
+ end: string;
9978
+ }[];
9979
+ timeZone: string;
9980
+ useWorkspaceLegal: boolean;
9981
+ attributes: {
9982
+ [x: string]: ResourceAttributeValue;
9983
+ };
9984
+ };
9985
+ };
9986
+ outputFormat: "json";
9987
+ status: 200;
9988
+ };
9989
+ };
9990
+ } & {
9991
+ "/branches/delete": {
9992
+ $post: {
9993
+ input: {
9994
+ json: {
9995
+ workspace: string;
9996
+ branchId: string;
9997
+ };
9998
+ };
9999
+ output: {
10000
+ success: false;
10001
+ error: string;
10002
+ };
10003
+ outputFormat: "json";
10004
+ status: 404;
10005
+ } | {
10006
+ input: {
10007
+ json: {
10008
+ workspace: string;
10009
+ branchId: string;
10010
+ };
10011
+ };
10012
+ output: {
10013
+ success: false;
10014
+ error: "A workspace keeps at least one branch" | "Make another branch the default before removing this one" | "Archive or move this branch's warehouses first";
10015
+ reason: BranchDeleteBlock;
10016
+ };
10017
+ outputFormat: "json";
10018
+ status: 409;
10019
+ } | {
10020
+ input: {
10021
+ json: {
10022
+ workspace: string;
10023
+ branchId: string;
10024
+ };
10025
+ };
10026
+ output: {
10027
+ success: true;
10028
+ };
10029
+ outputFormat: "json";
10030
+ status: 200;
10031
+ };
10032
+ };
10033
+ } & {
10034
+ "/branches/default": {
10035
+ $post: {
10036
+ input: {
10037
+ json: {
10038
+ workspace: string;
10039
+ branchId: string;
10040
+ };
10041
+ };
10042
+ output: {
10043
+ success: false;
10044
+ error: string;
10045
+ };
10046
+ outputFormat: "json";
10047
+ status: 404;
10048
+ } | {
10049
+ input: {
10050
+ json: {
10051
+ workspace: string;
10052
+ branchId: string;
10053
+ };
10054
+ };
10055
+ output: {
10056
+ success: true;
10057
+ };
10058
+ outputFormat: "json";
10059
+ status: 200;
10060
+ };
10061
+ };
10062
+ } & {
10063
+ "/places/active": {
10064
+ $post: {
10065
+ input: {
10066
+ json: {
10067
+ workspace: string;
10068
+ placeId: string;
10069
+ active: boolean;
10070
+ };
10071
+ };
10072
+ output: {
10073
+ success: false;
10074
+ error: string;
10075
+ };
10076
+ outputFormat: "json";
10077
+ status: 404;
10078
+ } | {
10079
+ input: {
10080
+ json: {
10081
+ workspace: string;
10082
+ placeId: string;
10083
+ active: boolean;
10084
+ };
10085
+ };
10086
+ output: {
10087
+ success: true;
10088
+ };
10089
+ outputFormat: "json";
10090
+ status: 200;
10091
+ };
10092
+ };
10093
+ } & {
10094
+ "/warehouses/save": {
10095
+ $post: {
10096
+ input: {
10097
+ json: {
10098
+ workspace: string;
10099
+ warehouse: {
10100
+ id?: string | undefined;
10101
+ branchId: string;
10102
+ name: string;
10103
+ address: string | null;
10104
+ isDefault: boolean;
10105
+ responsibleId: string | null;
10106
+ attributes: {
10107
+ [x: string]: string | number | boolean | string[] | null;
10108
+ };
10109
+ };
10110
+ };
10111
+ };
10112
+ output: {
10113
+ success: false;
10114
+ error: string;
10115
+ };
10116
+ outputFormat: "json";
10117
+ status: 404;
10118
+ } | {
10119
+ input: {
10120
+ json: {
10121
+ workspace: string;
10122
+ warehouse: {
10123
+ id?: string | undefined;
10124
+ branchId: string;
10125
+ name: string;
10126
+ address: string | null;
10127
+ isDefault: boolean;
10128
+ responsibleId: string | null;
10129
+ attributes: {
10130
+ [x: string]: string | number | boolean | string[] | null;
10131
+ };
10132
+ };
10133
+ };
10134
+ };
10135
+ output: {
10136
+ success: true;
10137
+ warehouse: {
10138
+ id: string;
10139
+ workspaceId: string;
10140
+ name: string;
10141
+ createdAt: string;
10142
+ isDefault: boolean;
10143
+ address: string | null;
10144
+ attributes: {
10145
+ [x: string]: ResourceAttributeValue;
10146
+ };
10147
+ branchId: string;
10148
+ responsibleId: string | null;
10149
+ archivedAt: string | null;
10150
+ };
10151
+ };
10152
+ outputFormat: "json";
10153
+ status: 200;
10154
+ };
10155
+ };
10156
+ } & {
10157
+ "/warehouses/archive": {
10158
+ $post: {
10159
+ input: {
10160
+ json: {
10161
+ workspace: string;
10162
+ warehouseId: string;
10163
+ };
10164
+ };
10165
+ output: {
10166
+ success: false;
10167
+ error: string;
10168
+ };
10169
+ outputFormat: "json";
10170
+ status: 404;
10171
+ } | {
10172
+ input: {
10173
+ json: {
10174
+ workspace: string;
10175
+ warehouseId: string;
10176
+ };
10177
+ };
10178
+ output: {
10179
+ success: false;
10180
+ error: "A workspace keeps at least one active warehouse" | "Make another warehouse the default before archiving this one" | "Move this warehouse's stock out before archiving it";
10181
+ reason: WarehouseArchiveBlock;
10182
+ };
10183
+ outputFormat: "json";
10184
+ status: 409;
10185
+ } | {
10186
+ input: {
10187
+ json: {
10188
+ workspace: string;
10189
+ warehouseId: string;
10190
+ };
10191
+ };
10192
+ output: {
10193
+ success: true;
10194
+ };
10195
+ outputFormat: "json";
10196
+ status: 200;
10197
+ };
10198
+ };
10199
+ } & {
10200
+ "/warehouses/restore": {
10201
+ $post: {
10202
+ input: {
10203
+ json: {
10204
+ workspace: string;
10205
+ warehouseId: string;
10206
+ };
10207
+ };
10208
+ output: {
10209
+ success: false;
10210
+ error: string;
10211
+ };
10212
+ outputFormat: "json";
10213
+ status: 404;
10214
+ } | {
10215
+ input: {
10216
+ json: {
10217
+ workspace: string;
10218
+ warehouseId: string;
10219
+ };
10220
+ };
10221
+ output: {
10222
+ success: true;
10223
+ };
10224
+ outputFormat: "json";
10225
+ status: 200;
10226
+ };
10227
+ };
10228
+ } & {
10229
+ "/warehouses/default": {
10230
+ $post: {
10231
+ input: {
10232
+ json: {
10233
+ workspace: string;
10234
+ warehouseId: string;
10235
+ };
10236
+ };
10237
+ output: {
10238
+ success: false;
10239
+ error: string;
10240
+ };
10241
+ outputFormat: "json";
10242
+ status: 404;
10243
+ } | {
10244
+ input: {
10245
+ json: {
10246
+ workspace: string;
10247
+ warehouseId: string;
10248
+ };
10249
+ };
10250
+ output: {
10251
+ success: true;
10252
+ };
10253
+ outputFormat: "json";
10254
+ status: 200;
10255
+ };
10256
+ };
10257
+ } & {
10258
+ "/stock/set": {
10259
+ $post: {
10260
+ input: {
10261
+ json: {
10262
+ workspace: string;
10263
+ warehouseId: string;
10264
+ sku: string;
10265
+ productName: string;
10266
+ variant: string | null;
10267
+ quantity: number;
10268
+ minStock: number;
10269
+ };
10270
+ };
10271
+ output: {
10272
+ success: false;
10273
+ error: string;
10274
+ };
10275
+ outputFormat: "json";
10276
+ status: 404;
10277
+ } | {
10278
+ input: {
10279
+ json: {
10280
+ workspace: string;
10281
+ warehouseId: string;
10282
+ sku: string;
10283
+ productName: string;
10284
+ variant: string | null;
10285
+ quantity: number;
10286
+ minStock: number;
10287
+ };
10288
+ };
10289
+ output: {
10290
+ success: true;
10291
+ item: {
10292
+ id: string;
10293
+ workspaceId: string;
10294
+ warehouseId: string;
10295
+ productName: string;
10296
+ variant: string | null;
10297
+ sku: string;
10298
+ quantity: number;
10299
+ minStock: number;
10300
+ };
10301
+ };
10302
+ outputFormat: "json";
10303
+ status: 200;
10304
+ };
10305
+ };
10306
+ } & {
10307
+ "/stock/transfer": {
10308
+ $post: {
10309
+ input: {
10310
+ json: {
10311
+ workspace: string;
10312
+ fromWarehouseId: string;
10313
+ toWarehouseId: string;
10314
+ sku: string;
10315
+ quantity: number;
10316
+ date: string;
10317
+ comment: string | null;
10318
+ };
10319
+ };
10320
+ output: {
10321
+ success: false;
10322
+ error: "Both warehouses must be active warehouses of the workspace" | "The source warehouse doesn't have this product" | "The source warehouse doesn't have that many units";
10323
+ reason: StockTransferBlock;
10324
+ };
10325
+ outputFormat: "json";
10326
+ status: 409;
10327
+ } | {
10328
+ input: {
10329
+ json: {
10330
+ workspace: string;
10331
+ fromWarehouseId: string;
10332
+ toWarehouseId: string;
10333
+ sku: string;
10334
+ quantity: number;
10335
+ date: string;
10336
+ comment: string | null;
10337
+ };
10338
+ };
10339
+ output: {
10340
+ success: true;
10341
+ movement: {
10342
+ id: string;
10343
+ userId: string | null;
10344
+ workspaceId: string;
10345
+ createdAt: string;
10346
+ reason: string;
10347
+ date: string;
10348
+ productName: string;
10349
+ variant: string | null;
10350
+ sku: string;
10351
+ quantity: number;
10352
+ fromWarehouseId: string;
10353
+ toWarehouseId: string;
10354
+ comment: string | null;
10355
+ userName: string | null;
10356
+ };
10357
+ };
10358
+ outputFormat: "json";
10359
+ status: 201;
10360
+ };
10361
+ };
10362
+ }, "/resources">, "/", "/">;
9729
10363
  type GlobalErrorResponses = {
9730
10364
  400: {
9731
10365
  json: ApiError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.284",
3
+ "version": "0.0.286",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,