diff --git a/src/entity/eform_beneficial_owner_identities.ts b/src/entity/eform_beneficial_owner_identities.ts new file mode 100644 index 0000000..3984fdc --- /dev/null +++ b/src/entity/eform_beneficial_owner_identities.ts @@ -0,0 +1,64 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { EformBeneficialOwner } from "./eform_beneficial_owners"; +import { EformIdentityType } from "../types/eform"; + +@Entity("eform_beneficial_owner_identities", { schema: "eforms" }) +export class EformBeneficialOwnerIdentity { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => EformBeneficialOwner, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + beneficial_owner: EformBeneficialOwner; + + @Column({ + nullable: true, + length: 256, + }) + type: EformIdentityType; + + @Column({ + nullable: true, + length: 256, + }) + number: string; + + @Column({ + nullable: true, + length: 256, + }) + issued_at: string; + + @Column({ + nullable: true, + length: 256, + }) + expired_at: string; + + @Column({ + nullable: true, + length: 4096, + }) + file: 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/eform_beneficial_owner_jobs.ts b/src/entity/eform_beneficial_owner_jobs.ts new file mode 100644 index 0000000..732b6ce --- /dev/null +++ b/src/entity/eform_beneficial_owner_jobs.ts @@ -0,0 +1,60 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { EformConfigOccupation } from "./eform_config_occupations"; +import { EformConfigBusinessField } from "./eform_config_business_fields"; +import { EformConfigSourceIncome } from "./eform_config_source_incomes"; +import { EformBeneficialOwner } from "./eform_beneficial_owners"; + +@Entity("eform_beneficial_owner_jobs", { schema: "eforms" }) +export class EformBeneficialOwnerJob { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => EformBeneficialOwner, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + beneficial_owner: EformBeneficialOwner; + + @ManyToOne(() => EformConfigOccupation, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + occupation: EformConfigOccupation; + + @ManyToOne(() => EformConfigSourceIncome, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + source_income: EformConfigSourceIncome; + + @ManyToOne(() => EformConfigBusinessField, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + business_field: EformConfigBusinessField; + + @Column({ + nullable: true, + length: 256, + }) + place: string; + + @Column({ + nullable: true, + length: 256, + }) + position: 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/eform_beneficial_owners.ts b/src/entity/eform_beneficial_owners.ts index 3f5d6d0..2fc1ae9 100644 --- a/src/entity/eform_beneficial_owners.ts +++ b/src/entity/eform_beneficial_owners.ts @@ -8,16 +8,25 @@ import { EformConfigBusinessField } from "./eform_config_business_fields"; import { EformConfigOccupation } from "./eform_config_occupations"; import { EformConfigSourceIncome } from "./eform_config_source_incomes"; import { EformConfigRelation } from "./eform_config_relations"; - +import { EformConfigNationality } from "./eform_config_nationalities"; +import { EformRequest } from "./eform_requests"; @Entity("eform_beneficial_owners", { schema: "eforms" }) export class EformBeneficialOwner { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => EformRequest, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + request: EformRequest; + @ManyToOne(() => EformConfigRelation, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() relation: EformConfigRelation; + @ManyToOne(() => EformConfigNationality, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + nationality: EformConfigNationality; + @ManyToOne(() => EformConfigSourceIncome, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() source_income: EformConfigSourceIncome; diff --git a/src/entity/eform_emergency_contacts.ts b/src/entity/eform_emergency_contacts.ts index 2f2fb16..acb1484 100644 --- a/src/entity/eform_emergency_contacts.ts +++ b/src/entity/eform_emergency_contacts.ts @@ -4,22 +4,27 @@ import { EformRegionAdministrativu } from "./eform_region_administrativus"; import { EformRegionSuco } from "./eform_region_sucos"; import { EformRegionAldeia } from "./eform_region_aldeias"; import { EformConfigRelation } from "./eform_config_relations"; +import { EformRequest } from "./eform_requests"; @Entity("eform_emergency_contacts", { schema: "eforms" }) export class EformEmergencyContact { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => EformRequest, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + request: EformRequest; + + @ManyToOne(() => EformConfigRelation, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + relation: EformConfigRelation; + @Column({ nullable: false, length: 4096, }) name: string; - @ManyToOne(() => EformConfigRelation, { onDelete: "NO ACTION", nullable: true }) - @JoinColumn() - relation: EformConfigRelation; - @Column({ nullable: true, length: 4096, diff --git a/src/entity/eform_financials.ts b/src/entity/eform_financials.ts index 2015fd3..3a69a07 100644 --- a/src/entity/eform_financials.ts +++ b/src/entity/eform_financials.ts @@ -2,12 +2,17 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToM import { EformInterestAccountType } from "../types/eform"; import { EformConfigSourceIncome } from "./eform_config_source_incomes"; import { EformFinancialBank } from "./eform_financial_banks"; +import { EformRequest } from "./eform_requests"; @Entity("eform_financials", { schema: "eforms" }) export class EformFinancial { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => EformRequest, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + request: EformRequest; + @ManyToOne(() => EformConfigSourceIncome, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() source_income: EformConfigSourceIncome; diff --git a/src/entity/eform_jobs.ts b/src/entity/eform_jobs.ts index 732d5ca..fb64a02 100644 --- a/src/entity/eform_jobs.ts +++ b/src/entity/eform_jobs.ts @@ -5,12 +5,17 @@ import { EformRegionSuco } from "./eform_region_sucos"; import { EformRegionAldeia } from "./eform_region_aldeias"; import { EformConfigOccupation } from "./eform_config_occupations"; import { EformConfigBusinessField } from "./eform_config_business_fields"; +import { EformRequest } from "./eform_requests"; @Entity("eform_jobs", { schema: "eforms" }) export class EformJob { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => EformRequest, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + request: EformRequest; + @ManyToOne(() => EformConfigOccupation, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() occupation: EformConfigOccupation; diff --git a/src/entity/eform_personal_identities.ts b/src/entity/eform_personal_identities.ts index 0fde68c..3923131 100644 --- a/src/entity/eform_personal_identities.ts +++ b/src/entity/eform_personal_identities.ts @@ -29,6 +29,12 @@ export class EformPersonalIdentity { }) expired_at: string; + @Column({ + nullable: true, + length: 256, + }) + issued_at: string; + @Column({ nullable: true, length: 4096, diff --git a/src/entity/eform_personals.ts b/src/entity/eform_personals.ts index a07e336..ffd389b 100644 --- a/src/entity/eform_personals.ts +++ b/src/entity/eform_personals.ts @@ -4,12 +4,17 @@ import { EformConfigNationality } from "./eform_config_nationalities"; import { EformConfigEducation } from "./eform_config_educations"; import { EformPersonalIdentity } from "./eform_personal_identities"; import { EformConfigMarital } from "./eform_config_maritals"; +import { EformRequest } from "./eform_requests"; @Entity("eform_personals", { schema: "eforms" }) export class EformPersonal { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => EformRequest, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + request: EformRequest; + @ManyToOne(() => EformConfigNationality, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() nationality: EformConfigNationality; @@ -18,16 +23,18 @@ export class EformPersonal { @JoinColumn() education: EformConfigEducation; - @ManyToOne(() => EformConfigMarital, { onDelete: "NO ACTION", nullable: true }) - @JoinColumn() - marital: EformConfigMarital; - @Column({ nullable: false, length: 4096, }) name: string; + @Column({ + nullable: false, + length: 4096, + }) + marital: string; + @Column({ nullable: true, length: 128, @@ -87,6 +94,18 @@ export class EformPersonal { }) birth_date: Date; + @Column({ + nullable: false, + length: 4096, + }) + birth_mother: string; + + @Column({ + nullable: false, + length: 4096, + }) + faximilie: string; + @ManyToMany(() => EformPersonalIdentity, (identity) => identity.personal) personal_identities: EformPersonalIdentity[]; diff --git a/src/schema/eform.ts b/src/schema/eform.ts index 6b85f80..d0160b9 100644 --- a/src/schema/eform.ts +++ b/src/schema/eform.ts @@ -24,6 +24,7 @@ export * from "../entity/eform_cifs"; export * from "../entity/eform_requests"; export * from "../entity/eform_cifs"; export * from "../entity/eform_personals"; +export * from "../entity/eform_personal_identities"; export * from "../entity/eform_personal_main_addresses"; export * from "../entity/eform_personal_domicile_addresses"; export * from "../entity/eform_jobs"; @@ -31,4 +32,5 @@ export * from "../entity/eform_financials"; export * from "../entity/eform_financial_banks"; export * from "../entity/eform_emergency_contacts"; export * from "../entity/eform_beneficial_owners"; -export * from "../entity/eform_personal_identities"; +export * from "../entity/eform_beneficial_owner_identities"; +export * from "../entity/eform_beneficial_owner_jobs"; diff --git a/src/types/eform.ts b/src/types/eform.ts index cb6c053..1d6ed32 100644 --- a/src/types/eform.ts +++ b/src/types/eform.ts @@ -32,7 +32,7 @@ export enum EformRequestRequestorType { } export enum EformGender { - "man" = "man", + "male" = "male", "female" = "female", }