@deepintel-ltd/farmpro-contracts 1.23.2 → 1.24.1
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/routes/commodity-deals.routes.d.ts +1339 -0
- package/dist/routes/commodity-deals.routes.d.ts.map +1 -1
- package/dist/routes/commodity-deals.routes.js +49 -1
- package/dist/routes/documents.routes.d.ts +6 -0
- package/dist/routes/documents.routes.d.ts.map +1 -1
- package/dist/routes/documents.routes.js +2 -0
- package/dist/routes/finance.routes.d.ts +68 -68
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +2 -0
- package/dist/routes/inventory.routes.d.ts +584 -0
- package/dist/routes/inventory.routes.d.ts.map +1 -1
- package/dist/routes/inventory.routes.js +26 -1
- package/dist/routes/live-monitor.routes.d.ts +15 -10
- package/dist/routes/live-monitor.routes.d.ts.map +1 -1
- package/dist/routes/monitoring-visualization.routes.d.ts +3 -0
- package/dist/routes/monitoring-visualization.routes.d.ts.map +1 -1
- package/dist/routes/poultry.routes.d.ts +3318 -0
- package/dist/routes/poultry.routes.d.ts.map +1 -0
- package/dist/routes/poultry.routes.js +195 -0
- package/dist/routes/team-payments.routes.d.ts +42 -42
- package/dist/routes/trade-cash-events.routes.d.ts +20 -20
- package/dist/routes/waybills.routes.d.ts +14 -0
- package/dist/routes/waybills.routes.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.d.ts +484 -0
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.js +34 -0
- package/dist/schemas/finance.schemas.d.ts +78 -78
- package/dist/schemas/inventory.schemas.d.ts +122 -0
- package/dist/schemas/inventory.schemas.d.ts.map +1 -1
- package/dist/schemas/inventory.schemas.js +35 -0
- package/dist/schemas/live-monitor.schemas.d.ts +24 -16
- package/dist/schemas/live-monitor.schemas.d.ts.map +1 -1
- package/dist/schemas/live-monitor.schemas.js +3 -2
- package/dist/schemas/monitoring-visualization.schemas.d.ts +64 -0
- package/dist/schemas/monitoring-visualization.schemas.d.ts.map +1 -1
- package/dist/schemas/monitoring-visualization.schemas.js +25 -1
- package/dist/schemas/team-payments.schemas.d.ts +30 -30
- package/dist/schemas/trade-cash-events.schemas.d.ts +24 -24
- package/dist/schemas/waybills.schemas.d.ts +16 -0
- package/dist/schemas/waybills.schemas.d.ts.map +1 -1
- package/dist/schemas/waybills.schemas.js +1 -0
- package/package.json +1 -1
|
@@ -2849,5 +2849,589 @@ export declare const inventoryRouter: {
|
|
|
2849
2849
|
}>;
|
|
2850
2850
|
};
|
|
2851
2851
|
};
|
|
2852
|
+
logIssue: {
|
|
2853
|
+
pathParams: z.ZodObject<{
|
|
2854
|
+
farmId: z.ZodString;
|
|
2855
|
+
}, "strip", z.ZodTypeAny, {
|
|
2856
|
+
farmId: string;
|
|
2857
|
+
}, {
|
|
2858
|
+
farmId: string;
|
|
2859
|
+
}>;
|
|
2860
|
+
summary: "Issue stock";
|
|
2861
|
+
description: "Debit inventory stock and optionally post a flock/field-allocated expense from avgCost";
|
|
2862
|
+
method: "POST";
|
|
2863
|
+
body: z.ZodObject<{
|
|
2864
|
+
data: z.ZodObject<{
|
|
2865
|
+
type: z.ZodLiteral<"issues">;
|
|
2866
|
+
attributes: z.ZodEffects<z.ZodObject<{
|
|
2867
|
+
itemId: z.ZodString;
|
|
2868
|
+
quantity: z.ZodNumber;
|
|
2869
|
+
date: z.ZodString;
|
|
2870
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
2871
|
+
fieldId: z.ZodOptional<z.ZodString>;
|
|
2872
|
+
cropId: z.ZodOptional<z.ZodString>;
|
|
2873
|
+
groupId: z.ZodOptional<z.ZodString>;
|
|
2874
|
+
allocationType: z.ZodOptional<z.ZodEnum<["field", "crop", "general", "livestock_group"]>>;
|
|
2875
|
+
}, "strip", z.ZodTypeAny, {
|
|
2876
|
+
date: string;
|
|
2877
|
+
quantity: number;
|
|
2878
|
+
itemId: string;
|
|
2879
|
+
notes?: string | undefined;
|
|
2880
|
+
fieldId?: string | undefined;
|
|
2881
|
+
cropId?: string | undefined;
|
|
2882
|
+
groupId?: string | undefined;
|
|
2883
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2884
|
+
}, {
|
|
2885
|
+
date: string;
|
|
2886
|
+
quantity: number;
|
|
2887
|
+
itemId: string;
|
|
2888
|
+
notes?: string | undefined;
|
|
2889
|
+
fieldId?: string | undefined;
|
|
2890
|
+
cropId?: string | undefined;
|
|
2891
|
+
groupId?: string | undefined;
|
|
2892
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2893
|
+
}>, {
|
|
2894
|
+
date: string;
|
|
2895
|
+
quantity: number;
|
|
2896
|
+
itemId: string;
|
|
2897
|
+
notes?: string | undefined;
|
|
2898
|
+
fieldId?: string | undefined;
|
|
2899
|
+
cropId?: string | undefined;
|
|
2900
|
+
groupId?: string | undefined;
|
|
2901
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2902
|
+
}, {
|
|
2903
|
+
date: string;
|
|
2904
|
+
quantity: number;
|
|
2905
|
+
itemId: string;
|
|
2906
|
+
notes?: string | undefined;
|
|
2907
|
+
fieldId?: string | undefined;
|
|
2908
|
+
cropId?: string | undefined;
|
|
2909
|
+
groupId?: string | undefined;
|
|
2910
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2911
|
+
}>;
|
|
2912
|
+
}, "strip", z.ZodTypeAny, {
|
|
2913
|
+
type: "issues";
|
|
2914
|
+
attributes: {
|
|
2915
|
+
date: string;
|
|
2916
|
+
quantity: number;
|
|
2917
|
+
itemId: string;
|
|
2918
|
+
notes?: string | undefined;
|
|
2919
|
+
fieldId?: string | undefined;
|
|
2920
|
+
cropId?: string | undefined;
|
|
2921
|
+
groupId?: string | undefined;
|
|
2922
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2923
|
+
};
|
|
2924
|
+
}, {
|
|
2925
|
+
type: "issues";
|
|
2926
|
+
attributes: {
|
|
2927
|
+
date: string;
|
|
2928
|
+
quantity: number;
|
|
2929
|
+
itemId: string;
|
|
2930
|
+
notes?: string | undefined;
|
|
2931
|
+
fieldId?: string | undefined;
|
|
2932
|
+
cropId?: string | undefined;
|
|
2933
|
+
groupId?: string | undefined;
|
|
2934
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2935
|
+
};
|
|
2936
|
+
}>;
|
|
2937
|
+
}, "strip", z.ZodTypeAny, {
|
|
2938
|
+
data: {
|
|
2939
|
+
type: "issues";
|
|
2940
|
+
attributes: {
|
|
2941
|
+
date: string;
|
|
2942
|
+
quantity: number;
|
|
2943
|
+
itemId: string;
|
|
2944
|
+
notes?: string | undefined;
|
|
2945
|
+
fieldId?: string | undefined;
|
|
2946
|
+
cropId?: string | undefined;
|
|
2947
|
+
groupId?: string | undefined;
|
|
2948
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2949
|
+
};
|
|
2950
|
+
};
|
|
2951
|
+
}, {
|
|
2952
|
+
data: {
|
|
2953
|
+
type: "issues";
|
|
2954
|
+
attributes: {
|
|
2955
|
+
date: string;
|
|
2956
|
+
quantity: number;
|
|
2957
|
+
itemId: string;
|
|
2958
|
+
notes?: string | undefined;
|
|
2959
|
+
fieldId?: string | undefined;
|
|
2960
|
+
cropId?: string | undefined;
|
|
2961
|
+
groupId?: string | undefined;
|
|
2962
|
+
allocationType?: "crop" | "field" | "general" | "livestock_group" | undefined;
|
|
2963
|
+
};
|
|
2964
|
+
};
|
|
2965
|
+
}>;
|
|
2966
|
+
path: "/farms/:farmId/inventory/issue";
|
|
2967
|
+
responses: {
|
|
2968
|
+
201: z.ZodObject<{
|
|
2969
|
+
data: z.ZodObject<{
|
|
2970
|
+
type: z.ZodLiteral<"issue-results">;
|
|
2971
|
+
id: z.ZodString;
|
|
2972
|
+
attributes: z.ZodObject<{
|
|
2973
|
+
inventoryItemId: z.ZodString;
|
|
2974
|
+
transactionId: z.ZodString;
|
|
2975
|
+
expenseId: z.ZodOptional<z.ZodString>;
|
|
2976
|
+
totalCost: z.ZodNumber;
|
|
2977
|
+
}, "strip", z.ZodTypeAny, {
|
|
2978
|
+
inventoryItemId: string;
|
|
2979
|
+
totalCost: number;
|
|
2980
|
+
transactionId: string;
|
|
2981
|
+
expenseId?: string | undefined;
|
|
2982
|
+
}, {
|
|
2983
|
+
inventoryItemId: string;
|
|
2984
|
+
totalCost: number;
|
|
2985
|
+
transactionId: string;
|
|
2986
|
+
expenseId?: string | undefined;
|
|
2987
|
+
}>;
|
|
2988
|
+
}, "strip", z.ZodTypeAny, {
|
|
2989
|
+
type: "issue-results";
|
|
2990
|
+
id: string;
|
|
2991
|
+
attributes: {
|
|
2992
|
+
inventoryItemId: string;
|
|
2993
|
+
totalCost: number;
|
|
2994
|
+
transactionId: string;
|
|
2995
|
+
expenseId?: string | undefined;
|
|
2996
|
+
};
|
|
2997
|
+
}, {
|
|
2998
|
+
type: "issue-results";
|
|
2999
|
+
id: string;
|
|
3000
|
+
attributes: {
|
|
3001
|
+
inventoryItemId: string;
|
|
3002
|
+
totalCost: number;
|
|
3003
|
+
transactionId: string;
|
|
3004
|
+
expenseId?: string | undefined;
|
|
3005
|
+
};
|
|
3006
|
+
}>;
|
|
3007
|
+
included: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3008
|
+
type: z.ZodString;
|
|
3009
|
+
id: z.ZodString;
|
|
3010
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3011
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3012
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3013
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3014
|
+
}, "strip", z.ZodTypeAny, {
|
|
3015
|
+
type: string;
|
|
3016
|
+
id: string;
|
|
3017
|
+
attributes?: Record<string, unknown> | undefined;
|
|
3018
|
+
relationships?: Record<string, unknown> | undefined;
|
|
3019
|
+
links?: Record<string, string> | undefined;
|
|
3020
|
+
meta?: Record<string, unknown> | undefined;
|
|
3021
|
+
}, {
|
|
3022
|
+
type: string;
|
|
3023
|
+
id: string;
|
|
3024
|
+
attributes?: Record<string, unknown> | undefined;
|
|
3025
|
+
relationships?: Record<string, unknown> | undefined;
|
|
3026
|
+
links?: Record<string, string> | undefined;
|
|
3027
|
+
meta?: Record<string, unknown> | undefined;
|
|
3028
|
+
}>, "many">>;
|
|
3029
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3030
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
3031
|
+
}, "strip", z.ZodTypeAny, {
|
|
3032
|
+
data: {
|
|
3033
|
+
type: "issue-results";
|
|
3034
|
+
id: string;
|
|
3035
|
+
attributes: {
|
|
3036
|
+
inventoryItemId: string;
|
|
3037
|
+
totalCost: number;
|
|
3038
|
+
transactionId: string;
|
|
3039
|
+
expenseId?: string | undefined;
|
|
3040
|
+
};
|
|
3041
|
+
};
|
|
3042
|
+
links?: Record<string, string> | undefined;
|
|
3043
|
+
meta?: Record<string, unknown> | undefined;
|
|
3044
|
+
included?: {
|
|
3045
|
+
type: string;
|
|
3046
|
+
id: string;
|
|
3047
|
+
attributes?: Record<string, unknown> | undefined;
|
|
3048
|
+
relationships?: Record<string, unknown> | undefined;
|
|
3049
|
+
links?: Record<string, string> | undefined;
|
|
3050
|
+
meta?: Record<string, unknown> | undefined;
|
|
3051
|
+
}[] | undefined;
|
|
3052
|
+
}, {
|
|
3053
|
+
data: {
|
|
3054
|
+
type: "issue-results";
|
|
3055
|
+
id: string;
|
|
3056
|
+
attributes: {
|
|
3057
|
+
inventoryItemId: string;
|
|
3058
|
+
totalCost: number;
|
|
3059
|
+
transactionId: string;
|
|
3060
|
+
expenseId?: string | undefined;
|
|
3061
|
+
};
|
|
3062
|
+
};
|
|
3063
|
+
links?: Record<string, string> | undefined;
|
|
3064
|
+
meta?: Record<string, unknown> | undefined;
|
|
3065
|
+
included?: {
|
|
3066
|
+
type: string;
|
|
3067
|
+
id: string;
|
|
3068
|
+
attributes?: Record<string, unknown> | undefined;
|
|
3069
|
+
relationships?: Record<string, unknown> | undefined;
|
|
3070
|
+
links?: Record<string, string> | undefined;
|
|
3071
|
+
meta?: Record<string, unknown> | undefined;
|
|
3072
|
+
}[] | undefined;
|
|
3073
|
+
}>;
|
|
3074
|
+
400: z.ZodObject<{
|
|
3075
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
3076
|
+
id: z.ZodOptional<z.ZodString>;
|
|
3077
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
3078
|
+
about: z.ZodOptional<z.ZodString>;
|
|
3079
|
+
}, "strip", z.ZodTypeAny, {
|
|
3080
|
+
about?: string | undefined;
|
|
3081
|
+
}, {
|
|
3082
|
+
about?: string | undefined;
|
|
3083
|
+
}>>;
|
|
3084
|
+
status: z.ZodOptional<z.ZodString>;
|
|
3085
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3086
|
+
title: z.ZodOptional<z.ZodString>;
|
|
3087
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3088
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3089
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
3090
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
3091
|
+
}, "strip", z.ZodTypeAny, {
|
|
3092
|
+
pointer?: string | undefined;
|
|
3093
|
+
parameter?: string | undefined;
|
|
3094
|
+
}, {
|
|
3095
|
+
pointer?: string | undefined;
|
|
3096
|
+
parameter?: string | undefined;
|
|
3097
|
+
}>>;
|
|
3098
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3099
|
+
}, "strip", z.ZodTypeAny, {
|
|
3100
|
+
status?: string | undefined;
|
|
3101
|
+
code?: string | undefined;
|
|
3102
|
+
id?: string | undefined;
|
|
3103
|
+
links?: {
|
|
3104
|
+
about?: string | undefined;
|
|
3105
|
+
} | undefined;
|
|
3106
|
+
meta?: Record<string, unknown> | undefined;
|
|
3107
|
+
title?: string | undefined;
|
|
3108
|
+
detail?: string | undefined;
|
|
3109
|
+
source?: {
|
|
3110
|
+
pointer?: string | undefined;
|
|
3111
|
+
parameter?: string | undefined;
|
|
3112
|
+
} | undefined;
|
|
3113
|
+
}, {
|
|
3114
|
+
status?: string | undefined;
|
|
3115
|
+
code?: string | undefined;
|
|
3116
|
+
id?: string | undefined;
|
|
3117
|
+
links?: {
|
|
3118
|
+
about?: string | undefined;
|
|
3119
|
+
} | undefined;
|
|
3120
|
+
meta?: Record<string, unknown> | undefined;
|
|
3121
|
+
title?: string | undefined;
|
|
3122
|
+
detail?: string | undefined;
|
|
3123
|
+
source?: {
|
|
3124
|
+
pointer?: string | undefined;
|
|
3125
|
+
parameter?: string | undefined;
|
|
3126
|
+
} | undefined;
|
|
3127
|
+
}>, "many">;
|
|
3128
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3129
|
+
}, "strip", z.ZodTypeAny, {
|
|
3130
|
+
errors: {
|
|
3131
|
+
status?: string | undefined;
|
|
3132
|
+
code?: string | undefined;
|
|
3133
|
+
id?: string | undefined;
|
|
3134
|
+
links?: {
|
|
3135
|
+
about?: string | undefined;
|
|
3136
|
+
} | undefined;
|
|
3137
|
+
meta?: Record<string, unknown> | undefined;
|
|
3138
|
+
title?: string | undefined;
|
|
3139
|
+
detail?: string | undefined;
|
|
3140
|
+
source?: {
|
|
3141
|
+
pointer?: string | undefined;
|
|
3142
|
+
parameter?: string | undefined;
|
|
3143
|
+
} | undefined;
|
|
3144
|
+
}[];
|
|
3145
|
+
meta?: Record<string, unknown> | undefined;
|
|
3146
|
+
}, {
|
|
3147
|
+
errors: {
|
|
3148
|
+
status?: string | undefined;
|
|
3149
|
+
code?: string | undefined;
|
|
3150
|
+
id?: string | undefined;
|
|
3151
|
+
links?: {
|
|
3152
|
+
about?: string | undefined;
|
|
3153
|
+
} | undefined;
|
|
3154
|
+
meta?: Record<string, unknown> | undefined;
|
|
3155
|
+
title?: string | undefined;
|
|
3156
|
+
detail?: string | undefined;
|
|
3157
|
+
source?: {
|
|
3158
|
+
pointer?: string | undefined;
|
|
3159
|
+
parameter?: string | undefined;
|
|
3160
|
+
} | undefined;
|
|
3161
|
+
}[];
|
|
3162
|
+
meta?: Record<string, unknown> | undefined;
|
|
3163
|
+
}>;
|
|
3164
|
+
404: z.ZodObject<{
|
|
3165
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
3166
|
+
id: z.ZodOptional<z.ZodString>;
|
|
3167
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
3168
|
+
about: z.ZodOptional<z.ZodString>;
|
|
3169
|
+
}, "strip", z.ZodTypeAny, {
|
|
3170
|
+
about?: string | undefined;
|
|
3171
|
+
}, {
|
|
3172
|
+
about?: string | undefined;
|
|
3173
|
+
}>>;
|
|
3174
|
+
status: z.ZodOptional<z.ZodString>;
|
|
3175
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3176
|
+
title: z.ZodOptional<z.ZodString>;
|
|
3177
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3178
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3179
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
3180
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
3181
|
+
}, "strip", z.ZodTypeAny, {
|
|
3182
|
+
pointer?: string | undefined;
|
|
3183
|
+
parameter?: string | undefined;
|
|
3184
|
+
}, {
|
|
3185
|
+
pointer?: string | undefined;
|
|
3186
|
+
parameter?: string | undefined;
|
|
3187
|
+
}>>;
|
|
3188
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3189
|
+
}, "strip", z.ZodTypeAny, {
|
|
3190
|
+
status?: string | undefined;
|
|
3191
|
+
code?: string | undefined;
|
|
3192
|
+
id?: string | undefined;
|
|
3193
|
+
links?: {
|
|
3194
|
+
about?: string | undefined;
|
|
3195
|
+
} | undefined;
|
|
3196
|
+
meta?: Record<string, unknown> | undefined;
|
|
3197
|
+
title?: string | undefined;
|
|
3198
|
+
detail?: string | undefined;
|
|
3199
|
+
source?: {
|
|
3200
|
+
pointer?: string | undefined;
|
|
3201
|
+
parameter?: string | undefined;
|
|
3202
|
+
} | undefined;
|
|
3203
|
+
}, {
|
|
3204
|
+
status?: string | undefined;
|
|
3205
|
+
code?: string | undefined;
|
|
3206
|
+
id?: string | undefined;
|
|
3207
|
+
links?: {
|
|
3208
|
+
about?: string | undefined;
|
|
3209
|
+
} | undefined;
|
|
3210
|
+
meta?: Record<string, unknown> | undefined;
|
|
3211
|
+
title?: string | undefined;
|
|
3212
|
+
detail?: string | undefined;
|
|
3213
|
+
source?: {
|
|
3214
|
+
pointer?: string | undefined;
|
|
3215
|
+
parameter?: string | undefined;
|
|
3216
|
+
} | undefined;
|
|
3217
|
+
}>, "many">;
|
|
3218
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3219
|
+
}, "strip", z.ZodTypeAny, {
|
|
3220
|
+
errors: {
|
|
3221
|
+
status?: string | undefined;
|
|
3222
|
+
code?: string | undefined;
|
|
3223
|
+
id?: string | undefined;
|
|
3224
|
+
links?: {
|
|
3225
|
+
about?: string | undefined;
|
|
3226
|
+
} | undefined;
|
|
3227
|
+
meta?: Record<string, unknown> | undefined;
|
|
3228
|
+
title?: string | undefined;
|
|
3229
|
+
detail?: string | undefined;
|
|
3230
|
+
source?: {
|
|
3231
|
+
pointer?: string | undefined;
|
|
3232
|
+
parameter?: string | undefined;
|
|
3233
|
+
} | undefined;
|
|
3234
|
+
}[];
|
|
3235
|
+
meta?: Record<string, unknown> | undefined;
|
|
3236
|
+
}, {
|
|
3237
|
+
errors: {
|
|
3238
|
+
status?: string | undefined;
|
|
3239
|
+
code?: string | undefined;
|
|
3240
|
+
id?: string | undefined;
|
|
3241
|
+
links?: {
|
|
3242
|
+
about?: string | undefined;
|
|
3243
|
+
} | undefined;
|
|
3244
|
+
meta?: Record<string, unknown> | undefined;
|
|
3245
|
+
title?: string | undefined;
|
|
3246
|
+
detail?: string | undefined;
|
|
3247
|
+
source?: {
|
|
3248
|
+
pointer?: string | undefined;
|
|
3249
|
+
parameter?: string | undefined;
|
|
3250
|
+
} | undefined;
|
|
3251
|
+
}[];
|
|
3252
|
+
meta?: Record<string, unknown> | undefined;
|
|
3253
|
+
}>;
|
|
3254
|
+
401: z.ZodObject<{
|
|
3255
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
3256
|
+
id: z.ZodOptional<z.ZodString>;
|
|
3257
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
3258
|
+
about: z.ZodOptional<z.ZodString>;
|
|
3259
|
+
}, "strip", z.ZodTypeAny, {
|
|
3260
|
+
about?: string | undefined;
|
|
3261
|
+
}, {
|
|
3262
|
+
about?: string | undefined;
|
|
3263
|
+
}>>;
|
|
3264
|
+
status: z.ZodOptional<z.ZodString>;
|
|
3265
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3266
|
+
title: z.ZodOptional<z.ZodString>;
|
|
3267
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3268
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3269
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
3270
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
3271
|
+
}, "strip", z.ZodTypeAny, {
|
|
3272
|
+
pointer?: string | undefined;
|
|
3273
|
+
parameter?: string | undefined;
|
|
3274
|
+
}, {
|
|
3275
|
+
pointer?: string | undefined;
|
|
3276
|
+
parameter?: string | undefined;
|
|
3277
|
+
}>>;
|
|
3278
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3279
|
+
}, "strip", z.ZodTypeAny, {
|
|
3280
|
+
status?: string | undefined;
|
|
3281
|
+
code?: string | undefined;
|
|
3282
|
+
id?: string | undefined;
|
|
3283
|
+
links?: {
|
|
3284
|
+
about?: string | undefined;
|
|
3285
|
+
} | undefined;
|
|
3286
|
+
meta?: Record<string, unknown> | undefined;
|
|
3287
|
+
title?: string | undefined;
|
|
3288
|
+
detail?: string | undefined;
|
|
3289
|
+
source?: {
|
|
3290
|
+
pointer?: string | undefined;
|
|
3291
|
+
parameter?: string | undefined;
|
|
3292
|
+
} | undefined;
|
|
3293
|
+
}, {
|
|
3294
|
+
status?: string | undefined;
|
|
3295
|
+
code?: string | undefined;
|
|
3296
|
+
id?: string | undefined;
|
|
3297
|
+
links?: {
|
|
3298
|
+
about?: string | undefined;
|
|
3299
|
+
} | undefined;
|
|
3300
|
+
meta?: Record<string, unknown> | undefined;
|
|
3301
|
+
title?: string | undefined;
|
|
3302
|
+
detail?: string | undefined;
|
|
3303
|
+
source?: {
|
|
3304
|
+
pointer?: string | undefined;
|
|
3305
|
+
parameter?: string | undefined;
|
|
3306
|
+
} | undefined;
|
|
3307
|
+
}>, "many">;
|
|
3308
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3309
|
+
}, "strip", z.ZodTypeAny, {
|
|
3310
|
+
errors: {
|
|
3311
|
+
status?: string | undefined;
|
|
3312
|
+
code?: string | undefined;
|
|
3313
|
+
id?: string | undefined;
|
|
3314
|
+
links?: {
|
|
3315
|
+
about?: string | undefined;
|
|
3316
|
+
} | undefined;
|
|
3317
|
+
meta?: Record<string, unknown> | undefined;
|
|
3318
|
+
title?: string | undefined;
|
|
3319
|
+
detail?: string | undefined;
|
|
3320
|
+
source?: {
|
|
3321
|
+
pointer?: string | undefined;
|
|
3322
|
+
parameter?: string | undefined;
|
|
3323
|
+
} | undefined;
|
|
3324
|
+
}[];
|
|
3325
|
+
meta?: Record<string, unknown> | undefined;
|
|
3326
|
+
}, {
|
|
3327
|
+
errors: {
|
|
3328
|
+
status?: string | undefined;
|
|
3329
|
+
code?: string | undefined;
|
|
3330
|
+
id?: string | undefined;
|
|
3331
|
+
links?: {
|
|
3332
|
+
about?: string | undefined;
|
|
3333
|
+
} | undefined;
|
|
3334
|
+
meta?: Record<string, unknown> | undefined;
|
|
3335
|
+
title?: string | undefined;
|
|
3336
|
+
detail?: string | undefined;
|
|
3337
|
+
source?: {
|
|
3338
|
+
pointer?: string | undefined;
|
|
3339
|
+
parameter?: string | undefined;
|
|
3340
|
+
} | undefined;
|
|
3341
|
+
}[];
|
|
3342
|
+
meta?: Record<string, unknown> | undefined;
|
|
3343
|
+
}>;
|
|
3344
|
+
422: z.ZodObject<{
|
|
3345
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
3346
|
+
id: z.ZodOptional<z.ZodString>;
|
|
3347
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
3348
|
+
about: z.ZodOptional<z.ZodString>;
|
|
3349
|
+
}, "strip", z.ZodTypeAny, {
|
|
3350
|
+
about?: string | undefined;
|
|
3351
|
+
}, {
|
|
3352
|
+
about?: string | undefined;
|
|
3353
|
+
}>>;
|
|
3354
|
+
status: z.ZodOptional<z.ZodString>;
|
|
3355
|
+
code: z.ZodOptional<z.ZodString>;
|
|
3356
|
+
title: z.ZodOptional<z.ZodString>;
|
|
3357
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
3358
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3359
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
3360
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
3361
|
+
}, "strip", z.ZodTypeAny, {
|
|
3362
|
+
pointer?: string | undefined;
|
|
3363
|
+
parameter?: string | undefined;
|
|
3364
|
+
}, {
|
|
3365
|
+
pointer?: string | undefined;
|
|
3366
|
+
parameter?: string | undefined;
|
|
3367
|
+
}>>;
|
|
3368
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3369
|
+
}, "strip", z.ZodTypeAny, {
|
|
3370
|
+
status?: string | undefined;
|
|
3371
|
+
code?: string | undefined;
|
|
3372
|
+
id?: string | undefined;
|
|
3373
|
+
links?: {
|
|
3374
|
+
about?: string | undefined;
|
|
3375
|
+
} | undefined;
|
|
3376
|
+
meta?: Record<string, unknown> | undefined;
|
|
3377
|
+
title?: string | undefined;
|
|
3378
|
+
detail?: string | undefined;
|
|
3379
|
+
source?: {
|
|
3380
|
+
pointer?: string | undefined;
|
|
3381
|
+
parameter?: string | undefined;
|
|
3382
|
+
} | undefined;
|
|
3383
|
+
}, {
|
|
3384
|
+
status?: string | undefined;
|
|
3385
|
+
code?: string | undefined;
|
|
3386
|
+
id?: string | undefined;
|
|
3387
|
+
links?: {
|
|
3388
|
+
about?: string | undefined;
|
|
3389
|
+
} | undefined;
|
|
3390
|
+
meta?: Record<string, unknown> | undefined;
|
|
3391
|
+
title?: string | undefined;
|
|
3392
|
+
detail?: string | undefined;
|
|
3393
|
+
source?: {
|
|
3394
|
+
pointer?: string | undefined;
|
|
3395
|
+
parameter?: string | undefined;
|
|
3396
|
+
} | undefined;
|
|
3397
|
+
}>, "many">;
|
|
3398
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3399
|
+
}, "strip", z.ZodTypeAny, {
|
|
3400
|
+
errors: {
|
|
3401
|
+
status?: string | undefined;
|
|
3402
|
+
code?: string | undefined;
|
|
3403
|
+
id?: string | undefined;
|
|
3404
|
+
links?: {
|
|
3405
|
+
about?: string | undefined;
|
|
3406
|
+
} | undefined;
|
|
3407
|
+
meta?: Record<string, unknown> | undefined;
|
|
3408
|
+
title?: string | undefined;
|
|
3409
|
+
detail?: string | undefined;
|
|
3410
|
+
source?: {
|
|
3411
|
+
pointer?: string | undefined;
|
|
3412
|
+
parameter?: string | undefined;
|
|
3413
|
+
} | undefined;
|
|
3414
|
+
}[];
|
|
3415
|
+
meta?: Record<string, unknown> | undefined;
|
|
3416
|
+
}, {
|
|
3417
|
+
errors: {
|
|
3418
|
+
status?: string | undefined;
|
|
3419
|
+
code?: string | undefined;
|
|
3420
|
+
id?: string | undefined;
|
|
3421
|
+
links?: {
|
|
3422
|
+
about?: string | undefined;
|
|
3423
|
+
} | undefined;
|
|
3424
|
+
meta?: Record<string, unknown> | undefined;
|
|
3425
|
+
title?: string | undefined;
|
|
3426
|
+
detail?: string | undefined;
|
|
3427
|
+
source?: {
|
|
3428
|
+
pointer?: string | undefined;
|
|
3429
|
+
parameter?: string | undefined;
|
|
3430
|
+
} | undefined;
|
|
3431
|
+
}[];
|
|
3432
|
+
meta?: Record<string, unknown> | undefined;
|
|
3433
|
+
}>;
|
|
3434
|
+
};
|
|
3435
|
+
};
|
|
2852
3436
|
};
|
|
2853
3437
|
//# sourceMappingURL=inventory.routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.routes.d.ts","sourceRoot":"","sources":["../../src/routes/inventory.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"inventory.routes.d.ts","sourceRoot":"","sources":["../../src/routes/inventory.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoJ1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { logPurchaseSchema, createInventoryItemSchema, updateInventoryItemSchema, inventoryItemResponseSchema, inventoryItemDetailResponseSchema, inventoryItemListResponseSchema, } from '../schemas/inventory.schemas';
|
|
3
|
+
import { logPurchaseSchema, logIssueSchema, createInventoryItemSchema, updateInventoryItemSchema, inventoryItemResponseSchema, inventoryItemDetailResponseSchema, inventoryItemListResponseSchema, } from '../schemas/inventory.schemas';
|
|
4
4
|
import { jsonApiErrorResponseSchema, jsonApiSuccessResponseSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, jsonApiIncludeQuerySchema, jsonApiSingleResponseSchema } from '../schemas/common.schemas';
|
|
5
5
|
const c = initContract();
|
|
6
6
|
export const inventoryRouter = c.router({
|
|
@@ -115,4 +115,29 @@ export const inventoryRouter = c.router({
|
|
|
115
115
|
summary: 'Log purchase',
|
|
116
116
|
description: 'Log a purchase that updates inventory and creates an expense',
|
|
117
117
|
},
|
|
118
|
+
// Issue stock (debits inventory; optional flock/field expense for P&L)
|
|
119
|
+
logIssue: {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
path: '/farms/:farmId/inventory/issue',
|
|
122
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
123
|
+
body: z.object({ data: logIssueSchema }),
|
|
124
|
+
responses: {
|
|
125
|
+
201: jsonApiSingleResponseSchema(z.object({
|
|
126
|
+
type: z.literal('issue-results'),
|
|
127
|
+
id: z.string().uuid(),
|
|
128
|
+
attributes: z.object({
|
|
129
|
+
inventoryItemId: z.string().uuid(),
|
|
130
|
+
transactionId: z.string().uuid(),
|
|
131
|
+
expenseId: z.string().uuid().optional(),
|
|
132
|
+
totalCost: z.number().nonnegative(),
|
|
133
|
+
}),
|
|
134
|
+
})),
|
|
135
|
+
400: jsonApiErrorResponseSchema,
|
|
136
|
+
404: jsonApiErrorResponseSchema,
|
|
137
|
+
401: jsonApiErrorResponseSchema,
|
|
138
|
+
422: jsonApiErrorResponseSchema,
|
|
139
|
+
},
|
|
140
|
+
summary: 'Issue stock',
|
|
141
|
+
description: 'Debit inventory stock and optionally post a flock/field-allocated expense from avgCost',
|
|
142
|
+
},
|
|
118
143
|
});
|