Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
address Submodule
addresses
CRUD for normalized postal addresses, including typed addresses and per-type primary-address enforcement.
Source path: libraries/address/src
Module file: address.module.ts
Introduction
The Address module is a focused infrastructure library used by higher-level business modules that need reusable address records. It supports paginated listing, direct lookup, create/update flows, and bulk deletion.
A key business rule in this package is primary-address handling: when an address is marked as primary for a given type, the service is responsible for keeping that type’s primary state consistent rather than leaving conflicting primaries in user space. The module also exposes the same CRUD surface through MCP tools for AI-driven automations.
HTTP Endpoints
5 endpoints
List addresses with pagination, search, sorting, and field selection.
- Query
- page, pageSize, search, sortField, sortOrder, fields
Get a single address by ID.
- Params
- id (int)
Create a new address record.
Update an existing address.
- Params
- id (int)
Delete one or more addresses.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| ids | number[] | yes | Bulk delete payload |
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
address.listList addresses with pagination and search
address.getGet a single address by ID
address.createCreate a new address
address.updateUpdate an existing address
address.deleteDelete one or more addresses