@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.
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/routes/agents.routes.d.ts +192 -18
- package/dist/routes/agents.routes.d.ts.map +1 -1
- package/dist/routes/index.d.ts +9 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +6 -0
- package/dist/routes/invoices.routes.d.ts +3608 -0
- package/dist/routes/invoices.routes.d.ts.map +1 -0
- package/dist/routes/invoices.routes.js +98 -0
- package/dist/routes/organizations.routes.d.ts +1669 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -0
- package/dist/routes/organizations.routes.js +63 -0
- package/dist/routes/subscriptions.routes.d.ts +232 -0
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +25 -2
- package/dist/routes/waybills.routes.d.ts +3225 -0
- package/dist/routes/waybills.routes.d.ts.map +1 -0
- package/dist/routes/waybills.routes.js +95 -0
- package/dist/schemas/agents.schemas.d.ts +760 -49
- package/dist/schemas/agents.schemas.d.ts.map +1 -1
- package/dist/schemas/agents.schemas.js +21 -1
- package/dist/schemas/invoices.schemas.d.ts +1533 -0
- package/dist/schemas/invoices.schemas.d.ts.map +1 -0
- package/dist/schemas/invoices.schemas.js +85 -0
- package/dist/schemas/organizations.schemas.d.ts +509 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -0
- package/dist/schemas/organizations.schemas.js +39 -0
- package/dist/schemas/waybills.schemas.d.ts +1261 -0
- package/dist/schemas/waybills.schemas.d.ts.map +1 -0
- package/dist/schemas/waybills.schemas.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waybills.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/waybills.schemas.ts"],"names":[],"mappings":"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qB,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,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { timestampsSchema, createJsonApiResourceSchema, jsonApiSingleResponseSchema, jsonApiCollectionResponseSchema } from './common.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Waybill schemas - JSON:API compliant
|
|
5
|
+
*/
|
|
6
|
+
// Waybill item schema
|
|
7
|
+
export const waybillItemSchema = z.object({
|
|
8
|
+
description: z.string().min(1).max(500),
|
|
9
|
+
quantity: z.number().positive(),
|
|
10
|
+
unit: z.string().min(1).max(50),
|
|
11
|
+
weight: z.number().positive().optional(),
|
|
12
|
+
value: z.number().nonnegative().optional(),
|
|
13
|
+
});
|
|
14
|
+
// Waybill attributes schema
|
|
15
|
+
export const waybillAttributesSchema = z.object({
|
|
16
|
+
waybillNumber: z.string().min(1).max(100),
|
|
17
|
+
issueDate: z.string().datetime(),
|
|
18
|
+
senderName: z.string().min(1).max(200),
|
|
19
|
+
senderAddress: z.string().optional().nullable(),
|
|
20
|
+
senderPhone: z.string().optional().nullable(),
|
|
21
|
+
senderEmail: z.string().email().optional().nullable(),
|
|
22
|
+
recipientName: z.string().min(1).max(200),
|
|
23
|
+
recipientAddress: z.string().optional().nullable(),
|
|
24
|
+
recipientPhone: z.string().optional().nullable(),
|
|
25
|
+
recipientEmail: z.string().email().optional().nullable(),
|
|
26
|
+
items: z.array(waybillItemSchema).min(1),
|
|
27
|
+
totalWeight: z.number().positive().optional().nullable(),
|
|
28
|
+
totalValue: z.number().nonnegative().optional().nullable(),
|
|
29
|
+
currency: z.string().length(3).default('NGN'),
|
|
30
|
+
notes: z.string().optional().nullable(),
|
|
31
|
+
pdfUrl: z.string().url().optional().nullable(),
|
|
32
|
+
organizationId: z.string().uuid(),
|
|
33
|
+
createdAt: z.string().datetime(),
|
|
34
|
+
updatedAt: z.string().datetime(),
|
|
35
|
+
}).merge(timestampsSchema);
|
|
36
|
+
// Waybill attributes for creation (input)
|
|
37
|
+
export const createWaybillAttributesSchema = z.object({
|
|
38
|
+
issueDate: z.string().datetime().optional(),
|
|
39
|
+
senderName: z.string().min(1).max(200),
|
|
40
|
+
senderAddress: z.string().optional(),
|
|
41
|
+
senderPhone: z.string().optional(),
|
|
42
|
+
senderEmail: z.string().email().optional(),
|
|
43
|
+
recipientName: z.string().min(1).max(200),
|
|
44
|
+
recipientAddress: z.string().optional(),
|
|
45
|
+
recipientPhone: z.string().optional(),
|
|
46
|
+
recipientEmail: z.string().email().optional(),
|
|
47
|
+
items: z.array(waybillItemSchema).min(1),
|
|
48
|
+
totalWeight: z.number().positive().optional(),
|
|
49
|
+
totalValue: z.number().nonnegative().optional(),
|
|
50
|
+
currency: z.string().length(3).default('NGN'),
|
|
51
|
+
notes: z.string().optional(),
|
|
52
|
+
});
|
|
53
|
+
// Waybill attributes for update (input)
|
|
54
|
+
export const updateWaybillAttributesSchema = createWaybillAttributesSchema.partial();
|
|
55
|
+
// Create waybill input (JSON:API format)
|
|
56
|
+
export const createWaybillSchema = z.object({
|
|
57
|
+
type: z.literal('waybills'),
|
|
58
|
+
attributes: createWaybillAttributesSchema,
|
|
59
|
+
});
|
|
60
|
+
// Update waybill input (JSON:API format)
|
|
61
|
+
export const updateWaybillSchema = z.object({
|
|
62
|
+
type: z.literal('waybills'),
|
|
63
|
+
id: z.string().uuid(),
|
|
64
|
+
attributes: updateWaybillAttributesSchema,
|
|
65
|
+
});
|
|
66
|
+
// Waybill resource (JSON:API resource object)
|
|
67
|
+
export const waybillResourceSchema = createJsonApiResourceSchema('waybills', waybillAttributesSchema);
|
|
68
|
+
// Waybill responses (JSON:API format)
|
|
69
|
+
export const waybillResponseSchema = jsonApiSingleResponseSchema(waybillResourceSchema);
|
|
70
|
+
export const waybillListResponseSchema = jsonApiCollectionResponseSchema(waybillResourceSchema);
|