WIP - scaffold approvals
This commit is contained in:
31
backend/src/models/approval-definition.model.ts
Normal file
31
backend/src/models/approval-definition.model.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user