Source: src/data/address/
Service
The address service is a stub (export {}). Not yet implemented.
Repository
AddressRepository
| Method | Parameters | Returns |
|---|
| getById | (ctx: RequestContext, id: string) | Promise<AddressRecord | null> |
| listByTenant | (ctx: RequestContext) | Promise<AddressRecord[]> |
| create | (ctx: RequestContext, record: AddressRecord) | Promise<void> |
| update | (ctx: RequestContext, id: string, patch: Partial<Omit<AddressRecord, 'id' | 'tenantId'>>) | Promise<AddressRecord> |
| delete | (ctx: RequestContext, id: string) | Promise<void> |
AddressRecord
| Field | Type |
|---|
| id | string |
| tenantId | string |
| createdAt | Date |
| updatedAt | Date |
| data | Record<string, unknown> (optional) |
Validators
addressSchema
| Field | Type | Required | Default |
|---|
| name | string | Yes | — |
| line1 | string | Yes | — |
| line2 | string | No | — |
| city | string | Yes | — |
| state | string | Yes | — |
| postalCode | string | Yes | — |
| country | string (min 2) | Yes | — |
| phone | string | No | — |
addressWithIdSchema
Extends addressSchema with:
| Field | Type | Required | Default |
|---|
| addressId | string | Yes | — |
Inferred Types
Address — z.infer<typeof addressSchema>
AddressWithId — z.infer<typeof addressWithIdSchema>