Grid Durable Object
Overview
Section titled “Overview”The Grid Durable Object is responsible for storing the state of a Grid.
The Grid Durable Object has the following state:
gridId: The ID of the GridworkspaceId: The ID of the Workspace that the Grid belongs togridAreas: The areas that are available to be targeted in the Grid. These areas can be a radius around a point (typically the business location), counties, or zip codes.targetingRules: Targeting rules are set in the HoneyGrid Web App using sliders. Each individual property in the materialized grid can be targeted individually and the resulting cells are stored intargetedCells. The targeting rules may be inclusion or exclusion rules and they may be targeted at a specific property or though manual cell selection.targetedCells: An array of H3 cells that are targeted by the Grid.excludedCells: An array of H3 cells that are excluded from targeting in the Grid.materializedGrid: The materialized Grid is a colleciton of geojson features that represent the combined grid areas. The grid areas are translated to H3 cell ids at the proper resolution and the cell ids are read from both the HoneyGrid KV cache and any custom data stored in the WorkspaceData durable object associated with the Workspace that the Grid belongs to. The two data sources are combined and the resulting cells are used to create the geojson features.
Methods
Section titled “Methods”The Grid Durable Object has the following methods:
initializeGrid: Initializes the Grid Durable Object with the given gridId, workspaceId, and targetedAreas.updateTargetedAreas: Updates the targeted areas for the Grid.updateTargetingRules: Updates the targeting rules for the Grid.updateTargetedCells: Updates the targeted cells for the Grid.updateExcludedCells: Updates the excluded cells for the Grid.updateMaterializedGrid: Updates the materialized grid for the Grid.getMaterializedGrid: Returns the materialized grid for the Grid.
Implementation plan
Section titled “Implementation plan”- Add HoneyGrid KV cache to the local dev environment at least for the Austin area so I can test with Buck Teeth Dental
- Add the counties and zip codes to the KV cache
- Implement the Grid DO with just the default HoneyGrid data
- Implement the Customer Data Service
- Implement the Data Source table within the Workspace DO
- Implement the DataSource DO
- Implement the Data Upload Workflow. Can we use an LLM with the first couple rows of data to determine which columns are the address fields? Must have reverse geocoding cache. Must have some data cleaning step.