@mestra-dev/contract 0.0.285 → 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 +627 -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 = {
@@ -2636,6 +2640,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
2636
2640
  active: boolean | null;
2637
2641
  price: number | null;
2638
2642
  created_by: string | null;
2643
+ renovation: string | null;
2639
2644
  fullPayment: boolean | null;
2640
2645
  mortgagePayment: boolean | null;
2641
2646
  installmentPayment: boolean | null;
@@ -2679,7 +2684,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
2679
2684
  floor: number | null;
2680
2685
  totalFloors: number | null;
2681
2686
  yearBuilt: string | null;
2682
- renovation: string | null;
2683
2687
  developerName: string | null;
2684
2688
  city: string | null;
2685
2689
  district: string | null;
@@ -2702,8 +2706,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
2702
2706
  active: boolean | null;
2703
2707
  price: number | null;
2704
2708
  created_by: string | null;
2705
- currency: string | null;
2706
2709
  stock: number | null;
2710
+ currency: string | null;
2707
2711
  qrCode: string | null;
2708
2712
  }[];
2709
2713
  };
@@ -3198,9 +3202,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
3198
3202
  email: string | null;
3199
3203
  phone: string | null;
3200
3204
  created_by: string | null;
3201
- companyName: string | null;
3202
3205
  telegram: string | null;
3203
3206
  whatsapp: string | null;
3207
+ companyName: string | null;
3204
3208
  instagram: string | null;
3205
3209
  vk: string | null;
3206
3210
  igSynapseId: string | null;
@@ -3254,11 +3258,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
3254
3258
  email: string | null;
3255
3259
  phone: string | null;
3256
3260
  created_by: string | null;
3261
+ address: string | null;
3257
3262
  website: string | null;
3258
3263
  birthDate: string | null;
3259
3264
  companyPhone: string | null;
3260
3265
  companyAddress: string | null;
3261
- address: string | null;
3262
3266
  utmSource: string | null;
3263
3267
  }[];
3264
3268
  };
@@ -3822,7 +3826,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3822
3826
  workspace: string;
3823
3827
  customerId: string;
3824
3828
  relatedCustomerId: string;
3825
- 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";
3826
3830
  };
3827
3831
  };
3828
3832
  output: {
@@ -3837,7 +3841,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3837
3841
  workspace: string;
3838
3842
  customerId: string;
3839
3843
  relatedCustomerId: string;
3840
- 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";
3841
3845
  };
3842
3846
  };
3843
3847
  output: {
@@ -3852,7 +3856,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
3852
3856
  workspace: string;
3853
3857
  customerId: string;
3854
3858
  relatedCustomerId: string;
3855
- 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";
3856
3860
  };
3857
3861
  };
3858
3862
  output: {
@@ -4003,6 +4007,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4003
4007
  status: string;
4004
4008
  created_by: string;
4005
4009
  customerId: string;
4010
+ date: string;
4006
4011
  fullPayment: boolean | null;
4007
4012
  installment: boolean | null;
4008
4013
  notes: string | null;
@@ -4012,7 +4017,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
4012
4017
  invoiceDiscount: number;
4013
4018
  discount: number;
4014
4019
  SellerFinanceAccountId: string;
4015
- date: string;
4016
4020
  language: string;
4017
4021
  vatOption: string;
4018
4022
  unitName: string;
@@ -4138,6 +4142,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4138
4142
  status: string;
4139
4143
  created_by: string;
4140
4144
  customerId: string;
4145
+ date: string;
4141
4146
  fullPayment: boolean | null;
4142
4147
  installment: boolean | null;
4143
4148
  notes: string | null;
@@ -4147,7 +4152,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
4147
4152
  invoiceDiscount: number;
4148
4153
  discount: number;
4149
4154
  SellerFinanceAccountId: string;
4150
- date: string;
4151
4155
  language: string;
4152
4156
  vatOption: string;
4153
4157
  unitName: string;
@@ -4327,6 +4331,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4327
4331
  status: string;
4328
4332
  created_by: string;
4329
4333
  customerId: string;
4334
+ date: string;
4330
4335
  fullPayment: boolean | null;
4331
4336
  installment: boolean | null;
4332
4337
  notes: string | null;
@@ -4336,7 +4341,6 @@ declare const routes: import("hono/hono-base").HonoBase<{
4336
4341
  invoiceDiscount: number;
4337
4342
  discount: number;
4338
4343
  SellerFinanceAccountId: string;
4339
- date: string;
4340
4344
  language: string;
4341
4345
  vatOption: string;
4342
4346
  unitName: string;
@@ -4470,9 +4474,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
4470
4474
  suspended_at: string | null;
4471
4475
  created_by: string;
4472
4476
  customerId: string;
4477
+ date: string;
4473
4478
  notes: string | null;
4474
4479
  serviceId: string;
4475
- date: string;
4476
4480
  }[];
4477
4481
  };
4478
4482
  outputFormat: "json";
@@ -9339,7 +9343,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9339
9343
  input: {
9340
9344
  query: {
9341
9345
  accountId?: string | undefined;
9342
- type?: "" | "refund" | "income" | "expense" | "transfer" | undefined;
9346
+ type?: "" | "transfer" | "refund" | "income" | "expense" | undefined;
9343
9347
  };
9344
9348
  } & {
9345
9349
  param: {
@@ -9449,7 +9453,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9449
9453
  collaboratorId?: string | null | undefined;
9450
9454
  taskId?: string | null | undefined;
9451
9455
  workspace: string;
9452
- type: "refund" | "income" | "expense" | "transfer";
9456
+ type: "transfer" | "refund" | "income" | "expense";
9453
9457
  customerId?: string | undefined;
9454
9458
  serviceId?: string | undefined;
9455
9459
  accountId?: string | undefined;
@@ -9479,7 +9483,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9479
9483
  collaboratorId?: string | null | undefined;
9480
9484
  taskId?: string | null | undefined;
9481
9485
  workspace: string;
9482
- type: "refund" | "income" | "expense" | "transfer";
9486
+ type: "transfer" | "refund" | "income" | "expense";
9483
9487
  customerId?: string | undefined;
9484
9488
  serviceId?: string | undefined;
9485
9489
  accountId?: string | undefined;
@@ -9539,7 +9543,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9539
9543
  taskId?: string | null | undefined;
9540
9544
  transactionId: string;
9541
9545
  workspace: string;
9542
- type?: "refund" | "income" | "expense" | "transfer" | undefined;
9546
+ type?: "transfer" | "refund" | "income" | "expense" | undefined;
9543
9547
  customerId?: string | undefined;
9544
9548
  serviceId?: string | undefined;
9545
9549
  accountId?: string | undefined;
@@ -9570,7 +9574,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9570
9574
  taskId?: string | null | undefined;
9571
9575
  transactionId: string;
9572
9576
  workspace: string;
9573
- type?: "refund" | "income" | "expense" | "transfer" | undefined;
9577
+ type?: "transfer" | "refund" | "income" | "expense" | undefined;
9574
9578
  customerId?: string | undefined;
9575
9579
  serviceId?: string | undefined;
9576
9580
  accountId?: string | undefined;
@@ -9749,7 +9753,613 @@ declare const routes: import("hono/hono-base").HonoBase<{
9749
9753
  status: 200;
9750
9754
  };
9751
9755
  };
9752
- }, "/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">, "/", "/">;
9753
10363
  type GlobalErrorResponses = {
9754
10364
  400: {
9755
10365
  json: ApiError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.285",
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,