@deepintel-ltd/farmpro-contracts 1.5.18 → 1.5.20

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 (33) hide show
  1. package/dist/index.d.ts +7 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -0
  4. package/dist/routes/agents.routes.d.ts +192 -18
  5. package/dist/routes/agents.routes.d.ts.map +1 -1
  6. package/dist/routes/index.d.ts +9 -0
  7. package/dist/routes/index.d.ts.map +1 -1
  8. package/dist/routes/index.js +6 -0
  9. package/dist/routes/invoices.routes.d.ts +3608 -0
  10. package/dist/routes/invoices.routes.d.ts.map +1 -0
  11. package/dist/routes/invoices.routes.js +98 -0
  12. package/dist/routes/organizations.routes.d.ts +1669 -0
  13. package/dist/routes/organizations.routes.d.ts.map +1 -0
  14. package/dist/routes/organizations.routes.js +63 -0
  15. package/dist/routes/subscriptions.routes.d.ts +232 -0
  16. package/dist/routes/subscriptions.routes.d.ts.map +1 -1
  17. package/dist/routes/subscriptions.routes.js +25 -2
  18. package/dist/routes/waybills.routes.d.ts +3225 -0
  19. package/dist/routes/waybills.routes.d.ts.map +1 -0
  20. package/dist/routes/waybills.routes.js +95 -0
  21. package/dist/schemas/agents.schemas.d.ts +760 -49
  22. package/dist/schemas/agents.schemas.d.ts.map +1 -1
  23. package/dist/schemas/agents.schemas.js +21 -1
  24. package/dist/schemas/invoices.schemas.d.ts +1533 -0
  25. package/dist/schemas/invoices.schemas.d.ts.map +1 -0
  26. package/dist/schemas/invoices.schemas.js +85 -0
  27. package/dist/schemas/organizations.schemas.d.ts +509 -0
  28. package/dist/schemas/organizations.schemas.d.ts.map +1 -0
  29. package/dist/schemas/organizations.schemas.js +39 -0
  30. package/dist/schemas/waybills.schemas.d.ts +1261 -0
  31. package/dist/schemas/waybills.schemas.d.ts.map +1 -0
  32. package/dist/schemas/waybills.schemas.js +70 -0
  33. package/package.json +1 -1
