@deepintel-ltd/farmpro-contracts 1.0.3 → 1.0.4

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.
@@ -0,0 +1,471 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Category schemas - JSON:API compliant
4
+ */
5
+ export declare const categoryTypeSchema: z.ZodEnum<["task", "budget", "expense"]>;
6
+ export declare const categoryAttributesSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ type: z.ZodEnum<["task", "budget", "expense"]>;
9
+ farmId: z.ZodNullable<z.ZodString>;
10
+ isDefault: z.ZodBoolean;
11
+ } & {
12
+ createdAt: z.ZodString;
13
+ updatedAt: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ type: "expense" | "task" | "budget";
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ name: string;
19
+ farmId: string | null;
20
+ isDefault: boolean;
21
+ }, {
22
+ type: "expense" | "task" | "budget";
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ name: string;
26
+ farmId: string | null;
27
+ isDefault: boolean;
28
+ }>;
29
+ export declare const createCategoryAttributesSchema: z.ZodObject<{
30
+ name: z.ZodString;
31
+ type: z.ZodEnum<["task", "budget", "expense"]>;
32
+ farmId: z.ZodOptional<z.ZodString>;
33
+ isDefault: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "expense" | "task" | "budget";
36
+ name: string;
37
+ isDefault: boolean;
38
+ farmId?: string | undefined;
39
+ }, {
40
+ type: "expense" | "task" | "budget";
41
+ name: string;
42
+ farmId?: string | undefined;
43
+ isDefault?: boolean | undefined;
44
+ }>;
45
+ export declare const updateCategoryAttributesSchema: z.ZodObject<{
46
+ name: z.ZodOptional<z.ZodString>;
47
+ isDefault: z.ZodOptional<z.ZodBoolean>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ name?: string | undefined;
50
+ isDefault?: boolean | undefined;
51
+ }, {
52
+ name?: string | undefined;
53
+ isDefault?: boolean | undefined;
54
+ }>;
55
+ export declare const createCategorySchema: z.ZodObject<{
56
+ type: z.ZodLiteral<"categories">;
57
+ attributes: z.ZodObject<{
58
+ name: z.ZodString;
59
+ type: z.ZodEnum<["task", "budget", "expense"]>;
60
+ farmId: z.ZodOptional<z.ZodString>;
61
+ isDefault: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ type: "expense" | "task" | "budget";
64
+ name: string;
65
+ isDefault: boolean;
66
+ farmId?: string | undefined;
67
+ }, {
68
+ type: "expense" | "task" | "budget";
69
+ name: string;
70
+ farmId?: string | undefined;
71
+ isDefault?: boolean | undefined;
72
+ }>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ type: "categories";
75
+ attributes: {
76
+ type: "expense" | "task" | "budget";
77
+ name: string;
78
+ isDefault: boolean;
79
+ farmId?: string | undefined;
80
+ };
81
+ }, {
82
+ type: "categories";
83
+ attributes: {
84
+ type: "expense" | "task" | "budget";
85
+ name: string;
86
+ farmId?: string | undefined;
87
+ isDefault?: boolean | undefined;
88
+ };
89
+ }>;
90
+ export declare const updateCategorySchema: z.ZodObject<{
91
+ type: z.ZodLiteral<"categories">;
92
+ id: z.ZodString;
93
+ attributes: z.ZodObject<{
94
+ name: z.ZodOptional<z.ZodString>;
95
+ isDefault: z.ZodOptional<z.ZodBoolean>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ name?: string | undefined;
98
+ isDefault?: boolean | undefined;
99
+ }, {
100
+ name?: string | undefined;
101
+ isDefault?: boolean | undefined;
102
+ }>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ type: "categories";
105
+ id: string;
106
+ attributes: {
107
+ name?: string | undefined;
108
+ isDefault?: boolean | undefined;
109
+ };
110
+ }, {
111
+ type: "categories";
112
+ id: string;
113
+ attributes: {
114
+ name?: string | undefined;
115
+ isDefault?: boolean | undefined;
116
+ };
117
+ }>;
118
+ export declare const categoryResourceSchema: z.ZodObject<{
119
+ type: z.ZodLiteral<string>;
120
+ id: z.ZodString;
121
+ attributes: z.ZodObject<{
122
+ name: z.ZodString;
123
+ type: z.ZodEnum<["task", "budget", "expense"]>;
124
+ farmId: z.ZodNullable<z.ZodString>;
125
+ isDefault: z.ZodBoolean;
126
+ } & {
127
+ createdAt: z.ZodString;
128
+ updatedAt: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ type: "expense" | "task" | "budget";
131
+ createdAt: string;
132
+ updatedAt: string;
133
+ name: string;
134
+ farmId: string | null;
135
+ isDefault: boolean;
136
+ }, {
137
+ type: "expense" | "task" | "budget";
138
+ createdAt: string;
139
+ updatedAt: string;
140
+ name: string;
141
+ farmId: string | null;
142
+ isDefault: boolean;
143
+ }>;
144
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
146
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ type: string;
149
+ id: string;
150
+ attributes: {
151
+ type: "expense" | "task" | "budget";
152
+ createdAt: string;
153
+ updatedAt: string;
154
+ name: string;
155
+ farmId: string | null;
156
+ isDefault: boolean;
157
+ };
158
+ relationships?: Record<string, unknown> | undefined;
159
+ links?: Record<string, string> | undefined;
160
+ meta?: Record<string, unknown> | undefined;
161
+ }, {
162
+ type: string;
163
+ id: string;
164
+ attributes: {
165
+ type: "expense" | "task" | "budget";
166
+ createdAt: string;
167
+ updatedAt: string;
168
+ name: string;
169
+ farmId: string | null;
170
+ isDefault: boolean;
171
+ };
172
+ relationships?: Record<string, unknown> | undefined;
173
+ links?: Record<string, string> | undefined;
174
+ meta?: Record<string, unknown> | undefined;
175
+ }>;
176
+ export declare const categoryResponseSchema: z.ZodObject<{
177
+ data: z.ZodObject<{
178
+ type: z.ZodLiteral<string>;
179
+ id: z.ZodString;
180
+ attributes: z.ZodObject<{
181
+ name: z.ZodString;
182
+ type: z.ZodEnum<["task", "budget", "expense"]>;
183
+ farmId: z.ZodNullable<z.ZodString>;
184
+ isDefault: z.ZodBoolean;
185
+ } & {
186
+ createdAt: z.ZodString;
187
+ updatedAt: z.ZodString;
188
+ }, "strip", z.ZodTypeAny, {
189
+ type: "expense" | "task" | "budget";
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ name: string;
193
+ farmId: string | null;
194
+ isDefault: boolean;
195
+ }, {
196
+ type: "expense" | "task" | "budget";
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ name: string;
200
+ farmId: string | null;
201
+ isDefault: boolean;
202
+ }>;
203
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
204
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
205
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ type: string;
208
+ id: string;
209
+ attributes: {
210
+ type: "expense" | "task" | "budget";
211
+ createdAt: string;
212
+ updatedAt: string;
213
+ name: string;
214
+ farmId: string | null;
215
+ isDefault: boolean;
216
+ };
217
+ relationships?: Record<string, unknown> | undefined;
218
+ links?: Record<string, string> | undefined;
219
+ meta?: Record<string, unknown> | undefined;
220
+ }, {
221
+ type: string;
222
+ id: string;
223
+ attributes: {
224
+ type: "expense" | "task" | "budget";
225
+ createdAt: string;
226
+ updatedAt: string;
227
+ name: string;
228
+ farmId: string | null;
229
+ isDefault: boolean;
230
+ };
231
+ relationships?: Record<string, unknown> | undefined;
232
+ links?: Record<string, string> | undefined;
233
+ meta?: Record<string, unknown> | undefined;
234
+ }>;
235
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ type: z.ZodString;
237
+ id: z.ZodString;
238
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
240
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
241
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ type: string;
244
+ id: string;
245
+ attributes?: Record<string, unknown> | undefined;
246
+ relationships?: Record<string, unknown> | undefined;
247
+ links?: Record<string, string> | undefined;
248
+ meta?: Record<string, unknown> | undefined;
249
+ }, {
250
+ type: string;
251
+ id: string;
252
+ attributes?: Record<string, unknown> | undefined;
253
+ relationships?: Record<string, unknown> | undefined;
254
+ links?: Record<string, string> | undefined;
255
+ meta?: Record<string, unknown> | undefined;
256
+ }>, "many">>;
257
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
258
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
259
+ }, "strip", z.ZodTypeAny, {
260
+ data: {
261
+ type: string;
262
+ id: string;
263
+ attributes: {
264
+ type: "expense" | "task" | "budget";
265
+ createdAt: string;
266
+ updatedAt: string;
267
+ name: string;
268
+ farmId: string | null;
269
+ isDefault: boolean;
270
+ };
271
+ relationships?: Record<string, unknown> | undefined;
272
+ links?: Record<string, string> | undefined;
273
+ meta?: Record<string, unknown> | undefined;
274
+ };
275
+ links?: Record<string, string> | undefined;
276
+ meta?: Record<string, unknown> | undefined;
277
+ included?: {
278
+ type: string;
279
+ id: string;
280
+ attributes?: Record<string, unknown> | undefined;
281
+ relationships?: Record<string, unknown> | undefined;
282
+ links?: Record<string, string> | undefined;
283
+ meta?: Record<string, unknown> | undefined;
284
+ }[] | undefined;
285
+ }, {
286
+ data: {
287
+ type: string;
288
+ id: string;
289
+ attributes: {
290
+ type: "expense" | "task" | "budget";
291
+ createdAt: string;
292
+ updatedAt: string;
293
+ name: string;
294
+ farmId: string | null;
295
+ isDefault: boolean;
296
+ };
297
+ relationships?: Record<string, unknown> | undefined;
298
+ links?: Record<string, string> | undefined;
299
+ meta?: Record<string, unknown> | undefined;
300
+ };
301
+ links?: Record<string, string> | undefined;
302
+ meta?: Record<string, unknown> | undefined;
303
+ included?: {
304
+ type: string;
305
+ id: string;
306
+ attributes?: Record<string, unknown> | undefined;
307
+ relationships?: Record<string, unknown> | undefined;
308
+ links?: Record<string, string> | undefined;
309
+ meta?: Record<string, unknown> | undefined;
310
+ }[] | undefined;
311
+ }>;
312
+ export declare const categoryListResponseSchema: z.ZodObject<{
313
+ data: z.ZodArray<z.ZodObject<{
314
+ type: z.ZodLiteral<string>;
315
+ id: z.ZodString;
316
+ attributes: z.ZodObject<{
317
+ name: z.ZodString;
318
+ type: z.ZodEnum<["task", "budget", "expense"]>;
319
+ farmId: z.ZodNullable<z.ZodString>;
320
+ isDefault: z.ZodBoolean;
321
+ } & {
322
+ createdAt: z.ZodString;
323
+ updatedAt: z.ZodString;
324
+ }, "strip", z.ZodTypeAny, {
325
+ type: "expense" | "task" | "budget";
326
+ createdAt: string;
327
+ updatedAt: string;
328
+ name: string;
329
+ farmId: string | null;
330
+ isDefault: boolean;
331
+ }, {
332
+ type: "expense" | "task" | "budget";
333
+ createdAt: string;
334
+ updatedAt: string;
335
+ name: string;
336
+ farmId: string | null;
337
+ isDefault: boolean;
338
+ }>;
339
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
341
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ type: string;
344
+ id: string;
345
+ attributes: {
346
+ type: "expense" | "task" | "budget";
347
+ createdAt: string;
348
+ updatedAt: string;
349
+ name: string;
350
+ farmId: string | null;
351
+ isDefault: boolean;
352
+ };
353
+ relationships?: Record<string, unknown> | undefined;
354
+ links?: Record<string, string> | undefined;
355
+ meta?: Record<string, unknown> | undefined;
356
+ }, {
357
+ type: string;
358
+ id: string;
359
+ attributes: {
360
+ type: "expense" | "task" | "budget";
361
+ createdAt: string;
362
+ updatedAt: string;
363
+ name: string;
364
+ farmId: string | null;
365
+ isDefault: boolean;
366
+ };
367
+ relationships?: Record<string, unknown> | undefined;
368
+ links?: Record<string, string> | undefined;
369
+ meta?: Record<string, unknown> | undefined;
370
+ }>, "many">;
371
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
372
+ type: z.ZodString;
373
+ id: z.ZodString;
374
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
375
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
376
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
377
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
378
+ }, "strip", z.ZodTypeAny, {
379
+ type: string;
380
+ id: string;
381
+ attributes?: Record<string, unknown> | undefined;
382
+ relationships?: Record<string, unknown> | undefined;
383
+ links?: Record<string, string> | undefined;
384
+ meta?: Record<string, unknown> | undefined;
385
+ }, {
386
+ type: string;
387
+ id: string;
388
+ attributes?: Record<string, unknown> | undefined;
389
+ relationships?: Record<string, unknown> | undefined;
390
+ links?: Record<string, string> | undefined;
391
+ meta?: Record<string, unknown> | undefined;
392
+ }>, "many">>;
393
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
394
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ data: {
397
+ type: string;
398
+ id: string;
399
+ attributes: {
400
+ type: "expense" | "task" | "budget";
401
+ createdAt: string;
402
+ updatedAt: string;
403
+ name: string;
404
+ farmId: string | null;
405
+ isDefault: boolean;
406
+ };
407
+ relationships?: Record<string, unknown> | undefined;
408
+ links?: Record<string, string> | undefined;
409
+ meta?: Record<string, unknown> | undefined;
410
+ }[];
411
+ links?: Record<string, string> | undefined;
412
+ meta?: Record<string, unknown> | undefined;
413
+ included?: {
414
+ type: string;
415
+ id: string;
416
+ attributes?: Record<string, unknown> | undefined;
417
+ relationships?: Record<string, unknown> | undefined;
418
+ links?: Record<string, string> | undefined;
419
+ meta?: Record<string, unknown> | undefined;
420
+ }[] | undefined;
421
+ }, {
422
+ data: {
423
+ type: string;
424
+ id: string;
425
+ attributes: {
426
+ type: "expense" | "task" | "budget";
427
+ createdAt: string;
428
+ updatedAt: string;
429
+ name: string;
430
+ farmId: string | null;
431
+ isDefault: boolean;
432
+ };
433
+ relationships?: Record<string, unknown> | undefined;
434
+ links?: Record<string, string> | undefined;
435
+ meta?: Record<string, unknown> | undefined;
436
+ }[];
437
+ links?: Record<string, string> | undefined;
438
+ meta?: Record<string, unknown> | undefined;
439
+ included?: {
440
+ type: string;
441
+ id: string;
442
+ attributes?: Record<string, unknown> | undefined;
443
+ relationships?: Record<string, unknown> | undefined;
444
+ links?: Record<string, string> | undefined;
445
+ meta?: Record<string, unknown> | undefined;
446
+ }[] | undefined;
447
+ }>;
448
+ export declare const getCategoriesQuerySchema: z.ZodObject<{
449
+ type: z.ZodOptional<z.ZodEnum<["task", "budget", "expense"]>>;
450
+ farmId: z.ZodOptional<z.ZodString>;
451
+ includeDefaults: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ includeDefaults: boolean;
454
+ type?: "expense" | "task" | "budget" | undefined;
455
+ farmId?: string | undefined;
456
+ }, {
457
+ type?: "expense" | "task" | "budget" | undefined;
458
+ farmId?: string | undefined;
459
+ includeDefaults?: boolean | undefined;
460
+ }>;
461
+ export type CategoryType = z.infer<typeof categoryTypeSchema>;
462
+ export type CreateCategoryAttributes = z.infer<typeof createCategoryAttributesSchema>;
463
+ export type UpdateCategoryAttributes = z.infer<typeof updateCategoryAttributesSchema>;
464
+ export type CreateCategoryInput = z.infer<typeof createCategorySchema>;
465
+ export type UpdateCategoryInput = z.infer<typeof updateCategorySchema>;
466
+ export type CategoryAttributes = z.infer<typeof categoryAttributesSchema>;
467
+ export type CategoryResource = z.infer<typeof categoryResourceSchema>;
468
+ export type CategoryResponse = z.infer<typeof categoryResponseSchema>;
469
+ export type CategoryListResponse = z.infer<typeof categoryListResponseSchema>;
470
+ export type GetCategoriesQuery = z.infer<typeof getCategoriesQuerySchema>;
471
+ //# sourceMappingURL=categories.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categories.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/categories.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,kBAAkB,0CAAwC,CAAC;AAGxE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;EAKX,CAAC;AAG3B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;EAKzC,CAAC;AAGH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG/B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/B,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsE,CAAC;AAG1G,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsD,CAAC;AAC1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0D,CAAC;AAGlG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAGH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCategoriesQuerySchema = exports.categoryListResponseSchema = exports.categoryResponseSchema = exports.categoryResourceSchema = exports.updateCategorySchema = exports.createCategorySchema = exports.updateCategoryAttributesSchema = exports.createCategoryAttributesSchema = exports.categoryAttributesSchema = exports.categoryTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_schemas_1 = require("./common.schemas");
6
+ /**
7
+ * Category schemas - JSON:API compliant
8
+ */
9
+ // Category type enum
10
+ exports.categoryTypeSchema = zod_1.z.enum(['task', 'budget', 'expense']);
11
+ // Category attributes schema (for JSON:API attributes object)
12
+ exports.categoryAttributesSchema = zod_1.z.object({
13
+ name: zod_1.z.string(),
14
+ type: exports.categoryTypeSchema,
15
+ farmId: zod_1.z.string().uuid().nullable(),
16
+ isDefault: zod_1.z.boolean(),
17
+ }).merge(common_schemas_1.timestampsSchema);
18
+ // Category attributes for creation (input)
19
+ exports.createCategoryAttributesSchema = zod_1.z.object({
20
+ name: zod_1.z.string().min(1).max(100),
21
+ type: exports.categoryTypeSchema,
22
+ farmId: zod_1.z.string().uuid().optional(), // Optional - if not provided, creates system default
23
+ isDefault: zod_1.z.boolean().optional().default(false),
24
+ });
25
+ // Category attributes for update (input)
26
+ exports.updateCategoryAttributesSchema = zod_1.z.object({
27
+ name: zod_1.z.string().min(1).max(100).optional(),
28
+ isDefault: zod_1.z.boolean().optional(),
29
+ });
30
+ // Create category input (JSON:API format)
31
+ exports.createCategorySchema = zod_1.z.object({
32
+ type: zod_1.z.literal('categories'),
33
+ attributes: exports.createCategoryAttributesSchema,
34
+ });
35
+ // Update category input (JSON:API format)
36
+ exports.updateCategorySchema = zod_1.z.object({
37
+ type: zod_1.z.literal('categories'),
38
+ id: zod_1.z.string().uuid(),
39
+ attributes: exports.updateCategoryAttributesSchema,
40
+ });
41
+ // Category resource (JSON:API resource object)
42
+ exports.categoryResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('categories', exports.categoryAttributesSchema);
43
+ // Category responses (JSON:API format)
44
+ exports.categoryResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.categoryResourceSchema);
45
+ exports.categoryListResponseSchema = (0, common_schemas_1.jsonApiCollectionResponseSchema)(exports.categoryResourceSchema);
46
+ // Get categories query parameters
47
+ exports.getCategoriesQuerySchema = zod_1.z.object({
48
+ type: exports.categoryTypeSchema.optional(),
49
+ farmId: zod_1.z.string().uuid().optional(),
50
+ includeDefaults: zod_1.z.boolean().optional().default(true),
51
+ });