diff --git a/src/entity/remit_beneficiaries.ts b/src/entity/remit_beneficiaries.ts index 5233bf6..d92dbed 100644 --- a/src/entity/remit_beneficiaries.ts +++ b/src/entity/remit_beneficiaries.ts @@ -12,6 +12,9 @@ import { RemitConfigSourceIncome } from "./remit_config_source_incomes"; import { RemitConfigBank } from "./remit_config_banks"; import { RemitIndoProvince } from "./remit_indo_provinces"; import { RemitIndoCity } from "./remit_indo_cities"; +import { RemitConfigRelation } from "./remit_config_relations"; +import { RemitConfigBusinessType } from "./remit_config_business_types"; +import { RemitConfigBusinessField } from "./remit_config_business_fields"; @Entity("remit_beneficiaries", { schema: "remits" }) export class RemitBeneficiary { @@ -96,4 +99,24 @@ export class RemitBeneficiary { @ManyToOne(() => RemitBeneficiary, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() parent: RemitBeneficiary; + + @ManyToOne(() => RemitConfigRelation, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + relation: RemitConfigRelation; + + @ManyToOne(() => RemitConfigOccupation, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + occupation: RemitConfigOccupation; + + @ManyToOne(() => RemitConfigBusinessType, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + business_type: RemitConfigBusinessType; + + @ManyToOne(() => RemitConfigBusinessField, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + business_field: RemitConfigBusinessField; + + @ManyToOne(() => RemitConfigNationalities, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + nationality: RemitConfigNationalities; } diff --git a/src/entity/remit_senders.ts b/src/entity/remit_senders.ts index 3518321..d9570a0 100644 --- a/src/entity/remit_senders.ts +++ b/src/entity/remit_senders.ts @@ -15,6 +15,8 @@ import { RemitAdministrativu } from "./remit_administrativus"; import { RemitSuco } from "./remit_sucos"; import { RemitAldeia } from "./remit_aldeias"; import { RemitSenderIdentity } from "./remit_sender_identities"; +import { RemitConfigBusinessType } from "./remit_config_business_types"; +import { RemitConfigBusinessField } from "./remit_config_business_fields"; @Entity("remit_senders", { schema: "remits" }) export class RemitSender { @@ -139,4 +141,12 @@ export class RemitSender { @ManyToOne(() => RemitSender, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() parent: RemitSender; + + @ManyToOne(() => RemitConfigBusinessType, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + business_type: RemitConfigBusinessType; + + @ManyToOne(() => RemitConfigBusinessField, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + business_field: RemitConfigBusinessField; } diff --git a/src/entity/remit_transactions.ts b/src/entity/remit_transactions.ts index 9c50080..44fc1ce 100644 --- a/src/entity/remit_transactions.ts +++ b/src/entity/remit_transactions.ts @@ -9,6 +9,7 @@ import { RemitConfigPurpose } from "./remit_config_purposes"; import { RemitTransactionCurrencyType, RemitTransactionStatus } from "../types/remit"; import { RemitBeneficial } from "./remit_beneficials"; import { RemitConfigRate } from "./remit_config_rates"; +import { RemitMunisipo } from "./remit_munisipos"; @Entity("remit_transactions", { schema: "remits" }) export class RemitTransaction { @@ -29,11 +30,11 @@ export class RemitTransaction { }) reference: string; - @ManyToOne(() => RemitPartner, { onDelete: "RESTRICT" }) + @ManyToOne(() => RemitPartner, { onDelete: "NO ACTION" }) @JoinTable() partner: RemitPartner; - @ManyToOne(() => RemitSender, { onDelete: "RESTRICT" }) + @ManyToOne(() => RemitSender, { onDelete: "NO ACTION" }) @JoinTable() sender: RemitSender; @@ -41,14 +42,18 @@ export class RemitTransaction { @JoinColumn() benefecial: RemitBeneficial; - @ManyToOne(() => RemitBeneficiary, { onDelete: "RESTRICT" }) + @ManyToOne(() => RemitBeneficiary, { onDelete: "NO ACTION" }) @JoinTable() beneficiary: RemitBeneficiary; - @ManyToOne(() => RemitConfigPurpose, { onDelete: "RESTRICT" }) + @ManyToOne(() => RemitConfigPurpose, { onDelete: "NO ACTION" }) @JoinTable() purpose: RemitConfigPurpose; + @ManyToOne(() => RemitMunisipo, { onDelete: "NO ACTION", nullable: true }) + @JoinTable() + munisipo: RemitMunisipo; + @Column({ nullable: true, length: 5,