@la-main-verte/shared-types 1.0.73 → 1.0.74

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.73",
3
+ "version": "1.0.74",
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/home.api.d.ts CHANGED
@@ -148,18 +148,23 @@ export namespace HOME {
148
148
  totalStepsCount: number
149
149
  }
150
150
 
151
- /** Minimal plant info for preview display in grouped tasks */
151
+ /** Minimal plant info for preview display (e.g. parent plant in grouped tasks) */
152
152
  export interface TaskPlantPreviewI {
153
153
  name: string
154
154
  slug: string
155
155
  imageURL?: string | null
156
156
  }
157
157
 
158
+ /** Plant info within a family group — includes the task ID specific to this plant */
159
+ export interface TaskFamilyPlantPreviewI extends TaskPlantPreviewI {
160
+ taskId: number
161
+ }
162
+
158
163
  /** Family group info when multiple plants share the same task */
159
164
  export interface TaskFamilyGroupI {
160
165
  familyName: string
161
166
  plantsCount: number
162
- plants: TaskPlantPreviewI[]
167
+ plants: TaskFamilyPlantPreviewI[]
163
168
  }
164
169
 
165
170
  export interface UpcomingTaskI {
package/src/plant.d.ts CHANGED
@@ -1,107 +1,107 @@
1
- import type { TaxonFamilyI } from './taxonFamily'
2
- import type { SeedingInfoI } from './pages.api'
3
- /**
4
- * Range filter value for min/max filters
5
- */
6
- export interface RangeFilterValueI {
7
- min: number
8
- max: number
9
- }
10
-
11
- /**
12
- * Plant filter value types
13
- * Represents the possible values for a single filter
14
- */
15
- export type PlantFilterValueI = string | string[] | number | boolean | RangeFilterValueI
16
-
17
- /**
18
- * Plant attributes for filtering
19
- * Used in JSONB field and as query parameters
20
- * Supports multiple value types for different filter types
21
- */
22
- export type PlantAttributesI = Record<string, PlantFilterValueI>
23
-
24
- export interface PlantI {
25
- id: number
26
- name: string
27
- slug: string
28
- description: string
29
- descriptionSource?: string
30
- female: boolean
31
- family?: string | null
32
- taxonFamilyId?: number | null
33
- spaceBetweenSeedMin: number
34
- spaceBetweenSeedMax: number
35
- spaceBetweenAlleyMin: number
36
- spaceBetweenAlleyMax: number
37
- weeksInTransplant: number
38
- weeksDuringWhichYouCanSeedOutdoor: number
39
- weeksToMaturity: number
40
- daysToMaturity: number | null
41
- weeksToWaitAfterFreezingDate: number
42
- weeksToHarvest: number
43
- indoorSeeding: boolean
44
- outdoorSeeding: boolean
45
- azoteNeedsKgPerHa: number
46
- hibernate: boolean
47
- germinationTemperature: number | null
48
- minGerminationTemperature: number | null
49
- germinationNumberOfDays: string | null
50
- germinationSeedDepth: string | null
51
- cultivationInfo: string | null
52
- parentId: number | null
53
- memberId?: number
54
- memberFirstName?: string | null
55
- shared: boolean
56
- hexColor: string | null
57
- sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
58
- isHardy: boolean | null
59
- imageURL: string
60
- totalWeeksToMaturity: number
61
- hasNoInformation: boolean
62
- createdAt: Date
63
- updatedAt: Date
64
- translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
65
- parent?: PlantI
66
- children?: PlantI[]
67
- PlantInventories?: PlantInventoryI[]
68
- taggedItems?: TaggedItemI[]
69
- /**
70
- * List of selections that the plant is in.
71
- * --------------------------------------
72
- * Tends to be used for featured selections
73
- */
74
- Selections?: SelectionI[]
75
- tasks?: TaskI[]
76
- Images?: ImageI[]
77
- Member?: Partial<MemberI>
78
- notes?: NoteI[]
79
- rotationGroup?: string
80
- // @deprecate once v1.8.1 is fully adopted
81
- rotationFamily?: string
82
- taxonFamily?: TaxonFamilyI
83
- seedingInfo: SeedingInfoI
84
- /**
85
- * Contextual search text for recommended plants
86
- * Provides additional context when suggesting plants for specific garden zones
87
- */
88
- contextualSearchText?: string
89
- }
90
-
91
- interface PlantInventoryI {
92
- id: number
93
- plantId: number
94
- supplierName: string
95
- plantName: string
96
- supplierURL: string
97
- imageLocation: string
98
- description: string
99
- inStock: boolean
100
- }
101
-
102
- export interface PlantSearchResultI {
103
- plants: PlantModelI[]
104
- selections: SelectionModelI[]
105
- total?: number
106
- familyName?: string
107
- }
1
+ import type { TaxonFamilyI } from './taxonFamily'
2
+ import type { SeedingInfoI } from './pages.api'
3
+ /**
4
+ * Range filter value for min/max filters
5
+ */
6
+ export interface RangeFilterValueI {
7
+ min: number
8
+ max: number
9
+ }
10
+
11
+ /**
12
+ * Plant filter value types
13
+ * Represents the possible values for a single filter
14
+ */
15
+ export type PlantFilterValueI = string | string[] | number | boolean | RangeFilterValueI
16
+
17
+ /**
18
+ * Plant attributes for filtering
19
+ * Used in JSONB field and as query parameters
20
+ * Supports multiple value types for different filter types
21
+ */
22
+ export type PlantAttributesI = Record<string, PlantFilterValueI>
23
+
24
+ export interface PlantI {
25
+ id: number
26
+ name: string
27
+ slug: string
28
+ description: string
29
+ descriptionSource?: string
30
+ female: boolean
31
+ family?: string | null
32
+ taxonFamilyId?: number | null
33
+ spaceBetweenSeedMin: number
34
+ spaceBetweenSeedMax: number
35
+ spaceBetweenAlleyMin: number
36
+ spaceBetweenAlleyMax: number
37
+ weeksInTransplant: number
38
+ weeksDuringWhichYouCanSeedOutdoor: number
39
+ weeksToMaturity: number
40
+ daysToMaturity: number | null
41
+ weeksToWaitAfterFreezingDate: number
42
+ weeksToHarvest: number
43
+ indoorSeeding: boolean
44
+ outdoorSeeding: boolean
45
+ azoteNeedsKgPerHa: number
46
+ hibernate: boolean
47
+ germinationTemperature: number | null
48
+ minGerminationTemperature: number | null
49
+ germinationNumberOfDays: string | null
50
+ germinationSeedDepth: string | null
51
+ cultivationInfo: string | null
52
+ parentId: number | null
53
+ memberId?: number
54
+ memberFirstName?: string | null
55
+ shared: boolean
56
+ hexColor: string | null
57
+ sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
58
+ isHardy: boolean | null
59
+ imageURL: string
60
+ totalWeeksToMaturity: number
61
+ hasNoInformation: boolean
62
+ createdAt: Date
63
+ updatedAt: Date
64
+ translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
65
+ parent?: PlantI
66
+ children?: PlantI[]
67
+ PlantInventories?: PlantInventoryI[]
68
+ taggedItems?: TaggedItemI[]
69
+ /**
70
+ * List of selections that the plant is in.
71
+ * --------------------------------------
72
+ * Tends to be used for featured selections
73
+ */
74
+ Selections?: SelectionI[]
75
+ tasks?: TaskI[]
76
+ Images?: ImageI[]
77
+ Member?: Partial<MemberI>
78
+ notes?: NoteI[]
79
+ rotationGroup?: string
80
+ // @deprecate once v1.8.1 is fully adopted
81
+ rotationFamily?: string
82
+ taxonFamily?: TaxonFamilyI
83
+ seedingInfo: SeedingInfoI
84
+ /**
85
+ * Contextual search text for recommended plants
86
+ * Provides additional context when suggesting plants for specific garden zones
87
+ */
88
+ contextualSearchText?: string
89
+ }
90
+
91
+ interface PlantInventoryI {
92
+ id: number
93
+ plantId: number
94
+ supplierName: string
95
+ plantName: string
96
+ supplierURL: string
97
+ imageLocation: string
98
+ description: string
99
+ inStock: boolean
100
+ }
101
+
102
+ export interface PlantSearchResultI {
103
+ plants: PlantModelI[]
104
+ selections: SelectionModelI[]
105
+ total?: number
106
+ familyName?: string
107
+ }
@@ -80,7 +80,7 @@ export namespace PLANTS {
80
80
  spaceBetweenSeedMax?: number | null
81
81
  spaceBetweenAlleyMin?: number | null
82
82
  spaceBetweenAlleyMax?: number | null
83
- weeksToMaturity?: number | null
83
+ daysToMaturity?: number | null
84
84
  indoorSeeding?: boolean
85
85
  outdoorSeeding?: boolean
86
86
  sunRequirements?: 'partialShade' | 'fullSun' | 'fullShade' | null
package/src/task.d.ts CHANGED
@@ -10,6 +10,8 @@ export interface TaskI {
10
10
  colourCode: string
11
11
  iconName?: string
12
12
  private: boolean
13
+ isDone: boolean
14
+ doneAt?: Date
13
15
  }
14
16
 
15
17
  /**
@@ -27,6 +29,25 @@ export interface TaskTagI {
27
29
  iconName?: string
28
30
  }
29
31
 
32
+ /** Optional toast notification payload returned after task completion. All fields are optional — the frontend applies its own defaults for any missing field. */
33
+ export interface CompleteTaskToastI {
34
+ title?: string
35
+ subtitle?: string
36
+ iconName?: string
37
+ }
38
+
39
+ /**
40
+ * Response returned when one or more tasks are marked as done.
41
+ * Keys are plant slugs, values are the full updated task list for that plant selection.
42
+ * Single completion returns a record with one entry; bulk returns one entry per plant.
43
+ */
44
+ export interface CompleteTaskResponseI {
45
+ success: boolean
46
+ updatedTasksByPlant: Record<string, TaskI[]>
47
+ /** Optional toast to display after completion. Missing fields fall back to frontend defaults. */
48
+ toast?: CompleteTaskToastI
49
+ }
50
+
30
51
  /**
31
52
  * Data used to create or edit a task
32
53
  */