Kaizen
Browse modulesFormsforms/serverClasses

Class: FormStepRepository

Defined in: server/forms/form-step-repository.ts:25

Repository with full CRUD capabilities. Extend this for most repositories that need create, read, update, and delete.

Extends

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

Constructors

Constructor

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

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

Parameters

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

Returns

FormStepRepository

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/forms/form-step-repository.ts:50

Returns

Promise<number>

Overrides

CrudRepository._count


_create()

protected _create(input: CreateInput): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/forms/form-step-repository.ts:71

Parameters

ParameterType
inputCreateInput

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._create


_exists()

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

Defined in: server/forms/form-step-repository.ts:43

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Overrides

CrudRepository._exists


_findById()

protected _findById(id: string): Promise<
  | {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/forms/form-step-repository.ts:37

Parameters

ParameterType
idstring

Returns

Promise< | { createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; } | null>

Overrides

CrudRepository._findById


_findMany()

protected _findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<{
  items: {
     createdAt: Date;
     createdBy: string | null;
     deletedAt: Date | null;
     deletedBy: string | null;
     description: string | null;
     fields: JsonValue;
     formSchemaVersionId: string;
     id: string;
     key: string;
     label: string | null;
     updatedAt: Date;
     updatedBy: string | null;
  }[];
  total: number;
}>;

Defined in: server/forms/form-step-repository.ts:54

Parameters

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

Returns

Promise<{ items: { createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }[]; total: number; }>

Overrides

CrudRepository._findMany


_hardDelete()

protected _hardDelete(id: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/forms/form-step-repository.ts:98

Parameters

ParameterType
idstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._hardDelete


_softDelete()

protected _softDelete(id: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/forms/form-step-repository.ts:91

Parameters

ParameterType
idstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._softDelete


_update()

protected _update(id: string, patch: UpdateInput): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

Defined in: server/forms/form-step-repository.ts:80

Parameters

ParameterType
idstring
patchUpdateInput

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Overrides

CrudRepository._update


afterCreate()

protected afterCreate(entity: {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, _input: CreateInput): Promise<void>;

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

Parameters

ParameterType
entity{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }
entity.createdAtDate
entity.createdBystring | null
entity.deletedAtDate | null
entity.deletedBystring | null
entity.descriptionstring | null
entity.fieldsJsonValue
entity.formSchemaVersionIdstring
entity.idstring
entity.keystring
entity.labelstring | null
entity.updatedAtDate
entity.updatedBystring | null
_inputCreateInput

Returns

Promise<void>

Inherited from

CrudRepository.afterCreate


afterDelete()

protected afterDelete(_entity: {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, id: string): Promise<void>;

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

Parameters

ParameterType
_entity{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }
_entity.createdAtDate
_entity.createdBystring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.descriptionstring | null
_entity.fieldsJsonValue
_entity.formSchemaVersionIdstring
_entity.idstring
_entity.keystring
_entity.labelstring | null
_entity.updatedAtDate
_entity.updatedBystring | null
idstring

Returns

Promise<void>

Inherited from

CrudRepository.afterDelete


afterUpdate()

protected afterUpdate(
   _entity: {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, 
   id: string, 
   input: Partial<Pick<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, "description" | "updatedBy" | "label"> & {
  fields: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     fields?: {
        additionalInfo?: {
           body?: ... | ...;
           title?: ... | ...;
        };
        adoptionStatement?: string;
        allowedFonts?: string[];
        asset?: {
           alt?: ... | ...;
           fileId?: ... | ...;
           filename?: ... | ...;
           mimeType?: ... | ...;
           url?: ... | ...;
        };
        dataSource?: string;
        defaultValue?:   | string
           | {
           from: string;
           to: ... | ...;
         };
        description?: string;
        format?: string;
        label: string;
        maxDate?: string;
        maxFiles?: number;
        maxLength?: number;
        minDate?: string;
        name: string;
        options?: (... | ...)[];
        placeholder?: string;
        prefillFrom?: string;
        required: boolean;
        showRange?: boolean;
        showTime?: boolean;
        signatureMode?: "typed" | "drawn";
        timezone?: string;
        type:   | "number"
           | "date"
           | "file"
           | "email"
           | "url"
           | "select"
           | "text"
           | "checkbox"
           | "textarea"
           | "phone"
           | "radio-group"
           | "multiselect"
           | "field-array"
           | "image"
           | "file-download"
           | "section-header"
           | "section-unset"
           | "signature"
           | "signature-adopted";
     }[];
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     maxRows?: number;
     minDate?: string;
     minRows?: number;
     name: string;
     options?: (
        | string
        | {
        description?: string;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
}>
): Promise<void>;

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

Parameters

ParameterType
_entity{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }
_entity.createdAtDate
_entity.createdBystring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.descriptionstring | null
_entity.fieldsJsonValue
_entity.formSchemaVersionIdstring
_entity.idstring
_entity.keystring
_entity.labelstring | null
_entity.updatedAtDate
_entity.updatedBystring | null
idstring
inputPartial<Pick<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }, "description" | "updatedBy" | "label"> & { fields: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; fields?: { additionalInfo?: { body?: ... | ...; title?: ... | ...; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: ... | ...; fileId?: ... | ...; filename?: ... | ...; mimeType?: ... | ...; url?: ... | ...; }; dataSource?: string; defaultValue?: | string | { from: string; to: ... | ...; }; description?: string; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; minDate?: string; name: string; options?: (... | ...)[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; maxRows?: number; minDate?: string; minRows?: number; name: string; options?: ( | string | { description?: string; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; }>

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: {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}): Promise<void>;

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

Parameters

ParameterType
_idstring
_existing{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }
_existing.createdAtDate
_existing.createdBystring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.descriptionstring | null
_existing.fieldsJsonValue
_existing.formSchemaVersionIdstring
_existing.idstring
_existing.keystring
_existing.labelstring | null
_existing.updatedAtDate
_existing.updatedBystring | null

Returns

Promise<void>

Inherited from

CrudRepository.beforeDelete


beforeUpdate()

protected beforeUpdate(
   _id: string, 
   _input: Partial<Pick<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, "description" | "updatedBy" | "label"> & {
  fields: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     fields?: {
        additionalInfo?: {
           body?: ... | ...;
           title?: ... | ...;
        };
        adoptionStatement?: string;
        allowedFonts?: string[];
        asset?: {
           alt?: ... | ...;
           fileId?: ... | ...;
           filename?: ... | ...;
           mimeType?: ... | ...;
           url?: ... | ...;
        };
        dataSource?: string;
        defaultValue?:   | string
           | {
           from: string;
           to: ... | ...;
         };
        description?: string;
        format?: string;
        label: string;
        maxDate?: string;
        maxFiles?: number;
        maxLength?: number;
        minDate?: string;
        name: string;
        options?: (... | ...)[];
        placeholder?: string;
        prefillFrom?: string;
        required: boolean;
        showRange?: boolean;
        showTime?: boolean;
        signatureMode?: "typed" | "drawn";
        timezone?: string;
        type:   | "number"
           | "date"
           | "file"
           | "email"
           | "url"
           | "select"
           | "text"
           | "checkbox"
           | "textarea"
           | "phone"
           | "radio-group"
           | "multiselect"
           | "field-array"
           | "image"
           | "file-download"
           | "section-header"
           | "section-unset"
           | "signature"
           | "signature-adopted";
     }[];
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     maxRows?: number;
     minDate?: string;
     minRows?: number;
     name: string;
     options?: (
        | string
        | {
        description?: string;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
}>, 
   _existing: {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}
): Promise<void>;

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

Parameters

ParameterType
_idstring
_inputPartial<Pick<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }, "description" | "updatedBy" | "label"> & { fields: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; fields?: { additionalInfo?: { body?: ... | ...; title?: ... | ...; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: ... | ...; fileId?: ... | ...; filename?: ... | ...; mimeType?: ... | ...; url?: ... | ...; }; dataSource?: string; defaultValue?: | string | { from: string; to: ... | ...; }; description?: string; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; minDate?: string; name: string; options?: (... | ...)[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; maxRows?: number; minDate?: string; minRows?: number; name: string; options?: ( | string | { description?: string; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; }>
_existing{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }
_existing.createdAtDate
_existing.createdBystring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.descriptionstring | null
_existing.fieldsJsonValue
_existing.formSchemaVersionIdstring
_existing.idstring
_existing.keystring
_existing.labelstring | null
_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<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
inputCreateInput

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; 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


findById()

findById(id: string): Promise<
  | {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

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

Parameters

ParameterType
idstring

Returns

Promise< | { createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; } | null>

Inherited from

CrudRepository.findById


findByIdOrThrow()

findByIdOrThrow(id: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.findByIdOrThrow


findByVersionId()

findByVersionId(formSchemaVersionId: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}[]>;

Defined in: server/forms/form-step-repository.ts:104

Parameters

ParameterType
formSchemaVersionIdstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }[]>


findByVersionIdAndKey()

findByVersionIdAndKey(formSchemaVersionId: string, key: string): Promise<
  | {
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}
| null>;

Defined in: server/forms/form-step-repository.ts:111

Parameters

ParameterType
formSchemaVersionIdstring
keystring

Returns

Promise< | { createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; } | null>


findMany()

findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<OffsetPaginatedResult<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  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<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>>

Inherited from

CrudRepository.findMany


hardDelete()

hardDelete(id: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; 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/forms/form-step-repository.ts:33

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

Parameters

ParameterType
idstring

Returns

Error

Overrides

CrudRepository.notFoundError


softDelete()

softDelete(id: string): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }>

Inherited from

CrudRepository.softDelete


update()

update(id: string, input: Partial<Pick<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}, "description" | "updatedBy" | "label"> & {
  fields: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     fields?: {
        additionalInfo?: {
           body?: ... | ...;
           title?: ... | ...;
        };
        adoptionStatement?: string;
        allowedFonts?: string[];
        asset?: {
           alt?: ... | ...;
           fileId?: ... | ...;
           filename?: ... | ...;
           mimeType?: ... | ...;
           url?: ... | ...;
        };
        dataSource?: string;
        defaultValue?:   | string
           | {
           from: string;
           to: ... | ...;
         };
        description?: string;
        format?: string;
        label: string;
        maxDate?: string;
        maxFiles?: number;
        maxLength?: number;
        minDate?: string;
        name: string;
        options?: (... | ...)[];
        placeholder?: string;
        prefillFrom?: string;
        required: boolean;
        showRange?: boolean;
        showTime?: boolean;
        signatureMode?: "typed" | "drawn";
        timezone?: string;
        type:   | "number"
           | "date"
           | "file"
           | "email"
           | "url"
           | "select"
           | "text"
           | "checkbox"
           | "textarea"
           | "phone"
           | "radio-group"
           | "multiselect"
           | "field-array"
           | "image"
           | "file-download"
           | "section-header"
           | "section-unset"
           | "signature"
           | "signature-adopted";
     }[];
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     maxRows?: number;
     minDate?: string;
     minRows?: number;
     name: string;
     options?: (
        | string
        | {
        description?: string;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
}>): Promise<{
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  description: string | null;
  fields: JsonValue;
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
  updatedAt: Date;
  updatedBy: string | null;
}>;

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

Parameters

ParameterType
idstring
inputPartial<Pick<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; updatedAt: Date; updatedBy: string | null; }, "description" | "updatedBy" | "label"> & { fields: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; fields?: { additionalInfo?: { body?: ... | ...; title?: ... | ...; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: ... | ...; fileId?: ... | ...; filename?: ... | ...; mimeType?: ... | ...; url?: ... | ...; }; dataSource?: string; defaultValue?: | string | { from: string; to: ... | ...; }; description?: string; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; minDate?: string; name: string; options?: (... | ...)[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; maxRows?: number; minDate?: string; minRows?: number; name: string; options?: ( | string | { description?: string; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; }>

Returns

Promise<{ createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; description: string | null; fields: JsonValue; formSchemaVersionId: string; id: string; key: string; label: string | null; 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 fromfindById()ParametersReturnsInherited fromfindByIdOrThrow()ParametersReturnsInherited fromfindByVersionId()ParametersReturnsfindByVersionIdAndKey()ParametersReturnsfindMany()ParametersReturnsInherited fromhardDelete()ParametersReturnsInherited fromlogActivity()ParametersReturnsInherited fromnotFoundError()ParametersReturnsOverridessoftDelete()ParametersReturnsInherited fromupdate()ParametersReturnsInherited from