EntityIdStrategy

EntityIdStrategy

The EntityIdStrategy determines how entity IDs are generated and stored in the database, as well as how they are transformed when being passed from the API to the service layer.

Signature

interface EntityIdStrategy<T extends ID = ID> {
  readonly primaryKeyType: PrimaryKeyType;
  encodeId: (primaryKey: T) => string;
  decodeId: (id: string) => T;
}

Members

primaryKeyType

property

encodeId

property
type:
(primaryKey: T) => string

decodeId

property
type:
(id: string) => T
alpha