Kaizen
Browse modulesBookingsbookings/serverClasses

Class: BookingEventRepository

Defined in: server/bookings/booking-event-repository.ts:50

APPEND-ONLY timeline + transactional outbox (§6.5/§8.1). The dispatcher's cursor and lease fields are mutable; domain event content is immutable.

Extends

Constructors

Constructor

new BookingEventRepository(prismaClient: PrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs>, options?: RepositoryOptions): BookingEventRepository;

Defined in: server/persistence/base-repository.ts:68

Parameters

ParameterType
prismaClientPrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs>
optionsRepositoryOptions

Returns

BookingEventRepository

Inherited from

WriteRepository.constructor

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

WriteRepository.ENTITY_TYPE


logger?

protected readonly optional logger?: Logger;

Defined in: server/persistence/base-repository.ts:64

Inherited from

WriteRepository.logger


prismaClient

protected prismaClient: PrismaClientLike<Tx<PrismaClient<PrismaClientOptions, never, DefaultArgs>>> & PrismaClient<PrismaClientOptions, never, DefaultArgs>;

Defined in: server/persistence/base-repository.ts:69

Inherited from

WriteRepository.prismaClient

Accessors

actorId

Get Signature

get protected actorId(): string | null | undefined;

Defined in: server/persistence/base-repository.ts:76

Returns

string | null | undefined

Inherited from

WriteRepository.actorId


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

WriteRepository.auditCreate


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

WriteRepository.auditDelete


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

WriteRepository.auditUpdate


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 normally
Returns

this

Inherited from

WriteRepository.silent


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

WriteRepository.tx

Methods

_count()

protected _count(): Promise<number>;

Defined in: server/bookings/booking-event-repository.ts:71

Returns

Promise<number>

Overrides

WriteRepository._count


_create()

protected _create(input: BookingEventAppendInput): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/bookings/booking-event-repository.ts:89

Parameters

ParameterType
inputBookingEventAppendInput

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>

Overrides

WriteRepository._create


_exists()

protected _exists(id: string): Promise<boolean>;

Defined in: server/bookings/booking-event-repository.ts:66

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Overrides

WriteRepository._exists


_findById()

protected _findById(id: string): Promise<
  | {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}
| null>;

Defined in: server/bookings/booking-event-repository.ts:62

Parameters

ParameterType
idstring

Returns

Promise< | { actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; } | null>

Overrides

WriteRepository._findById


_findMany()

protected _findMany(): Promise<{
  items: {
     actorId: string | null;
     bookingId: string;
     channel: string | null;
     createdBy: string | null;
     data: JsonValue;
     dispatchedAt: Date | null;
     eventType: string;
     id: string;
     idempotencyKey: string | null;
     leaseToken: string | null;
     leaseUntil: Date | null;
     occurredAt: Date;
     reason: string | null;
     sequence: number;
     statusAfter: string | null;
     statusBefore: string | null;
  }[];
  total: number;
}>;

Defined in: server/bookings/booking-event-repository.ts:80

No unscoped reads: paging over EVERY org's events is never a valid access pattern (mirrors _update throwing on this append-only repo). Use findByBooking or findUndispatched instead.

Returns

Promise<{ items: { actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }[]; total: number; }>

Overrides

WriteRepository._findMany


_update()

protected _update(): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/bookings/booking-event-repository.ts:132

Append-only: event content is never mutated. Use markDispatched for the cursor.

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>

Overrides

WriteRepository._update


acknowledge()

acknowledge(id: string, token: string): Promise<boolean>;

Defined in: server/bookings/booking-event-repository.ts:193

Call with the matching outcome append in one short transaction.

Parameters

ParameterType
idstring
tokenstring

Returns

Promise<boolean>


afterCreate()

protected afterCreate(entity: {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}, _input: BookingEventAppendInput): Promise<void>;

Defined in: server/persistence/base-repository.ts:316

Parameters

