Class: BookingCrudRepository
Defined in: server/bookings/booking-crud-repository.ts:72
Repository with full CRUD capabilities. Extend this for most repositories that need create, read, update, and delete.
Extends
CrudRepository<PrismaClient,Bookings,CreateInput,UpdateInput,string,Tx<PrismaClient>>
Constructors
Constructor
new BookingCrudRepository(prismaClient: PrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs>, options?: RepositoryOptions): BookingCrudRepository;Defined in: server/persistence/base-repository.ts:68
Parameters
| Parameter | Type |
|---|---|
prismaClient | PrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs> |
options | RepositoryOptions |
Returns
BookingCrudRepository
Inherited from
Properties
ENTITY_TYPE?
protected readonly optional ENTITY_TYPE?: string;Defined in: server/persistence/base-repository.ts:61
Set ENTITY_TYPE in child repositories to enable automatic activity
logging. When set, create/update/delete operations auto-log unless
silenced with .silent. Requires an activity model on the consumer's
Prisma schema.
Inherited from
logger?
protected readonly optional logger?: Logger;Defined in: server/persistence/base-repository.ts:64
Inherited from
prismaClient
protected prismaClient: PrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs>;Defined in: server/persistence/base-repository.ts:69
Inherited from
Accessors
actorId
Get Signature
get protected actorId(): string | null | undefined;Defined in: server/persistence/base-repository.ts:76
Returns
string | null | undefined
Inherited from
auditCreate
Get Signature
get protected auditCreate(): {
createdBy: string | null | undefined;
updatedBy: string | null | undefined;
};Defined in: server/persistence/base-repository.ts:90
Returns
{
createdBy: string | null | undefined;
updatedBy: string | null | undefined;
}createdBy
createdBy: string | null | undefined = actorId;updatedBy
updatedBy: string | null | undefined = actorId;Inherited from
auditDelete
Get Signature
get protected auditDelete(): {
deletedAt: Date;
deletedBy: string | null | undefined;
};Defined in: server/persistence/base-repository.ts:99
Returns
{
deletedAt: Date;
deletedBy: string | null | undefined;
}deletedAt
deletedAt: Date;deletedBy
deletedBy: string | null | undefined;Inherited from
auditUpdate
Get Signature
get protected auditUpdate(): {
updatedBy: string | null | undefined;
};Defined in: server/persistence/base-repository.ts:95
Returns
{
updatedBy: string | null | undefined;
}updatedBy
updatedBy: string | null | undefined;Inherited from
silent
Get Signature
get silent(): this;Defined in: server/persistence/base-repository.ts:115
Suppress activity logging for the next mutation call. One-shot: the flag is consumed by the next create/update/delete.
Example
await repo.silent.update(id, data); // no activity logged
await repo.update(id, data); // activity logged normallyReturns
this
Inherited from
tx
Get Signature
get protected tx(): TTx;Defined in: server/persistence/base-repository.ts:86
The current Prisma handle: the active transaction if one is running on this async context, otherwise the raw client.
Returns
TTx
Inherited from
Methods
_count()
protected _count(): Promise<number>;Defined in: server/bookings/booking-crud-repository.ts:95
Returns
Promise<number>
Overrides
_create()
protected _create(input: CreateInput): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:116
Parameters
| Parameter | Type |
|---|---|
input | CreateInput |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Overrides
_exists()
protected _exists(id: string): Promise<boolean>;Defined in: server/bookings/booking-crud-repository.ts:88
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<boolean>
Overrides
_findById()
protected _findById(id: string): Promise<
| {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}
| null>;Defined in: server/bookings/booking-crud-repository.ts:84
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<
| {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}
| null>
Overrides
_findMany()
protected _findMany(pagination: {
page: number;
pageSize: number;
}): Promise<{
items: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}[];
total: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:99
Parameters
| Parameter | Type |
|---|---|
pagination | { page: number; pageSize: number; } |
pagination.page | number |
pagination.pageSize | number |
Returns
Promise<{
items: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}[];
total: number;
}>
Overrides
_hardDelete()
protected _hardDelete(id: string): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:163
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Overrides
_softDelete()
protected _softDelete(id: string): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:159
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Overrides
_update()
protected _update(id: string, patch: UpdateInput): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:155
Parameters
| Parameter | Type |
|---|---|
id | string |
patch | UpdateInput |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Overrides
afterCreate()
protected afterCreate(entity: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}, _input: CreateInput): Promise<void>;Defined in: server/persistence/base-repository.ts:316
Parameters
| Parameter | Type | Description |
|---|---|---|
entity | { amountOwedCents: number | null; bookingTypeId: string; bookingTypeVersionId: string; capacityUnits: number; createdAt: Date; createdBy: string | null; currency: string | null; deletedAt: Date | null; deletedBy: string | null; groupId: string | null; holdExpiresAt: Date | null; id: string; organizationId: string; origin: BookingOrigin; paid: boolean; partyEmail: string | null; partyName: string | null; partyRef: string | null; payload: JsonValue; paymentRef: string | null; pendingExpiresAt: Date | null; status: BookingStatus; statusUpdatedAt: Date; statusUpdatedBy: string | null; supersededById: string | null; uid: string; updatedAt: Date; updatedBy: string | null; version: number; } | - |
entity.amountOwedCents | number | null | - |
entity.bookingTypeId | string | - |
entity.bookingTypeVersionId | string | - |
entity.capacityUnits | number | - |
entity.createdAt | Date | - |
entity.createdBy | string | null | - |
entity.currency | string | null | - |
entity.deletedAt | Date | null | - |
entity.deletedBy | string | null | - |
entity.groupId | string | null | - |
entity.holdExpiresAt | Date | null | - |
entity.id | string | - |
entity.organizationId | string | - |
entity.origin | BookingOrigin | Discriminator separating customer reservations from system/offering occupancy blocks (§6.7/§6.8). system bookings carry partyRef = null; CRM/report queries filter on this instead of inventing a sentinel partyRef string. |
entity.paid | boolean | - |
entity.partyEmail | string | null | - |
entity.partyName | string | null | - |
entity.partyRef | string | null | - |
entity.payload | JsonValue | - |
entity.paymentRef | string | null | - |
entity.pendingExpiresAt | Date | null | - |
entity.status | BookingStatus | - |
entity.statusUpdatedAt | Date | - |
entity.statusUpdatedBy | string | null | - |
entity.supersededById | string | null | - |
entity.uid | string | - |
entity.updatedAt | Date | - |
entity.updatedBy | string | null | - |
entity.version | number | - |
_input | CreateInput | - |
Returns
Promise<void>
Inherited from
afterDelete()
protected afterDelete(_entity: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}, id: string): Promise<void>;Defined in: server/persistence/base-repository.ts:390
Parameters
| Parameter | Type | Description |
|---|---|---|
_entity | { amountOwedCents: number | null; bookingTypeId: string; bookingTypeVersionId: string; capacityUnits: number; createdAt: Date; createdBy: string | null; currency: string | null; deletedAt: Date | null; deletedBy: string | null; groupId: string | null; holdExpiresAt: Date | null; id: string; organizationId: string; origin: BookingOrigin; paid: boolean; partyEmail: string | null; partyName: string | null; partyRef: string | null; payload: JsonValue; paymentRef: string | null; pendingExpiresAt: Date | null; status: BookingStatus; statusUpdatedAt: Date; statusUpdatedBy: string | null; supersededById: string | null; uid: string; updatedAt: Date; updatedBy: string | null; version: number; } | - |
_entity.amountOwedCents | number | null | - |
_entity.bookingTypeId | string | - |
_entity.bookingTypeVersionId | string | - |
_entity.capacityUnits | number | - |
_entity.createdAt | Date | - |
_entity.createdBy | string | null | - |
_entity.currency | string | null | - |
_entity.deletedAt | Date | null | - |
_entity.deletedBy | string | null | - |
_entity.groupId | string | null | - |
_entity.holdExpiresAt | Date | null | - |
_entity.id | string | - |
_entity.organizationId | string | - |
_entity.origin | BookingOrigin | Discriminator separating customer reservations from system/offering occupancy blocks (§6.7/§6.8). system bookings carry partyRef = null; CRM/report queries filter on this instead of inventing a sentinel partyRef string. |
_entity.paid | boolean | - |
_entity.partyEmail | string | null | - |
_entity.partyName | string | null | - |
_entity.partyRef | string | null | - |
_entity.payload | JsonValue | - |
_entity.paymentRef | string | null | - |
_entity.pendingExpiresAt | Date | null | - |
_entity.status | BookingStatus | - |
_entity.statusUpdatedAt | Date | - |
_entity.statusUpdatedBy | string | null | - |
_entity.supersededById | string | null | - |
_entity.uid | string | - |
_entity.updatedAt | Date | - |
_entity.updatedBy | string | null | - |
_entity.version | number | - |
id | string | - |
Returns
Promise<void>
Inherited from
afterUpdate()
protected afterUpdate(
_entity: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
},
id: string,
input: Partial<{
groupId: string | null;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
}>
): Promise<void>;Defined in: server/persistence/base-repository.ts:328
Parameters
| Parameter | Type | Description |
|---|---|---|
_entity | { amountOwedCents: number | null; bookingTypeId: string; bookingTypeVersionId: string; capacityUnits: number; createdAt: Date; createdBy: string | null; currency: string | null; deletedAt: Date | null; deletedBy: string | null; groupId: string | null; holdExpiresAt: Date | null; id: string; organizationId: string; origin: BookingOrigin; paid: boolean; partyEmail: string | null; partyName: string | null; partyRef: string | null; payload: JsonValue; paymentRef: string | null; pendingExpiresAt: Date | null; status: BookingStatus; statusUpdatedAt: Date; statusUpdatedBy: string | null; supersededById: string | null; uid: string; updatedAt: Date; updatedBy: string | null; version: number; } | - |
_entity.amountOwedCents | number | null | - |
_entity.bookingTypeId | string | - |
_entity.bookingTypeVersionId | string | - |
_entity.capacityUnits | number | - |
_entity.createdAt | Date | - |
_entity.createdBy | string | null | - |
_entity.currency | string | null | - |
_entity.deletedAt | Date | null | - |
_entity.deletedBy | string | null | - |
_entity.groupId | string | null | - |
_entity.holdExpiresAt | Date | null | - |
_entity.id | string | - |
_entity.organizationId | string | - |
_entity.origin | BookingOrigin | Discriminator separating customer reservations from system/offering occupancy blocks (§6.7/§6.8). system bookings carry partyRef = null; CRM/report queries filter on this instead of inventing a sentinel partyRef string. |
_entity.paid | boolean | - |
_entity.partyEmail | string | null | - |
_entity.partyName | string | null | - |
_entity.partyRef | string | null | - |
_entity.payload | JsonValue | - |
_entity.paymentRef | string | null | - |
_entity.pendingExpiresAt | Date | null | - |
_entity.status | BookingStatus | - |
_entity.statusUpdatedAt | Date | - |
_entity.statusUpdatedBy | string | null | - |
_entity.supersededById | string | null | - |
_entity.uid | string | - |
_entity.updatedAt | Date | - |
_entity.updatedBy | string | null | - |
_entity.version | number | - |
id | string | - |
input | Partial<{ groupId: string | null; partyEmail: string | null; partyName: string | null; partyRef: string | null; }> | - |
Returns
Promise<void>
Inherited from
beforeCreate()
protected beforeCreate(_input: CreateInput): Promise<void>;Defined in: server/persistence/base-repository.ts:315
Parameters
| Parameter | Type |
|---|---|
_input | CreateInput |
Returns
Promise<void>
Inherited from
beforeDelete()
protected beforeDelete(_id: string, _existing: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}): Promise<void>;Defined in: server/persistence/base-repository.ts:388
Parameters
| Parameter | Type | Description |
|---|---|---|
_id | string | - |
_existing | { amountOwedCents: number | null; bookingTypeId: string; bookingTypeVersionId: string; capacityUnits: number; createdAt: Date; createdBy: string | null; currency: string | null; deletedAt: Date | null; deletedBy: string | null; groupId: string | null; holdExpiresAt: Date | null; id: string; organizationId: string; origin: BookingOrigin; paid: boolean; partyEmail: string | null; partyName: string | null; partyRef: string | null; payload: JsonValue; paymentRef: string | null; pendingExpiresAt: Date | null; status: BookingStatus; statusUpdatedAt: Date; statusUpdatedBy: string | null; supersededById: string | null; uid: string; updatedAt: Date; updatedBy: string | null; version: number; } | - |
_existing.amountOwedCents | number | null | - |
_existing.bookingTypeId | string | - |
_existing.bookingTypeVersionId | string | - |
_existing.capacityUnits | number | - |
_existing.createdAt | Date | - |
_existing.createdBy | string | null | - |
_existing.currency | string | null | - |
_existing.deletedAt | Date | null | - |
_existing.deletedBy | string | null | - |
_existing.groupId | string | null | - |
_existing.holdExpiresAt | Date | null | - |
_existing.id | string | - |
_existing.organizationId | string | - |
_existing.origin | BookingOrigin | Discriminator separating customer reservations from system/offering occupancy blocks (§6.7/§6.8). system bookings carry partyRef = null; CRM/report queries filter on this instead of inventing a sentinel partyRef string. |
_existing.paid | boolean | - |
_existing.partyEmail | string | null | - |
_existing.partyName | string | null | - |
_existing.partyRef | string | null | - |
_existing.payload | JsonValue | - |
_existing.paymentRef | string | null | - |
_existing.pendingExpiresAt | Date | null | - |
_existing.status | BookingStatus | - |
_existing.statusUpdatedAt | Date | - |
_existing.statusUpdatedBy | string | null | - |
_existing.supersededById | string | null | - |
_existing.uid | string | - |
_existing.updatedAt | Date | - |
_existing.updatedBy | string | null | - |
_existing.version | number | - |
Returns
Promise<void>
Inherited from
beforeUpdate()
protected beforeUpdate(
_id: string,
_input: Partial<{
groupId: string | null;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
}>,
_existing: {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}
): Promise<void>;Defined in: server/persistence/base-repository.ts:323
Parameters
| Parameter | Type | Description |
|---|---|---|
_id | string | - |
_input | Partial<{ groupId: string | null; partyEmail: string | null; partyName: string | null; partyRef: string | null; }> | - |
_existing | { amountOwedCents: number | null; bookingTypeId: string; bookingTypeVersionId: string; capacityUnits: number; createdAt: Date; createdBy: string | null; currency: string | null; deletedAt: Date | null; deletedBy: string | null; groupId: string | null; holdExpiresAt: Date | null; id: string; organizationId: string; origin: BookingOrigin; paid: boolean; partyEmail: string | null; partyName: string | null; partyRef: string | null; payload: JsonValue; paymentRef: string | null; pendingExpiresAt: Date | null; status: BookingStatus; statusUpdatedAt: Date; statusUpdatedBy: string | null; supersededById: string | null; uid: string; updatedAt: Date; updatedBy: string | null; version: number; } | - |
_existing.amountOwedCents | number | null | - |
_existing.bookingTypeId | string | - |
_existing.bookingTypeVersionId | string | - |
_existing.capacityUnits | number | - |
_existing.createdAt | Date | - |
_existing.createdBy | string | null | - |
_existing.currency | string | null | - |
_existing.deletedAt | Date | null | - |
_existing.deletedBy | string | null | - |
_existing.groupId | string | null | - |
_existing.holdExpiresAt | Date | null | - |
_existing.id | string | - |
_existing.organizationId | string | - |
_existing.origin | BookingOrigin | Discriminator separating customer reservations from system/offering occupancy blocks (§6.7/§6.8). system bookings carry partyRef = null; CRM/report queries filter on this instead of inventing a sentinel partyRef string. |
_existing.paid | boolean | - |
_existing.partyEmail | string | null | - |
_existing.partyName | string | null | - |
_existing.partyRef | string | null | - |
_existing.payload | JsonValue | - |
_existing.paymentRef | string | null | - |
_existing.pendingExpiresAt | Date | null | - |
_existing.status | BookingStatus | - |
_existing.statusUpdatedAt | Date | - |
_existing.statusUpdatedBy | string | null | - |
_existing.supersededById | string | null | - |
_existing.uid | string | - |
_existing.updatedAt | Date | - |
_existing.updatedBy | string | null | - |
_existing.version | number | - |
Returns
Promise<void>
Inherited from
consumeSilent()
protected consumeSilent(): boolean;Defined in: server/persistence/base-repository.ts:128
Consume and reset the silent flag. Called by template methods.
Returns
boolean
Inherited from
count()
count(): Promise<number>;Defined in: server/persistence/base-repository.ts:191
Returns
Promise<number>
Inherited from
create()
create(input: CreateInput): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/persistence/base-repository.ts:292
Parameters
| Parameter | Type |
|---|---|
input | CreateInput |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Inherited from
exists()
exists(id: string): Promise<boolean>;Defined in: server/persistence/base-repository.ts:187
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<boolean>
Inherited from
findActiveOnResourceWindow()
findActiveOnResourceWindow(query: {
from: Date;
resourceId: string;
to: Date;
}): Promise<{
id: string;
status: BookingStatus;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:408
All non-terminal bookings (confirmed/offered/waitlisted/held/
pending) on a resource's window — the set a run-decision cancels when an
offering is under-enrolled (§6.10). Returns id + status + version for the
cancel loop.
Parameters
| Parameter | Type |
|---|---|
query | { from: Date; resourceId: string; to: Date; } |
query.from | Date |
query.resourceId | string |
query.to | Date |
Returns
Promise<{
id: string;
status: BookingStatus;
version: number;
}[]>
findById()
findById(id: string): Promise<
| {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}
| null>;Defined in: server/persistence/base-repository.ts:177
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<
| {
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}
| null>
Inherited from
findByIdOrThrow()
findByIdOrThrow(id: string): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/persistence/base-repository.ts:181
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Inherited from
CrudRepository.findByIdOrThrow
findCompletable()
findCompletable(now: Date): Promise<{
id: string;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:298
Find all confirmed bookings whose schedule endsAt <= now — the
completion sweeper's hot-path query. Joins the schedule row so the
structural endsAt <= now guard can pass inside applyTransition.
Returns only the minimal columns the sweeper needs.
Parameters
| Parameter | Type |
|---|---|
now | Date |
Returns
Promise<{
id: string;
version: number;
}[]>
findComposedOrThrow()
findComposedOrThrow(id: string): Promise<ComposedBookingRow>;Defined in: server/bookings/booking-crud-repository.ts:213
Hydrated composed host: bookings ⋈ component rows + the type row. Component includes grow as later PRs add tables (seats in PR 14).
The offers include is filtered to the ACTIVE rows (queued/offered)
so toHost can surface the live offerExpiresAt onto the host for the
§5.2 offered→confirmed structural guard — a terminalized offer must
never shadow the active one.
NB: bookingTypeId is a LOGICAL pointer (deliberately no Prisma relation
on the schema — see the model comment), so the type is fetched with a
second query here rather than an include. Folding it into hydration
keeps the transition core's lock-holding section free of extra reads
(Stage 0 carry-forward).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<ComposedBookingRow>
findDistinctSlotsInGroup()
findDistinctSlotsInGroup(groupId: string): Promise<string[]>;Defined in: server/bookings/booking-crud-repository.ts:448
The distinct SLOTS — (resourceId, startsAt, endsAt) — across a group's
live (non-deleted) bookings (§6.10). The scope guard for joinWaitlist.
A slot is the resource AND the window, not the resource alone: the waitlist
cascade fits a whole party against ONE freeCapacity read, which is only
meaningful when every member wants the same slot. Two members on the same
resource at different times are exactly as un-fittable in a single read as
two on different resources — fitting the party against one member's window
and then offering the rest regardless would overbook the members whose own
window has no room. Stage 2 therefore waitlists single-slot parties only
(PLA-111 tracks full multi-slot support); schedule-less members contribute
no slot.
Returned as opaque resource|start|end keys — callers only count them.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
Returns
Promise<string[]>
findExpiredHolds()
findExpiredHolds(now: Date): Promise<{
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:235
Find all held bookings whose holdExpiresAt <= now — the hold sweeper's
hot-path query (hits the [status, holdExpiresAt] composite index). Returns
only the columns the sweeper needs (id, groupId, holdExpiresAt, version).
Parameters
| Parameter | Type |
|---|---|
now | Date |
Returns
Promise<{
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
version: number;
}[]>
findExpiredPending()
findExpiredPending(now: Date): Promise<{
id: string;
pendingExpiresAt: Date | null;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:275
Find all pending bookings whose pendingExpiresAt <= now — the
approval-expiry sweeper's hot-path query.
Parameters
| Parameter | Type |
|---|---|
now | Date |
Returns
Promise<{
id: string;
pendingExpiresAt: Date | null;
version: number;
}[]>
findHeldGroupSiblings()
findHeldGroupSiblings(groupId: string): Promise<{
holdExpiresAt: Date | null;
id: string;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:258
Find all held siblings sharing a group_id — used by the hold sweeper
for group-unit expiry (§6.10). Returns the same minimal shape as
findExpiredHolds.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
Returns
Promise<{
holdExpiresAt: Date | null;
id: string;
version: number;
}[]>
findMany()
findMany(pagination: {
page: number;
pageSize: number;
}): Promise<OffsetPaginatedResult<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>>;Defined in: server/persistence/base-repository.ts:195
Parameters
| Parameter | Type |
|---|---|
pagination | { page: number; pageSize: number; } |
pagination.page | number |
pagination.pageSize | number |
Returns
Promise<OffsetPaginatedResult<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>>
Inherited from
findNoShowable()
findNoShowable(cutoff: Date): Promise<{
bookingTypeId: string;
bookingTypeVersionId: string;
id: string;
scheduleStartsAt: Date;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:336
Find all confirmed bookings whose schedule startsAt + graceMs <= now
AND whose slot has NOT yet ended (endsAt > now) — the no-show sweeper's
query for bookings past the grace window but still in progress. Returns
only the minimal columns the sweeper needs (including the pinned policy
version for per-booking grace lookup).
The endsAt > now bound partitions the timeline against
findCompletable (endsAt <= now): an ended confirmed booking is
ONLY completable, never no-showable. Without it the two sweeps overlap on
ended slots and a lagging/absent completion tick could leave an ended
booking marked no_show instead of completed (whichever sweep ran
first won). markNoShow itself carries no structural endsAt guard (an
operator may mark no-show manually after a slot ends), so this bound lives
in the sweeper query, not the transition.
Parameters
| Parameter | Type |
|---|---|
cutoff | Date |
Returns
Promise<{
bookingTypeId: string;
bookingTypeVersionId: string;
id: string;
scheduleStartsAt: Date;
version: number;
}[]>
findOfferedInGroupSlot()
findOfferedInGroupSlot(groupId: string, slot: {
endsAt: Date;
resourceId: string;
startsAt: Date;
}): Promise<{
id: string;
version: number;
}[]>;Defined in: server/bookings/booking-crud-repository.ts:488
The offered bookings sharing a group_id AND a slot — the party a
waitlist accept/decline acts on as a UNIT (§6.10).
Scoped to the slot, not the group alone, so this agrees with how the
cascade builds parties (findQueuedPartiesForResource keys on group +
resource + window). A group whose members were regrouped across windows is
offered as separate parties, one per window; resolving the party by group
alone here would then let accepting one window's offer confirm a sibling on
another, and let declining one terminalize a sibling's still-live offer.
Ordered by id for a stable batch order. Returns the minimal shape (id + version) the party operations need.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
slot | { endsAt: Date; resourceId: string; startsAt: Date; } |
slot.endsAt | Date |
slot.resourceId | string |
slot.startsAt | Date |
Returns
Promise<{
id: string;
version: number;
}[]>
hardDelete()
hardDelete(id: string): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/persistence/base-repository.ts:377
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Inherited from
logActivity()
protected logActivity(
_entityId: string,
_action: string,
_metadata?: Record<string, unknown>
): Promise<void>;Defined in: server/persistence/base-repository.ts:140
Log an activity entry.
NOTE: This is not implemented because there's no activity model implemented in taproot yet! https://linear.app/kaizenlabs/issue/ENG-7846/add-activity-log-tables
Parameters
| Parameter | Type |
|---|---|
_entityId | string |
_action | string |
_metadata? | Record<string, unknown> |
Returns
Promise<void>
Inherited from
notFoundError()
protected notFoundError(id: string): Error;Defined in: server/bookings/booking-crud-repository.ts:80
Create a not-found error. Override to provide custom error types.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Error
Overrides
softDelete()
softDelete(id: string): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/persistence/base-repository.ts:366
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Inherited from
sumConfirmedEnrollment()
sumConfirmedEnrollment(query: {
from: Date;
resourceId: string;
to: Date;
}): Promise<number>;Defined in: server/bookings/booking-crud-repository.ts:382
Confirmed enrollment on a resource's window (§6.10 run-decision): the
SUM(capacity_units) of confirmed bookings whose schedule overlaps
[from, to) on resourceId. Used by WaitlistService.decideRun to compare
against the pinned minEnrollment.
Parameters
| Parameter | Type |
|---|---|
query | { from: Date; resourceId: string; to: Date; } |
query.from | Date |
query.resourceId | string |
query.to | Date |
Returns
Promise<number>
uidTaken()
uidTaken(organizationId: string, uid: string): Promise<boolean>;Defined in: server/bookings/booking-crud-repository.ts:516
True if ANY booking in the org — live or soft-deleted — already carries
this external uid. Deliberately no deletedAt: null filter: the
@@unique([organizationId, uid]) constraint covers soft-deleted rows
too, and create() probes-then-inserts without a P2002 retry (a failed
INSERT would abort the surrounding transaction), so the probe must see
everything the constraint sees.
Parameters
| Parameter | Type |
|---|---|
organizationId | string |
uid | string |
Returns
Promise<boolean>
update()
update(id: string, input: Partial<{
groupId: string | null;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
}>): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/persistence/base-repository.ts:301
Parameters
| Parameter | Type |
|---|---|
id | string |
input | Partial<{ groupId: string | null; partyEmail: string | null; partyName: string | null; partyRef: string | null; }> |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>
Inherited from
updateIfVersion()
updateIfVersion(
id: string,
data:
| BookingsUpdateManyMutationInput
| BookingsUpdateManyMutationInput & {
supersededById?: string | null;
},
expectedVersion: number
): Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>;Defined in: server/bookings/booking-crud-repository.ts:173
Version-CAS update: zero rows ⇒ concurrent transition ⇒ StaleBookingError.
Accepts the checked input plus an optional supersededById FK scalar
(§7.1) so the FK escape hatch is scoped to that one field rather than
allowing the full unchecked union.
Parameters
| Parameter | Type |
|---|---|
id | string |
data | | BookingsUpdateManyMutationInput | BookingsUpdateManyMutationInput & { supersededById?: string | null; } |
expectedVersion | number |
Returns
Promise<{
amountOwedCents: number | null;
bookingTypeId: string;
bookingTypeVersionId: string;
capacityUnits: number;
createdAt: Date;
createdBy: string | null;
currency: string | null;
deletedAt: Date | null;
deletedBy: string | null;
groupId: string | null;
holdExpiresAt: Date | null;
id: string;
organizationId: string;
origin: BookingOrigin;
paid: boolean;
partyEmail: string | null;
partyName: string | null;
partyRef: string | null;
payload: JsonValue;
paymentRef: string | null;
pendingExpiresAt: Date | null;
status: BookingStatus;
statusUpdatedAt: Date;
statusUpdatedBy: string | null;
supersededById: string | null;
uid: string;
updatedAt: Date;
updatedBy: string | null;
version: number;
}>