@deepintel-ltd/farmpro-contracts 1.12.0 → 1.15.1
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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/routes/capital.routes.d.ts +70 -0
- package/dist/routes/capital.routes.d.ts.map +1 -1
- package/dist/routes/field-activities.routes.d.ts +24 -24
- package/dist/routes/finance.routes.d.ts +112 -0
- package/dist/routes/finance.routes.d.ts.map +1 -1
- package/dist/routes/market-intelligence.routes.d.ts +1052 -1
- package/dist/routes/market-intelligence.routes.d.ts.map +1 -1
- package/dist/routes/market-intelligence.routes.js +97 -1
- package/dist/routes/yield-prediction.routes.d.ts +133 -0
- package/dist/routes/yield-prediction.routes.d.ts.map +1 -1
- package/dist/schemas/capital.schemas.d.ts +68 -0
- package/dist/schemas/capital.schemas.d.ts.map +1 -1
- package/dist/schemas/capital.schemas.js +2 -0
- package/dist/schemas/field-activities.schemas.d.ts +18 -18
- package/dist/schemas/finance.schemas.d.ts +136 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -1
- package/dist/schemas/finance.schemas.js +4 -0
- package/dist/schemas/yield-prediction.schemas.d.ts +123 -0
- package/dist/schemas/yield-prediction.schemas.d.ts.map +1 -1
- package/dist/schemas/yield-prediction.schemas.js +20 -0
- package/package.json +1 -1
|
@@ -622,6 +622,52 @@ export declare const fieldYieldSummarySchema: z.ZodObject<{
|
|
|
622
622
|
confidenceScore: number;
|
|
623
623
|
daysToHarvest: number | null;
|
|
624
624
|
}>;
|
|
625
|
+
/** Multi-year / tree cash-crop stand for Market Watch orchard ledger (not season hero). */
|
|
626
|
+
export declare const cashCropStandSchema: z.ZodObject<{
|
|
627
|
+
fieldId: z.ZodString;
|
|
628
|
+
fieldName: z.ZodString;
|
|
629
|
+
cropType: z.ZodString;
|
|
630
|
+
fieldArea: z.ZodNumber;
|
|
631
|
+
plantingDate: z.ZodNullable<z.ZodString>;
|
|
632
|
+
yearsToFirstHarvest: z.ZodNumber;
|
|
633
|
+
ageYears: z.ZodNullable<z.ZodNumber>;
|
|
634
|
+
yearsRemaining: z.ZodNullable<z.ZodNumber>;
|
|
635
|
+
stage: z.ZodEnum<["establishing", "bearing", "unknown_age"]>;
|
|
636
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
637
|
+
planningYieldPerHa: z.ZodNullable<z.ZodNumber>;
|
|
638
|
+
planningTotalYield: z.ZodNullable<z.ZodNumber>;
|
|
639
|
+
unit: z.ZodString;
|
|
640
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
641
|
+
includedInSeasonRevenue: z.ZodBoolean;
|
|
642
|
+
}, "strip", z.ZodTypeAny, {
|
|
643
|
+
plantingDate: string | null;
|
|
644
|
+
fieldId: string;
|
|
645
|
+
fieldName: string;
|
|
646
|
+
unit: string;
|
|
647
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
648
|
+
cropType: string;
|
|
649
|
+
fieldArea: number;
|
|
650
|
+
yearsToFirstHarvest: number;
|
|
651
|
+
ageYears: number | null;
|
|
652
|
+
yearsRemaining: number | null;
|
|
653
|
+
planningYieldPerHa: number | null;
|
|
654
|
+
planningTotalYield: number | null;
|
|
655
|
+
includedInSeasonRevenue: boolean;
|
|
656
|
+
}, {
|
|
657
|
+
plantingDate: string | null;
|
|
658
|
+
fieldId: string;
|
|
659
|
+
fieldName: string;
|
|
660
|
+
unit: string;
|
|
661
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
662
|
+
cropType: string;
|
|
663
|
+
fieldArea: number;
|
|
664
|
+
yearsToFirstHarvest: number;
|
|
665
|
+
ageYears: number | null;
|
|
666
|
+
yearsRemaining: number | null;
|
|
667
|
+
planningYieldPerHa: number | null;
|
|
668
|
+
planningTotalYield: number | null;
|
|
669
|
+
includedInSeasonRevenue: boolean;
|
|
670
|
+
}>;
|
|
625
671
|
export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
626
672
|
farmId: z.ZodString;
|
|
627
673
|
farmName: z.ZodString;
|
|
@@ -722,6 +768,52 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
722
768
|
confidenceScore: number;
|
|
723
769
|
daysToHarvest: number | null;
|
|
724
770
|
}>, "many">;
|
|
771
|
+
/** Tree / perennial stands (cashew, cocoa, …) — always listed when planted. */
|
|
772
|
+
cashCropStands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
773
|
+
fieldId: z.ZodString;
|
|
774
|
+
fieldName: z.ZodString;
|
|
775
|
+
cropType: z.ZodString;
|
|
776
|
+
fieldArea: z.ZodNumber;
|
|
777
|
+
plantingDate: z.ZodNullable<z.ZodString>;
|
|
778
|
+
yearsToFirstHarvest: z.ZodNumber;
|
|
779
|
+
ageYears: z.ZodNullable<z.ZodNumber>;
|
|
780
|
+
yearsRemaining: z.ZodNullable<z.ZodNumber>;
|
|
781
|
+
stage: z.ZodEnum<["establishing", "bearing", "unknown_age"]>;
|
|
782
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
783
|
+
planningYieldPerHa: z.ZodNullable<z.ZodNumber>;
|
|
784
|
+
planningTotalYield: z.ZodNullable<z.ZodNumber>;
|
|
785
|
+
unit: z.ZodString;
|
|
786
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
787
|
+
includedInSeasonRevenue: z.ZodBoolean;
|
|
788
|
+
}, "strip", z.ZodTypeAny, {
|
|
789
|
+
plantingDate: string | null;
|
|
790
|
+
fieldId: string;
|
|
791
|
+
fieldName: string;
|
|
792
|
+
unit: string;
|
|
793
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
794
|
+
cropType: string;
|
|
795
|
+
fieldArea: number;
|
|
796
|
+
yearsToFirstHarvest: number;
|
|
797
|
+
ageYears: number | null;
|
|
798
|
+
yearsRemaining: number | null;
|
|
799
|
+
planningYieldPerHa: number | null;
|
|
800
|
+
planningTotalYield: number | null;
|
|
801
|
+
includedInSeasonRevenue: boolean;
|
|
802
|
+
}, {
|
|
803
|
+
plantingDate: string | null;
|
|
804
|
+
fieldId: string;
|
|
805
|
+
fieldName: string;
|
|
806
|
+
unit: string;
|
|
807
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
808
|
+
cropType: string;
|
|
809
|
+
fieldArea: number;
|
|
810
|
+
yearsToFirstHarvest: number;
|
|
811
|
+
ageYears: number | null;
|
|
812
|
+
yearsRemaining: number | null;
|
|
813
|
+
planningYieldPerHa: number | null;
|
|
814
|
+
planningTotalYield: number | null;
|
|
815
|
+
includedInSeasonRevenue: boolean;
|
|
816
|
+
}>, "many">>;
|
|
725
817
|
overallMetrics: z.ZodObject<{
|
|
726
818
|
totalArea: z.ZodNumber;
|
|
727
819
|
averageConfidence: z.ZodNumber;
|
|
@@ -771,6 +863,21 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
771
863
|
confidenceScore: number;
|
|
772
864
|
daysToHarvest: number | null;
|
|
773
865
|
}[];
|
|
866
|
+
cashCropStands: {
|
|
867
|
+
plantingDate: string | null;
|
|
868
|
+
fieldId: string;
|
|
869
|
+
fieldName: string;
|
|
870
|
+
unit: string;
|
|
871
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
872
|
+
cropType: string;
|
|
873
|
+
fieldArea: number;
|
|
874
|
+
yearsToFirstHarvest: number;
|
|
875
|
+
ageYears: number | null;
|
|
876
|
+
yearsRemaining: number | null;
|
|
877
|
+
planningYieldPerHa: number | null;
|
|
878
|
+
planningTotalYield: number | null;
|
|
879
|
+
includedInSeasonRevenue: boolean;
|
|
880
|
+
}[];
|
|
774
881
|
overallMetrics: {
|
|
775
882
|
totalArea: number;
|
|
776
883
|
averageConfidence: number;
|
|
@@ -816,6 +923,21 @@ export declare const farmYieldSummarySchema: z.ZodObject<{
|
|
|
816
923
|
averageConfidence: number;
|
|
817
924
|
overallHealthStatus: "critical" | "poor" | "fair" | "good" | "excellent";
|
|
818
925
|
};
|
|
926
|
+
cashCropStands?: {
|
|
927
|
+
plantingDate: string | null;
|
|
928
|
+
fieldId: string;
|
|
929
|
+
fieldName: string;
|
|
930
|
+
unit: string;
|
|
931
|
+
stage: "bearing" | "establishing" | "unknown_age";
|
|
932
|
+
cropType: string;
|
|
933
|
+
fieldArea: number;
|
|
934
|
+
yearsToFirstHarvest: number;
|
|
935
|
+
ageYears: number | null;
|
|
936
|
+
yearsRemaining: number | null;
|
|
937
|
+
planningYieldPerHa: number | null;
|
|
938
|
+
planningTotalYield: number | null;
|
|
939
|
+
includedInSeasonRevenue: boolean;
|
|
940
|
+
}[] | undefined;
|
|
819
941
|
}>;
|
|
820
942
|
export declare const yieldPredictionQuerySchema: z.ZodObject<{
|
|
821
943
|
historicalYears: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -864,6 +986,7 @@ export type PredictionFactor = z.infer<typeof predictionFactorSchema>;
|
|
|
864
986
|
export type YieldRecommendation = z.infer<typeof yieldRecommendationSchema>;
|
|
865
987
|
export type YieldPrediction = z.infer<typeof yieldPredictionSchema>;
|
|
866
988
|
export type FieldYieldSummary = z.infer<typeof fieldYieldSummarySchema>;
|
|
989
|
+
export type CashCropStand = z.infer<typeof cashCropStandSchema>;
|
|
867
990
|
export type FarmYieldSummary = z.infer<typeof farmYieldSummarySchema>;
|
|
868
991
|
export type YieldPredictionQuery = z.infer<typeof yieldPredictionQuerySchema>;
|
|
869
992
|
export type FarmYieldQuery = z.infer<typeof farmYieldQuerySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yield-prediction.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/yield-prediction.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,8BAA8B,mDAAiD,CAAC;AAC7F,eAAO,MAAM,kBAAkB,8DAA4D,CAAC;AAC5F,eAAO,MAAM,qBAAqB,+D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BAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -133,6 +133,24 @@ export const fieldYieldSummarySchema = z.object({
|
|
|
133
133
|
healthStatus: healthStatusSchema,
|
|
134
134
|
daysToHarvest: z.number().nullable(),
|
|
135
135
|
});
|
|
136
|
+
/** Multi-year / tree cash-crop stand for Market Watch orchard ledger (not season hero). */
|
|
137
|
+
export const cashCropStandSchema = z.object({
|
|
138
|
+
fieldId: z.string().uuid(),
|
|
139
|
+
fieldName: z.string(),
|
|
140
|
+
cropType: z.string(),
|
|
141
|
+
fieldArea: z.number(),
|
|
142
|
+
plantingDate: z.string().datetime().nullable(),
|
|
143
|
+
yearsToFirstHarvest: z.number().positive(),
|
|
144
|
+
ageYears: z.number().nullable(),
|
|
145
|
+
yearsRemaining: z.number().nullable(),
|
|
146
|
+
stage: z.enum(['establishing', 'bearing', 'unknown_age']),
|
|
147
|
+
/** Cold-start or harvest-calibrated kg/ha when bearing and catalog/history exists. */
|
|
148
|
+
planningYieldPerHa: z.number().nullable(),
|
|
149
|
+
planningTotalYield: z.number().nullable(),
|
|
150
|
+
unit: z.string(),
|
|
151
|
+
/** True when this stand also contributes to this-season field/crop summaries. */
|
|
152
|
+
includedInSeasonRevenue: z.boolean(),
|
|
153
|
+
});
|
|
136
154
|
export const farmYieldSummarySchema = z.object({
|
|
137
155
|
farmId: z.string().uuid(),
|
|
138
156
|
farmName: z.string(),
|
|
@@ -157,6 +175,8 @@ export const farmYieldSummarySchema = z.object({
|
|
|
157
175
|
})),
|
|
158
176
|
// Individual field summaries
|
|
159
177
|
fieldSummaries: z.array(fieldYieldSummarySchema),
|
|
178
|
+
/** Tree / perennial stands (cashew, cocoa, …) — always listed when planted. */
|
|
179
|
+
cashCropStands: z.array(cashCropStandSchema).default([]),
|
|
160
180
|
// Overall farm metrics
|
|
161
181
|
overallMetrics: z.object({
|
|
162
182
|
totalArea: z.number(),
|