ParameterTypeDescription
entity{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }-
entity.actorIdstring | null-
entity.bookingIdstring-
entity.channelstring | null-
entity.createdBystring | null-
entity.dataJsonValue-
entity.dispatchedAtDate | nullOutbox cursor: NULL for an undispatched effect row (*_due eventType); set by event-dispatcher.ts after the side effect succeeds (§8.1). The ONLY mutable domain cursor; leases are dispatcher bookkeeping. Plain timeline rows are born dispatched.
entity.eventTypestring-
entity.idstring-
entity.idempotencyKeystring | nullDedup key so a cron re-run doesn't re-emit (cedar's fire-and-forget bug, §12).
entity.leaseTokenstring | null-
entity.leaseUntilDate | null-
entity.occurredAtDate-
entity.reasonstring | null-
entity.sequencenumber-
entity.statusAfterstring | null-
entity.statusBeforestring | null-
_inputBookingEventAppendInput-

Returns

Promise<void>

Inherited from

WriteRepository.afterCreate


afterUpdate()

protected afterUpdate(
   _entity: {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}, 
   id: string, 
   input: Record<string, never>
): Promise<void>;

Defined in: server/persistence/base-repository.ts:328

Parameters

ParameterTypeDescription
_entity{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }-
_entity.actorIdstring | null-
_entity.bookingIdstring-
_entity.channelstring | null-
_entity.createdBystring | null-
_entity.dataJsonValue-
_entity.dispatchedAtDate | nullOutbox cursor: NULL for an undispatched effect row (*_due eventType); set by event-dispatcher.ts after the side effect succeeds (§8.1). The ONLY mutable domain cursor; leases are dispatcher bookkeeping. Plain timeline rows are born dispatched.
_entity.eventTypestring-
_entity.idstring-
_entity.idempotencyKeystring | nullDedup key so a cron re-run doesn't re-emit (cedar's fire-and-forget bug, §12).
_entity.leaseTokenstring | null-
_entity.leaseUntilDate | null-
_entity.occurredAtDate-
_entity.reasonstring | null-
_entity.sequencenumber-
_entity.statusAfterstring | null-
_entity.statusBeforestring | null-
idstring-
inputRecord<string, never>-

Returns

Promise<void>

Inherited from

WriteRepository.afterUpdate


append()

append(input: BookingEventAppendInput): Promise<
  | {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}
| null>;

Defined in: server/bookings/booking-event-repository.ts:142

Atomic idempotent append. Reusing a key for another booking/event type fails explicitly; redelivery of the same event returns its existing row.

Parameters

ParameterType
inputBookingEventAppendInput

Returns

Promise< | { actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; } | null>


beforeCreate()

protected beforeCreate(_input: BookingEventAppendInput): Promise<void>;

Defined in: server/persistence/base-repository.ts:315

Parameters

ParameterType
_inputBookingEventAppendInput

Returns

Promise<void>

Inherited from

WriteRepository.beforeCreate


beforeUpdate()

protected beforeUpdate(
   _id: string, 
   _input: Record<string, never>, 
   _existing: {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}
): Promise<void>;

Defined in: server/persistence/base-repository.ts:323

Parameters

ParameterTypeDescription
_idstring-
_inputRecord<string, never>-
_existing{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }-
_existing.actorIdstring | null-
_existing.bookingIdstring-
_existing.channelstring | null-
_existing.createdBystring | null-
_existing.dataJsonValue-
_existing.dispatchedAtDate | nullOutbox cursor: NULL for an undispatched effect row (*_due eventType); set by event-dispatcher.ts after the side effect succeeds (§8.1). The ONLY mutable domain cursor; leases are dispatcher bookkeeping. Plain timeline rows are born dispatched.
_existing.eventTypestring-
_existing.idstring-
_existing.idempotencyKeystring | nullDedup key so a cron re-run doesn't re-emit (cedar's fire-and-forget bug, §12).
_existing.leaseTokenstring | null-
_existing.leaseUntilDate | null-
_existing.occurredAtDate-
_existing.reasonstring | null-
_existing.sequencenumber-
_existing.statusAfterstring | null-
_existing.statusBeforestring | null-

Returns

Promise<void>

Inherited from

WriteRepository.beforeUpdate


claim()

claim(id: string, leaseSeconds: number): Promise<string | null>;

Defined in: server/bookings/booking-event-repository.ts:167

Lease only the oldest unacknowledged effect for this booking. DB time and an ownership token prevent concurrent drains from sharing a live claim.

Parameters

ParameterType
idstring
leaseSecondsnumber

Returns

Promise<string | null>


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

WriteRepository.consumeSilent


count()

count(): Promise<number>;

