@la-main-verte/shared-types 1.0.81 → 1.0.82

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.81",
3
+ "version": "1.0.82",
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",
package/src/index.ts CHANGED
@@ -1,32 +1,34 @@
1
- export * from './member'
2
- export * from './selection'
3
- export * from './plantSelection'
4
- export * from './plant'
5
- export * from './task'
6
- export * from './calendarView'
7
- export * from './apiError'
8
- export * from './gardenMap'
9
- export * from './gardenOverview'
10
- export * from './alert'
11
- export * from './image'
12
- export * from './note'
13
- export * from './taggedItem'
14
- export * from './fertilizer'
15
- export * from './utmParams'
16
- export * from './plantFilters'
17
- import * as PlantsAPI from './plants.api'
18
- import * as UsersAPI from './users.api'
19
- import * as SessionsAPI from './sessions.api'
20
- import * as HomeAPI from './home.api'
21
- import * as PagesAPI from './pages.api'
22
- import * as PaymentsAPI from './payments.api'
23
-
24
- // Allow access to the API namespaces without conflicts
25
- export namespace API {
26
- export import PLANTS = PlantsAPI
27
- export import USERS = UsersAPI
28
- export import SESSIONS = SessionsAPI
29
- export import HOME = HomeAPI
30
- export import PAGES = PagesAPI
31
- export import PAYMENTS = PaymentsAPI
32
- }
1
+ export * from './member'
2
+ export * from './selection'
3
+ export * from './plantSelection'
4
+ export * from './plant'
5
+ export * from './task'
6
+ export * from './calendarView'
7
+ export * from './apiError'
8
+ export * from './gardenMap'
9
+ export * from './gardenOverview'
10
+ export * from './alert'
11
+ export * from './image'
12
+ export * from './note'
13
+ export * from './taggedItem'
14
+ export * from './fertilizer'
15
+ export * from './utmParams'
16
+ export * from './plantFilters'
17
+ export * from './taxonFamily'
18
+ export * from './rotationGroup'
19
+ import * as PlantsAPI from './plants.api'
20
+ import * as UsersAPI from './users.api'
21
+ import * as SessionsAPI from './sessions.api'
22
+ import * as HomeAPI from './home.api'
23
+ import * as PagesAPI from './pages.api'
24
+ import * as PaymentsAPI from './payments.api'
25
+
26
+ // Allow access to the API namespaces without conflicts
27
+ export namespace API {
28
+ export import PLANTS = PlantsAPI
29
+ export import USERS = UsersAPI
30
+ export import SESSIONS = SessionsAPI
31
+ export import HOME = HomeAPI
32
+ export import PAGES = PagesAPI
33
+ export import PAYMENTS = PaymentsAPI
34
+ }
package/src/plant.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { TaxonFamilyI } from './taxonFamily'
2
2
  import type { SeedingInfoI } from './pages.api'
3
3
  import type { PlantFilterI } from './plantFilters'
4
+ import type { RotationGroup } from './rotationGroup'
4
5
  /**
5
6
  * Range filter value for min/max filters
6
7
  */
@@ -98,9 +99,16 @@ export interface PlantI {
98
99
  Images?: ImageI[]
99
100
  Member?: Partial<MemberI>
100
101
  notes?: NoteI[]
101
- rotationGroup?: string
102
- // @deprecate once v1.8.1 is fully adopted
103
- rotationFamily?: string
102
+ /**
103
+ * Nitrogen-derived rotation group enum (virtual field on the Plant model).
104
+ * Source of truth for rotation classification — derived from
105
+ * `azoteNeedsKgPerHa` plus the regenerative override on `taxonFamily`.
106
+ */
107
+ rotationGroup?: RotationGroup | null
108
+ /**
109
+ * French label of `rotationGroup`, ready for display.
110
+ */
111
+ translatedRotationGroup?: string | null
104
112
  taxonFamily?: TaxonFamilyI
105
113
  seedingInfo: SeedingInfoI
106
114
  /**
@@ -166,3 +174,16 @@ export interface PlantSearchResultI {
166
174
  familyName?: string
167
175
  filtersUI?: PlantFiltersUII
168
176
  }
177
+
178
+ /**
179
+ * Response shape for `GET /selections/:slug/gardenZones/:id/rotation-suggestions`.
180
+ * - `advice`: short user-facing sentence explaining the recommendation
181
+ * - `Plants`: parent plants matching the recommended rotation group, with
182
+ * the avoided taxon families excluded. Empty when the zone has no usable
183
+ * history yet.
184
+ */
185
+ export interface PlantRotationSuggestionsI {
186
+ targetYear: number
187
+ advice: string
188
+ Plants: PlantI[]
189
+ }
@@ -0,0 +1,15 @@
1
+ import type { RotationGroup } from './rotationGroup'
2
+
3
+ export interface TaxonFamilyI {
4
+ id: number
5
+ slug: string
6
+ translation_key: string
7
+ name: string
8
+ latin_name: string | null
9
+ kingdom: string
10
+ description: string | null
11
+ rotation_group: RotationGroup | null
12
+ translated_rotation_group: string | null
13
+ createdAt?: Date
14
+ updatedAt?: Date
15
+ }