update
This commit is contained in:
67
src/entity/trx_customer_accounts.ts
Normal file
67
src/entity/trx_customer_accounts.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
import { TrxPartner } from "./trx_partners";
|
||||
import { TrxCif } from "./trx_cifs";
|
||||
import { TrxCustomer } from "./trx_customers";
|
||||
import { Branch } from "./branchs";
|
||||
|
||||
@Entity("trx_customer_accounts", { schema: "trx" })
|
||||
export class TrxCustomerAccount {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
customer: TrxCustomer;
|
||||
|
||||
@ManyToOne(() => Branch, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
branch: Branch;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
cif_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
account_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096,
|
||||
})
|
||||
address: string;
|
||||
|
||||
@Column({
|
||||
type: "float8",
|
||||
})
|
||||
balance: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
balance_at: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
88
src/entity/trx_customers.ts
Normal file
88
src/entity/trx_customers.ts
Normal file
@ -0,0 +1,88 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Status } from "../types/status";
|
||||
import { TrxCustomerType } from "../types/trx";
|
||||
|
||||
@Entity("trx_customers", { schema: "trx" })
|
||||
export class TrxCustomer {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 4096,
|
||||
})
|
||||
type: TrxCustomerType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 4096,
|
||||
})
|
||||
address: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
pic_name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
pic_phone: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
pic_email: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
desclimer: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -42,4 +42,7 @@ export * from "../entity/trx_partner_accounts";
|
||||
export * from "../entity/trx_partner_user_activities";
|
||||
export * from "../entity/trx_partner_user_refresh_tokens";
|
||||
export * from "../entity/trx_partner_users";
|
||||
|
||||
export * from "../entity/trx_customers";
|
||||
export * from "../entity/trx_customer_accounts";
|
||||
export * from "../types/trx";
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
export enum TrxCustomerType {
|
||||
"personal" = "personal",
|
||||
"business" = "business",
|
||||
}
|
||||
|
||||
export enum TrxTransactionStatus {
|
||||
"verify" = "verify",
|
||||
"open" = "open",
|
||||
|
||||
Reference in New Issue
Block a user