Logotipo Hedhog

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

FieldTypeRequiredNotes
idsnumber[]yesBulk delete payload

MCP Tools

Named tools callable by AI models via the Model Context Protocol (MCP).

  • address.list

    List addresses with pagination and search

  • address.get

    Get a single address by ID

  • address.create

    Create a new address

  • address.update

    Update an existing address

  • address.delete

    Delete one or more addresses