Kaizen
Browse modulesCapacityClasses

Class: CapacityAttendanceSettingsRepository

Defined in: server/capacity/capacity-repository.ts:77

CRUD repository for CapacityAttendanceSettings rows (PLA-137). No Rules/Conditions involvement or versioning. Writes that set a pricing tier lock that tier through TierRepository to serialize with tier deletion.

Resolves the ambient Prisma client itself (no separate "Repositories" container) — there's only ever this one repository in the capacity domain, so a wrapping container would just be a single-member pass-through.

Extends

  • CrudRepository<PrismaClient, CapacityAttendanceSettings, CapacityAttendanceSettingsCreateInput, CapacityAttendanceSettingsUpdateInput, string, Tx<PrismaClient>>

Constructors

Constructor

new CapacityAttendanceSettingsRepository(options?: RepositoryOptions): CapacityAttendanceSettingsRepository;

Defined in: server/capacity/capacity-repository.ts:85

Parameters

ParameterType
optionsRepositoryOptions

Returns

CapacityAttendanceSettingsRepository

Overrides

CrudRepository.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

CrudRepository.ENTITY_TYPE


logger?

protected readonly optional logger?: Logger;

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

Inherited from

CrudRepository.logger


prismaClient

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

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

Inherited from

CrudRepository.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

CrudRepository.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

CrudRepository.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

CrudRepository.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

CrudRepository.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

CrudRepository.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

CrudRepository.tx

Methods

_count()

protected _count(): Promise<number>;

Defined in: server/capacity/capacity-repository.ts:127

Returns

Promise<number>

Overrides

CrudRepository._count


_create()

protected _create(input: CapacityAttendanceSettingsCreateInput): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:196

Parameters

ParameterType
inputCapacityAttendanceSettingsCreateInput

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._create


_exists()

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

Defined in: server/capacity/capacity-repository.ts:120

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Overrides

CrudRepository._exists


_findById()

