Kaizen
Browse modulesPeripheralsperipherals/serverClasses

Class: PeripheralDeviceRepository

Defined in: server/peripherals/peripheral-device-repository.ts:57

CRUD repository over peripheral_devices rows. Works in camelCase Prisma rows; the service layer maps to/from the shared PeripheralDevice shape. Mirrors RuleCrudRepository.

Extends

Constructors

Constructor

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

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

Parameters

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

Returns

PeripheralDeviceRepository

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/peripherals/peripheral-device-repository.ts:85

Returns

Promise<number>

Overrides

CrudRepository._count


_create()

protected _create(input: PeripheralDeviceCreateRow): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

Defined in: server/peripherals/peripheral-device-repository.ts:106

Parameters

ParameterType
inputPeripheralDeviceCreateRow

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Overrides

CrudRepository._create


_exists()

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

Defined in: server/peripherals/peripheral-device-repository.ts:78

Parameters

ParameterType
idstring

Returns

Promise<boolean>

Overrides

CrudRepository._exists


_findById()

protected _findById(id: string): Promise<
  | {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}
| null>;

Defined in: server/peripherals/peripheral-device-repository.ts:72

Parameters

ParameterType
idstring

Returns

Promise< | { connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; } | null>

Overrides

CrudRepository._findById


_findMany()

protected _findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<{
  items: {
     connectionKind: string;
     createdAt: Date;
     createdBy: string | null;
     deletedAt: Date | null;
     deletedBy: string | null;
     deviceType: string;
     drawerPin: number | null;
     host: string | null;
     id: string;
     make: string | null;
     metadata: JsonValue;
     model: string | null;
     name: string;
     organizationId: string;
     paperWidthChars: number | null;
     port: number | null;
     printerLanguage: string | null;
     qzPrinterName: string | null;
     stationId: string | null;
     status: string;
     statusUpdatedAt: Date;
     statusUpdatedBy: string | null;
     storeId: string | null;
     updatedAt: Date;
     updatedBy: string | null;
     usbProductId: number | null;
     usbSerialNumber: string | null;
     usbVendorId: number | null;
  }[];
  total: number;
}>;

Defined in: server/peripherals/peripheral-device-repository.ts:89

Parameters

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

Returns

Promise<{ items: { connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }[]; total: number; }>

Overrides

CrudRepository._findMany


_hardDelete()

protected _hardDelete(id: string): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

Defined in: server/peripherals/peripheral-device-repository.ts:128

Parameters

ParameterType
idstring

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Overrides

CrudRepository._hardDelete


_softDelete()

protected _softDelete(id: string): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

Defined in: server/peripherals/peripheral-device-repository.ts:121

Parameters

ParameterType
idstring

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Overrides

CrudRepository._softDelete


_update()

protected _update(id: string, patch: PeripheralDeviceUpdateRow): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

Defined in: server/peripherals/peripheral-device-repository.ts:114

Parameters

ParameterType
idstring
patchPeripheralDeviceUpdateRow

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Overrides

CrudRepository._update


afterCreate()

protected afterCreate(entity: {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}, _input: PeripheralDeviceCreateRow): Promise<void>;

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

Parameters

ParameterType
entity{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }
entity.connectionKindstring
entity.createdAtDate
entity.createdBystring | null
entity.deletedAtDate | null
entity.deletedBystring | null
entity.deviceTypestring
entity.drawerPinnumber | null
entity.hoststring | null
entity.idstring
entity.makestring | null
entity.metadataJsonValue
entity.modelstring | null
entity.namestring
entity.organizationIdstring
entity.paperWidthCharsnumber | null
entity.portnumber | null
entity.printerLanguagestring | null
entity.qzPrinterNamestring | null
entity.stationIdstring | null
entity.statusstring
entity.statusUpdatedAtDate
entity.statusUpdatedBystring | null
entity.storeIdstring | null
entity.updatedAtDate
entity.updatedBystring | null
entity.usbProductIdnumber | null
entity.usbSerialNumberstring | null
entity.usbVendorIdnumber | null
_inputPeripheralDeviceCreateRow

Returns

Promise<void>

Inherited from

CrudRepository.afterCreate


afterDelete()

protected afterDelete(_entity: {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}, id: string): Promise<void>;

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

Parameters

