Skip to main content

Address

Source: src/data/address/

Service​

The address service is a stub (export {}). Not yet implemented.

Repository​

AddressRepository​

MethodParametersReturns
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​

FieldType
idstring
tenantIdstring
createdAtDate
updatedAtDate
dataRecord<string, unknown> (optional)

Validators​

addressSchema​

FieldTypeRequiredDefault
namestringYes—
line1stringYes—
line2stringNo—
citystringYes—
statestringYes—
postalCodestringYes—
countrystring (min 2)Yes—
phonestringNo—

addressWithIdSchema​

Extends addressSchema with:

FieldTypeRequiredDefault
addressIdstringYes—

Inferred Types​

  • Address — z.infer<typeof addressSchema>
  • AddressWithId — z.infer<typeof addressWithIdSchema>