protected _findById(id: string): Promise<
  | {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/capacity/capacity-repository.ts:112

Parameters

ParameterType
idstring

Returns

Promise< | { chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; } | null>

Overrides

CrudRepository._findById


_findMany()

protected _findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<{
  items: {
     chaperoneRatio: number | null;
     createdAt: Date;
     createdBy: string | null;
     deletedAt: Date | null;
     deletedBy: string | null;
     estimatedAttendance: number | null;
     extraChaperoneRateTierId: string | null;
     id: string;
     maxCapacity: number | null;
     organizationId: string;
     scopes: JsonValue;
     updatedAt: Date;
     updatedBy: string | null;
  }[];
  total: number;
}>;

Defined in: server/capacity/capacity-repository.ts:133

Parameters

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

Returns

Promise<{ items: { chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }[]; total: number; }>

Overrides

CrudRepository._findMany


_hardDelete()

protected _hardDelete(id: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:233

Parameters

ParameterType
idstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._hardDelete


_softDelete()

protected _softDelete(id: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:226

Parameters

ParameterType
idstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._softDelete


_update()

protected _update(id: string, patch: CapacityAttendanceSettingsUpdateInput): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:211

Parameters

ParameterType
idstring
patchCapacityAttendanceSettingsUpdateInput

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._update


afterCreate()

protected afterCreate(entity: {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}, _input: CapacityAttendanceSettingsCreateInput): Promise<void>;

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

Parameters

ParameterTypeDescription
entity{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }-
entity.chaperoneRationumber | null"1 free chaperone per N students" — this is N. Must be a positive integer when set (validated at the repository boundary, not the DB — Prisma's schema DSL has no CHECK-constraint escape hatch here worth the migration hand-editing; dividing by a non-positive ratio is meaningless).
entity.createdAtDate-
entity.createdBystring | null-
entity.deletedAtDate | null-
entity.deletedBystring | null-
entity.estimatedAttendancenumber | nullInformational only — never used in a calculation (Figma: "not used in reporting").
entity.extraChaperoneRateTierIdstring | null-
entity.idstring-
entity.maxCapacitynumber | null-
entity.organizationIdstring-
entity.scopesJsonValueFacility/module scoping — same Scope[] shape used elsewhere. Mutable (unlike PricingRateTiers.scopes, an immutable system-injected identity marker): this just tags which facility/module the settings apply to, so reassigning it is an ordinary edit, not an identity change.
entity.updatedAtDate-
entity.updatedBystring | null-
_inputCapacityAttendanceSettingsCreateInput-

Returns

Promise<void>

Inherited from

CrudRepository.afterCreate


afterDelete()

protected afterDelete(_entity: {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}, id: string): Promise<void>;

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

Parameters

ParameterTypeDescription
_entity{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }-
_entity.chaperoneRationumber | null"1 free chaperone per N students" — this is N. Must be a positive integer when set (validated at the repository boundary, not the DB — Prisma's schema DSL has no CHECK-constraint escape hatch here worth the migration hand-editing; dividing by a non-positive ratio is meaningless).
_entity.createdAtDate-
_entity.createdBystring | null-
_entity.deletedAtDate | null-
_entity.deletedBystring | null-
_entity.estimatedAttendancenumber | nullInformational only — never used in a calculation (Figma: "not used in reporting").
_entity.extraChaperoneRateTierIdstring | null-
_entity.idstring-
_entity.maxCapacitynumber | null-
_entity.organizationIdstring-
_entity.scopesJsonValueFacility/module scoping — same Scope[] shape used elsewhere. Mutable (unlike PricingRateTiers.scopes, an immutable system-injected identity marker): this just tags which facility/module the settings apply to, so reassigning it is an ordinary edit, not an identity change.
_entity.updatedAtDate-
_entity.updatedBystring | null-
idstring-

Returns

Promise<void>

Inherited from

CrudRepository.afterDelete


afterUpdate()

protected afterUpdate(
   _entity: {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}, 
   id: string, 
   input: Partial<{
  chaperoneRatio: number | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  maxCapacity: number | null;
  scopes: {
     scope_type: string;
     scope_value: string[];
  }[];
}>
): Promise<void>;

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

Parameters

ParameterTypeDescription
_entity{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }-
_entity.chaperoneRationumber | null"1 free chaperone per N students" — this is N. Must be a positive integer when set (validated at the repository boundary, not the DB — Prisma's schema DSL has no CHECK-constraint escape hatch here worth the migration hand-editing; dividing by a non-positive ratio is meaningless).
_entity.createdAtDate-
_entity.createdBystring | null-
_entity.deletedAtDate | null-
_entity.deletedBystring | null-
_entity.estimatedAttendancenumber | nullInformational only — never used in a calculation (Figma: "not used in reporting").
_entity.extraChaperoneRateTierIdstring | null-
_entity.idstring-
_entity.maxCapacitynumber | null-
_entity.organizationIdstring-
_entity.scopesJsonValueFacility/module scoping — same Scope[] shape used elsewhere. Mutable (unlike PricingRateTiers.scopes, an immutable system-injected identity marker): this just tags which facility/module the settings apply to, so reassigning it is an ordinary edit, not an identity change.
_entity.updatedAtDate-
_entity.updatedBystring | null-
idstring-
inputPartial<{ chaperoneRatio: number | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; maxCapacity: number | null; scopes: { scope_type: string; scope_value: string[]; }[]; }>-

Returns

Promise<void>

Inherited from

CrudRepository.afterUpdate


beforeCreate()

protected beforeCreate(input: CapacityAttendanceSettingsCreateInput): Promise<void>;

Defined in: server/capacity/capacity-repository.ts:150

Parameters

ParameterType
inputCapacityAttendanceSettingsCreateInput

Returns

Promise<void>

Overrides

CrudRepository.beforeCreate


beforeDelete()

protected beforeDelete(_id: string, _existing: {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}): Promise<void>;

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

Parameters

ParameterTypeDescription
_idstring-
_existing{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }-
_existing.chaperoneRationumber | null"1 free chaperone per N students" — this is N. Must be a positive integer when set (validated at the repository boundary, not the DB — Prisma's schema DSL has no CHECK-constraint escape hatch here worth the migration hand-editing; dividing by a non-positive ratio is meaningless).
_existing.createdAtDate-
_existing.createdBystring | null-
_existing.deletedAtDate | null-
_existing.deletedBystring | null-
_existing.estimatedAttendancenumber | nullInformational only — never used in a calculation (Figma: "not used in reporting").
_existing.extraChaperoneRateTierIdstring | null-
_existing.idstring-
_existing.maxCapacitynumber | null-
_existing.organizationIdstring-
_existing.scopesJsonValueFacility/module scoping — same Scope[] shape used elsewhere. Mutable (unlike PricingRateTiers.scopes, an immutable system-injected identity marker): this just tags which facility/module the settings apply to, so reassigning it is an ordinary edit, not an identity change.
_existing.updatedAtDate-
_existing.updatedBystring | null-

Returns

Promise<void>

Inherited from

CrudRepository.beforeDelete


beforeUpdate()

protected beforeUpdate(
   _id: string, 
   input: CapacityAttendanceSettingsUpdateInput, 
   existing: {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}
): Promise<void>;

Defined in: server/capacity/capacity-repository.ts:160

Parameters

ParameterTypeDescription
_idstring-
inputCapacityAttendanceSettingsUpdateInput-
existing{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }-
existing.chaperoneRationumber | null"1 free chaperone per N students" — this is N. Must be a positive integer when set (validated at the repository boundary, not the DB — Prisma's schema DSL has no CHECK-constraint escape hatch here worth the migration hand-editing; dividing by a non-positive ratio is meaningless).
existing.createdAtDate-
existing.createdBystring | null-
existing.deletedAtDate | null-
existing.deletedBystring | null-
existing.estimatedAttendancenumber | nullInformational only — never used in a calculation (Figma: "not used in reporting").
existing.extraChaperoneRateTierIdstring | null-
existing.idstring-
existing.maxCapacitynumber | null-
existing.organizationIdstring-
existing.scopesJsonValueFacility/module scoping — same Scope[] shape used elsewhere. Mutable (unlike PricingRateTiers.scopes, an immutable system-injected identity marker): this just tags which facility/module the settings apply to, so reassigning it is an ordinary edit, not an identity change.
existing.updatedAtDate-
existing.updatedBystring | null-

Returns

Promise<void>

Overrides

CrudRepository.beforeUpdate


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

CrudRepository.consumeSilent


count()

count(): Promise<number>;

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

Returns

Promise<number>

Inherited from

CrudRepository.count


create()

create(input: CapacityAttendanceSettingsCreateInput): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:95

Parameters

ParameterType
inputCapacityAttendanceSettingsCreateInput

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository.create


exists()

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

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

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Inherited from

CrudRepository.exists


findActiveByOrg()

findActiveByOrg(organizationId: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}[]>;

Defined in: server/capacity/capacity-repository.ts:242

Every non-deleted settings row for an organization. There is no scope-matching engine here (PLA-137 is deliberately not a rules-engine domain) — callers pick the right row by inspecting scopes themselves.

Parameters

ParameterType
organizationIdstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }[]>


findById()

findById(id: string): Promise<
  | {
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

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

Parameters

ParameterType
idstring

Returns

Promise< | { chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; } | null>

Inherited from

CrudRepository.findById


findByIdOrThrow()

findByIdOrThrow(id: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.findByIdOrThrow


findMany()

findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<OffsetPaginatedResult<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>>;

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

Parameters

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

Returns

Promise<OffsetPaginatedResult<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>>

Inherited from

CrudRepository.findMany


hardDelete()

hardDelete(id: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.hardDelete


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

CrudRepository.logActivity


notFoundError()

protected notFoundError(id: string): Error;

Defined in: server/capacity/capacity-repository.ts:91

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

Parameters

ParameterType
idstring

Returns

Error

Overrides

CrudRepository.notFoundError


softDelete()

softDelete(id: string): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.softDelete


update()

update(id: string, input: CapacityAttendanceSettingsUpdateInput): Promise<{
  chaperoneRatio: number | null;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  estimatedAttendance: number | null;
  extraChaperoneRateTierId: string | null;
  id: string;
  maxCapacity: number | null;
  organizationId: string;
  scopes: JsonValue;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/capacity/capacity-repository.ts:103

Parameters

ParameterType
idstring
inputCapacityAttendanceSettingsUpdateInput

Returns

Promise<{ chaperoneRatio: number | null; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; estimatedAttendance: number | null; extraChaperoneRateTierId: string | null; id: string; maxCapacity: number | null; organizationId: string; scopes: JsonValue; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository.update

On this page

ExtendsConstructorsConstructorParametersReturnsOverridesPropertiesENTITY_TYPE?Inherited fromlogger?Inherited fromprismaClientInherited fromAccessorsactorIdGet SignatureReturnsInherited fromauditCreateGet SignatureReturnscreatedByupdatedByInherited fromauditDeleteGet SignatureReturnsdeletedAtdeletedByInherited fromauditUpdateGet SignatureReturnsupdatedByInherited fromsilentGet SignatureExampleReturnsInherited fromtxGet SignatureReturnsInherited fromMethods_count()ReturnsOverrides_create()ParametersReturnsOverrides_exists()ParametersReturnsOverrides_findById()ParametersReturnsOverrides_findMany()ParametersReturnsOverrides_hardDelete()ParametersReturnsOverrides_softDelete()ParametersReturnsOverrides_update()ParametersReturnsOverridesafterCreate()ParametersReturnsInherited fromafterDelete()ParametersReturnsInherited fromafterUpdate()ParametersReturnsInherited frombeforeCreate()ParametersReturnsOverridesbeforeDelete()ParametersReturnsInherited frombeforeUpdate()ParametersReturnsOverridesconsumeSilent()ReturnsInherited fromcount()ReturnsInherited fromcreate()ParametersReturnsOverridesexists()ParametersReturnsInherited fromfindActiveByOrg()ParametersReturnsfindById()ParametersReturnsInherited fromfindByIdOrThrow()ParametersReturnsInherited fromfindMany()ParametersReturnsInherited fromhardDelete()ParametersReturnsInherited fromlogActivity()ParametersReturnsInherited fromnotFoundError()ParametersReturnsOverridessoftDelete()ParametersReturnsInherited fromupdate()ParametersReturnsOverrides