update
This commit is contained in:
@ -1,68 +1,74 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from 'typeorm';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { BrivaCompany } from './briva_companies';
|
||||
import { Status } from "../types/status";
|
||||
import { BrivaCompany } from "./briva_companies";
|
||||
|
||||
@Entity('briva_accounts', { schema: 'brivas' })
|
||||
@Entity("briva_accounts", { schema: "brivas" })
|
||||
export class BrivaAccount {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256
|
||||
})
|
||||
code: string;
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
account_number: string;
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
account_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
account_holder: string;
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
account_holder: string;
|
||||
|
||||
@ManyToOne(() => BrivaCompany, { onDelete: 'NO ACTION', nullable: true })
|
||||
@JoinTable()
|
||||
company: BrivaCompany
|
||||
@ManyToOne(() => BrivaCompany, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinTable()
|
||||
company: BrivaCompany;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
last_trans_at: Date;
|
||||
@Column({
|
||||
type: "jsonb",
|
||||
nullable: true,
|
||||
})
|
||||
labels: any[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
last_trans_ref_number: string;
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
last_trans_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'float8'
|
||||
})
|
||||
last_trans_amount: number;
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
last_trans_ref_number: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
last_trans_amount: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
|
||||
44
src/entity/briva_company_account_labels.ts
Normal file
44
src/entity/briva_company_account_labels.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
import { BrivaCompany } from "./briva_companies";
|
||||
|
||||
@Entity("briva_company_account_labels", { schema: "brivas" })
|
||||
export class BrivaCompanyAccountLabel {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrivaCompany, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinTable()
|
||||
company: BrivaCompany;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
label: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
prefix_code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
value: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -61,6 +61,7 @@ import { BrivaCompanyUser } from "./entity/briva_company_users";
|
||||
import { BrivaCompanyUserRefreshToken } from "./entity/briva_company_user_refresh_token";
|
||||
import { BrivaAccount } from "./entity/briva_accounts";
|
||||
import { BrivaTransaction } from "./entity/briva_transactions";
|
||||
import { BrivaCompanyAccountLabel } from "./entity/briva_company_account_labels";
|
||||
|
||||
import { AssetSupplier } from "./entity/asset_supplier";
|
||||
import { AssetFixedClassification } from "./entity/asset_fixed_classification";
|
||||
@ -274,6 +275,7 @@ export {
|
||||
BrivaCompanyUserRefreshToken,
|
||||
BrivaAccount,
|
||||
BrivaTransaction,
|
||||
BrivaCompanyAccountLabel,
|
||||
AssetSupplier,
|
||||
AssetFixedClassification,
|
||||
AssetFixedType,
|
||||
|
||||
Reference in New Issue
Block a user