diff --git a/src/entity/compliance_appendix_.ts b/src/entity/compliance_appendix_.ts new file mode 100644 index 0000000..93216a5 --- /dev/null +++ b/src/entity/compliance_appendix_.ts @@ -0,0 +1,75 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm"; +import { Status } from "../types/status"; +import { EformLanguage } from "./eform_languages"; +import { ComplianceAppendixCategory } from "./compliance_appendix_categories"; + +@Entity("compliance_appendix_items", { schema: "compliances" }) +export class ComplianceAppendixItem { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => ComplianceAppendixCategory, { onDelete: "RESTRICT" }) + @JoinColumn() + appendix_category: ComplianceAppendixCategory; + + @Column({ + nullable: true, + length: 256, + }) + code: string; + + @Column({ + nullable: true, + length: 256, + }) + name: string; + + @Column({ + nullable: true, + length: 256, + }) + label_in: string; + + @Column({ + nullable: true, + length: 256, + }) + label_tt: string; + + @Column({ + nullable: true, + length: 256, + }) + label_en: string; + + @ManyToOne(() => ComplianceAppendixItem, { onDelete: "RESTRICT" }) + @JoinColumn() + parent: ComplianceAppendixItem; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/entity/compliance_appendix_categories.ts b/src/entity/compliance_appendix_categories.ts new file mode 100644 index 0000000..5433ff2 --- /dev/null +++ b/src/entity/compliance_appendix_categories.ts @@ -0,0 +1,66 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm"; +import { Status } from "../types/status"; +import { EformLanguage } from "./eform_languages"; + +@Entity("compliance_appendix_categories", { schema: "compliances" }) +export class ComplianceAppendixCategory { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: true, + length: 256, + }) + code: string; + + @Column({ + nullable: true, + length: 256, + }) + name: string; + + @Column({ + nullable: true, + length: 256, + }) + label_in: string; + + @Column({ + nullable: true, + length: 256, + }) + label_tt: string; + + @Column({ + nullable: true, + length: 256, + }) + label_en: string; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/entity/compliance_appendix_item_references.ts b/src/entity/compliance_appendix_item_references.ts new file mode 100644 index 0000000..d38d20c --- /dev/null +++ b/src/entity/compliance_appendix_item_references.ts @@ -0,0 +1,48 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm"; +import { Status } from "../types/status"; +import { EformLanguage } from "./eform_languages"; +import { ComplianceAppendixCategory } from "./compliance_appendix_categories"; +import { ComplianceAppendixItem } from "./compliance_appendix_items"; + +@Entity("compliance_appendix_item_references", { schema: "compliances" }) +export class ComplianceAppendixItemReference { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => ComplianceAppendixItem, { onDelete: "RESTRICT" }) + @JoinColumn() + appendix_item: ComplianceAppendixItem; + + @Column({ + nullable: true, + length: 256, + }) + label: string; + + @Column({ + nullable: true, + length: 256, + }) + value: string; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/entity/compliance_appendix_item_risk_levels.ts b/src/entity/compliance_appendix_item_risk_levels.ts new file mode 100644 index 0000000..cae9466 --- /dev/null +++ b/src/entity/compliance_appendix_item_risk_levels.ts @@ -0,0 +1,48 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { Status } from "../types/status"; +import { Application } from "./application"; +import { ComplianceAppendixItem } from "./compliance_appendix_items"; + +@Entity("compliance_appendix_item_risk_levels", { schema: "compliances" }) +export class complianceAppendixItemRiskLevels { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => Application, { onDelete: "RESTRICT" }) + @JoinColumn() + application: Application; + + @ManyToOne(() => ComplianceAppendixItem, { onDelete: "RESTRICT" }) + @JoinColumn() + appendix_item: ComplianceAppendixItem; + + @Column({ type: "smallint", default: 0 }) + level: Number; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/entity/compliance_appendix_items.ts b/src/entity/compliance_appendix_items.ts new file mode 100644 index 0000000..93216a5 --- /dev/null +++ b/src/entity/compliance_appendix_items.ts @@ -0,0 +1,75 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm"; +import { Status } from "../types/status"; +import { EformLanguage } from "./eform_languages"; +import { ComplianceAppendixCategory } from "./compliance_appendix_categories"; + +@Entity("compliance_appendix_items", { schema: "compliances" }) +export class ComplianceAppendixItem { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => ComplianceAppendixCategory, { onDelete: "RESTRICT" }) + @JoinColumn() + appendix_category: ComplianceAppendixCategory; + + @Column({ + nullable: true, + length: 256, + }) + code: string; + + @Column({ + nullable: true, + length: 256, + }) + name: string; + + @Column({ + nullable: true, + length: 256, + }) + label_in: string; + + @Column({ + nullable: true, + length: 256, + }) + label_tt: string; + + @Column({ + nullable: true, + length: 256, + }) + label_en: string; + + @ManyToOne(() => ComplianceAppendixItem, { onDelete: "RESTRICT" }) + @JoinColumn() + parent: ComplianceAppendixItem; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/index.ts b/src/index.ts index 427f6c9..c24d2f2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,3 +9,4 @@ export * from "./schema/brizzi"; export * from "./schema/tcel"; export * from "./schema/brilink"; export * from "./schema/eform"; +export * from "./schema/compliance"; diff --git a/src/schema/compliance.ts b/src/schema/compliance.ts new file mode 100644 index 0000000..95736d0 --- /dev/null +++ b/src/schema/compliance.ts @@ -0,0 +1,4 @@ +export * from "../entity/compliance_appendix_categories"; +export * from "../entity/compliance_appendix_items"; +export * from "../entity/compliance_appendix_item_references"; +export * from "../entity/compliance_appendix_item_risk_levels";