@la-main-verte/shared-types 1.0.78 → 1.0.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@la-main-verte/shared-types",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "Shared TypeScript interfaces for frontend of la-main-verte app",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -1,56 +1,55 @@
1
- export interface FertilizerI {
2
- id: number
3
- name: string
4
- slug: string
5
- azotePercentage: number
6
- phosphorePercentage: number
7
- potassiumPercentage: number
8
- /**
9
- * The real azote percentage is the azote percentage multiplied by the azote efficiency.
10
- */
11
- realAzotePercentage: number
12
- /**
13
- * The azote efficiency is a percentage number between 0 and 1.
14
- * Its how efficient the mineralization of the azote is.
15
- */
16
- azoteEfficiency: number
17
- imageLocation: string
18
- imageURL: string
19
- quantitySuggested: string
20
- /**
21
- * Blend composition when this fertilizer is a combination of two products.
22
- * Null for single fertilizers.
23
- * When populated, contains the IDs and ratios (as percentages) of the primary and secondary fertilizers.
24
- * The NPK values should be calculated by fetching each fertilizer and applying the weighted average.
25
- *
26
- * @example
27
- * // For a blend:
28
- * {
29
- * "primary_fertilizer_id": 1, // Acti-Sol (70%)
30
- * "primary_fertilizer_ratio": 70,
31
- * "secondary_fertilizer_id": 12, // Bionik (30%)
32
- * "secondary_fertilizer_ratio": 30
33
- * }
34
- *
35
- * // For a single fertilizer:
36
- * {}
37
- */
38
- combination_details: BlendCompositionI | null
39
- }
40
-
41
- interface BlendCompositionI {
42
- primary_fertilizer_id: number
43
- primary_fertilizer_ratio: number
44
- secondary_fertilizer_id: number
45
- secondary_fertilizer_ratio: number
46
- }
47
-
48
- export interface FertilizerSectionI {
49
- sectionTitle: string
50
- sectionSubtitle: string
51
- fertilizers: FertilizerI[]
52
- }
53
-
54
- export interface FertilizersInGridI {
55
- fertilizerSection: FertilizerSectionI[]
56
- }
1
+ export interface FertilizerI {
2
+ id: number
3
+ name: string
4
+ slug: string
5
+ azotePercentage: number
6
+ phosphorePercentage: number
7
+ potassiumPercentage: number
8
+ /**
9
+ * The real azote percentage is the azote percentage multiplied by the azote efficiency.
10
+ */
11
+ realAzotePercentage: number
12
+ /**
13
+ * Nitrogen mineralization rate, between 0 and 1 (e.g. 0.9 for 90%).
14
+ */
15
+ nitrogenMineralizationRate: number | null
16
+ imageLocation: string
17
+ imageURL: string
18
+ quantitySuggested: string
19
+ /**
20
+ * Blend composition when this fertilizer is a combination of two products.
21
+ * Null for single fertilizers.
22
+ * When populated, contains the IDs and ratios (as percentages) of the primary and secondary fertilizers.
23
+ * The NPK values should be calculated by fetching each fertilizer and applying the weighted average.
24
+ *
25
+ * @example
26
+ * // For a blend:
27
+ * {
28
+ * "primary_fertilizer_id": 1, // Acti-Sol (70%)
29
+ * "primary_fertilizer_ratio": 70,
30
+ * "secondary_fertilizer_id": 12, // Bionik (30%)
31
+ * "secondary_fertilizer_ratio": 30
32
+ * }
33
+ *
34
+ * // For a single fertilizer:
35
+ * {}
36
+ */
37
+ combination_details: BlendCompositionI | null
38
+ }
39
+
40
+ interface BlendCompositionI {
41
+ primary_fertilizer_id: number
42
+ primary_fertilizer_ratio: number
43
+ secondary_fertilizer_id: number
44
+ secondary_fertilizer_ratio: number
45
+ }
46
+
47
+ export interface FertilizerSectionI {
48
+ sectionTitle: string
49
+ sectionSubtitle: string
50
+ fertilizers: FertilizerI[]
51
+ }
52
+
53
+ export interface FertilizersInGridI {
54
+ fertilizerSection: FertilizerSectionI[]
55
+ }
package/src/plant.d.ts CHANGED
@@ -59,7 +59,26 @@ export interface PlantI {
59
59
  isHardy: boolean | null
60
60
  quantityForFiveInJardinVivrier?: number | null
61
61
  imageURL: string
62
- plantMeshURL: string | null
62
+ /**
63
+ * Filename of the plant's 3D mesh asset stored on S3.
64
+ * - Ideally a `.webp` file (e.g. `ail.webp`).
65
+ * - Stored in S3 under the `images/meshes/` folder.
66
+ * - By default named after the `Plant.slug` (e.g. `ail.webp` for the garlic plant).
67
+ * - Only the filename is persisted; the public URL is exposed through the
68
+ * virtual `meshURL` field.
69
+ */
70
+ meshFilename: string | null
71
+ /**
72
+ * Public ImageKit URL to the plant's 3D mesh asset.
73
+ * Virtual field computed from `meshFilename`. The underlying file is
74
+ * stored on S3 at `images/meshes/{meshFilename}` and rewritten to
75
+ * ImageKit for CDN delivery and transformations.
76
+ *
77
+ * Falls back to `imageURL` when `meshFilename` is not set.
78
+ *
79
+ * Example: `https://ik.imagekit.io/lamainverte/meshes/ail.webp`
80
+ */
81
+ meshURL: string
63
82
  totalWeeksToMaturity: number
64
83
  hasNoInformation: boolean
65
84
  createdAt: Date