update
This commit is contained in:
@ -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 { EformBeneficialOwner } from "./eform_beneficial_owners";
|
||||
import { EformIdentityType } from "../types/eform";
|
||||
|
||||
@ -7,8 +7,7 @@ export class EformBeneficialOwnerIdentity {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EformBeneficialOwner, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
@OneToOne(() => EformBeneficialOwner, (beneficial_owner) => beneficial_owner.identity, { onDelete: "CASCADE" })
|
||||
beneficial_owner: EformBeneficialOwner;
|
||||
|
||||
@Column({
|
||||
|
||||
@ -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 { EformConfigOccupation } from "./eform_config_occupations";
|
||||
import { EformConfigBusinessField } from "./eform_config_business_fields";
|
||||
import { EformConfigSourceIncome } from "./eform_config_source_incomes";
|
||||
@ -9,8 +9,7 @@ export class EformBeneficialOwnerJob {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EformBeneficialOwner, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
@OneToOne(() => EformBeneficialOwner, (beneficial_owner) => beneficial_owner.identity, { onDelete: "CASCADE" })
|
||||
beneficial_owner: EformBeneficialOwner;
|
||||
|
||||
@ManyToOne(() => EformConfigOccupation, { onDelete: "NO ACTION", nullable: true })
|
||||
|
||||
@ -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 { EformGender, EformIdentityType } from "../types/eform";
|
||||
import { EformRegionMunisipo } from "./eform_region_munisipos";
|
||||
import { EformRegionAdministrativu } from "./eform_region_administrativus";
|
||||
@ -10,6 +10,8 @@ import { EformConfigSourceIncome } from "./eform_config_source_incomes";
|
||||
import { EformConfigRelation } from "./eform_config_relations";
|
||||
import { EformConfigNationality } from "./eform_config_nationalities";
|
||||
import { EformRequest } from "./eform_requests";
|
||||
import { EformBeneficialOwnerIdentity } from "./eform_beneficial_owner_identities";
|
||||
import { EformBeneficialOwnerJob } from "./eform_beneficial_owner_jobs";
|
||||
@Entity("eform_beneficial_owners", { schema: "eforms" })
|
||||
export class EformBeneficialOwner {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
@ -51,6 +53,14 @@ export class EformBeneficialOwner {
|
||||
@JoinColumn()
|
||||
aldeia: EformRegionAldeia;
|
||||
|
||||
@OneToOne(() => EformBeneficialOwnerIdentity, (beneficial_identity) => beneficial_identity.beneficial_owner, { cascade: true })
|
||||
@JoinColumn()
|
||||
identity: EformBeneficialOwnerIdentity;
|
||||
|
||||
@OneToOne(() => EformBeneficialOwnerJob, (beneficial_job) => beneficial_job.beneficial_owner, { cascade: true })
|
||||
@JoinColumn()
|
||||
job: EformBeneficialOwnerJob;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 4096,
|
||||
|
||||
Reference in New Issue
Block a user