@agridea/suibi-module 0.1.0-preview.09bcbd4
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/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/elements/browser/main.js +78 -0
- package/dist/elements/browser/polyfills.js +1 -0
- package/dist/elements/browser/styles.css +1 -0
- package/dist/elements/browser/suibi-module-latest.css +1 -0
- package/dist/elements/browser/suibi-module-latest.js +78 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.09bcbd4.css +1 -0
- package/dist/elements/browser/suibi-module.v0.1.0-preview.09bcbd4.js +78 -0
- package/dist/elements/browser/suibi-theme-dark.css +1 -0
- package/dist/elements/browser/version.txt +1 -0
- package/dist/elements/browser/wc-global-utilities.css +1 -0
- package/dist/types/app/app.config.d.ts +2 -0
- package/dist/types/app/app.d.ts +34 -0
- package/dist/types/app/components/add-dashed-button/add-dashed-button.component.d.ts +9 -0
- package/dist/types/app/components/data-preview/data-preview.component.d.ts +12 -0
- package/dist/types/app/components/empty-state/empty-state.component.d.ts +12 -0
- package/dist/types/app/components/module-placeholder-page/module-placeholder-page.component.d.ts +6 -0
- package/dist/types/app/components/planning-result/planning-result.component.d.ts +46 -0
- package/dist/types/app/components/planning-result/planning-trigger.component.d.ts +13 -0
- package/dist/types/app/components/results-page/results-page.component.d.ts +13 -0
- package/dist/types/app/components/suissebilanz-dashboard/gauge-arc.component.d.ts +47 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-dashboard.component.d.ts +24 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-metrics.service.d.ts +21 -0
- package/dist/types/app/components/suissebilanz-dashboard/suissebilanz-minibar.component.d.ts +19 -0
- package/dist/types/app/components/validation-page/validation-page.component.d.ts +18 -0
- package/dist/types/app/components/welcome-page/metadata.types.d.ts +1 -0
- package/dist/types/app/components/welcome-page/welcome-page.component.d.ts +28 -0
- package/dist/types/app/components/workflow-stepper/workflow-stepper.component.d.ts +49 -0
- package/dist/types/app/core/data/naebi-data.service.d.ts +278 -0
- package/dist/types/app/core/error/global-error-handler.d.ts +6 -0
- package/dist/types/app/core/events/suibi-data-emitter.service.d.ts +13 -0
- package/dist/types/app/core/events/suibi-data-event.d.ts +26 -0
- package/dist/types/app/core/i18n/i18n.service.d.ts +20 -0
- package/dist/types/app/core/i18n/locales/de.d.ts +2 -0
- package/dist/types/app/core/i18n/locales/en.d.ts +2 -0
- package/dist/types/app/core/master-data/master-data.service.d.ts +32 -0
- package/dist/types/app/core/metadata/suibi-metadata.service.d.ts +6 -0
- package/dist/types/app/core/metadata/suibi-metadata.types.d.ts +8 -0
- package/dist/types/app/core/navigation/navigation.service.d.ts +100 -0
- package/dist/types/app/core/planning/planning-balance.service.d.ts +37 -0
- package/dist/types/app/core/planning/planning-balance.types.d.ts +206 -0
- package/dist/types/app/core/planning/planning-balance.utils.d.ts +10 -0
- package/dist/types/app/core/schemas/index.d.ts +18 -0
- package/dist/types/app/core/schemas/schema-localization.util.d.ts +18 -0
- package/dist/types/app/core/schemas/schema-merge.util.d.ts +26 -0
- package/dist/types/app/core/schemas/ui-helper-registry.d.ts +16 -0
- package/dist/types/app/core/telemetry/telemetry.service.d.ts +12 -0
- package/dist/types/app/core/utils/object.util.d.ts +24 -0
- package/dist/types/app/core/validation/ajv-custom.d.ts +15 -0
- package/dist/types/app/core/validation/capabilities.d.ts +18 -0
- package/dist/types/app/core/validation/error-formatter.d.ts +19 -0
- package/dist/types/app/core/validation/global-validation.service.d.ts +59 -0
- package/dist/types/app/core/validation/validation-errors-panel.d.ts +36 -0
- package/dist/types/app/header-bar.d.ts +14 -0
- package/dist/types/app/jsonforms/constraints/constraint-resolvers.d.ts +50 -0
- package/dist/types/app/jsonforms/filters/code-list-filter-resolvers.d.ts +63 -0
- package/dist/types/app/jsonforms/registry/renderers.registry.d.ts +34 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/animal-category/animal-category-select.renderer.d.ts +21 -0
- package/dist/types/app/jsonforms/renderers/controls/selects/code-list/code-list-select.renderer.d.ts +34 -0
- package/dist/types/app/jsonforms/renderers/layout/array/array-layout.renderer.d.ts +43 -0
- package/dist/types/app/jsonforms/renderers/layout/categorization/selected-category-categorization.renderer.d.ts +34 -0
- package/dist/types/app/jsonforms/renderers/layout/constraint/constraint-layout.renderer.d.ts +30 -0
- package/dist/types/app/jsonforms/renderers/layout/group/base-group.renderer.d.ts +29 -0
- package/dist/types/app/jsonforms/renderers/layout/group/card-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/renderers/layout/group/group-testers.d.ts +4 -0
- package/dist/types/app/jsonforms/renderers/layout/group/logical-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/renderers/layout/group/plain-group.renderer.d.ts +6 -0
- package/dist/types/app/jsonforms/shared/base-control/base-select-control.d.ts +16 -0
- package/dist/types/app/jsonforms/shared/option-sources/code-lists.d.ts +11 -0
- package/dist/types/app/jsonforms/shared/validation/field-error.service.d.ts +18 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-detail.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-list.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock-master-detail.component.d.ts +24 -0
- package/dist/types/app/nutrient-cycle/animal-stock/animal-stock.types.d.ts +69 -0
- package/dist/types/app/nutrient-cycle/animal-stock/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-detail.component.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-list.component.d.ts +23 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading-master-detail.component.d.ts +25 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/farm-manure-trading.types.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/index.d.ts +4 -0
- package/dist/types/app/nutrient-cycle/farm-manure-trading/transaction-unit.util.d.ts +1 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-detail.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-general.component.d.ts +22 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-list.component.d.ts +17 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation-master-detail.component.d.ts +36 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.types.d.ts +40 -0
- package/dist/types/app/nutrient-cycle/field-cultivation/field-cultivation.util.d.ts +6 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/field-spreading/field-spreading.types.d.ts +43 -0
- package/dist/types/app/nutrient-cycle/field-spreading/index.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-detail.component.d.ts +32 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-list.component.d.ts +21 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder-master-detail.component.d.ts +37 -0
- package/dist/types/app/nutrient-cycle/fodder/fodder.types.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/fodder/transaction-unit.util.d.ts +2 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance-form.component.d.ts +27 -0
- package/dist/types/app/nutrient-cycle/lifetime-performance/lifetime-performance.types.d.ts +5 -0
- package/dist/types/app/nutrient-cycle/storage/storage-detail.component.d.ts +30 -0
- package/dist/types/app/nutrient-cycle/storage/storage-general.component.d.ts +29 -0
- package/dist/types/app/nutrient-cycle/storage/storage-list.component.d.ts +20 -0
- package/dist/types/app/nutrient-cycle/storage/storage-master-detail.component.d.ts +31 -0
- package/dist/types/app/nutrient-cycle/storage/storage.types.d.ts +40 -0
- package/dist/types/environments/environment.d.ts +11 -0
- package/dist/types/public-api.d.ts +6 -0
- package/dist/types/shared/material-icons.d.ts +16 -0
- package/package.json +91 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import exampleDetail from '../../../../assets/example-data/example-naebi-data.json';
|
|
2
|
+
type SampleEvent = typeof exampleDetail;
|
|
3
|
+
type SampleData = SampleEvent['payload']['data'];
|
|
4
|
+
export type NaebiData = SampleData;
|
|
5
|
+
/**
|
|
6
|
+
* Calculation mode determines which validation rules and features are active.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum CalculationMode {
|
|
9
|
+
SuiBi = "SuiBi",// SuisseBilanz (standard)
|
|
10
|
+
ExBi = "ExBi"
|
|
11
|
+
}
|
|
12
|
+
export declare class NaebiDataService {
|
|
13
|
+
private readonly _data;
|
|
14
|
+
readonly data: import("@angular/core").Signal<{
|
|
15
|
+
nutrientCycle: {
|
|
16
|
+
animalStock: {
|
|
17
|
+
order: string;
|
|
18
|
+
animalCategoryPRIF: number;
|
|
19
|
+
selfReportedLivestock: {
|
|
20
|
+
averageQuantity: number;
|
|
21
|
+
};
|
|
22
|
+
durationCorrectionQuantity: number;
|
|
23
|
+
durationCorrectionDays: number;
|
|
24
|
+
utilisation: number;
|
|
25
|
+
formOfDetention: {
|
|
26
|
+
hasGrazing: boolean;
|
|
27
|
+
pasture: {
|
|
28
|
+
days: number;
|
|
29
|
+
hoursPerDay: number;
|
|
30
|
+
};
|
|
31
|
+
stall: {
|
|
32
|
+
stableSystem: string;
|
|
33
|
+
stableCapacity: number;
|
|
34
|
+
stableVentilationType: number;
|
|
35
|
+
stableAirPurification: number;
|
|
36
|
+
hasStableDeepLitter: boolean;
|
|
37
|
+
hasStableManureBeltDrying: boolean;
|
|
38
|
+
stableManureRemovalFrequency: number;
|
|
39
|
+
stableWaterSupply: number;
|
|
40
|
+
hasStableManureAndSlurryProduction: boolean;
|
|
41
|
+
hasStableFeedingStationElevated: boolean;
|
|
42
|
+
hasStableFloorSlopedUrineDrainage: boolean;
|
|
43
|
+
hasYard: boolean;
|
|
44
|
+
yardFeeding: number;
|
|
45
|
+
yardFloorType: number;
|
|
46
|
+
yardDays: number;
|
|
47
|
+
yardHoursPerDay: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
hasImpexDerivedExcretion: boolean;
|
|
51
|
+
hasLinearCorrectionDerivedExcretion: boolean;
|
|
52
|
+
feeding: {
|
|
53
|
+
fodderConsumption: number;
|
|
54
|
+
concentratedFeedstuffConsumption: number;
|
|
55
|
+
winterFeeding: {
|
|
56
|
+
feedingRoutine: {
|
|
57
|
+
typeOfFeedstuffProduct: string;
|
|
58
|
+
transactionUnit: string;
|
|
59
|
+
quantity: number;
|
|
60
|
+
}[];
|
|
61
|
+
dailyConcentratedFeedstuff: {
|
|
62
|
+
quantity: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
summerFeeding: {
|
|
66
|
+
feedingRoutine: {
|
|
67
|
+
typeOfFeedstuffProduct: string;
|
|
68
|
+
transactionUnit: string;
|
|
69
|
+
quantity: number;
|
|
70
|
+
}[];
|
|
71
|
+
dailyConcentratedFeedstuff: {
|
|
72
|
+
quantity: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
}[];
|
|
77
|
+
storage: {
|
|
78
|
+
stableStrawLitter: number;
|
|
79
|
+
manureSupplyProportionStored: number;
|
|
80
|
+
slurrySupplyProportionStored: number;
|
|
81
|
+
createFacilitySpecificManureProduct: boolean;
|
|
82
|
+
createFacilitySpecificSlurryProduct: boolean;
|
|
83
|
+
dilutionRatio: number;
|
|
84
|
+
manurePit: {
|
|
85
|
+
descriptor: string;
|
|
86
|
+
cover: number;
|
|
87
|
+
manureFromAnimalStockStored: {
|
|
88
|
+
manureDerivation: string;
|
|
89
|
+
proportionStored: number;
|
|
90
|
+
}[];
|
|
91
|
+
}[];
|
|
92
|
+
slurryTank: {
|
|
93
|
+
descriptor: string;
|
|
94
|
+
volumeInM3: number;
|
|
95
|
+
depthInM: number;
|
|
96
|
+
cover: number;
|
|
97
|
+
mixingFrequency: number;
|
|
98
|
+
manureDerivation: string[];
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
farmManureTrading: {
|
|
102
|
+
supply: {
|
|
103
|
+
quantity: number;
|
|
104
|
+
typeOfManureRecyclingProduct: string;
|
|
105
|
+
transactionUnit: string;
|
|
106
|
+
manureDerivation: {
|
|
107
|
+
zoologicalAnimal: string;
|
|
108
|
+
percentageAllocation: number;
|
|
109
|
+
}[];
|
|
110
|
+
ingredient: {
|
|
111
|
+
quantity: number;
|
|
112
|
+
molecularFormula: string;
|
|
113
|
+
unit: string;
|
|
114
|
+
}[];
|
|
115
|
+
}[];
|
|
116
|
+
dispense: {
|
|
117
|
+
quantity: number;
|
|
118
|
+
typeOfManureRecyclingProduct: string;
|
|
119
|
+
transactionUnit: string;
|
|
120
|
+
manureDerivation: {
|
|
121
|
+
zoologicalAnimal: string;
|
|
122
|
+
percentageAllocation: number;
|
|
123
|
+
}[];
|
|
124
|
+
ingredient: {
|
|
125
|
+
quantity: number;
|
|
126
|
+
molecularFormula: string;
|
|
127
|
+
unit: string;
|
|
128
|
+
}[];
|
|
129
|
+
}[];
|
|
130
|
+
};
|
|
131
|
+
fieldSpreading: {
|
|
132
|
+
soilPh: number;
|
|
133
|
+
slurry: {
|
|
134
|
+
quantity: number;
|
|
135
|
+
dilutionRatio: number;
|
|
136
|
+
otherApplicationTechnologies: {
|
|
137
|
+
applicationTechnologyType: number;
|
|
138
|
+
proportionOfArea: number;
|
|
139
|
+
}[];
|
|
140
|
+
applicationDuringWarmDays: number;
|
|
141
|
+
proportionAppliedSummerMonths: number;
|
|
142
|
+
proportionAppliedOtherMonths: number;
|
|
143
|
+
proportionAppliedAfter6PM: number;
|
|
144
|
+
dragHoseAreaSize: number;
|
|
145
|
+
};
|
|
146
|
+
manure: {
|
|
147
|
+
applicationIncorporationTime: number;
|
|
148
|
+
proportionAppliedSummerMonths: number;
|
|
149
|
+
proportionAppliedOtherMonths: number;
|
|
150
|
+
};
|
|
151
|
+
fertiliser: {
|
|
152
|
+
descriptor: string;
|
|
153
|
+
fertiliserProductCategory: string;
|
|
154
|
+
quantity: number;
|
|
155
|
+
transactionUnit: string;
|
|
156
|
+
ingredient: {
|
|
157
|
+
molecularFormula: string;
|
|
158
|
+
quantity: number;
|
|
159
|
+
unit: string;
|
|
160
|
+
}[];
|
|
161
|
+
}[];
|
|
162
|
+
recycling: {
|
|
163
|
+
typeOfManureRecyclingProduct: string;
|
|
164
|
+
quantity: number;
|
|
165
|
+
transactionUnit: string;
|
|
166
|
+
ingredient: {
|
|
167
|
+
molecularFormula: string;
|
|
168
|
+
quantity: number;
|
|
169
|
+
unit: string;
|
|
170
|
+
}[];
|
|
171
|
+
}[];
|
|
172
|
+
};
|
|
173
|
+
lifetimePerformance: {
|
|
174
|
+
milkProductionReport: number;
|
|
175
|
+
};
|
|
176
|
+
fodder: {
|
|
177
|
+
trading: {
|
|
178
|
+
supply: {
|
|
179
|
+
typeOfFeedstuffProduct: string;
|
|
180
|
+
quantity: number;
|
|
181
|
+
transactionUnit: string;
|
|
182
|
+
ingredient: {
|
|
183
|
+
quantity: number;
|
|
184
|
+
molecularFormula: string;
|
|
185
|
+
unit: string;
|
|
186
|
+
}[];
|
|
187
|
+
}[];
|
|
188
|
+
dispense: {
|
|
189
|
+
typeOfFeedstuffProduct: string;
|
|
190
|
+
quantity: number;
|
|
191
|
+
transactionUnit: string;
|
|
192
|
+
ingredient: never[];
|
|
193
|
+
}[];
|
|
194
|
+
};
|
|
195
|
+
cropFromNonFodderCropland: {
|
|
196
|
+
typeOfFeedstuffProduct: string;
|
|
197
|
+
quantity: number;
|
|
198
|
+
transactionUnit: string;
|
|
199
|
+
ingredient: {
|
|
200
|
+
quantity: number;
|
|
201
|
+
molecularFormula: string;
|
|
202
|
+
unit: string;
|
|
203
|
+
}[];
|
|
204
|
+
}[];
|
|
205
|
+
proportionStorageLoss: number;
|
|
206
|
+
totalBalanceErrorMargin: number;
|
|
207
|
+
};
|
|
208
|
+
fieldCultivation: {
|
|
209
|
+
buildingZoneAreaSize: number;
|
|
210
|
+
outdoorVegetableMainCropAreaSize: number;
|
|
211
|
+
indoorVegetableMainCropAreaSize: number;
|
|
212
|
+
feedingOfCropHarvest: {
|
|
213
|
+
agronomicCropCategory: string;
|
|
214
|
+
effectiveYield: number;
|
|
215
|
+
}[];
|
|
216
|
+
dispenseOfCropHarvest: {
|
|
217
|
+
agronomicCropCategory: string;
|
|
218
|
+
effectiveYield: number;
|
|
219
|
+
}[];
|
|
220
|
+
fodderCropland: ({
|
|
221
|
+
agronomicCropCategory: string;
|
|
222
|
+
isMainCrop: boolean;
|
|
223
|
+
areaSize: number;
|
|
224
|
+
calculateYieldThroughFodderBalance: boolean;
|
|
225
|
+
yieldPerSquareMeasure?: undefined;
|
|
226
|
+
} | {
|
|
227
|
+
agronomicCropCategory: string;
|
|
228
|
+
isMainCrop: boolean;
|
|
229
|
+
areaSize: number;
|
|
230
|
+
yieldPerSquareMeasure: number;
|
|
231
|
+
calculateYieldThroughFodderBalance?: undefined;
|
|
232
|
+
})[];
|
|
233
|
+
arableLand: {
|
|
234
|
+
agronomicCropCategory: string;
|
|
235
|
+
isMainCrop: boolean;
|
|
236
|
+
areaSize: number;
|
|
237
|
+
yieldPerSquareMeasure: number;
|
|
238
|
+
hasLongTermYieldDivergence: boolean;
|
|
239
|
+
}[];
|
|
240
|
+
special: {
|
|
241
|
+
agronomicCropCategory: string;
|
|
242
|
+
userSpecificPlantName: string;
|
|
243
|
+
isMainCrop: boolean;
|
|
244
|
+
areaSize: number;
|
|
245
|
+
requirementCorrection: {
|
|
246
|
+
quantity: number;
|
|
247
|
+
molecularFormula: string;
|
|
248
|
+
unit: string;
|
|
249
|
+
}[];
|
|
250
|
+
}[];
|
|
251
|
+
};
|
|
252
|
+
generateReport: boolean;
|
|
253
|
+
};
|
|
254
|
+
calculationVersion: {
|
|
255
|
+
version: string;
|
|
256
|
+
};
|
|
257
|
+
}>;
|
|
258
|
+
private readonly _lastEmitted;
|
|
259
|
+
private readonly _dirty;
|
|
260
|
+
readonly dirty: import("@angular/core").Signal<boolean>;
|
|
261
|
+
private readonly _calculationMode;
|
|
262
|
+
readonly calculationMode: import("@angular/core").Signal<CalculationMode>;
|
|
263
|
+
/**
|
|
264
|
+
* Set new data value; accepts plain object (already parsed) matching NaebiData shape.
|
|
265
|
+
* Silent no-op if value is structurally equal after normalization to avoid unnecessary updates.
|
|
266
|
+
*/
|
|
267
|
+
setData(value: NaebiData): void;
|
|
268
|
+
/** Mark current data as saved (clears dirty state and updates snapshot). */
|
|
269
|
+
markSaved(): void;
|
|
270
|
+
/**
|
|
271
|
+
* Set calculation mode (SuiBi or ExBi).
|
|
272
|
+
* Can affect which validation rules are active or which features are enabled.
|
|
273
|
+
*/
|
|
274
|
+
setCalculationMode(mode: CalculationMode): void;
|
|
275
|
+
/** Reset to bundled example */
|
|
276
|
+
reset(): void;
|
|
277
|
+
}
|
|
278
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SuibiDataEventDetail, SuibiDataEventMetadata } from './suibi-data-event';
|
|
2
|
+
/**
|
|
3
|
+
* Centralizes construction + dispatch of the `suibi-data-emitted` payload so multiple UI entry points can reuse it.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SuibiDataEmitterService {
|
|
6
|
+
private readonly i18n;
|
|
7
|
+
private readonly validation;
|
|
8
|
+
private readonly metadataSvc;
|
|
9
|
+
private readonly naebi;
|
|
10
|
+
buildMetadata(): SuibiDataEventMetadata;
|
|
11
|
+
buildDetail(): SuibiDataEventDetail;
|
|
12
|
+
emitFrom(target: HTMLElement): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Locale } from '../i18n/i18n.service';
|
|
2
|
+
import { NaebiData } from '../data/naebi-data.service';
|
|
3
|
+
import { SuibiMetadata } from '../metadata/suibi-metadata.types';
|
|
4
|
+
/**
|
|
5
|
+
* Increment when the payload contract changes in a backwards-incompatible way.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SUIBI_DATA_EVENT_VERSION = "suibi-data.v1";
|
|
8
|
+
/** Detail object emitted with the `suibi-data` CustomEvent. */
|
|
9
|
+
export interface SuibiDataEventDetail {
|
|
10
|
+
version: typeof SUIBI_DATA_EVENT_VERSION;
|
|
11
|
+
payload: SuibiDataEventPayload;
|
|
12
|
+
}
|
|
13
|
+
/** Top-level payload structure delivered to host applications. */
|
|
14
|
+
export interface SuibiDataEventPayload {
|
|
15
|
+
metadata: SuibiDataEventMetadata;
|
|
16
|
+
data: NaebiData;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Metadata describing the dataset at the moment of emission so hosts can audit and reason about it.
|
|
20
|
+
*/
|
|
21
|
+
export type SuibiDataEventMetadata = SuibiMetadata & {
|
|
22
|
+
emittedAt: string;
|
|
23
|
+
locale: Locale;
|
|
24
|
+
isValid: boolean;
|
|
25
|
+
errorCount: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PipeTransform, Signal } from '@angular/core';
|
|
2
|
+
export type Locale = 'en' | 'de';
|
|
3
|
+
export type JsonFormsTranslator = (key: string, defaultMessage: string | undefined, context: unknown) => string;
|
|
4
|
+
export declare class I18nService {
|
|
5
|
+
private readonly _locale;
|
|
6
|
+
locale: Signal<Locale>;
|
|
7
|
+
private readonly translator;
|
|
8
|
+
readonly jsonFormsI18n: Signal<{
|
|
9
|
+
locale: Locale;
|
|
10
|
+
translate: JsonFormsTranslator;
|
|
11
|
+
}>;
|
|
12
|
+
setLocale(locale: Locale): void;
|
|
13
|
+
t(key: string, defaultMessage?: string): string;
|
|
14
|
+
}
|
|
15
|
+
export declare class TranslatePipe implements PipeTransform {
|
|
16
|
+
private readonly i18n;
|
|
17
|
+
private readonly cache;
|
|
18
|
+
constructor(i18n: I18nService);
|
|
19
|
+
transform(key: string, defaultMessage?: string): Signal<string>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Locale } from '../i18n/i18n.service';
|
|
2
|
+
/** The property name of the primary key in a master-data catalog entry. */
|
|
3
|
+
type MasterDataKeyField = string;
|
|
4
|
+
interface MasterDataCatalog {
|
|
5
|
+
entries: any[];
|
|
6
|
+
/** Property name to use as the lookup key; 'id' entries are coerced to Number. */
|
|
7
|
+
key: MasterDataKeyField;
|
|
8
|
+
}
|
|
9
|
+
declare const MASTER_DATA: Record<string, MasterDataCatalog>;
|
|
10
|
+
export type MasterDataKind = keyof typeof MASTER_DATA;
|
|
11
|
+
export declare class MasterDataService {
|
|
12
|
+
private readonly i18n;
|
|
13
|
+
private readonly locale;
|
|
14
|
+
private readonly indices;
|
|
15
|
+
/** Public lookup of raw master-data entry (typed as any for now). */
|
|
16
|
+
entry<T = any>(kind: MasterDataKind, id: number | string | null | undefined): T | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the localized designation for a master-data entry by kind and id.
|
|
19
|
+
* Falls back to 'deu' if not found in the current locale.
|
|
20
|
+
*/
|
|
21
|
+
designation(kind: MasterDataKind, id: number | string | null | undefined, locale?: Locale): string;
|
|
22
|
+
resolveAnimalCategory(id: number | string | null | undefined, locale?: Locale): string;
|
|
23
|
+
resolveUtilisation(id: number | string | null | undefined, locale?: Locale): string;
|
|
24
|
+
resolveManureProduct(code: string | null | undefined, locale?: Locale): string;
|
|
25
|
+
resolveZoologicalAnimal(code: string | null | undefined, locale?: Locale): string;
|
|
26
|
+
resolveCultivationCategory(code: string | null | undefined, locale?: Locale): string;
|
|
27
|
+
resolveAgronomicCropCategory(code: string | null | undefined, locale?: Locale): string;
|
|
28
|
+
resolveFeedstuffProduct(code: string | null | undefined, locale?: Locale): string;
|
|
29
|
+
resolveCover(id: number | string | null | undefined, locale?: Locale): string;
|
|
30
|
+
resolveMixingFrequency(id: number | string | null | undefined, locale?: Locale): string;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type SuibiVersion = '1.19' | '1.20';
|
|
2
|
+
export type SubmissionStatus = 'draft' | 'submitted' | 'final';
|
|
3
|
+
export interface SuibiMetadata {
|
|
4
|
+
title: string;
|
|
5
|
+
suibiVersion: SuibiVersion;
|
|
6
|
+
status: SubmissionStatus;
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_SUIBI_METADATA: SuibiMetadata;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export type PageId = 'welcome' | 'animal_stock' | 'data_preview' | 'storage' | 'field_spreading' | 'farm_manure_trading' | 'fodder' | 'field_cultivation' | 'validation' | 'results';
|
|
2
|
+
export type AnimalStockCategory = 'base' | 'formOfDetention' | 'feeding';
|
|
3
|
+
export type FarmManureTradingMode = 'supply' | 'dispense';
|
|
4
|
+
export type FarmManureTradingCategory = 'general' | 'derivation' | 'ingredients';
|
|
5
|
+
export type FodderMode = 'supply' | 'dispense' | 'non_fodder_cropland';
|
|
6
|
+
export type FodderCategory = 'general' | 'ingredients';
|
|
7
|
+
export type FieldSpreadingCategory = 'general' | 'fertiliser' | 'recycling';
|
|
8
|
+
export type FieldCultivationTab = 'general' | 'fodderCropland' | 'arableLand' | 'special';
|
|
9
|
+
export type StorageTab = 'manure' | 'slurry';
|
|
10
|
+
export type StorageEntryType = 'manure_pit' | 'slurry_tank';
|
|
11
|
+
/**
|
|
12
|
+
* NavigationService
|
|
13
|
+
* Global reactive store for application routing and deep-link state.
|
|
14
|
+
* Follows Pinia/Vuex pattern: signals = state, computed = getters, methods = actions.
|
|
15
|
+
*
|
|
16
|
+
* Responsibilities:
|
|
17
|
+
* - Track current page and page-specific context (e.g., selected entity index, active tab)
|
|
18
|
+
* - Provide navigation actions that update state atomically
|
|
19
|
+
* - Used by validation system to deep-link users to fields requiring correction
|
|
20
|
+
*
|
|
21
|
+
* Pattern for adding new pages:
|
|
22
|
+
* 1. Add page ID to PageId type
|
|
23
|
+
* 2. Add page-specific state signals (e.g., selectedStorageIndex)
|
|
24
|
+
* 3. Add navigation actions (e.g., navigateToStorageDetail)
|
|
25
|
+
* 4. Update reset logic in resetPageContext()
|
|
26
|
+
*/
|
|
27
|
+
export declare class NavigationService {
|
|
28
|
+
/** Current active page */
|
|
29
|
+
readonly currentPage: import("@angular/core").WritableSignal<PageId>;
|
|
30
|
+
/** Selected animal stock entry index (null = list view) */
|
|
31
|
+
readonly selectedAnimalStockIndex: import("@angular/core").WritableSignal<number | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Generic category (tab) selection: stores current page + selected category key.
|
|
34
|
+
* Used by categorization renderer for programmatic tab control.
|
|
35
|
+
* Format: { page: PageId, category: string }
|
|
36
|
+
*/
|
|
37
|
+
readonly selectedCategory: import("@angular/core").WritableSignal<{
|
|
38
|
+
page: PageId;
|
|
39
|
+
category: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Selected farm manure trading detail context (mode + index) */
|
|
42
|
+
readonly selectedFarmManureTrading: import("@angular/core").WritableSignal<{
|
|
43
|
+
mode: FarmManureTradingMode;
|
|
44
|
+
index: number;
|
|
45
|
+
} | null>;
|
|
46
|
+
/** Selected fodder detail context (mode + index) */
|
|
47
|
+
readonly selectedFodderDetail: import("@angular/core").WritableSignal<{
|
|
48
|
+
mode: FodderMode;
|
|
49
|
+
index: number;
|
|
50
|
+
} | null>;
|
|
51
|
+
/** Selected field cultivation detail context (tab + index) */
|
|
52
|
+
readonly selectedFieldCultivationDetail: import("@angular/core").WritableSignal<{
|
|
53
|
+
tab: Exclude<FieldCultivationTab, "general">;
|
|
54
|
+
index: number;
|
|
55
|
+
} | null>;
|
|
56
|
+
/** Selected storage detail context (type + index) */
|
|
57
|
+
readonly selectedStorageDetail: import("@angular/core").WritableSignal<{
|
|
58
|
+
type: StorageEntryType;
|
|
59
|
+
index: number;
|
|
60
|
+
} | null>;
|
|
61
|
+
/** True if currently viewing animal stock detail (not list) */
|
|
62
|
+
readonly isAnimalStockDetailView: import("@angular/core").Signal<boolean>;
|
|
63
|
+
/** True if currently on animal stock page (list or detail) */
|
|
64
|
+
readonly isAnimalStockPage: import("@angular/core").Signal<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Navigate to a top-level page. Resets page-specific context.
|
|
67
|
+
* Use this for simple page switches (e.g., nav menu clicks).
|
|
68
|
+
*/
|
|
69
|
+
navigateToPage(page: PageId): void;
|
|
70
|
+
/**
|
|
71
|
+
* Navigate to animal stock list view (no entry selected).
|
|
72
|
+
*/
|
|
73
|
+
navigateToAnimalStockList(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Navigate to animal stock detail view (specific entry + optional tab).
|
|
76
|
+
* Used by validation error navigation and internal routing.
|
|
77
|
+
*/
|
|
78
|
+
navigateToAnimalStockDetail(index: number, category?: AnimalStockCategory): void;
|
|
79
|
+
navigateToFarmManureTradingDetail(mode: FarmManureTradingMode, index: number, category?: FarmManureTradingCategory): void;
|
|
80
|
+
navigateToFarmManureTradingList(): void;
|
|
81
|
+
navigateToFodderDetail(mode: FodderMode, index: number, category?: FodderCategory): void;
|
|
82
|
+
navigateToFodderList(): void;
|
|
83
|
+
navigateToFieldSpreading(category?: FieldSpreadingCategory): void;
|
|
84
|
+
navigateToFieldCultivationDetail(tab: Exclude<FieldCultivationTab, 'general'>, index: number): void;
|
|
85
|
+
navigateToFieldCultivationList(tab?: FieldCultivationTab): void;
|
|
86
|
+
navigateToStorageDetail(type: StorageEntryType, index: number): void;
|
|
87
|
+
navigateToStorageList(tab?: StorageTab): void;
|
|
88
|
+
/**
|
|
89
|
+
* Set active category/tab for current page (without changing page/entry).
|
|
90
|
+
* Generic method supporting any page's categorization navigation.
|
|
91
|
+
* No-op when page and category are already the same values to prevent
|
|
92
|
+
* unnecessary signal emissions that re-trigger the tab index computed.
|
|
93
|
+
*/
|
|
94
|
+
setCategory(page: PageId, category: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Reset page-specific context when navigating away.
|
|
97
|
+
* Prevents stale state (e.g., old selected index) from affecting new page.
|
|
98
|
+
*/
|
|
99
|
+
private resetPageContext;
|
|
100
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NaebiData } from '../data/naebi-data.service';
|
|
2
|
+
import type { PlanningBalanceResponse } from './planning-balance.types';
|
|
3
|
+
export type { PlanningBalanceResponse } from './planning-balance.types';
|
|
4
|
+
/** Which backend to target for planning requests. */
|
|
5
|
+
export type PlanningEndpoint = 'ebilanz' | 'blw';
|
|
6
|
+
/**
|
|
7
|
+
* Sends NAEBI data to a planning endpoint and exposes the result as a
|
|
8
|
+
* signal-based resource. Call `runPlanning(data, endpoint)` to trigger a request.
|
|
9
|
+
*
|
|
10
|
+
* The ID counter ensures each call re-fetches even if the payload hasn't changed.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PlanningBalanceService {
|
|
13
|
+
private readonly http;
|
|
14
|
+
private readonly _value;
|
|
15
|
+
private readonly _error;
|
|
16
|
+
private readonly _isLoading;
|
|
17
|
+
private readonly _selectedEndpoint;
|
|
18
|
+
private readonly _lastStartedRequestId;
|
|
19
|
+
private readonly _lastCompletedRequestId;
|
|
20
|
+
private readonly _lastSuccessfulRequestId;
|
|
21
|
+
private _nextId;
|
|
22
|
+
private activeRequestId;
|
|
23
|
+
private activeRequestSub;
|
|
24
|
+
readonly planningResource: {
|
|
25
|
+
value: import("@angular/core").Signal<PlanningBalanceResponse | undefined>;
|
|
26
|
+
error: import("@angular/core").Signal<unknown>;
|
|
27
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
28
|
+
hasValue: import("@angular/core").Signal<boolean>;
|
|
29
|
+
lastStartedRequestId: import("@angular/core").Signal<number>;
|
|
30
|
+
lastCompletedRequestId: import("@angular/core").Signal<number>;
|
|
31
|
+
lastSuccessfulRequestId: import("@angular/core").Signal<number>;
|
|
32
|
+
};
|
|
33
|
+
readonly selectedEndpoint: import("@angular/core").Signal<PlanningEndpoint>;
|
|
34
|
+
setSelectedEndpoint(endpoint: PlanningEndpoint): void;
|
|
35
|
+
/** Fire a new planning-balance request with the current NAEBI data payload. */
|
|
36
|
+
runPlanning(data: NaebiData, endpoint?: PlanningEndpoint): void;
|
|
37
|
+
}
|