guest-billing.delete
Delete a billing address by id (tenant-scoped, RLS-enforced). Returns { ok: true } or throws if not found. DRY: delegates to the shared deleteGuestBilling() function (same as the tRPC router).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
ok | literal | yes | One of: true |
guest-billing.list
List all billing addresses for a guest (tenant-scoped, RLS-enforced). Returns { addresses } ordered by createdAt ASC. DRY: delegates to the shared listGuestBilling() query (same as the tRPC router).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
guestId | string | yes |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
addresses | array of object | yes | |
addresses.id | string | yes | |
addresses.tenantId | string | yes | |
addresses.guestId | string | yes | |
addresses.company | string · nullable | yes | |
addresses.name | string | yes | |
addresses.line1 | string · nullable | yes | |
addresses.line2 | string · nullable | yes | |
addresses.postalCode | string · nullable | yes | |
addresses.city | string · nullable | yes | |
addresses.country | string | yes | |
addresses.taxId | string · nullable | yes | |
addresses.reservationRef | string · nullable | yes | |
addresses.isBusiness | boolean | yes | |
addresses.isDefault | boolean | yes | |
addresses.createdAt | string | yes | |
addresses.updatedAt | string | yes |
guest-billing.upsert
Create or update a billing address for a guest. If id is provided and exists, updates the existing row; if id is provided but does not exist, inserts with that id; if id is omitted, inserts with auto-generated id. If isDefault:true, atomically clears all other defaults for the guest first (the clear + set run inside the same withTenant() transaction — partial-unique safe). Returns { address: GuestBillingRow }. DRY: delegates to the shared upsertGuestBilling() function (same as the tRPC router).
Input parameters
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | no | |
guestId | string | yes | |
company | string | no | |
name | string | no | |
line1 | string | no | |
line2 | string | no | |
postalCode | string | no | |
city | string | no | |
country | string | no | |
taxId | string | no | |
reservationRef | string | no | |
isBusiness | boolean | no | |
isDefault | boolean | no |
Output fields
| Field | Type | Required | Notes |
|---|---|---|---|
address | object | yes | |
address.id | string | yes | |
address.tenantId | string | yes | |
address.guestId | string | yes | |
address.company | string · nullable | yes | |
address.name | string | yes | |
address.line1 | string · nullable | yes | |
address.line2 | string · nullable | yes | |
address.postalCode | string · nullable | yes | |
address.city | string · nullable | yes | |
address.country | string | yes | |
address.taxId | string · nullable | yes | |
address.reservationRef | string · nullable | yes | |
address.isBusiness | boolean | yes | |
address.isDefault | boolean | yes | |
address.createdAt | string | yes | |
address.updatedAt | string | yes |