@deepintel-ltd/farmpro-contracts 1.36.4 → 1.36.6

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 (70) hide show
  1. package/dist/index.d.ts +4 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -1
  4. package/dist/routes/accounting.routes.d.ts +18 -18
  5. package/dist/routes/agent-workflows.routes.d.ts +56 -56
  6. package/dist/routes/cooperative.routes.d.ts +6 -6
  7. package/dist/routes/crop-care.routes.d.ts +2 -2
  8. package/dist/routes/extension.routes.d.ts +18 -18
  9. package/dist/routes/farm-status.routes.d.ts +8 -8
  10. package/dist/routes/fertigation.routes.d.ts +556 -556
  11. package/dist/routes/field-monitoring.routes.d.ts +89 -89
  12. package/dist/routes/field-observations.routes.d.ts +50 -50
  13. package/dist/routes/index.d.ts +0 -3
  14. package/dist/routes/index.d.ts.map +1 -1
  15. package/dist/routes/index.js +0 -2
  16. package/dist/routes/integrations.routes.d.ts +4 -4
  17. package/dist/routes/inventory.routes.d.ts +966 -0
  18. package/dist/routes/inventory.routes.d.ts.map +1 -1
  19. package/dist/routes/invoices.routes.d.ts +30 -30
  20. package/dist/routes/irrigation.routes.d.ts +20 -20
  21. package/dist/routes/measurements.routes.d.ts +6 -6
  22. package/dist/routes/monitoring-visualization.routes.d.ts +16 -16
  23. package/dist/routes/nutrient-plan.routes.d.ts +1847 -350
  24. package/dist/routes/nutrient-plan.routes.d.ts.map +1 -1
  25. package/dist/routes/nutrient-plan.routes.js +46 -0
  26. package/dist/routes/orchard-plan.routes.d.ts +10 -10
  27. package/dist/routes/purchase-orders.routes.d.ts +6 -6
  28. package/dist/routes/session.routes.d.ts +36 -36
  29. package/dist/routes/soil-tests.routes.d.ts +126 -126
  30. package/dist/routes/team-payments.routes.d.ts +36 -36
  31. package/dist/routes/waybills.routes.d.ts +12 -12
  32. package/dist/routes/weather.routes.d.ts +12 -12
  33. package/dist/routes/yield-prediction.routes.d.ts +8 -8
  34. package/dist/schemas/accounting.schemas.d.ts +20 -20
  35. package/dist/schemas/agent-workflows.schemas.d.ts +64 -64
  36. package/dist/schemas/cooperative.schemas.d.ts +8 -8
  37. package/dist/schemas/crop-care.schemas.d.ts +2 -2
  38. package/dist/schemas/extension.schemas.d.ts +18 -18
  39. package/dist/schemas/farm-fertilizers.schemas.d.ts +289 -162
  40. package/dist/schemas/farm-fertilizers.schemas.d.ts.map +1 -1
  41. package/dist/schemas/farm-fertilizers.schemas.js +31 -5
  42. package/dist/schemas/farm-status.schemas.d.ts +14 -14
  43. package/dist/schemas/fertigation-board.schemas.d.ts +889 -0
  44. package/dist/schemas/fertigation-board.schemas.d.ts.map +1 -0
  45. package/dist/schemas/fertigation-board.schemas.js +107 -0
  46. package/dist/schemas/fertigation.schemas.d.ts +214 -214
  47. package/dist/schemas/field-monitoring.schemas.d.ts +69 -69
  48. package/dist/schemas/field-observations.schemas.d.ts +34 -34
  49. package/dist/schemas/integrations.schemas.d.ts +6 -6
  50. package/dist/schemas/inventory.schemas.d.ts +1298 -0
  51. package/dist/schemas/inventory.schemas.d.ts.map +1 -1
  52. package/dist/schemas/inventory.schemas.js +7 -0
  53. package/dist/schemas/invoices.schemas.d.ts +18 -18
  54. package/dist/schemas/irrigation.schemas.d.ts +12 -12
  55. package/dist/schemas/measurements.schemas.d.ts +6 -6
  56. package/dist/schemas/monitoring-visualization.schemas.d.ts +16 -16
  57. package/dist/schemas/nutrient-plan.schemas.d.ts +98 -98
  58. package/dist/schemas/orchard-plan.schemas.d.ts +26 -26
  59. package/dist/schemas/purchase-orders.schemas.d.ts +6 -6
  60. package/dist/schemas/recommendations.schemas.d.ts +6 -6
  61. package/dist/schemas/session.schemas.d.ts +36 -36
  62. package/dist/schemas/soil-tests.schemas.d.ts +120 -120
  63. package/dist/schemas/team-payments.schemas.d.ts +30 -30
  64. package/dist/schemas/waybills.schemas.d.ts +12 -12
  65. package/dist/schemas/weather.schemas.d.ts +36 -36
  66. package/dist/schemas/yield-prediction.schemas.d.ts +4 -4
  67. package/package.json +1 -1
  68. package/dist/routes/farm-fertilizers.routes.d.ts +0 -1139
  69. package/dist/routes/farm-fertilizers.routes.d.ts.map +0 -1
  70. package/dist/routes/farm-fertilizers.routes.js +0 -63
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fertigation-board.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/fertigation-board.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,0BAA0B;;;;;;;;;IASrC,qFAAqF;;;;;;;;;;;;;;;;;;;;;;EAErF,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMxC,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,8BAA8B;;;;;;;;;;;;EAIzC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;QApBtC,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;IAkCrF,qEAAqE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAErE,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE7C,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9C,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,qBAAqB;;;;;;IAMhC,2DAA2D;;;;;;;IAO3D,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAExC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;IAIxC,+EAA+E;;;;;;;;;;;;EAE/E,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;QAJjC,+EAA+E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAjE/E,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;QAkCrF,qEAAqE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAErE,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAE7C,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAY9C,2DAA2D;;;;;;;QAO3D,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBxC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;IAG/B,iFAAiF;;;;;;;;;;;;;;;;EAIjF,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;IAMhC,oDAAoD;;;IAGpD,2GAA2G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3G,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { z } from 'zod';
2
+ const tank = z.enum(['A', 'B']);
3
+ export const fertigationBoardLineSchema = z.object({
4
+ productId: z.string(),
5
+ name: z.string(),
6
+ tank,
7
+ gramsPerPlant: z.number(),
8
+ fieldKg: z.number().nullable(),
9
+ inventoryItemId: z.string().nullable(),
10
+ stockKg: z.number().nullable(),
11
+ bagSizeKg: z.number().nullable(),
12
+ /** False when the plan names a product the farm has not entered as a supply item. */
13
+ inStockList: z.boolean(),
14
+ });
15
+ /** A feed day that is not recorded yet: a missed one to catch up, or one coming up. */
16
+ export const fertigationBoardFeedDaySchema = z.object({
17
+ plannedFor: z.string(),
18
+ tank,
19
+ lines: z.array(z.object({ productId: z.string(), name: z.string(), fieldKg: z.number().nullable() })),
20
+ });
21
+ /** A feed already recorded for today, so it can be undone. */
22
+ export const fertigationBoardRecordedSchema = z.object({
23
+ id: z.string(),
24
+ status: z.enum(['done', 'skipped']),
25
+ tank,
26
+ });
27
+ export const fertigationBoardFieldSchema = z.object({
28
+ fieldId: z.string(),
29
+ fieldName: z.string(),
30
+ stageLabel: z.string().nullable(),
31
+ fieldDay: z.number().nullable(),
32
+ plantCount: z.number().nullable(),
33
+ kind: z.enum(['feed', 'water', 'none']),
34
+ tank: tank.nullable(),
35
+ due: z.boolean(),
36
+ overdue: z.boolean(),
37
+ feedHold: z.boolean(),
38
+ blockers: z.array(z.string()),
39
+ warnings: z.array(z.string()),
40
+ lines: z.array(fertigationBoardLineSchema),
41
+ /** Feed days in the last two weeks nobody recorded, oldest first. */
42
+ missed: z.array(fertigationBoardFeedDaySchema),
43
+ /** The next feed days in the coming week. */
44
+ upcoming: z.array(fertigationBoardFeedDaySchema),
45
+ /** Today's feed once it has been recorded. */
46
+ recorded: fertigationBoardRecordedSchema.nullable(),
47
+ message: z.string().nullable(),
48
+ });
49
+ /** One fertilizer the farm's fields use, held against the stock across every field. */
50
+ export const fertigationNeedSchema = z.object({
51
+ productId: z.string(),
52
+ name: z.string(),
53
+ inventoryItemId: z.string().nullable(),
54
+ fieldCount: z.number(),
55
+ weeklyKg: z.number(),
56
+ /** Kilograms every field needs over the planning weeks. */
57
+ needKg: z.number(),
58
+ stockKg: z.number().nullable(),
59
+ weeksOfCover: z.number().nullable(),
60
+ purchaseKg: z.number().nullable(),
61
+ purchaseBags: z.number().nullable(),
62
+ bagSizeKg: z.number().nullable(),
63
+ /** Stock covers less than two weeks. */
64
+ low: z.boolean(),
65
+ });
66
+ export const fertigationBoardSummarySchema = z.object({
67
+ dueToday: z.number(),
68
+ doneToday: z.number(),
69
+ missedFeeds: z.number(),
70
+ /** Cost of the feeds recorded in the last 30 days, from average stock cost. */
71
+ costLast30Days: z.number(),
72
+ });
73
+ export const fertigationBoardSchema = z.object({
74
+ today: z.string(),
75
+ planningWeeks: z.number(),
76
+ summary: fertigationBoardSummarySchema,
77
+ fields: z.array(fertigationBoardFieldSchema),
78
+ needs: z.array(fertigationNeedSchema),
79
+ });
80
+ export const recordFeedBodySchema = z.object({
81
+ plannedFor: z.string().regex(/^\d{4}-\d{2}-\d{2}/),
82
+ idempotencyKey: z.string().min(8).max(80),
83
+ /** Actual kilograms, keyed by product id. Omitted lines use the planned dose. */
84
+ actualKg: z.record(z.string(), z.number().min(0)).optional(),
85
+ note: z.string().max(500).optional(),
86
+ skipReason: z.string().max(500).optional(),
87
+ });
88
+ export const fertigationFeedSchema = z.object({
89
+ id: z.string(),
90
+ fieldId: z.string(),
91
+ plannedFor: z.string(),
92
+ status: z.enum(['done', 'skipped', 'void']),
93
+ tank,
94
+ /** Field cost posted to Finance for a done feed. */
95
+ totalCost: z.number(),
96
+ expenseId: z.string().nullable(),
97
+ /** True when the stock count could not cover a line: the feed is recorded, the count should be checked. */
98
+ stockShort: z.boolean(),
99
+ lines: z.array(z.object({
100
+ productName: z.string(),
101
+ inventoryItemId: z.string().nullable(),
102
+ plannedKg: z.number(),
103
+ actualKg: z.number().nullable(),
104
+ deductedKg: z.number(),
105
+ shortfallKg: z.number(),
106
+ })),
107
+ });