@deepintel-ltd/farmpro-contracts 1.5.19 → 1.5.21
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 +3789 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -0
- package/dist/routes/organizations.routes.js +148 -0
- 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 +975 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -0
- package/dist/schemas/organizations.schemas.js +79 -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":"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;;;;;;;;;;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AC;AAC5F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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);
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// Bank Account Schemas
|
|
42
|
+
// ============================================================================
|
|
43
|
+
// Bank account attributes schema
|
|
44
|
+
export const bankAccountAttributesSchema = z.object({
|
|
45
|
+
bankName: z.string().min(1).max(200),
|
|
46
|
+
accountNumber: z.string().min(1).max(50),
|
|
47
|
+
accountName: z.string().min(1).max(200),
|
|
48
|
+
isDefault: z.boolean().default(false),
|
|
49
|
+
}).merge(timestampsSchema);
|
|
50
|
+
// Bank account attributes for creation (input)
|
|
51
|
+
export const createBankAccountAttributesSchema = z.object({
|
|
52
|
+
bankName: z.string().min(1).max(200),
|
|
53
|
+
accountNumber: z.string().min(1).max(50),
|
|
54
|
+
accountName: z.string().min(1).max(200),
|
|
55
|
+
isDefault: z.boolean().optional().default(false),
|
|
56
|
+
});
|
|
57
|
+
// Bank account attributes for update (input)
|
|
58
|
+
export const updateBankAccountAttributesSchema = z.object({
|
|
59
|
+
bankName: z.string().min(1).max(200).optional(),
|
|
60
|
+
accountNumber: z.string().min(1).max(50).optional(),
|
|
61
|
+
accountName: z.string().min(1).max(200).optional(),
|
|
62
|
+
isDefault: z.boolean().optional(),
|
|
63
|
+
});
|
|
64
|
+
// Create bank account input (JSON:API format)
|
|
65
|
+
export const createBankAccountSchema = z.object({
|
|
66
|
+
type: z.literal('bank-accounts'),
|
|
67
|
+
attributes: createBankAccountAttributesSchema,
|
|
68
|
+
});
|
|
69
|
+
// Update bank account input (JSON:API format)
|
|
70
|
+
export const updateBankAccountSchema = z.object({
|
|
71
|
+
type: z.literal('bank-accounts'),
|
|
72
|
+
id: z.string().uuid(),
|
|
73
|
+
attributes: updateBankAccountAttributesSchema,
|
|
74
|
+
});
|
|
75
|
+
// Bank account resource (JSON:API resource object)
|
|
76
|
+
export const bankAccountResourceSchema = createJsonApiResourceSchema('bank-accounts', bankAccountAttributesSchema);
|
|
77
|
+
// Bank account responses (JSON:API format)
|
|
78
|
+
export const bankAccountResponseSchema = jsonApiSingleResponseSchema(bankAccountResourceSchema);
|
|
79
|
+
export const bankAccountListResponseSchema = jsonApiCollectionResponseSchema(bankAccountResourceSchema);
|