Season Data¶
The following data structures are published by the season management module. If you want to learn how to retrieve entities published by other modules refer to the our guide "Consuming Data Shared By Other Modules".
Entity Season¶
Seasons are the building block of the farm operation. Crops are grown in seasons that usually span across multiple months. In HortiView the season capture what is grown (crop, variety, etc.), where it is grown (greenhouse, open field, block/zone), and when it is grown (start and end date).
/api/v1.0/{orgId}/ModuleDependencies/{moduleId}
/api/v1.0/{orgId}/ModuleDependentEntities/{moduleId}/{entityId}
orgIdrepresents the organization you want data from; in most cases it's the current organizationmoduleIdrepresents the ID of the module requesting the data; in most cases it's your module IDentityIdrepresents the ID of theSeasonentity you want to retrieve (see results ofModuleDependencies)
import { Group } from "@element-public/react-group";
import { TypoBody } from "@element-public/react-typography";
import { useEntity } from "@hortiview/modulebase";
export const SeasonComponent = () => {
const { data: seasons } = useEntity("ModuleDepended", "Season");
return (
<Group>
{seasons.map((season) => (
<TypoBody>{season.cropSeasonName}</TypoBody>
))}
</Group>
);
};
JSON Format¶
{
"entityName": "season",
"season": {
"startDate": "2025-02-18T00:00:00+00:00",
"endDate": "2025-03-18T00:00:00+00:00",
"seasonStateId": "5e9e38c5-a775-4fff-b579-81e8a04c3188",
"cropSeasonName": "GH-1-Tomatoes-Acapulco-2025-02",
"cropId": "e6fcac72-5885-45ec-8e92-fb8e1754300c",
"cropTypeId": "8458aa30-f64f-4b5e-9d58-917b9cab8ce9",
"cropVarietyId": "a5a49e49-30b5-4f0b-ba50-2de5cca3a3c5",
"rootstockId": "4ae2c149-e43a-4b89-ae48-d250ca6ff09b",
"farmId": "13e4ca75-0e38-4a55-86c1-a3c39ab6d250",
"fieldId": "43a10d69-e463-43d8-8cbd-4f7454024535",
"id": "a4bc44e7-13b1-46b4-905a-6d7c05e54ecd"
},
"blockPlantLayout": null,
"id": "64c8458f-1a9d-41c3-86da-0735cc5c02ce"
}
Properties¶
| Property | Type | Description |
|---|---|---|
season.startdate | String, ISO 8601 | Start date of the season |
season.enddate | String, ISO 8601 | End date of the season |
sesson.seasonStateId | UUID | Current state of the season: draft, active or archived (see CommonData API for details) |
season.cropSeasonName | String | Display name of the season; custom or auto-generated |
season.cropId | UUID | The crop grown in this season (see CommonData API for details) |
season.cropTypeId | UUID | The crop type grown in this season (see CommonData API for details) |
season.cropVarietyId | UUID | The crop variety grown in this season (see CommonData API for details) |
season.rootstockId | UUID | The rootstock used with a crop; only available when crop is 'tomato' (see CommonData API for details) |
season.farmId | UUID | ID of the farm location the season is associated with |
season.fieldId | UUID | ID of the farm location's field the season is associated with |
blockplantlayout | UUID | Block assignments used in this season |
id | UUID | ID of the season |
Entity BlockPlantLayout¶
The "block plant layout" is used in seasons to associate individual blocks to seasons. For example, a growing season can comprise of a complete greenhouse or only a few blocks. Likewise, seasons can stretch across multiple greenhouses. The entity BlockPlantLayout is used to associate blocks with seasons and augment them with critical information such as dimensions and plant density.
/api/v1.0/{orgId}/ModuleDependencies/{moduleId}
/api/v1.0/{orgId}/ModuleDependentEntities/{moduleId}/{entityId}
orgIdrepresents the organization you want data from; in most cases it's the current organizationmoduleIdrepresents the ID of the module requesting the data; in most cases it's your module IDentityIdrepresents the ID of theBlockPlantLayoutentity you want to retrieve (see results ofModuleDependencies)
import { Group } from "@element-public/react-group";
import { TypoBody, TypoOverline, TypoSubtitle} from "@element-public/react-typography";
import { useEntity } from "@hortiview/modulebase";
import { Block, BlockPlantLayout } from "@hortiview/modulebase/dist/types/ModuleApi";
import { useMemo } from "react";
type MappedBlock = Block & {
blockPlantLayout?: BlockPlantLayout | undefined;
};
export const SeasonComponent = () => {
const { data: blockPlantLayouts } = useEntity("ModuleDepended","BlockPlantLayout");
const { data: blocks } = useEntity("FarmOrganization", "zones");
const mappedBlocks = useMemo(() => {
return blocks.map((block) => {
const mappedBlock: MappedBlock = block;
mappedBlock.blockPlantLayout = blockPlantLayouts.find(
(blockPlantLayout) => blockPlantLayout.blockId === block.id
);
return mappedBlock;
});
}, [blocks, blockPlantLayouts]);
return (
<Group>
{mappedBlocks.map((block) => (
<>
<TypoOverline key={block.id}>{block.id}</TypoOverline>
<TypoBody>Name: {block.blockName}</TypoBody>
<TypoSubtitle>with {block.blockPlantLayout?.numberOfPlants} rows</TypoSubtitle>
</>
))}
</Group>
);
};
JSON Format¶
{
"blockId": "e9770d2a-b5d1-4880-8385-cd365e6cb82a",
"arrangementType": null,
"offsetPlants": 25,
"offsetPlantsUnit": "cm",
"rowLength": 75,
"rowLengthUnit": "meter",
"offsetRows": 50,
"offsetRowsUnit": "cm",
"numberOfRows": 4,
"numberOfPlants": 90,
"id": "68eadbbe-b7d0-41d6-a86d-197eab63fa5e"
}
Properties¶
| Property | Type | Description |
|---|---|---|
blockId | UUID | ID of the block in this block plant layout |
arrangementType | String | Currently unused |
offsetPlants | Integer | Distance between plants in this block |
offsetPlantsUnit | String | Unit of measure for the distance between plants in this block |
rowLength | Integer | Length of the block |
rowLengthUnit | String | Unit of measure for the length of the block |
offsetRows | Integer | Distance between rows in this block |
offsetRowsUnit | String | Unit of measure for the distance between blocks |
numberOfRows | Integer | Number of rows in this block |
numberOfPlants | String | Number of plants in this block |
id | UUID | ID of the season |