ParameterType
_entity{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }
_entity.connectionKindstring
_entity.createdAtDate
_entity.createdBystring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.deviceTypestring
_entity.drawerPinnumber | null
_entity.hoststring | null
_entity.idstring
_entity.makestring | null
_entity.metadataJsonValue
_entity.modelstring | null
_entity.namestring
_entity.organizationIdstring
_entity.paperWidthCharsnumber | null
_entity.portnumber | null
_entity.printerLanguagestring | null
_entity.qzPrinterNamestring | null
_entity.stationIdstring | null
_entity.statusstring
_entity.statusUpdatedAtDate
_entity.statusUpdatedBystring | null
_entity.storeIdstring | null
_entity.updatedAtDate
_entity.updatedBystring | null
_entity.usbProductIdnumber | null
_entity.usbSerialNumberstring | null
_entity.usbVendorIdnumber | null
idstring

Returns

Promise<void>

Inherited from

CrudRepository.afterDelete


afterUpdate()

protected afterUpdate(
   _entity: {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}, 
   id: string, 
   input: PeripheralDeviceUpdateRow
): Promise<void>;

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

Parameters

ParameterType
_entity{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }
_entity.connectionKindstring
_entity.createdAtDate
_entity.createdBystring | null
_entity.deletedAtDate | null
_entity.deletedBystring | null
_entity.deviceTypestring
_entity.drawerPinnumber | null
_entity.hoststring | null
_entity.idstring
_entity.makestring | null
_entity.metadataJsonValue
_entity.modelstring | null
_entity.namestring
_entity.organizationIdstring
_entity.paperWidthCharsnumber | null
_entity.portnumber | null
_entity.printerLanguagestring | null
_entity.qzPrinterNamestring | null
_entity.stationIdstring | null
_entity.statusstring
_entity.statusUpdatedAtDate
_entity.statusUpdatedBystring | null
_entity.storeIdstring | null
_entity.updatedAtDate
_entity.updatedBystring | null
_entity.usbProductIdnumber | null
_entity.usbSerialNumberstring | null
_entity.usbVendorIdnumber | null
idstring
inputPeripheralDeviceUpdateRow

Returns

Promise<void>

Inherited from

CrudRepository.afterUpdate


beforeCreate()

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

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

Parameters

ParameterType
_inputPeripheralDeviceCreateRow

Returns

Promise<void>

Inherited from

CrudRepository.beforeCreate


beforeDelete()

protected beforeDelete(_id: string, _existing: {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}): Promise<void>;

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

Parameters

ParameterType
_idstring
_existing{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }
_existing.connectionKindstring
_existing.createdAtDate
_existing.createdBystring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.deviceTypestring
_existing.drawerPinnumber | null
_existing.hoststring | null
_existing.idstring
_existing.makestring | null
_existing.metadataJsonValue
_existing.modelstring | null
_existing.namestring
_existing.organizationIdstring
_existing.paperWidthCharsnumber | null
_existing.portnumber | null
_existing.printerLanguagestring | null
_existing.qzPrinterNamestring | null
_existing.stationIdstring | null
_existing.statusstring
_existing.statusUpdatedAtDate
_existing.statusUpdatedBystring | null
_existing.storeIdstring | null
_existing.updatedAtDate
_existing.updatedBystring | null
_existing.usbProductIdnumber | null
_existing.usbSerialNumberstring | null
_existing.usbVendorIdnumber | null

Returns

Promise<void>

Inherited from

CrudRepository.beforeDelete


beforeUpdate()

protected beforeUpdate(
   _id: string, 
   _input: PeripheralDeviceUpdateRow, 
   _existing: {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}
): Promise<void>;

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

Parameters

ParameterType
_idstring
_inputPeripheralDeviceUpdateRow
_existing{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }
_existing.connectionKindstring
_existing.createdAtDate
_existing.createdBystring | null
_existing.deletedAtDate | null
_existing.deletedBystring | null
_existing.deviceTypestring
_existing.drawerPinnumber | null
_existing.hoststring | null
_existing.idstring
_existing.makestring | null
_existing.metadataJsonValue
_existing.modelstring | null
_existing.namestring
_existing.organizationIdstring
_existing.paperWidthCharsnumber | null
_existing.portnumber | null
_existing.printerLanguagestring | null
_existing.qzPrinterNamestring | null
_existing.stationIdstring | null
_existing.statusstring
_existing.statusUpdatedAtDate
_existing.statusUpdatedBystring | null
_existing.storeIdstring | null
_existing.updatedAtDate
_existing.updatedBystring | null
_existing.usbProductIdnumber | null
_existing.usbSerialNumberstring | null
_existing.usbVendorIdnumber | 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: PeripheralDeviceCreateRow): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

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

