mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
contrat nad booking modification
This commit is contained in:
@@ -26,10 +26,10 @@ export class ContractApprovalStep extends BaseEntity {
|
||||
@Column({ name: 'step_order', type: 'smallint', default: 0 })
|
||||
stepOrder!: number;
|
||||
|
||||
@Column({ name: 'required_role', type: 'varchar', length: 40 })
|
||||
@Column({ name: 'required_role', type: 'varchar', length: 64 })
|
||||
requiredRole!: string;
|
||||
|
||||
@Column({ name: 'blocks_role', type: 'varchar', length: 40, nullable: true })
|
||||
@Column({ name: 'blocks_role', type: 'varchar', length: 64, nullable: true })
|
||||
blocksRole?: string | null;
|
||||
|
||||
@Column({ name: 'status', type: 'varchar', length: 20, default: 'PENDING' })
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { BaseEntity } from '@edr/api-common';
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||
import type { ContractDocumentChange } from '../contract-document-diff.util';
|
||||
import { Contract } from './contract.entity';
|
||||
|
||||
/**
|
||||
* Append-only audit of contract document edits. The document stays editable
|
||||
* through the whole approval chain, so this records who changed which article
|
||||
* and when — the contract itself only ever holds the current snapshot.
|
||||
*/
|
||||
@Entity({ schema: 'freight', name: 'contract_document_revisions' })
|
||||
@Index(['contractId'])
|
||||
export class ContractDocumentRevision extends BaseEntity {
|
||||
@Column({ name: 'contract_id', type: 'uuid' })
|
||||
contractId!: string;
|
||||
|
||||
@ManyToOne(() => Contract, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'contract_id' })
|
||||
contract?: Contract;
|
||||
|
||||
@Column({ name: 'actor_id', type: 'uuid', nullable: true })
|
||||
actorId?: string | null;
|
||||
|
||||
/** The approval step's required role at the time of the edit. */
|
||||
@Column({ name: 'actor_role', type: 'varchar', length: 64, nullable: true })
|
||||
actorRole?: string | null;
|
||||
|
||||
@Column({ name: 'step_id', type: 'uuid', nullable: true })
|
||||
stepId?: string | null;
|
||||
|
||||
@Column({ name: 'summary', type: 'varchar', length: 255, nullable: true })
|
||||
summary?: string | null;
|
||||
|
||||
@Column({ name: 'changes', type: 'jsonb', default: () => `'[]'::jsonb` })
|
||||
changes!: ContractDocumentChange[];
|
||||
}
|
||||
Reference in New Issue
Block a user