Add regional task templates API with climate zone lookup
Adds a new endpoint GET /api/tasks/templates/by-region/?zip= that resolves ZIP codes to IECC climate regions and returns relevant home maintenance task templates. Includes climate region model, region lookup service with tests, seed data for all 8 climate zones with 50+ templates, and OpenAPI spec. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -523,6 +523,39 @@ paths:
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskTemplateResponse'
|
||||
|
||||
/tasks/templates/by-region/:
|
||||
get:
|
||||
tags: [Static Data]
|
||||
operationId: getTaskTemplatesByRegion
|
||||
summary: Get task templates for a climate region by state or ZIP code
|
||||
description: Returns templates matching the climate zone for a given US state abbreviation or ZIP code. At least one parameter is required. If both are provided, state takes priority.
|
||||
parameters:
|
||||
- name: state
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: MA
|
||||
description: US state abbreviation (e.g., MA, FL, TX)
|
||||
- name: zip
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
example: "02101"
|
||||
description: US ZIP code (resolved to state on the server)
|
||||
responses:
|
||||
'200':
|
||||
description: Regional templates for the climate zone
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskTemplateResponse'
|
||||
'400':
|
||||
$ref: '#/components/responses/BadRequest'
|
||||
|
||||
/tasks/templates/{id}/:
|
||||
get:
|
||||
tags: [Static Data]
|
||||
|
||||
Reference in New Issue
Block a user