Added BPA-related entities and types
This commit is contained in:
72
src/entity/bpa.ts
Normal file
72
src/entity/bpa.ts
Normal file
@ -0,0 +1,72 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn, Unique, UpdateDateColumn } from 'typeorm';
|
||||
import { Branch } from './branchs';
|
||||
|
||||
@Entity('bpa')
|
||||
export class Bpa {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
position_date: Date;
|
||||
|
||||
@ManyToOne(() => Branch)
|
||||
@JoinColumn()
|
||||
branch: Branch
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 32
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64
|
||||
})
|
||||
ledger: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
default: 0
|
||||
})
|
||||
total: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
default: 0
|
||||
})
|
||||
total_eq: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
remark: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 32
|
||||
})
|
||||
parent: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column()
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
60
src/entity/bpa_format.ts
Normal file
60
src/entity/bpa_format.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
|
||||
import { Branch } from './branchs';
|
||||
|
||||
@Entity('bpa_format')
|
||||
export class BpaFormat {
|
||||
|
||||
@PrimaryColumn({
|
||||
nullable: false,
|
||||
length: 32
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64
|
||||
})
|
||||
ledger: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
normal_balance: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: false
|
||||
})
|
||||
is_formula: boolean;
|
||||
|
||||
@Column({
|
||||
type: 'jsonb',
|
||||
nullable: true,
|
||||
})
|
||||
formula: string[]
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 32
|
||||
})
|
||||
parent: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column()
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
46
src/entity/bpa_log.ts
Normal file
46
src/entity/bpa_log.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, OneToOne, ManyToOne, JoinColumn } from 'typeorm';
|
||||
|
||||
import { SummarizeType, SummarizeLogStatus } from '../types/summarize';
|
||||
import { Category } from './categories';
|
||||
|
||||
@Entity('bpa_log')
|
||||
export class BpaLog {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
position_date: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: SummarizeLogStatus,
|
||||
nullable: false,
|
||||
})
|
||||
status: SummarizeLogStatus;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'text'
|
||||
})
|
||||
error_log: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column()
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
finished_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -39,6 +39,9 @@ import { SummarizeLog } from "./entity/summarize_log";
|
||||
import { SummarizeLogStatus, SummarizeType } from "./types/summarize";
|
||||
import { TelegramBody, TelegramResponseSend } from "./types/telegram";
|
||||
import { Ledger } from "./entity/ledgers";
|
||||
import { BpaFormat } from "./entity/bpa_format"
|
||||
import { BpaLog } from "./entity/bpa_log"
|
||||
import { Bpa } from "./entity/bpa"
|
||||
import { CreditCompany } from "./entity/credit_companies";
|
||||
import { CreditDebtor } from "./entity/credit_debtors";
|
||||
import { CreditTypeForms } from "./entity/credit_type_forms";
|
||||
@ -128,6 +131,9 @@ export {
|
||||
SummarizeLogStatus,
|
||||
SummarizeType,
|
||||
Ledger,
|
||||
BpaFormat,
|
||||
BpaLog,
|
||||
Bpa,
|
||||
CreditCompany,
|
||||
CreditDebtor,
|
||||
CreditTypeForms,
|
||||
|
||||
Reference in New Issue
Block a user