ef20839f99
Phase 1-2: Setup, SQL schema, enums, queue constants, base entities
Phase 3 (US1): ReviewTeam, ReviewTeamMember, ReviewTask, TaskCreationService
Phase 4 (US2): ResponseCode, ResponseCodeRule, ImplicationsService, NotificationTriggerService
Phase 5 (US3): Delegation entity, CircularDetectionService, DelegationService/Controller/Module
Phase 6 (US4): ReminderRule, SchedulerService, EscalationService, ReminderProcessor, ReminderModule
Phase 7 (US5): DistributionMatrix, DistributionRecipient, ApprovalListenerService (Strangler),
TransmittalCreatorService, DistributionProcessor, DistributionModule
Phase 8 (US6): MatrixManagementService, InheritanceService (global→project override)
Phase 9 (Polish): AggregateStatusService, ConsensusService, VetoOverrideService,
ParallelGatewayHandler, review-validators, optimistic locking in completeReview,
test stubs (unit/integration/e2e), jest.config.js updated for tests/ directory
Frontend: ReviewTaskInbox, ParallelProgress, VetoOverrideDialog, DelegationForm,
DelegatedBadge, MatrixEditor, ProjectOverrideManager, DistributionStatus,
ReminderHistory, ResponseCodeSelector, CodeImplications, CompleteReviewForm,
ReviewTeamForm, ReviewTeamSelector, TeamMemberManager
Closes #1
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
// File: src/modules/response-code/entities/response-code.entity.ts
|
|
import {
|
|
Entity,
|
|
Column,
|
|
PrimaryGeneratedColumn,
|
|
CreateDateColumn,
|
|
OneToMany,
|
|
} from 'typeorm';
|
|
import { Exclude } from 'class-transformer';
|
|
import { UuidBaseEntity } from '../../../common/entities/uuid-base.entity';
|
|
import { ResponseCodeCategory } from '../../common/enums/review.enums';
|
|
import { ResponseCodeRule } from './response-code-rule.entity';
|
|
|
|
@Entity('response_codes')
|
|
export class ResponseCode extends UuidBaseEntity {
|
|
@PrimaryGeneratedColumn()
|
|
@Exclude()
|
|
id!: number;
|
|
|
|
@Column({ length: 10 })
|
|
code!: string; // '1A', '1B', '1C', ..., '2', '3', '4'
|
|
|
|
@Column({ name: 'sub_status', length: 10, nullable: true })
|
|
subStatus?: string;
|
|
|
|
@Column({
|
|
type: 'enum',
|
|
enum: ResponseCodeCategory,
|
|
})
|
|
category!: ResponseCodeCategory;
|
|
|
|
@Column({ name: 'description_th', type: 'text' })
|
|
descriptionTh!: string;
|
|
|
|
@Column({ name: 'description_en', type: 'text' })
|
|
descriptionEn!: string;
|
|
|
|
@Column({ type: 'json', nullable: true })
|
|
implications?: {
|
|
affectsSchedule?: boolean;
|
|
affectsCost?: boolean;
|
|
requiresContractReview?: boolean;
|
|
requiresEiaAmendment?: boolean;
|
|
};
|
|
|
|
@Column({ name: 'notify_roles', type: 'simple-array', nullable: true })
|
|
notifyRoles?: string[]; // ['CONTRACT_MANAGER', 'QS_MANAGER']
|
|
|
|
@Column({ name: 'is_active', type: 'tinyint', default: 1 })
|
|
isActive!: boolean;
|
|
|
|
@Column({ name: 'is_system', type: 'tinyint', default: 0 })
|
|
isSystem!: boolean; // System default — ลบไม่ได้
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt!: Date;
|
|
|
|
// Relations
|
|
@OneToMany(() => ResponseCodeRule, (rule: ResponseCodeRule) => rule.responseCode)
|
|
rules?: ResponseCodeRule[];
|
|
}
|