@mestra-dev/contract 0.0.285 → 0.0.287
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 +645 -17
- 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"
|
|
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"
|
|
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"
|
|
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?: "" | "
|
|
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: "
|
|
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: "
|
|
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?: "
|
|
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?: "
|
|
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,631 @@ 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
|
+
places: {
|
|
9986
|
+
id: string;
|
|
9987
|
+
workspaceId: string;
|
|
9988
|
+
branchId: string;
|
|
9989
|
+
name: string;
|
|
9990
|
+
zone: string | null;
|
|
9991
|
+
type: string;
|
|
9992
|
+
capacity: number | null;
|
|
9993
|
+
durationMinutes: number;
|
|
9994
|
+
color: string;
|
|
9995
|
+
linkedMemberIds: string[];
|
|
9996
|
+
active: boolean;
|
|
9997
|
+
attributes: {
|
|
9998
|
+
[x: string]: ResourceAttributeValue;
|
|
9999
|
+
};
|
|
10000
|
+
position: number;
|
|
10001
|
+
createdAt: string;
|
|
10002
|
+
}[];
|
|
10003
|
+
};
|
|
10004
|
+
outputFormat: "json";
|
|
10005
|
+
status: 200;
|
|
10006
|
+
};
|
|
10007
|
+
};
|
|
10008
|
+
} & {
|
|
10009
|
+
"/branches/delete": {
|
|
10010
|
+
$post: {
|
|
10011
|
+
input: {
|
|
10012
|
+
json: {
|
|
10013
|
+
workspace: string;
|
|
10014
|
+
branchId: string;
|
|
10015
|
+
};
|
|
10016
|
+
};
|
|
10017
|
+
output: {
|
|
10018
|
+
success: false;
|
|
10019
|
+
error: string;
|
|
10020
|
+
};
|
|
10021
|
+
outputFormat: "json";
|
|
10022
|
+
status: 404;
|
|
10023
|
+
} | {
|
|
10024
|
+
input: {
|
|
10025
|
+
json: {
|
|
10026
|
+
workspace: string;
|
|
10027
|
+
branchId: string;
|
|
10028
|
+
};
|
|
10029
|
+
};
|
|
10030
|
+
output: {
|
|
10031
|
+
success: false;
|
|
10032
|
+
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";
|
|
10033
|
+
reason: BranchDeleteBlock;
|
|
10034
|
+
};
|
|
10035
|
+
outputFormat: "json";
|
|
10036
|
+
status: 409;
|
|
10037
|
+
} | {
|
|
10038
|
+
input: {
|
|
10039
|
+
json: {
|
|
10040
|
+
workspace: string;
|
|
10041
|
+
branchId: string;
|
|
10042
|
+
};
|
|
10043
|
+
};
|
|
10044
|
+
output: {
|
|
10045
|
+
success: true;
|
|
10046
|
+
};
|
|
10047
|
+
outputFormat: "json";
|
|
10048
|
+
status: 200;
|
|
10049
|
+
};
|
|
10050
|
+
};
|
|
10051
|
+
} & {
|
|
10052
|
+
"/branches/default": {
|
|
10053
|
+
$post: {
|
|
10054
|
+
input: {
|
|
10055
|
+
json: {
|
|
10056
|
+
workspace: string;
|
|
10057
|
+
branchId: string;
|
|
10058
|
+
};
|
|
10059
|
+
};
|
|
10060
|
+
output: {
|
|
10061
|
+
success: false;
|
|
10062
|
+
error: string;
|
|
10063
|
+
};
|
|
10064
|
+
outputFormat: "json";
|
|
10065
|
+
status: 404;
|
|
10066
|
+
} | {
|
|
10067
|
+
input: {
|
|
10068
|
+
json: {
|
|
10069
|
+
workspace: string;
|
|
10070
|
+
branchId: string;
|
|
10071
|
+
};
|
|
10072
|
+
};
|
|
10073
|
+
output: {
|
|
10074
|
+
success: true;
|
|
10075
|
+
};
|
|
10076
|
+
outputFormat: "json";
|
|
10077
|
+
status: 200;
|
|
10078
|
+
};
|
|
10079
|
+
};
|
|
10080
|
+
} & {
|
|
10081
|
+
"/places/active": {
|
|
10082
|
+
$post: {
|
|
10083
|
+
input: {
|
|
10084
|
+
json: {
|
|
10085
|
+
workspace: string;
|
|
10086
|
+
placeId: string;
|
|
10087
|
+
active: boolean;
|
|
10088
|
+
};
|
|
10089
|
+
};
|
|
10090
|
+
output: {
|
|
10091
|
+
success: false;
|
|
10092
|
+
error: string;
|
|
10093
|
+
};
|
|
10094
|
+
outputFormat: "json";
|
|
10095
|
+
status: 404;
|
|
10096
|
+
} | {
|
|
10097
|
+
input: {
|
|
10098
|
+
json: {
|
|
10099
|
+
workspace: string;
|
|
10100
|
+
placeId: string;
|
|
10101
|
+
active: boolean;
|
|
10102
|
+
};
|
|
10103
|
+
};
|
|
10104
|
+
output: {
|
|
10105
|
+
success: true;
|
|
10106
|
+
};
|
|
10107
|
+
outputFormat: "json";
|
|
10108
|
+
status: 200;
|
|
10109
|
+
};
|
|
10110
|
+
};
|
|
10111
|
+
} & {
|
|
10112
|
+
"/warehouses/save": {
|
|
10113
|
+
$post: {
|
|
10114
|
+
input: {
|
|
10115
|
+
json: {
|
|
10116
|
+
workspace: string;
|
|
10117
|
+
warehouse: {
|
|
10118
|
+
id?: string | undefined;
|
|
10119
|
+
branchId: string;
|
|
10120
|
+
name: string;
|
|
10121
|
+
address: string | null;
|
|
10122
|
+
isDefault: boolean;
|
|
10123
|
+
responsibleId: string | null;
|
|
10124
|
+
attributes: {
|
|
10125
|
+
[x: string]: string | number | boolean | string[] | null;
|
|
10126
|
+
};
|
|
10127
|
+
};
|
|
10128
|
+
};
|
|
10129
|
+
};
|
|
10130
|
+
output: {
|
|
10131
|
+
success: false;
|
|
10132
|
+
error: string;
|
|
10133
|
+
};
|
|
10134
|
+
outputFormat: "json";
|
|
10135
|
+
status: 404;
|
|
10136
|
+
} | {
|
|
10137
|
+
input: {
|
|
10138
|
+
json: {
|
|
10139
|
+
workspace: string;
|
|
10140
|
+
warehouse: {
|
|
10141
|
+
id?: string | undefined;
|
|
10142
|
+
branchId: string;
|
|
10143
|
+
name: string;
|
|
10144
|
+
address: string | null;
|
|
10145
|
+
isDefault: boolean;
|
|
10146
|
+
responsibleId: string | null;
|
|
10147
|
+
attributes: {
|
|
10148
|
+
[x: string]: string | number | boolean | string[] | null;
|
|
10149
|
+
};
|
|
10150
|
+
};
|
|
10151
|
+
};
|
|
10152
|
+
};
|
|
10153
|
+
output: {
|
|
10154
|
+
success: true;
|
|
10155
|
+
warehouse: {
|
|
10156
|
+
id: string;
|
|
10157
|
+
workspaceId: string;
|
|
10158
|
+
name: string;
|
|
10159
|
+
createdAt: string;
|
|
10160
|
+
isDefault: boolean;
|
|
10161
|
+
address: string | null;
|
|
10162
|
+
attributes: {
|
|
10163
|
+
[x: string]: ResourceAttributeValue;
|
|
10164
|
+
};
|
|
10165
|
+
branchId: string;
|
|
10166
|
+
responsibleId: string | null;
|
|
10167
|
+
archivedAt: string | null;
|
|
10168
|
+
};
|
|
10169
|
+
};
|
|
10170
|
+
outputFormat: "json";
|
|
10171
|
+
status: 200;
|
|
10172
|
+
};
|
|
10173
|
+
};
|
|
10174
|
+
} & {
|
|
10175
|
+
"/warehouses/archive": {
|
|
10176
|
+
$post: {
|
|
10177
|
+
input: {
|
|
10178
|
+
json: {
|
|
10179
|
+
workspace: string;
|
|
10180
|
+
warehouseId: string;
|
|
10181
|
+
};
|
|
10182
|
+
};
|
|
10183
|
+
output: {
|
|
10184
|
+
success: false;
|
|
10185
|
+
error: string;
|
|
10186
|
+
};
|
|
10187
|
+
outputFormat: "json";
|
|
10188
|
+
status: 404;
|
|
10189
|
+
} | {
|
|
10190
|
+
input: {
|
|
10191
|
+
json: {
|
|
10192
|
+
workspace: string;
|
|
10193
|
+
warehouseId: string;
|
|
10194
|
+
};
|
|
10195
|
+
};
|
|
10196
|
+
output: {
|
|
10197
|
+
success: false;
|
|
10198
|
+
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";
|
|
10199
|
+
reason: WarehouseArchiveBlock;
|
|
10200
|
+
};
|
|
10201
|
+
outputFormat: "json";
|
|
10202
|
+
status: 409;
|
|
10203
|
+
} | {
|
|
10204
|
+
input: {
|
|
10205
|
+
json: {
|
|
10206
|
+
workspace: string;
|
|
10207
|
+
warehouseId: string;
|
|
10208
|
+
};
|
|
10209
|
+
};
|
|
10210
|
+
output: {
|
|
10211
|
+
success: true;
|
|
10212
|
+
};
|
|
10213
|
+
outputFormat: "json";
|
|
10214
|
+
status: 200;
|
|
10215
|
+
};
|
|
10216
|
+
};
|
|
10217
|
+
} & {
|
|
10218
|
+
"/warehouses/restore": {
|
|
10219
|
+
$post: {
|
|
10220
|
+
input: {
|
|
10221
|
+
json: {
|
|
10222
|
+
workspace: string;
|
|
10223
|
+
warehouseId: string;
|
|
10224
|
+
};
|
|
10225
|
+
};
|
|
10226
|
+
output: {
|
|
10227
|
+
success: false;
|
|
10228
|
+
error: string;
|
|
10229
|
+
};
|
|
10230
|
+
outputFormat: "json";
|
|
10231
|
+
status: 404;
|
|
10232
|
+
} | {
|
|
10233
|
+
input: {
|
|
10234
|
+
json: {
|
|
10235
|
+
workspace: string;
|
|
10236
|
+
warehouseId: string;
|
|
10237
|
+
};
|
|
10238
|
+
};
|
|
10239
|
+
output: {
|
|
10240
|
+
success: true;
|
|
10241
|
+
};
|
|
10242
|
+
outputFormat: "json";
|
|
10243
|
+
status: 200;
|
|
10244
|
+
};
|
|
10245
|
+
};
|
|
10246
|
+
} & {
|
|
10247
|
+
"/warehouses/default": {
|
|
10248
|
+
$post: {
|
|
10249
|
+
input: {
|
|
10250
|
+
json: {
|
|
10251
|
+
workspace: string;
|
|
10252
|
+
warehouseId: string;
|
|
10253
|
+
};
|
|
10254
|
+
};
|
|
10255
|
+
output: {
|
|
10256
|
+
success: false;
|
|
10257
|
+
error: string;
|
|
10258
|
+
};
|
|
10259
|
+
outputFormat: "json";
|
|
10260
|
+
status: 404;
|
|
10261
|
+
} | {
|
|
10262
|
+
input: {
|
|
10263
|
+
json: {
|
|
10264
|
+
workspace: string;
|
|
10265
|
+
warehouseId: string;
|
|
10266
|
+
};
|
|
10267
|
+
};
|
|
10268
|
+
output: {
|
|
10269
|
+
success: true;
|
|
10270
|
+
};
|
|
10271
|
+
outputFormat: "json";
|
|
10272
|
+
status: 200;
|
|
10273
|
+
};
|
|
10274
|
+
};
|
|
10275
|
+
} & {
|
|
10276
|
+
"/stock/set": {
|
|
10277
|
+
$post: {
|
|
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: false;
|
|
10291
|
+
error: string;
|
|
10292
|
+
};
|
|
10293
|
+
outputFormat: "json";
|
|
10294
|
+
status: 404;
|
|
10295
|
+
} | {
|
|
10296
|
+
input: {
|
|
10297
|
+
json: {
|
|
10298
|
+
workspace: string;
|
|
10299
|
+
warehouseId: string;
|
|
10300
|
+
sku: string;
|
|
10301
|
+
productName: string;
|
|
10302
|
+
variant: string | null;
|
|
10303
|
+
quantity: number;
|
|
10304
|
+
minStock: number;
|
|
10305
|
+
};
|
|
10306
|
+
};
|
|
10307
|
+
output: {
|
|
10308
|
+
success: true;
|
|
10309
|
+
item: {
|
|
10310
|
+
id: string;
|
|
10311
|
+
workspaceId: string;
|
|
10312
|
+
warehouseId: string;
|
|
10313
|
+
productName: string;
|
|
10314
|
+
variant: string | null;
|
|
10315
|
+
sku: string;
|
|
10316
|
+
quantity: number;
|
|
10317
|
+
minStock: number;
|
|
10318
|
+
};
|
|
10319
|
+
};
|
|
10320
|
+
outputFormat: "json";
|
|
10321
|
+
status: 200;
|
|
10322
|
+
};
|
|
10323
|
+
};
|
|
10324
|
+
} & {
|
|
10325
|
+
"/stock/transfer": {
|
|
10326
|
+
$post: {
|
|
10327
|
+
input: {
|
|
10328
|
+
json: {
|
|
10329
|
+
workspace: string;
|
|
10330
|
+
fromWarehouseId: string;
|
|
10331
|
+
toWarehouseId: string;
|
|
10332
|
+
sku: string;
|
|
10333
|
+
quantity: number;
|
|
10334
|
+
date: string;
|
|
10335
|
+
comment: string | null;
|
|
10336
|
+
};
|
|
10337
|
+
};
|
|
10338
|
+
output: {
|
|
10339
|
+
success: false;
|
|
10340
|
+
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";
|
|
10341
|
+
reason: StockTransferBlock;
|
|
10342
|
+
};
|
|
10343
|
+
outputFormat: "json";
|
|
10344
|
+
status: 409;
|
|
10345
|
+
} | {
|
|
10346
|
+
input: {
|
|
10347
|
+
json: {
|
|
10348
|
+
workspace: string;
|
|
10349
|
+
fromWarehouseId: string;
|
|
10350
|
+
toWarehouseId: string;
|
|
10351
|
+
sku: string;
|
|
10352
|
+
quantity: number;
|
|
10353
|
+
date: string;
|
|
10354
|
+
comment: string | null;
|
|
10355
|
+
};
|
|
10356
|
+
};
|
|
10357
|
+
output: {
|
|
10358
|
+
success: true;
|
|
10359
|
+
movement: {
|
|
10360
|
+
id: string;
|
|
10361
|
+
userId: string | null;
|
|
10362
|
+
workspaceId: string;
|
|
10363
|
+
createdAt: string;
|
|
10364
|
+
reason: string;
|
|
10365
|
+
date: string;
|
|
10366
|
+
productName: string;
|
|
10367
|
+
variant: string | null;
|
|
10368
|
+
sku: string;
|
|
10369
|
+
quantity: number;
|
|
10370
|
+
fromWarehouseId: string;
|
|
10371
|
+
toWarehouseId: string;
|
|
10372
|
+
comment: string | null;
|
|
10373
|
+
userName: string | null;
|
|
10374
|
+
};
|
|
10375
|
+
};
|
|
10376
|
+
outputFormat: "json";
|
|
10377
|
+
status: 201;
|
|
10378
|
+
};
|
|
10379
|
+
};
|
|
10380
|
+
}, "/resources">, "/", "/">;
|
|
9753
10381
|
type GlobalErrorResponses = {
|
|
9754
10382
|
400: {
|
|
9755
10383
|
json: ApiError;
|