create realization and realization recap entity
This commit is contained in:
106
src/entity/asset_invoice.ts
Normal file
106
src/entity/asset_invoice.ts
Normal file
@ -0,0 +1,106 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
import { Supplier } from './supplier';
|
||||
import { User } from './users';
|
||||
import { Department } from './department';
|
||||
|
||||
@Entity('invoices')
|
||||
export class Invoice {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
invoice_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'date',
|
||||
})
|
||||
invoice_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'date',
|
||||
})
|
||||
due_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'decimal',
|
||||
precision: 14,
|
||||
scale: 2,
|
||||
})
|
||||
total_amount: number;
|
||||
|
||||
@ManyToOne(() => Supplier, (supplier) => supplier.id, { nullable: false })
|
||||
@JoinColumn({ name: 'supplier_id' })
|
||||
supplier: Supplier;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
supplier_id: string;
|
||||
|
||||
@ManyToOne(() => Department, (department) => department.id, { nullable: false })
|
||||
@JoinColumn({ name: 'department_id' })
|
||||
department: Department;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
department_id: string;
|
||||
|
||||
@ManyToOne(() => User, (user) => user.id, { nullable: false })
|
||||
@JoinColumn({ name: 'created_by' })
|
||||
createdBy: User;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
created_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'text',
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'uuid',
|
||||
})
|
||||
payment_id: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
83
src/entity/asset_realization_recaps.ts
Normal file
83
src/entity/asset_realization_recaps.ts
Normal file
@ -0,0 +1,83 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
import { Department } from './department';
|
||||
import { User } from './users';
|
||||
|
||||
@Entity('asset_realization_recaps')
|
||||
export class AssetRealizationRecap {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
recap_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'date',
|
||||
})
|
||||
recap_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'int',
|
||||
})
|
||||
total_assets: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'decimal',
|
||||
precision: 14,
|
||||
scale: 2,
|
||||
})
|
||||
total_value: number;
|
||||
|
||||
@ManyToOne(() => Department, (department) => department.id, { nullable: false })
|
||||
@JoinColumn({ name: 'department_id' })
|
||||
department: Department;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
department_id: string;
|
||||
|
||||
@ManyToOne(() => User, (user) => user.id, { nullable: false })
|
||||
@JoinColumn({ name: 'created_by' })
|
||||
createdBy: User;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
created_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'text',
|
||||
})
|
||||
remarks: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
86
src/entity/asset_realizations.ts
Normal file
86
src/entity/asset_realizations.ts
Normal file
@ -0,0 +1,86 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
import { User } from './users';
|
||||
import { Department } from './department';
|
||||
import { Goods } from './goods';
|
||||
|
||||
@Entity('asset_realizations')
|
||||
export class AssetRealization {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
realization_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'date',
|
||||
})
|
||||
realization_date: Date;
|
||||
|
||||
@ManyToOne(() => Goods, (goods) => goods.id, { nullable: false })
|
||||
@JoinColumn({ name: 'goods_id' })
|
||||
goods: Goods;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
goods_id: string;
|
||||
|
||||
@ManyToOne(() => Department, (department) => department.id, { nullable: false })
|
||||
@JoinColumn({ name: 'department_id' })
|
||||
department: Department;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
department_id: string;
|
||||
|
||||
@ManyToOne(() => User, (user) => user.id, { nullable: false })
|
||||
@JoinColumn({ name: 'realized_by' })
|
||||
realizedBy: User;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
realized_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'text',
|
||||
})
|
||||
remarks: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -55,6 +55,8 @@ import { AssetDepreciation } from "./entity/asset_depreciation";
|
||||
import { RequestOrder } from "./entity/request_orders";
|
||||
import { RequestSubmission } from "./entity/request_submission";
|
||||
import { SubmissionRecapitulation } from "./entity/request_submission_recap";
|
||||
import {AssetRealization} from './entity/asset_realizations'
|
||||
import { AssetRealizationRecap } from "./entity/asset_realization_recaps";
|
||||
export {
|
||||
User, //
|
||||
UserRole,
|
||||
@ -109,6 +111,8 @@ export {
|
||||
RequestSubmission,
|
||||
SubmissionRecapitulation,
|
||||
RequestOrder,
|
||||
AssetRealization,
|
||||
AssetRealizationRecap,
|
||||
Ledger,
|
||||
CreditCompany,
|
||||
CreditDebtor,
|
||||
|
||||
Reference in New Issue
Block a user