Parameters

ParameterType
inputPeripheralDeviceCreateRow

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | 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


findActiveForStation()

findActiveForStation(organizationId: string, scope?: {
  deviceType?: string;
  stationId?: string;
  storeId?: string;
}): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}[]>;

Defined in: server/peripherals/peripheral-device-repository.ts:164

Active devices visible AT a station. The station is the primary axis and is ALWAYS constrained: an omitted stationId means "station-agnostic" (matches only rows with stationId null), so a bare findActiveForStation returns org-wide devices — never every station's devices. A provided stationId also matches station-null (org-wide) rows.

The store is a secondary filter applied ONLY when provided — querying by stationId alone does NOT require storeId to be null, so a device pinned to both a store and that station still appears (unlike a naive "both default to null" filter, which hid it).

Parameters

ParameterType
organizationIdstring
scope{ deviceType?: string; stationId?: string; storeId?: string; }
scope.deviceType?string
scope.stationId?string
scope.storeId?string

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }[]>


findById()

findById(id: string): Promise<
  | {
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}
| null>;

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

Parameters

ParameterType
idstring

Returns

Promise< | { connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; } | null>

Inherited from

CrudRepository.findById


findByIdOrThrow()

findByIdOrThrow(id: string): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Inherited from

CrudRepository.findByIdOrThrow


findByOrg()

findByOrg(organizationId: string, filter?: PeripheralDeviceFilter): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}[]>;

Defined in: server/peripherals/peripheral-device-repository.ts:133

Non-deleted devices for an organization, optionally narrowed.

Parameters

ParameterType
organizationIdstring
filterPeripheralDeviceFilter

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }[]>


findMany()

findMany(pagination: {
  page: number;
  pageSize: number;
}): Promise<OffsetPaginatedResult<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>>;

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

Parameters

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

Returns

Promise<OffsetPaginatedResult<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>>

Inherited from

CrudRepository.findMany


hardDelete()

hardDelete(id: string): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | 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/peripherals/peripheral-device-repository.ts:65

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

Parameters

ParameterType
idstring

Returns

Error

Overrides

CrudRepository.notFoundError


softDelete()

softDelete(id: string): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

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

Parameters

ParameterType
idstring

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | null; }>

Inherited from

CrudRepository.softDelete


update()

update(id: string, input: PeripheralDeviceUpdateRow): Promise<{
  connectionKind: string;
  createdAt: Date;
  createdBy: string | null;
  deletedAt: Date | null;
  deletedBy: string | null;
  deviceType: string;
  drawerPin: number | null;
  host: string | null;
  id: string;
  make: string | null;
  metadata: JsonValue;
  model: string | null;
  name: string;
  organizationId: string;
  paperWidthChars: number | null;
  port: number | null;
  printerLanguage: string | null;
  qzPrinterName: string | null;
  stationId: string | null;
  status: string;
  statusUpdatedAt: Date;
  statusUpdatedBy: string | null;
  storeId: string | null;
  updatedAt: Date;
  updatedBy: string | null;
  usbProductId: number | null;
  usbSerialNumber: string | null;
  usbVendorId: number | null;
}>;

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

Parameters

ParameterType
idstring
inputPeripheralDeviceUpdateRow

Returns

Promise<{ connectionKind: string; createdAt: Date; createdBy: string | null; deletedAt: Date | null; deletedBy: string | null; deviceType: string; drawerPin: number | null; host: string | null; id: string; make: string | null; metadata: JsonValue; model: string | null; name: string; organizationId: string; paperWidthChars: number | null; port: number | null; printerLanguage: string | null; qzPrinterName: string | null; stationId: string | null; status: string; statusUpdatedAt: Date; statusUpdatedBy: string | null; storeId: string | null; updatedAt: Date; updatedBy: string | null; usbProductId: number | null; usbSerialNumber: string | null; usbVendorId: number | 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 fromfindActiveForStation()ParametersReturnsfindById()ParametersReturnsInherited fromfindByIdOrThrow()ParametersReturnsInherited fromfindByOrg()ParametersReturnsfindMany()ParametersReturnsInherited fromhardDelete()ParametersReturnsInherited fromlogActivity()ParametersReturnsInherited fromnotFoundError()ParametersReturnsOverridessoftDelete()ParametersReturnsInherited fromupdate()ParametersReturnsInherited from