@deepintel-ltd/farmpro-contracts 1.0.2 → 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.
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/routes/analytics.routes.d.ts +754 -0
- package/dist/routes/analytics.routes.d.ts.map +1 -0
- package/dist/routes/analytics.routes.js +24 -0
- package/dist/routes/auth.routes.d.ts +3836 -0
- package/dist/routes/auth.routes.d.ts.map +1 -0
- package/dist/routes/auth.routes.js +158 -0
- package/dist/routes/categories.routes.d.ts +800 -0
- package/dist/routes/categories.routes.d.ts.map +1 -0
- package/dist/routes/categories.routes.js +120 -0
- package/dist/routes/documents.routes.d.ts +2476 -0
- package/dist/routes/documents.routes.d.ts.map +1 -0
- package/dist/routes/documents.routes.js +100 -0
- package/dist/routes/equipment.routes.d.ts +3617 -0
- package/dist/routes/equipment.routes.d.ts.map +1 -0
- package/dist/routes/equipment.routes.js +118 -0
- package/dist/routes/farms.routes.d.ts +2202 -0
- package/dist/routes/farms.routes.d.ts.map +1 -0
- package/dist/routes/farms.routes.js +111 -0
- package/dist/routes/fields.routes.d.ts +3479 -0
- package/dist/routes/fields.routes.d.ts.map +1 -0
- package/dist/routes/fields.routes.js +96 -0
- package/dist/routes/finance.routes.d.ts +6855 -0
- package/dist/routes/finance.routes.d.ts.map +1 -0
- package/dist/routes/finance.routes.js +259 -0
- package/dist/routes/harvest.routes.d.ts +2337 -0
- package/dist/routes/harvest.routes.d.ts.map +1 -0
- package/dist/routes/harvest.routes.js +99 -0
- package/dist/routes/index.d.ts +71 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +45 -0
- package/dist/routes/inventory.routes.d.ts +2853 -0
- package/dist/routes/inventory.routes.d.ts.map +1 -0
- package/dist/routes/inventory.routes.js +121 -0
- package/dist/routes/soil-tests.routes.d.ts +3005 -0
- package/dist/routes/soil-tests.routes.d.ts.map +1 -0
- package/dist/routes/soil-tests.routes.js +98 -0
- package/dist/routes/suppliers.routes.d.ts +4190 -0
- package/dist/routes/suppliers.routes.d.ts.map +1 -0
- package/dist/routes/suppliers.routes.js +146 -0
- package/dist/routes/tasks.routes.d.ts +4248 -0
- package/dist/routes/tasks.routes.d.ts.map +1 -0
- package/dist/routes/tasks.routes.js +138 -0
- package/dist/routes/team.routes.d.ts +2210 -0
- package/dist/routes/team.routes.d.ts.map +1 -0
- package/dist/routes/team.routes.js +98 -0
- package/dist/routes/users.routes.d.ts +721 -0
- package/dist/routes/users.routes.d.ts.map +1 -0
- package/dist/routes/users.routes.js +35 -0
- package/dist/routes/weather.routes.d.ts +500 -0
- package/dist/routes/weather.routes.d.ts.map +1 -0
- package/dist/routes/weather.routes.js +23 -0
- package/dist/schemas/analytics.schemas.d.ts +1344 -0
- package/dist/schemas/analytics.schemas.d.ts.map +1 -0
- package/dist/schemas/analytics.schemas.js +73 -0
- package/dist/schemas/auth.schemas.d.ts +1093 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -0
- package/dist/schemas/auth.schemas.js +159 -0
- package/dist/schemas/categories.schemas.d.ts +471 -0
- package/dist/schemas/categories.schemas.d.ts.map +1 -0
- package/dist/schemas/categories.schemas.js +51 -0
- package/dist/schemas/common.schemas.d.ts +562 -0
- package/dist/schemas/common.schemas.d.ts.map +1 -0
- package/dist/schemas/common.schemas.js +122 -0
- package/dist/schemas/documents.schemas.d.ts +850 -0
- package/dist/schemas/documents.schemas.d.ts.map +1 -0
- package/dist/schemas/documents.schemas.js +75 -0
- package/dist/schemas/equipment.schemas.d.ts +1618 -0
- package/dist/schemas/equipment.schemas.d.ts.map +1 -0
- package/dist/schemas/equipment.schemas.js +125 -0
- package/dist/schemas/farms.schemas.d.ts +1171 -0
- package/dist/schemas/farms.schemas.d.ts.map +1 -0
- package/dist/schemas/farms.schemas.js +62 -0
- package/dist/schemas/fields.schemas.d.ts +2508 -0
- package/dist/schemas/fields.schemas.d.ts.map +1 -0
- package/dist/schemas/fields.schemas.js +125 -0
- package/dist/schemas/finance.schemas.d.ts +2869 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -0
- package/dist/schemas/finance.schemas.js +196 -0
- package/dist/schemas/harvest.schemas.d.ts +1051 -0
- package/dist/schemas/harvest.schemas.d.ts.map +1 -0
- package/dist/schemas/harvest.schemas.js +71 -0
- package/dist/schemas/inventory.schemas.d.ts +1138 -0
- package/dist/schemas/inventory.schemas.d.ts.map +1 -0
- package/dist/schemas/inventory.schemas.js +89 -0
- package/dist/schemas/soil-tests.schemas.d.ts +1885 -0
- package/dist/schemas/soil-tests.schemas.d.ts.map +1 -0
- package/dist/schemas/soil-tests.schemas.js +102 -0
- package/dist/schemas/suppliers.schemas.d.ts +1774 -0
- package/dist/schemas/suppliers.schemas.d.ts.map +1 -0
- package/dist/schemas/suppliers.schemas.js +121 -0
- package/dist/schemas/tasks.schemas.d.ts +1811 -0
- package/dist/schemas/tasks.schemas.d.ts.map +1 -0
- package/dist/schemas/tasks.schemas.js +124 -0
- package/dist/schemas/team.schemas.d.ts +583 -0
- package/dist/schemas/team.schemas.d.ts.map +1 -0
- package/dist/schemas/team.schemas.js +60 -0
- package/dist/schemas/users.schemas.d.ts +288 -0
- package/dist/schemas/users.schemas.d.ts.map +1 -0
- package/dist/schemas/users.schemas.js +32 -0
- package/dist/schemas/weather.schemas.d.ts +682 -0
- package/dist/schemas/weather.schemas.d.ts.map +1 -0
- package/dist/schemas/weather.schemas.js +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.routes.d.ts","sourceRoot":"","sources":["../../src/routes/categories.routes.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgH3B,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categoriesRouter = void 0;
|
|
4
|
+
const core_1 = require("@ts-rest/core");
|
|
5
|
+
const categories_schemas_1 = require("../schemas/categories.schemas");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const c = (0, core_1.initContract)();
|
|
8
|
+
/**
|
|
9
|
+
* Categories API contract
|
|
10
|
+
* Provides endpoints for managing categories (task, budget, expense)
|
|
11
|
+
*/
|
|
12
|
+
exports.categoriesRouter = c.router({
|
|
13
|
+
/**
|
|
14
|
+
* Get categories
|
|
15
|
+
* Returns system defaults and optionally farm-specific categories
|
|
16
|
+
*/
|
|
17
|
+
getCategories: {
|
|
18
|
+
method: 'GET',
|
|
19
|
+
path: '/categories',
|
|
20
|
+
query: categories_schemas_1.getCategoriesQuerySchema,
|
|
21
|
+
responses: {
|
|
22
|
+
200: categories_schemas_1.categoryListResponseSchema,
|
|
23
|
+
},
|
|
24
|
+
summary: 'Get categories by type',
|
|
25
|
+
description: 'Returns system default categories and optionally farm-specific categories. Use type filter to get categories for tasks, budget, or expenses.',
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Get default category for a type
|
|
29
|
+
* Returns the default category that should be used when none is specified
|
|
30
|
+
*/
|
|
31
|
+
getDefaultCategory: {
|
|
32
|
+
method: 'GET',
|
|
33
|
+
path: '/categories/default/:type',
|
|
34
|
+
pathParams: zod_1.z.object({
|
|
35
|
+
type: zod_1.z.enum(['task', 'budget', 'expense']),
|
|
36
|
+
}),
|
|
37
|
+
responses: {
|
|
38
|
+
200: categories_schemas_1.categoryResponseSchema,
|
|
39
|
+
404: zod_1.z.object({
|
|
40
|
+
error: zod_1.z.object({
|
|
41
|
+
message: zod_1.z.string(),
|
|
42
|
+
code: zod_1.z.string(),
|
|
43
|
+
}),
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
summary: 'Get default category for a type',
|
|
47
|
+
description: 'Returns the default category that should be used when creating a task, budget, or expense without specifying a category.',
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Create category
|
|
51
|
+
* Creates a farm-specific category (farmId required) or system default (admin only)
|
|
52
|
+
*/
|
|
53
|
+
createCategory: {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
path: '/categories',
|
|
56
|
+
body: categories_schemas_1.createCategorySchema,
|
|
57
|
+
responses: {
|
|
58
|
+
201: categories_schemas_1.categoryResponseSchema,
|
|
59
|
+
400: zod_1.z.object({
|
|
60
|
+
error: zod_1.z.object({
|
|
61
|
+
message: zod_1.z.string(),
|
|
62
|
+
code: zod_1.z.string(),
|
|
63
|
+
}),
|
|
64
|
+
}),
|
|
65
|
+
409: zod_1.z.object({
|
|
66
|
+
error: zod_1.z.object({
|
|
67
|
+
message: zod_1.z.string(),
|
|
68
|
+
code: zod_1.z.string(),
|
|
69
|
+
}),
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
summary: 'Create a new category',
|
|
73
|
+
description: 'Creates a farm-specific category or system default category. Farm-specific categories override system defaults for that farm.',
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Update category
|
|
77
|
+
* Updates a farm-specific category
|
|
78
|
+
*/
|
|
79
|
+
updateCategory: {
|
|
80
|
+
method: 'PATCH',
|
|
81
|
+
path: '/categories/:id',
|
|
82
|
+
pathParams: zod_1.z.object({
|
|
83
|
+
id: zod_1.z.string().uuid(),
|
|
84
|
+
}),
|
|
85
|
+
body: categories_schemas_1.updateCategorySchema,
|
|
86
|
+
responses: {
|
|
87
|
+
200: categories_schemas_1.categoryResponseSchema,
|
|
88
|
+
404: zod_1.z.object({
|
|
89
|
+
error: zod_1.z.object({
|
|
90
|
+
message: zod_1.z.string(),
|
|
91
|
+
code: zod_1.z.string(),
|
|
92
|
+
}),
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
summary: 'Update a category',
|
|
96
|
+
description: 'Updates a farm-specific category. System default categories cannot be updated through this endpoint.',
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Delete category
|
|
100
|
+
* Deletes a farm-specific category
|
|
101
|
+
*/
|
|
102
|
+
deleteCategory: {
|
|
103
|
+
method: 'DELETE',
|
|
104
|
+
path: '/categories/:id',
|
|
105
|
+
pathParams: zod_1.z.object({
|
|
106
|
+
id: zod_1.z.string().uuid(),
|
|
107
|
+
}),
|
|
108
|
+
responses: {
|
|
109
|
+
204: zod_1.z.object({}),
|
|
110
|
+
404: zod_1.z.object({
|
|
111
|
+
error: zod_1.z.object({
|
|
112
|
+
message: zod_1.z.string(),
|
|
113
|
+
code: zod_1.z.string(),
|
|
114
|
+
}),
|
|
115
|
+
}),
|
|
116
|
+
},
|
|
117
|
+
summary: 'Delete a category',
|
|
118
|
+
description: 'Deletes a farm-specific category. System default categories cannot be deleted.',
|
|
119
|
+
},
|
|
120
|
+
});
|