src/issuer/issuance/entities/issuance-config.entity.ts
Entity to manage issuance configs
Properties |
|
| Optional authServers |
Type : string[]
|
Decorators :
@IsArray()
|
|
Authentication server URL for the issuance process. |
| Optional batchSize |
Type : number
|
Decorators :
@IsNumber()
|
|
Value to determine the amount of credentials that are issued in a batch. Default is 1. |
| createdAt |
Type : Date
|
Decorators :
@CreateDateColumn()
|
|
The timestamp when the VP request was created. |
| display |
Type : DisplayInfo[]
|
Decorators :
@ValidateNested({each: true})
|
| Optional dPopRequired |
Type : boolean
|
Decorators :
@IsBoolean()
|
|
Indicates whether DPoP is required for the issuance process. Default value is true. |
| Optional notifyWebhook |
Type : WebhookConfig
|
Decorators :
@IsOptional()
|
|
Webhook to send the result of the notification response |
| tenant |
Type : TenantEntity
|
Decorators :
@ManyToOne(undefined, {cascade: true, onDelete: 'CASCADE'})
|
|
The tenant that owns this object. |
| tenantId |
Type : string
|
Decorators :
@ApiHideProperty()
|
|
Tenant ID for the issuance configuration. |
| updatedAt |
Type : Date
|
Decorators :
@UpdateDateColumn()
|
|
The timestamp when the VP request was last updated. |
import { ApiExtraModels, ApiHideProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import {
IsArray,
IsBoolean,
IsNumber,
IsOptional,
ValidateNested,
} from "class-validator";
import {
Column,
CreateDateColumn,
Entity,
ManyToOne,
PrimaryColumn,
UpdateDateColumn,
} from "typeorm";
import { TenantEntity } from "../../../auth/tenant/entitites/tenant.entity";
import { WebhookConfig } from "../../../utils/webhook/webhook.dto";
import { DisplayInfo } from "../../display/dto/display.dto";
import {
AuthenticationMethodAuth,
AuthenticationMethodNone,
AuthenticationMethodPresentation,
} from "../dto/authentication-config.dto";
/**
* Entity to manage issuance configs
*/
@ApiExtraModels(
AuthenticationMethodNone,
AuthenticationMethodAuth,
AuthenticationMethodPresentation,
)
@Entity()
export class IssuanceConfig {
/**
* Tenant ID for the issuance configuration.
*/
@ApiHideProperty()
@PrimaryColumn()
tenantId!: string;
/**
* The tenant that owns this object.
*/
@ManyToOne(() => TenantEntity, { cascade: true, onDelete: "CASCADE" })
tenant!: TenantEntity;
/**
* Authentication server URL for the issuance process.
*/
@IsArray()
@IsOptional()
@Column({ type: "json", nullable: true })
authServers?: string[];
/**
* Webhook to send the result of the notification response
*/
@IsOptional()
@ValidateNested()
@Type(() => WebhookConfig)
@Column("json", { nullable: true })
notifyWebhook?: WebhookConfig;
/**
* Value to determine the amount of credentials that are issued in a batch.
* Default is 1.
*/
@IsNumber()
@IsOptional()
@Column("int", { default: 1 })
batchSize?: number;
/**
* Indicates whether DPoP is required for the issuance process. Default value is true.
*/
@IsBoolean()
@IsOptional()
@Column("boolean", { default: true })
dPopRequired?: boolean;
@ValidateNested({ each: true })
@Type(() => DisplayInfo)
@Column("json", { nullable: true })
display!: DisplayInfo[];
/**
* The timestamp when the VP request was created.
*/
@CreateDateColumn()
createdAt!: Date;
/**
* The timestamp when the VP request was last updated.
*/
@UpdateDateColumn()
updatedAt!: Date;
}