@@ -0,0 +1 @@
1
+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AAC,CAAC;AACpF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema } from './common.schemas';
3
+ /**
4
+ * Invoice schemas - JSON:API compliant
5
+ */
6
+ // Invoice item schema
7
+ export const invoiceItemSchema = z.object({
8
+ description: z.string().min(1).max(500),
9
+ quantity: z.number().positive(),
10
+ unitPrice: z.number().nonnegative(),
11
+ amount: z.number().nonnegative(),
12
+ taxRate: z.number().min(0).max(100).optional(),
13
+ });
14
+ // Invoice attributes schema
15
+ export const invoiceAttributesSchema = z.object({
16
+ invoiceNumber: z.string().min(1).max(100),
17
+ issueDate: z.string().datetime(),
18
+ dueDate: z.string().datetime().optional().nullable(),
19
+ billFromName: z.string().min(1).max(200),
20
+ billFromAddress: z.string().optional().nullable(),
21
+ billFromPhone: z.string().optional().nullable(),
22
+ billFromEmail: z.string().email().optional().nullable(),
23
+ billFromTaxId: z.string().optional().nullable(),
24
+ billToName: z.string().min(1).max(200),
25
+ billToAddress: z.string().optional().nullable(),
26
+ billToPhone: z.string().optional().nullable(),
27
+ billToEmail: z.string().email().optional().nullable(),
28
+ billToTaxId: z.string().optional().nullable(),
29
+ items: z.array(invoiceItemSchema).min(1),
30
+ subtotal: z.number().nonnegative(),
31
+ taxRate: z.number().min(0).max(100).optional().nullable(),
32
+ taxAmount: z.number().nonnegative().optional().nullable(),
33
+ discount: z.number().nonnegative().optional().nullable(),
34
+ total: z.number().nonnegative(),
35
+ currency: z.string().length(3).default('NGN'),
36
+ paymentTerms: z.string().optional().nullable(),
37
+ paymentStatus: z.enum(['pending', 'paid', 'overdue', 'cancelled']).default('pending'),
38
+ paidAt: z.string().datetime().optional().nullable(),
39
+ notes: z.string().optional().nullable(),
40
+ pdfUrl: z.string().url().optional().nullable(),
41
+ organizationId: z.string().uuid(),
42
+ createdAt: z.string().datetime(),
43
+ updatedAt: z.string().datetime(),
44
+ }).merge(timestampsSchema);
45
+ // Invoice attributes for creation (input)
46
+ export const createInvoiceAttributesSchema = z.object({
47
+ issueDate: z.string().datetime().optional(),
48
+ dueDate: z.string().datetime().optional(),
49
+ billFromName: z.string().min(1).max(200),
50
+ billFromAddress: z.string().optional(),
51
+ billFromPhone: z.string().optional(),
52
+ billFromEmail: z.string().email().optional(),
53
+ billFromTaxId: z.string().optional(),
54
+ billToName: z.string().min(1).max(200),
55
+ billToAddress: z.string().optional(),
56
+ billToPhone: z.string().optional(),
57
+ billToEmail: z.string().email().optional(),
58
+ billToTaxId: z.string().optional(),
59
+ items: z.array(invoiceItemSchema).min(1),
60
+ taxRate: z.number().min(0).max(100).optional(),
61
+ discount: z.number().nonnegative().optional(),
62
+ currency: z.string().length(3).default('NGN'),
63
+ paymentTerms: z.string().optional(),
64
+ notes: z.string().optional(),
65
+ });
66
+ // Invoice attributes for update (input)
67
+ export const updateInvoiceAttributesSchema = createInvoiceAttributesSchema.partial().extend({
68
+ paymentStatus: z.enum(['pending', 'paid', 'overdue', 'cancelled']).optional(),
69
+ });
70
+ // Create invoice input (JSON:API format)
71
+ export const createInvoiceSchema = z.object({
72
+ type: z.literal('invoices'),
73
+ attributes: createInvoiceAttributesSchema,
74
+ });
75
+ // Update invoice input (JSON:API format)
76
+ export const updateInvoiceSchema = z.object({
77
+ type: z.literal('invoices'),
78
+ id: z.string().uuid(),
79
+ attributes: updateInvoiceAttributesSchema,
80
+ });
81
+ // Invoice resource (JSON:API resource object)
82
+ export const invoiceResourceSchema = createJsonApiResourceSchema('invoices', invoiceAttributesSchema);
83
+ // Invoice responses (JSON:API format)
84
+ export const invoiceResponseSchema = jsonApiSingleResponseSchema(invoiceResourceSchema);
85
+ export const invoiceListResponseSchema = jsonApiCollectionResponseSchema(invoiceResourceSchema);
@@ -0,0 +1,509 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Organization schemas - JSON:API compliant
4
+ */
5
+ export declare const organizationAttributesSchema: z.ZodObject<{
6
+ name: z.ZodString;
7
+ email: z.ZodNullable<z.ZodString>;
8
+ phone: z.ZodNullable<z.ZodString>;
9
+ address: z.ZodNullable<z.ZodString>;
10
+ logo: z.ZodNullable<z.ZodString>;
11
+ } & {
12
+ createdAt: z.ZodString;
13
+ updatedAt: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ email: string | null;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ name: string;
19
+ phone: string | null;
20
+ address: string | null;
21
+ logo: string | null;
22
+ }, {
23
+ email: string | null;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ name: string;
27
+ phone: string | null;
28
+ address: string | null;
29
+ logo: string | null;
30
+ }>;
31
+ export declare const createOrganizationAttributesSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ email: z.ZodOptional<z.ZodString>;
34
+ phone: z.ZodOptional<z.ZodString>;
35
+ address: z.ZodOptional<z.ZodString>;
36
+ logo: z.ZodOptional<z.ZodString>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ name: string;
39
+ email?: string | undefined;
40
+ phone?: string | undefined;
41
+ address?: string | undefined;
42
+ logo?: string | undefined;
43
+ }, {
44
+ name: string;
45
+ email?: string | undefined;
46
+ phone?: string | undefined;
47
+ address?: string | undefined;
48
+ logo?: string | undefined;
49
+ }>;
50
+ export declare const updateOrganizationAttributesSchema: z.ZodObject<{
51
+ name: z.ZodOptional<z.ZodString>;
52
+ email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
53
+ phone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
54
+ address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ email?: string | undefined;
58
+ name?: string | undefined;
59
+ phone?: string | undefined;
60
+ address?: string | undefined;
61
+ logo?: string | undefined;
62
+ }, {
63
+ email?: string | undefined;
64
+ name?: string | undefined;
65
+ phone?: string | undefined;
66
+ address?: string | undefined;
67
+ logo?: string | undefined;
68
+ }>;
69
+ export declare const createOrganizationSchema: z.ZodObject<{
70
+ type: z.ZodLiteral<"organizations">;
71
+ attributes: z.ZodObject<{
72
+ name: z.ZodString;
73
+ email: z.ZodOptional<z.ZodString>;
74
+ phone: z.ZodOptional<z.ZodString>;
75
+ address: z.ZodOptional<z.ZodString>;
76
+ logo: z.ZodOptional<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ name: string;
79
+ email?: string | undefined;
80
+ phone?: string | undefined;
81
+ address?: string | undefined;
82
+ logo?: string | undefined;
83
+ }, {
84
+ name: string;
85
+ email?: string | undefined;
86
+ phone?: string | undefined;
87
+ address?: string | undefined;
88
+ logo?: string | undefined;
89
+ }>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "organizations";
92
+ attributes: {
93
+ name: string;
94
+ email?: string | undefined;
95
+ phone?: string | undefined;
96
+ address?: string | undefined;
97
+ logo?: string | undefined;
98
+ };
99
+ }, {
100
+ type: "organizations";
101
+ attributes: {
102
+ name: string;
103
+ email?: string | undefined;
104
+ phone?: string | undefined;
105
+ address?: string | undefined;
106
+ logo?: string | undefined;
107
+ };
108
+ }>;
109
+ export declare const updateOrganizationSchema: z.ZodObject<{
110
+ type: z.ZodLiteral<"organizations">;
111
+ id: z.ZodString;
112
+ attributes: z.ZodObject<{
113
+ name: z.ZodOptional<z.ZodString>;
114
+ email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
115
+ phone: z.ZodOptional<z.ZodOptional<z.ZodString>>;
116
+ address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
117
+ logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ email?: string | undefined;
120
+ name?: string | undefined;
121
+ phone?: string | undefined;
122
+ address?: string | undefined;
123
+ logo?: string | undefined;
124
+ }, {
125
+ email?: string | undefined;
126
+ name?: string | undefined;
127
+ phone?: string | undefined;
128
+ address?: string | undefined;
129
+ logo?: string | undefined;
130
+ }>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ type: "organizations";
133
+ id: string;
134
+ attributes: {
135
+ email?: string | undefined;
136
+ name?: string | undefined;
137
+ phone?: string | undefined;
138
+ address?: string | undefined;
139
+ logo?: string | undefined;
140
+ };
141
+ }, {
142
+ type: "organizations";
143
+ id: string;
144
+ attributes: {
145
+ email?: string | undefined;
146
+ name?: string | undefined;
147
+ phone?: string | undefined;
148
+ address?: string | undefined;
149
+ logo?: string | undefined;
150
+ };
151
+ }>;
152
+ export declare const organizationResourceSchema: z.ZodObject<{
153
+ type: z.ZodLiteral<string>;
154
+ id: z.ZodString;
155
+ attributes: z.ZodObject<{
156
+ name: z.ZodString;
157
+ email: z.ZodNullable<z.ZodString>;
158
+ phone: z.ZodNullable<z.ZodString>;
159
+ address: z.ZodNullable<z.ZodString>;
160
+ logo: z.ZodNullable<z.ZodString>;
161
+ } & {
162
+ createdAt: z.ZodString;
163
+ updatedAt: z.ZodString;
164
+ }, "strip", z.ZodTypeAny, {
165
+ email: string | null;
166
+ createdAt: string;
167
+ updatedAt: string;
168
+ name: string;
169
+ phone: string | null;
170
+ address: string | null;
171
+ logo: string | null;
172
+ }, {
173
+ email: string | null;
174
+ createdAt: string;
175
+ updatedAt: string;
176
+ name: string;
177
+ phone: string | null;
178
+ address: string | null;
179
+ logo: string | null;
180
+ }>;
181
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
182
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
183
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ type: string;
186
+ id: string;
187
+ attributes: {
188
+ email: string | null;
189
+ createdAt: string;
190
+ updatedAt: string;
191
+ name: string;
192
+ phone: string | null;
193
+ address: string | null;
194
+ logo: string | null;
195
+ };
196
+ relationships?: Record<string, unknown> | undefined;
197
+ links?: Record<string, string> | undefined;
198
+ meta?: Record<string, unknown> | undefined;
199
+ }, {
200
+ type: string;
201
+ id: string;
202
+ attributes: {
203
+ email: string | null;
204
+ createdAt: string;
205
+ updatedAt: string;
206
+ name: string;
207
+ phone: string | null;
208
+ address: string | null;
209
+ logo: string | null;
210
+ };
211
+ relationships?: Record<string, unknown> | undefined;
212
+ links?: Record<string, string> | undefined;
213
+ meta?: Record<string, unknown> | undefined;
214
+ }>;
215
+ export declare const organizationResponseSchema: z.ZodObject<{
216
+ data: z.ZodObject<{
217
+ type: z.ZodLiteral<string>;
218
+ id: z.ZodString;
219
+ attributes: z.ZodObject<{
220
+ name: z.ZodString;
221
+ email: z.ZodNullable<z.ZodString>;
222
+ phone: z.ZodNullable<z.ZodString>;
223
+ address: z.ZodNullable<z.ZodString>;
224
+ logo: z.ZodNullable<z.ZodString>;
225
+ } & {
226
+ createdAt: z.ZodString;
227
+ updatedAt: z.ZodString;
228
+ }, "strip", z.ZodTypeAny, {
229
+ email: string | null;
230
+ createdAt: string;
231
+ updatedAt: string;
232
+ name: string;
233
+ phone: string | null;
234
+ address: string | null;
235
+ logo: string | null;
236
+ }, {
237
+ email: string | null;
238
+ createdAt: string;
239
+ updatedAt: string;
240
+ name: string;
241
+ phone: string | null;
242
+ address: string | null;
243
+ logo: string | null;
244
+ }>;
245
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
247
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ type: string;
250
+ id: string;
251
+ attributes: {
252
+ email: string | null;
253
+ createdAt: string;
254
+ updatedAt: string;
255
+ name: string;
256
+ phone: string | null;
257
+ address: string | null;
258
+ logo: string | null;
259
+ };
260
+ relationships?: Record<string, unknown> | undefined;
261
+ links?: Record<string, string> | undefined;
262
+ meta?: Record<string, unknown> | undefined;
263
+ }, {
264
+ type: string;
265
+ id: string;
266
+ attributes: {
267
+ email: string | null;
268
+ createdAt: string;
269
+ updatedAt: string;
270
+ name: string;
271
+ phone: string | null;
272
+ address: string | null;
273
+ logo: string | null;
274
+ };
275
+ relationships?: Record<string, unknown> | undefined;
276
+ links?: Record<string, string> | undefined;
277
+ meta?: Record<string, unknown> | undefined;
278
+ }>;
279
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
280
+ type: z.ZodString;
281
+ id: z.ZodString;
282
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
283
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
284
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
285
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
286
+ }, "strip", z.ZodTypeAny, {
287
+ type: string;
288
+ id: string;
289
+ attributes?: Record<string, unknown> | undefined;
290
+ relationships?: Record<string, unknown> | undefined;
291
+ links?: Record<string, string> | undefined;
292
+ meta?: Record<string, unknown> | undefined;
293
+ }, {
294
+ type: string;
295
+ id: string;
296
+ attributes?: Record<string, unknown> | undefined;
297
+ relationships?: Record<string, unknown> | undefined;
298
+ links?: Record<string, string> | undefined;
299
+ meta?: Record<string, unknown> | undefined;
300
+ }>, "many">>;
301
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
302
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ data: {
305
+ type: string;
306
+ id: string;
307
+ attributes: {
308
+ email: string | null;
309
+ createdAt: string;
310
+ updatedAt: string;
311
+ name: string;
312
+ phone: string | null;
313
+ address: string | null;
314
+ logo: string | null;
315
+ };
316
+ relationships?: Record<string, unknown> | undefined;
317
+ links?: Record<string, string> | undefined;
318
+ meta?: Record<string, unknown> | undefined;
319
+ };
320
+ links?: Record<string, string> | undefined;
321
+ meta?: Record<string, unknown> | undefined;
322
+ included?: {
323
+ type: string;
324
+ id: string;
325
+ attributes?: Record<string, unknown> | undefined;
326
+ relationships?: Record<string, unknown> | undefined;
327
+ links?: Record<string, string> | undefined;
328
+ meta?: Record<string, unknown> | undefined;
329
+ }[] | undefined;
330
+ }, {
331
+ data: {
332
+ type: string;
333
+ id: string;
334
+ attributes: {
335
+ email: string | null;
336
+ createdAt: string;
337
+ updatedAt: string;
338
+ name: string;
339
+ phone: string | null;
340
+ address: string | null;
341
+ logo: string | null;
342
+ };
343
+ relationships?: Record<string, unknown> | undefined;
344
+ links?: Record<string, string> | undefined;
345
+ meta?: Record<string, unknown> | undefined;
346
+ };
347
+ links?: Record<string, string> | undefined;
348
+ meta?: Record<string, unknown> | undefined;
349
+ included?: {
350
+ type: string;
351
+ id: string;
352
+ attributes?: Record<string, unknown> | undefined;
353
+ relationships?: Record<string, unknown> | undefined;
354
+ links?: Record<string, string> | undefined;
355
+ meta?: Record<string, unknown> | undefined;
356
+ }[] | undefined;
357
+ }>;
358
+ export declare const organizationListResponseSchema: z.ZodObject<{
359
+ data: z.ZodArray<z.ZodObject<{
360
+ type: z.ZodLiteral<string>;
361
+ id: z.ZodString;
362
+ attributes: z.ZodObject<{
363
+ name: z.ZodString;
364
+ email: z.ZodNullable<z.ZodString>;
365
+ phone: z.ZodNullable<z.ZodString>;
366
+ address: z.ZodNullable<z.ZodString>;
367
+ logo: z.ZodNullable<z.ZodString>;
368
+ } & {
369
+ createdAt: z.ZodString;
370
+ updatedAt: z.ZodString;
371
+ }, "strip", z.ZodTypeAny, {
372
+ email: string | null;
373
+ createdAt: string;
374
+ updatedAt: string;
375
+ name: string;
376
+ phone: string | null;
377
+ address: string | null;
378
+ logo: string | null;
379
+ }, {
380
+ email: string | null;
381
+ createdAt: string;
382
+ updatedAt: string;
383
+ name: string;
384
+ phone: string | null;
385
+ address: string | null;
386
+ logo: string | null;
387
+ }>;
388
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
389
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
390
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
391
+ }, "strip", z.ZodTypeAny, {
392
+ type: string;
393
+ id: string;
394
+ attributes: {
395
+ email: string | null;
396
+ createdAt: string;
397
+ updatedAt: string;
398
+ name: string;
399
+ phone: string | null;
400
+ address: string | null;
401
+ logo: string | null;
402
+ };
403
+ relationships?: Record<string, unknown> | undefined;
404
+ links?: Record<string, string> | undefined;
405
+ meta?: Record<string, unknown> | undefined;
406
+ }, {
407
+ type: string;
408
+ id: string;
409
+ attributes: {
410
+ email: string | null;
411
+ createdAt: string;
412
+ updatedAt: string;
413
+ name: string;
414
+ phone: string | null;
415
+ address: string | null;
416
+ logo: string | null;
417
+ };
418
+ relationships?: Record<string, unknown> | undefined;
419
+ links?: Record<string, string> | undefined;
420
+ meta?: Record<string, unknown> | undefined;
421
+ }>, "many">;
422
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
423
+ type: z.ZodString;
424
+ id: z.ZodString;
425
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
426
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
427
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
428
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
429
+ }, "strip", z.ZodTypeAny, {
430
+ type: string;
431
+ id: string;
432
+ attributes?: Record<string, unknown> | undefined;
433
+ relationships?: Record<string, unknown> | undefined;
434
+ links?: Record<string, string> | undefined;
435
+ meta?: Record<string, unknown> | undefined;
436
+ }, {
437
+ type: string;
438
+ id: string;
439
+ attributes?: Record<string, unknown> | undefined;
440
+ relationships?: Record<string, unknown> | undefined;
441
+ links?: Record<string, string> | undefined;
442
+ meta?: Record<string, unknown> | undefined;
443
+ }>, "many">>;
444
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
445
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
446
+ }, "strip", z.ZodTypeAny, {
447
+ data: {
448
+ type: string;
449
+ id: string;
450
+ attributes: {
451
+ email: string | null;
452
+ createdAt: string;
453
+ updatedAt: string;
454
+ name: string;
455
+ phone: string | null;
456
+ address: string | null;
457
+ logo: string | null;
458
+ };
459
+ relationships?: Record<string, unknown> | undefined;
460
+ links?: Record<string, string> | undefined;
461
+ meta?: Record<string, unknown> | undefined;
462
+ }[];
463
+ links?: Record<string, string> | undefined;
464
+ meta?: Record<string, unknown> | undefined;
465
+ included?: {
466
+ type: string;
467
+ id: string;
468
+ attributes?: Record<string, unknown> | undefined;
469
+ relationships?: Record<string, unknown> | undefined;
470
+ links?: Record<string, string> | undefined;
471
+ meta?: Record<string, unknown> | undefined;
472
+ }[] | undefined;
473
+ }, {
474
+ data: {
475
+ type: string;
476
+ id: string;
477
+ attributes: {
478
+ email: string | null;
479
+ createdAt: string;
480
+ updatedAt: string;
481
+ name: string;
482
+ phone: string | null;
483
+ address: string | null;
484
+ logo: string | null;
485
+ };
486
+ relationships?: Record<string, unknown> | undefined;
487
+ links?: Record<string, string> | undefined;
488
+ meta?: Record<string, unknown> | undefined;
489
+ }[];
490
+ links?: Record<string, string> | undefined;
491
+ meta?: Record<string, unknown> | undefined;
492
+ included?: {
493
+ type: string;
494
+ id: string;
495
+ attributes?: Record<string, unknown> | undefined;
496
+ relationships?: Record<string, unknown> | undefined;
497
+ links?: Record<string, string> | undefined;
498
+ meta?: Record<string, unknown> | undefined;
499
+ }[] | undefined;
500
+ }>;
501
+ export type CreateOrganizationAttributes = z.infer<typeof createOrganizationAttributesSchema>;
502
+ export type UpdateOrganizationAttributes = z.infer<typeof updateOrganizationAttributesSchema>;
503
+ export type CreateOrganizationInput = z.infer<typeof createOrganizationSchema>;
504
+ export type UpdateOrganizationInput = z.infer<typeof updateOrganizationSchema>;
505
+ export type OrganizationAttributes = z.infer<typeof organizationAttributesSchema>;
506
+ export type OrganizationResource = z.infer<typeof organizationResourceSchema>;
507
+ export type OrganizationResponse = z.infer<typeof organizationResponseSchema>;
508
+ export type OrganizationListResponse = z.infer<typeof organizationListResponseSchema>;
509
+ //# sourceMappingURL=organizations.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/organizations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAMf,CAAC;AAG3B,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;EAM7C,CAAC;AAGH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;EAA+C,CAAC;AAG/F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema } from './common.schemas';
3
+ /**
4
+ * Organization schemas - JSON:API compliant
5
+ */
6
+ // Organization attributes schema
7
+ export const organizationAttributesSchema = z.object({
8
+ name: z.string().min(1).max(200),
9
+ email: z.string().email().nullable(),
10
+ phone: z.string().nullable(),
11
+ address: z.string().nullable(),
12
+ logo: z.string().url().nullable(),
13
+ }).merge(timestampsSchema);
14
+ // Organization attributes for creation (input)
15
+ export const createOrganizationAttributesSchema = z.object({
16
+ name: z.string().min(1).max(200),
17
+ email: z.string().email().optional(),
18
+ phone: z.string().optional(),
19
+ address: z.string().optional(),
20
+ logo: z.string().url().optional(),
21
+ });
22
+ // Organization attributes for update (input)
23
+ export const updateOrganizationAttributesSchema = createOrganizationAttributesSchema.partial();
24
+ // Create organization input (JSON:API format)
25
+ export const createOrganizationSchema = z.object({
26
+ type: z.literal('organizations'),
27
+ attributes: createOrganizationAttributesSchema,
28
+ });
29
+ // Update organization input (JSON:API format)
30
+ export const updateOrganizationSchema = z.object({
31
+ type: z.literal('organizations'),
32
+ id: z.string().uuid(),
33
+ attributes: updateOrganizationAttributesSchema,
34
+ });
35
+ // Organization resource (JSON:API resource object)
36
+ export const organizationResourceSchema = createJsonApiResourceSchema('organizations', organizationAttributesSchema);
37
+ // Organization responses (JSON:API format)
38
+ export const organizationResponseSchema = jsonApiSingleResponseSchema(organizationResourceSchema);
39
+ export const organizationListResponseSchema = jsonApiCollectionResponseSchema(organizationResourceSchema);