import { Entity, Column, ManyToOne, JoinColumn, OneToMany, Double, ManyToMany } from "typeorm"; import { EntityBase } from "./base/Base"; import { Province } from "./Province"; import { ActualPeople, CreateActualPeople } from "./ActualPeople"; import { CreatePlannedPeople, PlannedPeople } from "./PlannedPeople"; import { ActualGoal, CreateActualGoal } from "./ActualGoal"; import { CreatePlannedGoal, PlannedGoal } from "./PlannedGoal"; import { DevelopmentHistory } from "./DevelopmentHistory"; @Entity("development") export class Development extends EntityBase { @Column({ nullable: true, comment: "ปีงบประมาณ", }) year: number; @Column({ comment: "ชื่อโครงการ/กิจกรรม/หลักสูตร", length: 255, }) projectName: string; @Column({ nullable: true, comment: "หลักการและเหตุผล", default: null, }) reason: string; @Column({ nullable: true, comment: "วัตถุประสงค์", default: null, }) objective: string; @Column({ nullable: true, comment: "ประเภทตัวชี้วัด", default: null, }) metricType: string; @Column({ nullable: true, comment: "ตัวชี้วัด", default: null, }) indicators: string; @Column({ nullable: true, comment: "เป้าหมาย", default: null, }) target: string; @Column({ nullable: true, comment: "วิธีการคำนวณ/เครื่องมือ", default: null, }) calculation: string; @Column({ nullable: true, comment: "ระยะเวลาวัดผล", default: null, }) measuRement: string; @Column({ nullable: true, comment: "ผลการดำเนิน", default: null, }) results: string; @Column({ nullable: true, comment: "ปัญหาอุปสรรค", default: null, }) obstacles: string; @Column({ nullable: true, comment: "ข้อเสนอเเนะ", default: null, }) suggestions: string; @Column({ nullable: true, comment: "ประเภทโครงการ", default: null, }) project: string; @Column({ comment: "ผ่านการพิจาณา ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ", default: false, }) isPassAllocate: boolean; @Column({ comment: "ผ่านการพิจารณา ไม่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ แต่ได้รับการจัดสรรเงินนอกงบประมาณ", default: false, }) isPassNoAllocate: boolean; @Column({ comment: "ไม่ผ่านการพิจารณา แต่ได้รับการจัดสรรเงินนอกงบประมาณ", default: false, }) isNoPass: boolean; @Column({ comment: "แต่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ", default: false, }) isBudget: boolean; @Column({ comment: "แต่ได้รับการจัดสรรเงินนอกงบประมาณ", default: false, }) isOutBudget: boolean; @Column({ nullable: true, type: "datetime", comment: "วันที่เริ่มต้น", default: null, }) dateStart: Date; @Column({ nullable: true, type: "datetime", comment: "วันที่สิ้นสุด", default: null, }) dateEnd: Date; @Column({ nullable: true, comment: "รวมระยะเวลา (วัน)", default: null, }) totalDate: number; @Column({ nullable: true, comment: "ที่อยู่", default: null, }) address: string; @Column({ nullable: true, comment: "ประเภทงบประมาณ", default: null, }) budget: string; @Column({ nullable: true, comment: "จํานวนงบประมาณที่ขอรับการจัดสรรฯ", default: 0, type: "double", }) accept: Double; @Column({ nullable: true, comment: "จํานวนงบประมาณที่ได้รับการจัดสรรฯ", default: 0, type: "double", }) receive: Double; @Column({ nullable: true, comment: "จํานวนงบประมาณที่ได้รับอนุมัติ", default: 0, type: "double", }) approved: Double; @Column({ nullable: true, comment: "จํานวนงบประมาณที่จ่ายจริง", default: 0, type: "double", }) budgetPay: Double; @Column({ nullable: true, comment: "ประเด็นความเสี่ยง", default: null, }) issues: string; @Column({ nullable: true, comment: "โอกาสที่จะเกิด", default: null, }) chance: string; @Column({ nullable: true, comment: "ผลกระทบจากการเกิด", default: null, }) effects: string; @Column({ nullable: true, comment: "ระดับความเสี่ยง", default: null, }) riskLevel: string; @Column({ nullable: true, comment: "เเนวทางการบริหารความเสี่ยง", default: null, }) riskManagement: string; @Column({ nullable: true, comment: "ประโยชน์ที่คาดว่าจะได้รับ", default: null, }) expect: string; @Column({ nullable: true, comment: "หัวข้อ/ประเด็นการฝึกอบรม ศึกษาดูงาน", default: null, }) topicAcademic: string; @Column({ nullable: true, comment: "สถานที่ฝึกอบรม ศึกษาดูงาน", default: null, }) addressAcademic: string; @Column({ nullable: true, type: "datetime", comment: "วันเริ่มต้นการศึกษาดูงาน", default: null, }) dateStudyStart: Date; @Column({ nullable: true, type: "datetime", comment: "วันสิ้นสุดการศึกษาดูงาน", default: null, }) dateStudyEnd: Date; @Column({ // STRATEGIC_PROJECT = โครงการตามยุทธศาสตร์ // MISSION_PROJECT = โครงการตามภารกิจประจำของหน่วยงาน // NEW_PROJECT = โครงการใหม่ // ONGOING_PROJECT = โครงการต่อเนื่อง nullable: true, comment: "ประเภทโครงการ", default: null, }) projectType: string; @Column({ // GO_BACK = ไป-กลับ // HOLD = พักค้าง // GO_BACK_HOLD = ไป-กลับและพักค้าง nullable: true, comment: "ลักษณะ", default: null, }) projectCharacteristics: string; @Column({ nullable: true, comment: "จำนวน(วัน)", default: null, }) projectDay: number; @Column({ nullable: true, comment: "จำนวน(คืน)", default: null, }) projectNigth: number; @Column({ // TRAINING = การอบรม // MEETING = การประชุม // SEMINAR = การสัมมนา // STUDY_TOUR = การศึกษาดูงาน // ACADEMIC_SEMINAR = การสัมมนาทางวิชาการ // WORKSHOP = การสัมมนาเชิงปฏิบัติการ // SPECIAL_LECTURE = การบรรยายพิเศษ // STUDY_TRAINING = การฝึกศึกษา nullable: true, comment: "เทคนิควิธีการที่ใช้ในการพัฒนา", default: null, }) projectTechniques: string; @Column({ nullable: true, comment: "จำนวน(รุ่น)", default: null, }) projectModal: number; @Column({ // เงินบำรุง = MAINTENANCE // เงินกองทุน = FUND // เงินอุดหนุน = SUBSIDY nullable: true, comment: "ประเภทย่อย", default: null, }) budgetSub: string; @Column({ nullable: true, comment: "จังหวัด(ข้อมูลวิชาการ)", default: null, }) provinceActualId: string; @ManyToOne(() => Province, (province: Province) => province.developmentActuals) @JoinColumn({ name: "provinceActualId" }) provinceActual: Province; @ManyToMany(() => Province, (provinces) => provinces.developmentProvinces) provinces: Province[]; @OneToMany( () => ActualPeople, (actualPeople: ActualPeople) => actualPeople.developmentActualPeople, ) developmentActualPeoples: ActualPeople[]; @OneToMany( () => PlannedPeople, (plannedPeople: PlannedPeople) => plannedPeople.developmentPlannedPeople, ) developmentPlannedPeoples: PlannedPeople[]; @OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.developmentActualGoal) developmentActualGoals: ActualGoal[]; @OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.developmentPlannedGoal) developmentPlannedGoals: PlannedGoal[]; @OneToMany( () => DevelopmentHistory, (developmentHistory: DevelopmentHistory) => developmentHistory.development, ) developmentHistorys: DevelopmentHistory[]; } export class CreateDevelopment { @Column() year: number; @Column() projectName: string; @Column() reason: string | null; @Column() objective: string | null; @Column() metricType: string | null; @Column() indicators: string | null; @Column() target: string | null; @Column() calculation: string | null; @Column() measuRement: string | null; @Column() results: string | null; @Column() obstacles: string | null; @Column() suggestions: string | null; @Column() project: string | null; @Column() isPassAllocate: boolean; @Column() isPassNoAllocate: boolean; @Column() isNoPass: boolean; @Column() isBudget: boolean; @Column() isOutBudget: boolean; @Column() dateStart: Date | null; @Column() dateEnd: Date | null; @Column() totalDate: number | null; @Column() address: string | null; @Column() provinceIds: string[]; @Column() budget: string | null; @Column() accept: Double | null; @Column() receive: Double | null; @Column() approved: Double | null; @Column() budgetPay: Double | null; @Column() issues: string | null; @Column() chance: string | null; @Column() effects: string | null; @Column() riskLevel: string | null; @Column() riskManagement: string | null; @Column() expect: string | null; @Column() topicAcademic: string | null; @Column() addressAcademic: string | null; @Column() provinceActualId: string | null; @Column() dateStudyStart?: Date | null; @Column() dateStudyEnd?: Date | null; @Column() projectType: string | null; @Column() projectCharacteristics: string | null; @Column() projectDay: number | null; @Column() projectNigth: number | null; @Column() projectTechniques: string | null; @Column() projectModal: number | null; @Column() budgetSub: string | null; @Column() actualPeoples: CreateActualPeople[]; @Column() plannedPeoples: CreatePlannedPeople[]; @Column() actualGoals: CreateActualGoal[]; @Column() plannedGoals: CreatePlannedGoal[]; } export class UpdateDevelopment { @Column() year: number; @Column() projectName: string; @Column() reason: string | null; @Column() objective: string | null; @Column() metricType: string | null; @Column() indicators: string | null; @Column() target: string | null; @Column() calculation: string | null; @Column() measuRement: string | null; @Column() results: string | null; @Column() obstacles: string | null; @Column() suggestions: string | null; @Column() project: string | null; @Column() isPassAllocate: boolean; @Column() isPassNoAllocate: boolean; @Column() isNoPass: boolean; @Column() isBudget: boolean; @Column() isOutBudget: boolean; @Column() dateStart: Date | null; @Column() dateEnd: Date | null; @Column() totalDate: number | null; @Column() address: string | null; @Column() provinceIds: string[]; @Column() budget: string | null; @Column() accept: Double | null; @Column() receive: Double | null; @Column() approved: Double | null; @Column() budgetPay: Double | null; @Column() issues: string | null; @Column() chance: string | null; @Column() effects: string | null; @Column() riskLevel: string | null; @Column() riskManagement: string | null; @Column() expect: string | null; @Column() topicAcademic: string | null; @Column() addressAcademic: string | null; @Column() provinceActualId: string | null; @Column() dateStudyStart?: Date | null; @Column() dateStudyEnd?: Date | null; @Column() projectType?: string | null; @Column() projectCharacteristics?: string | null; @Column() projectDay?: number | null; @Column() projectNigth?: number | null; @Column() projectTechniques?: string | null; @Column() projectModal?: number | null; @Column() budgetSub: string | null; @Column() actualPeoples: CreateActualPeople[]; @Column() plannedPeoples: CreatePlannedPeople[]; @Column() actualGoals: CreateActualGoal[]; @Column() plannedGoals: CreatePlannedGoal[]; }