@la-main-verte/shared-types 1.0.57 → 1.0.58

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.
@@ -1,90 +1,105 @@
1
- /**
2
- * A gardenMap is a collection of garden zones
3
- */
4
- export interface GardenMapI {
5
- id: number
6
- name: string
7
- icon_name: string
8
- category?: string
9
- default: boolean
10
- width_in_units: number
11
- height_in_units: number
12
- createdAt: string
13
- Selections: SelectionI[]
14
- GardenZones: GardenZoneI[]
15
- imageURL: string
16
- }
17
-
18
- export interface GardenZoneI {
19
- id: number
20
- name: string | null
21
- gardenMapId: number
22
- widthInMeters: number
23
- heightInMeters: number
24
- diameterInMeters: number
25
- shape: 'rectangle' | 'circle'
26
- xPosition: number
27
- yPosition: number
28
- zIndex: number
29
- order: number
30
- totalSurfaceInSquareMeters: number
31
- totalSurfaceInSquareFeet: number
32
- backgroundColor: string
33
- createdAt: Date
34
- updatedAt: Date
35
- /**
36
- * When set, the garden zone is a subdivision of another garden zone
37
- * Parent zones are meant to be as eternal as possible.
38
- * Subdivisions are meant to be created and destroyed on a yearly basis.
39
- */
40
- parent_garden_zone_id: number
41
- /**
42
- * Virtual field to check if the garden zone is a subdivision
43
- * It is a renamed field from parent_garden_zone_id
44
- */
45
- is_subdivision: boolean
46
- has_subdivisions: boolean
47
- /**
48
- * Orientation virtual field ONLY USE FOR RECTANGLES
49
- * --------------------------------
50
- * Disregard if the shape is a circle or square. It will return 'vertical'
51
- */
52
- orientation: 'horizontal' | 'vertical'
53
- /**
54
- * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
55
- */
56
- GardenZoneCultures?: GardenZoneCultureI[]
57
- /**
58
- * The culture on the GardenZone
59
- */
60
- GardenZoneCulture?: GardenZoneCultureI
61
- }
62
-
63
- export interface GardenZoneCultureI {
64
- id: number
65
- gardenZoneId: number
66
- plantSelectionId: number
67
- seedQuantity: number
68
- densityMode: 'dense' | 'sparse' | 'custom'
69
- fertilizerId: number
70
- /**
71
- * The year of the culture - do not use it yet.
72
- * @deprecated Potentially a mistake to have this field here
73
- */
74
- yearOfCulture: number
75
- PlantSelection?: PlantSelectionI
76
- /**
77
- * The number of alleys
78
- * --------------------------------
79
- * Value is computed by the backend and NOT coming from the DB.
80
- */
81
- numberOfAlleys?: number
82
- /**
83
- * The number of seeds per alley
84
- * --------------------------------
85
- * Value is computed by the backend and NOT coming from the DB.
86
- */
87
- numberOfSeedsPerAlley?: number
88
- fertilizerQuantitySuggested?: string
89
- Fertilizer?: FertilizerI
90
- }
1
+ /**
2
+ * Available garden map categories across the platform
3
+ */
4
+ export type GardenMapCategory =
5
+ | 'community_garden'
6
+ | 'greenhouse'
7
+ | 'garden'
8
+ | 'recipe'
9
+ | 'favorites'
10
+ | 'indoor_garden'
11
+ | 'balcony'
12
+ | 'inventory'
13
+ | 'others'
14
+
15
+ /**
16
+ * A gardenMap is a collection of garden zones
17
+ */
18
+ export interface GardenMapI {
19
+ id: number
20
+ name: string
21
+ icon_name: string
22
+ category: GardenMapCategory
23
+ default: boolean
24
+ memberId: number
25
+ width_in_units: number
26
+ height_in_units: number
27
+ createdAt: string
28
+ Selections: SelectionI[]
29
+ GardenZones: GardenZoneI[]
30
+ imageURL: string
31
+ }
32
+
33
+ export interface GardenZoneI {
34
+ id: number
35
+ name: string | null
36
+ gardenMapId: number
37
+ widthInMeters: number
38
+ heightInMeters: number
39
+ diameterInMeters: number
40
+ shape: 'rectangle' | 'circle'
41
+ xPosition: number
42
+ yPosition: number
43
+ zIndex: number
44
+ order: number
45
+ totalSurfaceInSquareMeters: number
46
+ totalSurfaceInSquareFeet: number
47
+ backgroundColor: string
48
+ createdAt: Date
49
+ updatedAt: Date
50
+ /**
51
+ * When set, the garden zone is a subdivision of another garden zone
52
+ * Parent zones are meant to be as eternal as possible.
53
+ * Subdivisions are meant to be created and destroyed on a yearly basis.
54
+ */
55
+ parent_garden_zone_id: number
56
+ /**
57
+ * Virtual field to check if the garden zone is a subdivision
58
+ * It is a renamed field from parent_garden_zone_id
59
+ */
60
+ is_subdivision: boolean
61
+ has_subdivisions: boolean
62
+ /**
63
+ * Orientation virtual field ONLY USE FOR RECTANGLES
64
+ * --------------------------------
65
+ * Disregard if the shape is a circle or square. It will return 'vertical'
66
+ */
67
+ orientation: 'horizontal' | 'vertical'
68
+ /**
69
+ * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
70
+ */
71
+ GardenZoneCultures?: GardenZoneCultureI[]
72
+ /**
73
+ * The culture on the GardenZone
74
+ */
75
+ GardenZoneCulture?: GardenZoneCultureI
76
+ }
77
+
78
+ export interface GardenZoneCultureI {
79
+ id: number
80
+ gardenZoneId: number
81
+ plantSelectionId: number
82
+ seedQuantity: number
83
+ densityMode: 'dense' | 'sparse' | 'custom'
84
+ fertilizerId: number
85
+ /**
86
+ * The year of the culture - do not use it yet.
87
+ * @deprecated Potentially a mistake to have this field here
88
+ */
89
+ yearOfCulture: number
90
+ PlantSelection?: PlantSelectionI
91
+ /**
92
+ * The number of alleys
93
+ * --------------------------------
94
+ * Value is computed by the backend and NOT coming from the DB.
95
+ */
96
+ numberOfAlleys?: number
97
+ /**
98
+ * The number of seeds per alley
99
+ * --------------------------------
100
+ * Value is computed by the backend and NOT coming from the DB.
101
+ */
102
+ numberOfSeedsPerAlley?: number
103
+ fertilizerQuantitySuggested?: string
104
+ Fertilizer?: FertilizerI
105
+ }
@@ -1,79 +1,79 @@
1
- /**
2
- * Garden Overview Types
3
- * Represents the detailed overview of a garden selection
4
- */
5
- import { PlantI } from './plant'
6
-
7
- export interface GardenOverviewI {
8
- id: number
9
- title: string
10
- iconName: string
11
- yearOfCulture: number
12
- statistics: GardenOverviewStatsI
13
- }
14
-
15
- export interface GardenOverviewStatsI {
16
- totalSeeds: number
17
- totalSurface: string
18
- totalSurfaceWithoutCulture: string
19
- surfaceComparisonMessage: string | null
20
- familyDistribution: FamilyStatsI[]
21
- fertilization: FertilizationStatsI
22
- zones: GardenOverviewZoneStatsI[]
23
- }
24
-
25
- export interface FertilizationStatsI {
26
- totalWeightInKg: number
27
- weightComparisonMessage: string | null
28
- fertilizerDetails: FertilizerStatsI[]
29
- }
30
-
31
- export interface FertilizerStatsI {
32
- fertilizerName: string
33
- fertilizerQuantity: string
34
- imageURL: string
35
- }
36
-
37
- export interface FamilyStatsI {
38
- family: string
39
- hexColor: string
40
- totalSeeds: number
41
- totalSurface: string
42
- percentage: number
43
- plants: GardenOverviewPlantStatsI[]
44
- }
45
-
46
- /**
47
- * Extended PlantI with overview-specific statistics
48
- * Contains the full plant data plus surface, seedQuantity, and position
49
- */
50
- export interface GardenOverviewPlantStatsI extends PlantI {
51
- seedQuantity: number
52
- surface: string
53
- position: number
54
- densityMode: string
55
- fertilizerName: string
56
- fertilizerQuantity: string
57
- }
58
-
59
- export interface GardenOverviewZonePlantStatsI {
60
- id: number
61
- name: string
62
- imageURL: string | null
63
- }
64
-
65
- export interface GardenOverviewZoneFertilizerStatsI {
66
- name: string
67
- quantity: string
68
- }
69
-
70
- export interface GardenOverviewZoneStatsI {
71
- id: number
72
- name: string
73
- totalSeeds: number
74
- surface: string
75
- fertilizerQuantity: string
76
- thumbnailURL: string
77
- plants: GardenOverviewZonePlantStatsI[]
78
- fertilizers: GardenOverviewZoneFertilizerStatsI[]
79
- }
1
+ /**
2
+ * Garden Overview Types
3
+ * Represents the detailed overview of a garden selection
4
+ */
5
+ import { PlantI } from './plant'
6
+
7
+ export interface GardenOverviewI {
8
+ id: number
9
+ title: string
10
+ iconName: string
11
+ yearOfCulture: number
12
+ statistics: GardenOverviewStatsI
13
+ }
14
+
15
+ export interface GardenOverviewStatsI {
16
+ totalSeeds: number
17
+ totalSurface: string
18
+ totalSurfaceWithoutCulture: string
19
+ surfaceComparisonMessage: string | null
20
+ familyDistribution: FamilyStatsI[]
21
+ fertilization: FertilizationStatsI
22
+ zones: GardenOverviewZoneStatsI[]
23
+ }
24
+
25
+ export interface FertilizationStatsI {
26
+ totalWeightInKg: number
27
+ weightComparisonMessage: string | null
28
+ fertilizerDetails: FertilizerStatsI[]
29
+ }
30
+
31
+ export interface FertilizerStatsI {
32
+ fertilizerName: string
33
+ fertilizerQuantity: string
34
+ imageURL: string
35
+ }
36
+
37
+ export interface FamilyStatsI {
38
+ family: string
39
+ hexColor: string
40
+ totalSeeds: number
41
+ totalSurface: string
42
+ percentage: number
43
+ plants: GardenOverviewPlantStatsI[]
44
+ }
45
+
46
+ /**
47
+ * Extended PlantI with overview-specific statistics
48
+ * Contains the full plant data plus surface, seedQuantity, and position
49
+ */
50
+ export interface GardenOverviewPlantStatsI extends PlantI {
51
+ seedQuantity: number
52
+ surface: string
53
+ position: number
54
+ densityMode: string
55
+ fertilizerName: string
56
+ fertilizerQuantity: string
57
+ }
58
+
59
+ export interface GardenOverviewZonePlantStatsI {
60
+ id: number
61
+ name: string
62
+ imageURL: string | null
63
+ }
64
+
65
+ export interface GardenOverviewZoneFertilizerStatsI {
66
+ name: string
67
+ quantity: string
68
+ }
69
+
70
+ export interface GardenOverviewZoneStatsI {
71
+ id: number
72
+ name: string
73
+ totalSeeds: number
74
+ surface: string
75
+ fertilizerQuantity: string
76
+ thumbnailURL: string
77
+ plants: GardenOverviewZonePlantStatsI[]
78
+ fertilizers: GardenOverviewZoneFertilizerStatsI[]
79
+ }
package/src/home.api.d.ts CHANGED
@@ -1,159 +1,159 @@
1
- import type { PlantI } from './plant'
2
- import type { SelectionI } from './selection'
3
-
4
- export namespace HOME {
5
- export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
-
7
- export type SectionComponentType =
8
- | 'Header'
9
- | 'HeroCards'
10
- | 'PlantCarousel'
11
- | 'HeroCardsCarousel'
12
- | 'WideCardsCarousel'
13
- | 'Weather'
14
- | 'AdviceCarousel'
15
- | 'OnboardingCard'
16
-
17
- export type CarouselComponentType = Extract<
18
- SectionComponentType,
19
- 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
- >
21
-
22
- export interface WeatherDayI {
23
- date: string
24
- minTempC: number
25
- maxTempC: number
26
- chanceOfRainPercentage: number | null
27
- iconUrl: string | null
28
- condition?: string | null
29
- }
30
-
31
- export interface WeatherSectionI {
32
- componentType: 'Weather'
33
- title: string
34
- subtitle?: string
35
- locationName: string
36
- timezone: string
37
- days: WeatherDayI[]
38
- lastUpdatedAt: string
39
- dataSource: 'weatherapi'
40
- }
41
-
42
- export interface HeaderSectionI {
43
- componentType: 'Header'
44
- title: string
45
- subtitle: string
46
- }
47
-
48
- export interface AdviceI {
49
- title: string
50
- markdownContent: string
51
- titleColor?: string
52
- backgroundColor?: string
53
- }
54
-
55
- export interface AdviceSectionI {
56
- componentType: 'AdviceCarousel'
57
- title?: string
58
- subtitle?: string
59
- advices: AdviceI[]
60
- }
61
-
62
- export interface WideCardAuthorI {
63
- name?: string | null
64
- imageURL?: string | null
65
- }
66
-
67
- export interface WideCardItemI {
68
- title?: string | null
69
- text: string
70
- badgeText?: string | null
71
- thumbnailImageURL: string
72
- author?: WideCardAuthorI | null
73
- link?: string | null
74
- metadata?: Record<string, unknown>
75
- }
76
-
77
- export interface WideCardsCarouselSectionI {
78
- componentType: 'WideCardsCarousel'
79
- title: string
80
- subtitle?: string
81
- cards: WideCardItemI[]
82
- }
83
-
84
- export interface HeroCardBlueprintI {
85
- mode: HeroCardMode
86
- title?: string | null
87
- description?: string | null
88
- backgroundColor?: string | null
89
- backgroundImageUrl?: string | null
90
- ctaLabel?: string | null
91
- previewPlants?: PlantI[]
92
- selection?: SelectionI | null
93
- plant?: PlantI | null
94
- }
95
-
96
- export interface HeroCardsSectionI {
97
- componentType: 'HeroCards'
98
- title?: string | null
99
- subtitle?: string | null
100
- cards: HeroCardBlueprintI[]
101
- }
102
-
103
- export interface PlantCarouselSectionI {
104
- componentType: 'PlantCarousel'
105
- title: string
106
- subtitle?: string
107
- selection: SelectionI
108
- displayRanking?: boolean
109
- }
110
-
111
- export interface HeroCardsCarouselSectionI {
112
- componentType: 'HeroCardsCarousel'
113
- selections: SelectionI[]
114
- }
115
-
116
- export interface FamilyRecommendationI {
117
- family: string
118
- headline: string
119
- plants: PlantI[]
120
- }
121
-
122
- export interface FamilyExplorerSectionI {
123
- componentType: 'FamilyExplorer'
124
- title: string
125
- subtitle?: string
126
- families: FamilyRecommendationI[]
127
- }
128
-
129
- export interface OnboardingStepI {
130
- id: string
131
- title: string
132
- description: string
133
- isCompleted: boolean
134
- ctaLink: string
135
- }
136
-
137
- export interface OnboardingCardSectionI {
138
- componentType: 'OnboardingCard'
139
- title: string
140
- subtitle: string
141
- steps: OnboardingStepI[]
142
- completedStepsCount: number
143
- totalStepsCount: number
144
- }
145
-
146
- export type SectionI =
147
- | HeaderSectionI
148
- | HeroCardsSectionI
149
- | PlantCarouselSectionI
150
- | HeroCardsCarouselSectionI
151
- | WideCardsCarouselSectionI
152
- | WeatherSectionI
153
- | AdviceSectionI
154
- | OnboardingCardSectionI
155
-
156
- export interface Response {
157
- sections: SectionI[]
158
- }
159
- }
1
+ import type { PlantI } from './plant'
2
+ import type { SelectionI } from './selection'
3
+
4
+ export namespace HOME {
5
+ export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
+
7
+ export type SectionComponentType =
8
+ | 'Header'
9
+ | 'HeroCards'
10
+ | 'PlantCarousel'
11
+ | 'HeroCardsCarousel'
12
+ | 'WideCardsCarousel'
13
+ | 'Weather'
14
+ | 'AdviceCarousel'
15
+ | 'OnboardingCard'
16
+
17
+ export type CarouselComponentType = Extract<
18
+ SectionComponentType,
19
+ 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
+ >
21
+
22
+ export interface WeatherDayI {
23
+ date: string
24
+ minTempC: number
25
+ maxTempC: number
26
+ iconUrl: string | null
27
+ condition?: string | null
28
+ }
29
+
30
+ export interface WeatherSectionI {
31
+ componentType: 'Weather'
32
+ title: string
33
+ subtitle?: string
34
+ locationName: string
35
+ timezone: string
36
+ days: WeatherDayI[]
37
+ lastUpdatedAt: string
38
+ dataSource: 'weatherapi'
39
+ }
40
+
41
+ export interface HeaderSectionI {
42
+ componentType: 'Header'
43
+ title: string
44
+ subtitle: string
45
+ }
46
+
47
+ export interface AdviceI {
48
+ title: string
49
+ markdownContent: string
50
+ titleColor?: string
51
+ backgroundColor?: string
52
+ }
53
+
54
+ export interface AdviceSectionI {
55
+ componentType: 'AdviceCarousel'
56
+ title?: string
57
+ subtitle?: string
58
+ advices: AdviceI[]
59
+ }
60
+
61
+ export interface WideCardAuthorI {
62
+ name?: string | null
63
+ imageURL?: string | null
64
+ }
65
+
66
+ export interface WideCardItemI {
67
+ title?: string | null
68
+ text: string
69
+ badgeText?: string | null
70
+ thumbnailImageURL: string
71
+ author?: WideCardAuthorI | null
72
+ link?: string | null
73
+ metadata?: Record<string, unknown>
74
+ }
75
+
76
+ export interface WideCardsCarouselSectionI {
77
+ componentType: 'WideCardsCarousel'
78
+ title: string
79
+ subtitle?: string
80
+ cards: WideCardItemI[]
81
+ }
82
+
83
+ export interface HeroCardBlueprintI {
84
+ mode: HeroCardMode
85
+ title?: string | null
86
+ description?: string | null
87
+ backgroundColor?: string | null
88
+ backgroundImageUrl?: string | null
89
+ ctaLabel?: string | null
90
+ ctaRoute?: string | null
91
+ previewPlants?: PlantI[]
92
+ selection?: SelectionI | null
93
+ plant?: PlantI | null
94
+ }
95
+
96
+ export interface HeroCardsSectionI {
97
+ componentType: 'HeroCards'
98
+ title?: string | null
99
+ subtitle?: string | null
100
+ cards: HeroCardBlueprintI[]
101
+ }
102
+
103
+ export interface PlantCarouselSectionI {
104
+ componentType: 'PlantCarousel'
105
+ title: string
106
+ subtitle?: string
107
+ selection: SelectionI
108
+ displayRanking?: boolean
109
+ }
110
+
111
+ export interface HeroCardsCarouselSectionI {
112
+ componentType: 'HeroCardsCarousel'
113
+ selections: SelectionI[]
114
+ }
115
+
116
+ export interface FamilyRecommendationI {
117
+ family: string
118
+ headline: string
119
+ plants: PlantI[]
120
+ }
121
+
122
+ export interface FamilyExplorerSectionI {
123
+ componentType: 'FamilyExplorer'
124
+ title: string
125
+ subtitle?: string
126
+ families: FamilyRecommendationI[]
127
+ }
128
+
129
+ export interface OnboardingStepI {
130
+ id: string
131
+ title: string
132
+ description: string
133
+ isCompleted: boolean
134
+ ctaLink: string
135
+ }
136
+
137
+ export interface OnboardingCardSectionI {
138
+ componentType: 'OnboardingCard'
139
+ title: string
140
+ subtitle: string
141
+ steps: OnboardingStepI[]
142
+ completedStepsCount: number
143
+ totalStepsCount: number
144
+ }
145
+
146
+ export type SectionI =
147
+ | HeaderSectionI
148
+ | HeroCardsSectionI
149
+ | PlantCarouselSectionI
150
+ | HeroCardsCarouselSectionI
151
+ | WideCardsCarouselSectionI
152
+ | WeatherSectionI
153
+ | AdviceSectionI
154
+ | OnboardingCardSectionI
155
+
156
+ export interface Response {
157
+ sections: SectionI[]
158
+ }
159
+ }