Kaizen
Browse modulesRulesrules/serverClasses

Class: ConditionCrudRepository

Defined in: server/rules/condition-crud-repository.ts:37

CRUD repository for Conditions parent rows. Conditions have no status field of their own (unlike rules) — "active" simply means a current version exists and the row isn't soft-deleted.

Extends

  • CrudRepository<PrismaClient, Conditions, CreateInput, UpdateInput, string, Tx<PrismaClient>>

Constructors

Constructor

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

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

Parameters

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

Returns

ConditionCrudRepository

Inherited from

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/rules/condition-crud-repository.ts:62

Returns

Promise<number>

Overrides

CrudRepository._count


_create()

protected _create(input: CreateInput): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/rules/condition-crud-repository.ts:83

Parameters

ParameterType
inputCreateInput

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._create


_exists()

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

Defined in: server/rules/condition-crud-repository.ts:55

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Overrides

CrudRepository._exists


_findById()

protected _findById(id: string): Promise<
  | {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/rules/condition-crud-repository.ts:49

Parameters

ParameterType
idstring

Returns

Promise< | { conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; } | null>

Overrides

CrudRepository._findById


_findMany()

protected _findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<{
  items: {
     conditionType: string;
     createdAt: Date;
     createdBy: string | null;
     currentVersionId: string | null;
     deletedAt: Date | null;
     deletedBy: string | null;
     description: string | null;
     domain: string;
     id: string;
     identifier: string;
     module: string | null;
     name: string | null;
     organizationId: string;
     updatedAt: Date;
     updatedBy: string | null;
  }[];
  total: number;
}>;

Defined in: server/rules/condition-crud-repository.ts:66

Parameters

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

Returns

Promise<{ items: { conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }[]; total: number; }>

Overrides

CrudRepository._findMany


_hardDelete()

protected _hardDelete(id: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/rules/condition-crud-repository.ts:118

Parameters

ParameterType
idstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._hardDelete


_softDelete()

protected _softDelete(id: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/rules/condition-crud-repository.ts:111

Parameters

ParameterType
idstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._softDelete


_update()

protected _update(id: string, patch: UpdateInput): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/rules/condition-crud-repository.ts:97

Parameters

ParameterType
idstring
patchUpdateInput

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._update


afterCreate()

protected afterCreate(entity: {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}, _input: CreateInput): Promise<void>;

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

Parameters

ParameterType
entity{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }
entity.conditionTypestring
entity.createdAtDate
entity.createdBystring | null
entity.currentVersionIdstring | null
entity.deletedAtDate | null
entity.deletedBystring | null
entity.descriptionstring | null
entity.domainstring
entity.idstring
entity.identifierstring
entity.modulestring | null
entity.namestring | null
entity.organizationIdstring
entity.updatedAtDate
entity.updatedBystring | null
_inputCreateInput

Returns

Promise<void>

Inherited from

CrudRepository.afterCreate


afterDelete()

protected afterDelete(_entity: {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}, id: string): Promise<void>;

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

Parameters

ParameterType
_entity{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }
_entity.conditionTypestring
_entity.createdAtDate
_entity.createdBystring | null
_entity.currentVersionIdstring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.descriptionstring | null
_entity.domainstring
_entity.idstring
_entity.identifierstring
_entity.modulestring | null
_entity.namestring | null
_entity.organizationIdstring
_entity.updatedAtDate
_entity.updatedBystring | null
idstring

Returns

Promise<void>

Inherited from

CrudRepository.afterDelete


afterUpdate()

protected afterUpdate(
   _entity: {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}, 
   id: string, 
   input: Partial<{
  currentVersionId: string | null;
  description: string | null;
  module: string | null;
  name: string | null;
}>
): Promise<void>;

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

Parameters

ParameterType
_entity{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }
_entity.conditionTypestring
_entity.createdAtDate
_entity.createdBystring | null
_entity.currentVersionIdstring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.descriptionstring | null
_entity.domainstring
_entity.idstring
_entity.identifierstring
_entity.modulestring | null
_entity.namestring | null
_entity.organizationIdstring
_entity.updatedAtDate
_entity.updatedBystring | null
idstring
inputPartial<{ currentVersionId: string | null; description: string | null; module: string | null; name: string | null; }>

Returns

Promise<void>

Inherited from

CrudRepository.afterUpdate


beforeCreate()

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

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

Parameters

ParameterType
_inputCreateInput

Returns

Promise<void>

Inherited from

CrudRepository.beforeCreate


beforeDelete()

protected beforeDelete(_id: string, _existing: {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}): Promise<void>;

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

Parameters

ParameterType
_idstring
_existing{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }
_existing.conditionTypestring
_existing.createdAtDate
_existing.createdBystring | null
_existing.currentVersionIdstring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.descriptionstring | null
_existing.domainstring
_existing.idstring
_existing.identifierstring
_existing.modulestring | null
_existing.namestring | null
_existing.organizationIdstring
_existing.updatedAtDate
_existing.updatedBystring | null

Returns

Promise<void>

Inherited from

CrudRepository.beforeDelete


beforeUpdate()

protected beforeUpdate(
   _id: string, 
   _input: Partial<{
  currentVersionId: string | null;
  description: string | null;
  module: string | null;
  name: string | null;
}>, 
   _existing: {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}
): Promise<void>;

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

Parameters

ParameterType
_idstring
_inputPartial<{ currentVersionId: string | null; description: string | null; module: string | null; name: string | null; }>
_existing{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }
_existing.conditionTypestring
_existing.createdAtDate
_existing.createdBystring | null
_existing.currentVersionIdstring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.descriptionstring | null
_existing.domainstring
_existing.idstring
_existing.identifierstring
_existing.modulestring | null
_existing.namestring | null
_existing.organizationIdstring
_existing.updatedAtDate
_existing.updatedBystring | null

Returns

Promise<void>

Inherited from

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: CreateInput): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
inputCreateInput

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Inherited from

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


findActiveByDomainAndOrg()

findActiveByDomainAndOrg(domain: string, organizationId: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}[]>;

Defined in: server/rules/condition-crud-repository.ts:131

Parameters

ParameterType
domainstring
organizationIdstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }[]>


findById()

findById(id: string): Promise<
  | {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

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

Parameters

ParameterType
idstring

Returns

Promise< | { conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; } | null>

Inherited from

CrudRepository.findById


findByIdOrThrow()

findByIdOrThrow(id: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.findByIdOrThrow


findByOrgAndIdentifier()

findByOrgAndIdentifier(organizationId: string, identifier: string): Promise<
  | {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/rules/condition-crud-repository.ts:122

Parameters

ParameterType
organizationIdstring
identifierstring

Returns

Promise< | { conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; } | null>


findMany()

findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<OffsetPaginatedResult<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  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<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>>

Inherited from

CrudRepository.findMany


hardDelete()

hardDelete(id: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.hardDelete


lockById()

lockById(id: string): Promise<
  | {
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/rules/condition-crud-repository.ts:158

SELECT ... FOR UPDATE on the ambient transaction, then re-read through the same handle. Row-locks the condition for the duration of the transaction — used by pricing-matrix (PLA-136) callers that need a PRICING_SCHEDULE condition to stay stable (not be concurrently soft-deleted) while they read-then-write cell rules against it (see PricingMatrixService.setCellPrice/deleteSchedule, which both lock the same condition row so they serialize against each other instead of racing to create-a-cell-under vs. cascade-delete-cells-under the same schedule). Returns null (nothing locked) if the condition doesn't exist or is soft-deleted. Mirrors TierRepository.lockById.

Parameters

ParameterType
idstring

Returns

Promise< | { conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; } | 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

CrudRepository.logActivity


notFoundError()

protected notFoundError(id: string): Error;

Defined in: server/rules/condition-crud-repository.ts:45

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

Parameters

ParameterType
idstring

Returns

Error

Overrides

CrudRepository.notFoundError


softDelete()

softDelete(id: string): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.softDelete


update()

update(id: string, input: Partial<{
  currentVersionId: string | null;
  description: string | null;
  module: string | null;
  name: string | null;
}>): Promise<{
  conditionType: string;
  createdAt: Date;
  createdBy: string | null;
  currentVersionId: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  domain: string;
  id: string;
  identifier: string;
  module: string | null;
  name: string | null;
  organizationId: string;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring
inputPartial<{ currentVersionId: string | null; description: string | null; module: string | null; name: string | null; }>

Returns

Promise<{ conditionType: string; createdAt: Date; createdBy: string | null; currentVersionId: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; domain: string; id: string; identifier: string; module: string | null; name: string | null; organizationId: string; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.update

On this page

ExtendsConstructorsConstructorParametersReturnsInherited fromPropertiesENTITY_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()ParametersReturnsInherited frombeforeDelete()ParametersReturnsInherited frombeforeUpdate()ParametersReturnsInherited fromconsumeSilent()ReturnsInherited fromcount()ReturnsInherited fromcreate()ParametersReturnsInherited fromexists()ParametersReturnsInherited fromfindActiveByDomainAndOrg()ParametersReturnsfindById()ParametersReturnsInherited fromfindByIdOrThrow()ParametersReturnsInherited fromfindByOrgAndIdentifier()ParametersReturnsfindMany()ParametersReturnsInherited fromhardDelete()ParametersReturnsInherited fromlockById()ParametersReturnslogActivity()ParametersReturnsInherited fromnotFoundError()ParametersReturnsOverridessoftDelete()ParametersReturnsInherited fromupdate()ParametersReturnsInherited from