update eform
This commit is contained in:
@ -15,10 +15,6 @@ 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;
|
||||
|
||||
@ -11,10 +11,6 @@ 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;
|
||||
|
||||
@ -9,10 +9,6 @@ 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;
|
||||
|
||||
@ -12,10 +12,6 @@ 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;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { EformPersonal } from "./eform_personals";
|
||||
import { EformRegionMunisipo } from "./eform_region_munisipos";
|
||||
import { EformRegionAdministrativu } from "./eform_region_administrativus";
|
||||
@ -10,8 +10,7 @@ export class EformPersonalDomicileAddress {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EformPersonal, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
@OneToOne(() => EformPersonal, (personal) => personal.personal_domicile_address, { onDelete: "CASCADE" })
|
||||
personal: EformPersonal;
|
||||
|
||||
@Column({
|
||||
|
||||
@ -7,7 +7,7 @@ export class EformPersonalIdentity {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EformPersonal, { onDelete: "NO ACTION", nullable: true })
|
||||
@ManyToOne(() => EformPersonal, (personal) => personal.personal_identities, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
personal: EformPersonal;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { EformPersonal } from "./eform_personals";
|
||||
import { EformRegionMunisipo } from "./eform_region_munisipos";
|
||||
import { EformRegionAdministrativu } from "./eform_region_administrativus";
|
||||
@ -10,8 +10,7 @@ export class EformPersonalMainAddress {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EformPersonal, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
@OneToOne(() => EformPersonal, (personal) => personal.personal_main_address, { onDelete: "CASCADE" })
|
||||
personal: EformPersonal;
|
||||
|
||||
@Column({
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToMany, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { EformGender } from "../types/eform";
|
||||
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";
|
||||
import { EformPersonalMainAddress } from "./eform_personal_main_addresses";
|
||||
import { EformPersonalDomicileAddress } from "./eform_personal_domicile_addresses";
|
||||
|
||||
@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;
|
||||
@ -106,9 +104,21 @@ export class EformPersonal {
|
||||
})
|
||||
faximilie: string;
|
||||
|
||||
@ManyToMany(() => EformPersonalIdentity, (identity) => identity.personal)
|
||||
@OneToMany(() => EformPersonalIdentity, (identity) => identity.personal, { cascade: true })
|
||||
personal_identities: EformPersonalIdentity[];
|
||||
|
||||
@OneToOne(() => EformPersonalMainAddress, (main_address) => main_address.personal, { cascade: true })
|
||||
@JoinColumn()
|
||||
personal_main_address: EformPersonalMainAddress;
|
||||
|
||||
@OneToOne(() => EformPersonalDomicileAddress, (domicile_address) => domicile_address.personal, { cascade: true })
|
||||
@JoinColumn()
|
||||
personal_domicile_address: EformPersonalDomicileAddress;
|
||||
|
||||
@ManyToOne(() => EformPersonal, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
parent: EformPersonal;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@ -3,6 +3,11 @@ import { EformRequestAggrementType, EformRequestProductName, EformRequestProduct
|
||||
import { Branch } from "./branchs";
|
||||
import { EformAccount } from "./eform_accounts";
|
||||
import { EformCif } from "./eform_cifs";
|
||||
import { EformPersonal } from "./eform_personals";
|
||||
import { EformBeneficialOwner } from "./eform_beneficial_owners";
|
||||
import { EformEmergencyContact } from "./eform_emergency_contacts";
|
||||
import { EformFinancial } from "./eform_financials";
|
||||
import { EformJob } from "./eform_jobs";
|
||||
|
||||
@Entity("eform_requests", { schema: "eforms" })
|
||||
export class EformRequest {
|
||||
@ -87,6 +92,26 @@ export class EformRequest {
|
||||
@JoinColumn()
|
||||
branch: Branch;
|
||||
|
||||
@ManyToOne(() => EformJob, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
job: EformJob;
|
||||
|
||||
@ManyToOne(() => EformEmergencyContact, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
emergency_contact: EformEmergencyContact;
|
||||
|
||||
@ManyToOne(() => EformFinancial, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
financial: EformFinancial;
|
||||
|
||||
@ManyToOne(() => EformBeneficialOwner, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
beneficial_owner: EformBeneficialOwner;
|
||||
|
||||
@ManyToOne(() => EformPersonal, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
personal: EformPersonal;
|
||||
|
||||
@Column({ nullable: true })
|
||||
opened_at: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user