Defined in: server/persistence/base-repository.ts:191

Returns

Promise<number>

Inherited from

WriteRepository.count


create()

create(input: BookingEventAppendInput): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/persistence/base-repository.ts:292

Parameters

ParameterType
inputBookingEventAppendInput

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>

Inherited from

WriteRepository.create


exists()

exists(id: string): Promise<boolean>;

Defined in: server/persistence/base-repository.ts:187

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Inherited from

WriteRepository.exists


findByBooking()

findByBooking(bookingId: string): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}[]>;

Defined in: server/bookings/booking-event-repository.ts:147

Timeline read, oldest first.

Parameters

ParameterType
bookingIdstring

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }[]>


findById()

findById(id: string): Promise<
  | {
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}
| null>;

Defined in: server/persistence/base-repository.ts:177

Parameters

ParameterType
idstring

Returns

Promise< | { actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; } | null>

Inherited from

WriteRepository.findById


findByIdOrThrow()

findByIdOrThrow(id: string): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/persistence/base-repository.ts:181

Parameters

ParameterType
idstring

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>

Inherited from

WriteRepository.findByIdOrThrow


findMany()

findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<OffsetPaginatedResult<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>>;

Defined in: server/persistence/base-repository.ts:195

Parameters

ParameterType
pagination{ page: number; pageSize: number; }
pagination.pagenumber
pagination.pageSizenumber

Returns

Promise<OffsetPaginatedResult<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>>

Inherited from

WriteRepository.findMany


findUndispatched()

findUndispatched(bookingId?: string): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}[]>;

Defined in: server/bookings/booking-event-repository.ts:155

Undispatched outbox rows (dispatched_at IS NULL), oldest first.

Parameters

ParameterType
bookingId?string

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }[]>


latestOccurredAtByType()

latestOccurredAtByType(eventTypes: readonly string[]): Promise<Map<string, Date | null>>;

Defined in: server/bookings/booking-event-repository.ts:209

Return the occurredAt timestamp of the most-recent event for each provided eventType. Used by SchedulerHealth to derive per-sweeper watermarks (§11): { eventType → latestOccurredAt | null }.

A null value means the sweeper has never emitted that event type — its watermark is epoch-zero, i.e. it has never run.

Parameters

ParameterType
eventTypesreadonly string[]

Returns

Promise<Map<string, Date | null>>


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

ParameterType
_entityIdstring
_actionstring
_metadata?Record<string, unknown>

Returns

Promise<void>

Inherited from

WriteRepository.logActivity


markDispatched()

markDispatched(id: string): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/bookings/booking-event-repository.ts:230

Flip the outbox cursor — the one mutable column on this table.

Parameters

ParameterType
idstring

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>


notFoundError()

protected notFoundError(id: string): Error;

Defined in: server/bookings/booking-event-repository.ts:58

Create a not-found error. Override to provide custom error types.

Parameters

ParameterType
idstring

Returns

Error

Overrides

WriteRepository.notFoundError


release()

release(id: string, token: string): Promise<void>;

Defined in: server/bookings/booking-event-repository.ts:185

A failed attempt is retryable; a stale worker cannot clear a newer lease.

Parameters

ParameterType
idstring
tokenstring

Returns

Promise<void>


update()

update(id: string, input: Record<string, never>): Promise<{
  actorId: string | null;
  bookingId: string;
  channel: string | null;
  createdBy: string | null;
  data: JsonValue;
  dispatchedAt: Date | null;
  eventType: string;
  id: string;
  idempotencyKey: string | null;
  leaseToken: string | null;
  leaseUntil: Date | null;
  occurredAt: Date;
  reason: string | null;
  sequence: number;
  statusAfter: string | null;
  statusBefore: string | null;
}>;

Defined in: server/persistence/base-repository.ts:301

Parameters

ParameterType
idstring
inputRecord<string, never>

Returns

Promise<{ actorId: string | null; bookingId: string; channel: string | null; createdBy: string | null; data: JsonValue; dispatchedAt: Date | null; eventType: string; id: string; idempotencyKey: string | null; leaseToken: string | null; leaseUntil: Date | null; occurredAt: Date; reason: string | null; sequence: number; statusAfter: string | null; statusBefore: string | null; }>

Inherited from

WriteRepository.update

On this page