update
This commit is contained in:
36
src/entity/credit_application_forms.ts
Normal file
36
src/entity/credit_application_forms.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { CreditApplication } from './credit_applications';
|
||||
import { CreditTypeForms } from './credit_type_forms';
|
||||
|
||||
@Entity('credit_application_forms')
|
||||
export class CreditApplicationForm {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => CreditApplication, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
application: CreditApplication
|
||||
|
||||
@ManyToOne(() => CreditTypeForms, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
form: CreditTypeForms
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
value: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
66
src/entity/credit_applications.ts
Normal file
66
src/entity/credit_applications.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { CreditApplicationStatus } from '../types/credit';
|
||||
import { CreditCompany } from './credit_companies';
|
||||
import { CreditDebtor } from './credit_debtors';
|
||||
|
||||
@Entity('credit_applications')
|
||||
export class CreditApplication {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => CreditDebtor, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
debtor: CreditDebtor
|
||||
|
||||
@ManyToOne(() => CreditCompany, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
company: CreditCompany
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
application_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
account_number: string;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: true,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
period_type: string;
|
||||
|
||||
@Column({
|
||||
type: 'int2',
|
||||
nullable: false,
|
||||
})
|
||||
period_amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: CreditApplicationStatus;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
39
src/entity/credit_companies.ts
Normal file
39
src/entity/credit_companies.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
|
||||
@Entity('credit_companies')
|
||||
export class CreditCompany {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
116
src/entity/credit_debtors.ts
Normal file
116
src/entity/credit_debtors.ts
Normal file
@ -0,0 +1,116 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { CreditCompany } from './credit_companies';
|
||||
|
||||
@Entity('credit_debtors')
|
||||
export class CreditDebtor {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
employee_id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
phone: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
identity_type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
identity_file: string;
|
||||
|
||||
@ManyToOne(() => CreditCompany, { onDelete: "RESTRICT" })
|
||||
@JoinColumn()
|
||||
company: CreditCompany
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
marriage_type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
marriage_file: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
family_file: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
spouse_type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
spouse_file: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
photo: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
spouse_photo: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
69
src/entity/credit_type_forms.ts
Normal file
69
src/entity/credit_type_forms.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { CreditCompany } from './credit_companies';
|
||||
|
||||
@Entity('credit_type_forms')
|
||||
export class CreditTypeForms {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
required: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
label: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256
|
||||
})
|
||||
label_red: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
14
src/index.ts
14
src/index.ts
@ -39,6 +39,12 @@ import { Goods } from "./entity/goods";
|
||||
import { Supplier } from "./entity/supplier";
|
||||
import { TelegramBody, TelegramResponseSend } from "./types/telegram";
|
||||
import { Ledger } from "./entity/ledgers";
|
||||
import { CreditCompany } from "./entity/credit_companies";
|
||||
import { CreditDebtor } from "./entity/credit_debtors";
|
||||
import { CreditTypeForms } from "./entity/credit_type_forms";
|
||||
import { CreditApplication } from "./entity/credit_applications";
|
||||
import { CreditApplicationStatus } from "./types/credit";
|
||||
import { CreditApplicationForm } from "./entity/credit_application_forms";
|
||||
|
||||
export {
|
||||
User, //
|
||||
@ -85,5 +91,11 @@ export {
|
||||
SummarizeType,
|
||||
Goods,
|
||||
Supplier,
|
||||
Ledger
|
||||
Ledger,
|
||||
CreditCompany,
|
||||
CreditDebtor,
|
||||
CreditTypeForms,
|
||||
CreditApplication,
|
||||
CreditApplicationStatus,
|
||||
CreditApplicationForm
|
||||
};
|
||||
|
||||
6
src/types/credit.ts
Normal file
6
src/types/credit.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export enum CreditApplicationStatus {
|
||||
"draft" = "draft",
|
||||
"under_review" = "under_review",
|
||||
"approved" = "approved",
|
||||
"rejected" = "rejected"
|
||||
};
|
||||
Reference in New Issue
Block a user