32 lines
786 B
TypeScript
32 lines
786 B
TypeScript
import { BaseModel } from './base.model';
|
|
|
|
export class ApprovalDefinition extends BaseModel {
|
|
static tableName = 'approval_definitions';
|
|
|
|
id!: string;
|
|
name!: string;
|
|
description?: string;
|
|
triggerType!: string;
|
|
targetObjectType?: string;
|
|
entryCriteria?: Record<string, any> | null;
|
|
steps?: any[] | null;
|
|
votingPolicy?: Record<string, any> | null;
|
|
rejectionRule?: string | null;
|
|
materialChangePolicy?: string | null;
|
|
version!: number;
|
|
isActive!: boolean;
|
|
createdAt!: Date;
|
|
updatedAt!: Date;
|
|
|
|
static relationMappings = () => ({
|
|
requests: {
|
|
relation: BaseModel.HasManyRelation,
|
|
modelClass: 'approval-request.model',
|
|
join: {
|
|
from: 'approval_definitions.id',
|
|
to: 'approval_requests.definitionId',
|
|
},
|
|
},
|
|
});
|
|
}
|