fix finance memo
This commit is contained in:
46
src/entity/finance_memo.ts
Normal file
46
src/entity/finance_memo.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
import { User } from './users';
|
||||
import { PaymentApproval } from './payment_approval';
|
||||
|
||||
@Entity('finance_memos')
|
||||
export class FinanceMemo {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'text',
|
||||
})
|
||||
memo_content: string;
|
||||
|
||||
@OneToMany(() => PaymentApproval, (paymentApproval) => paymentApproval.financeMemo)
|
||||
paymentApprovals: PaymentApproval[];
|
||||
|
||||
@ManyToOne(() => User, (user) => user.id, { nullable: false })
|
||||
@JoinColumn({ name: 'created_by' })
|
||||
createdBy: User;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
created_by: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
}
|
||||
@ -12,6 +12,7 @@ import {
|
||||
import { User } from './users';
|
||||
import { RequestOrder } from './request_orders';
|
||||
import { AssetJournalEntry } from './journal_entries';
|
||||
import { FinanceMemo } from './finance_memo';
|
||||
|
||||
export enum ApprovalStatus {
|
||||
PENDING = 'PENDING',
|
||||
@ -63,7 +64,7 @@ export class PaymentApproval {
|
||||
@OneToMany(() => AssetJournalEntry, (journalEntry) => journalEntry.paymentApproval)
|
||||
journalEntries: AssetJournalEntry[];
|
||||
|
||||
@ManyToOne(() => FinanceMemo, (financeMemo) => financeMemo.paymentApprovals)
|
||||
@ManyToOne(() => FinanceMemo, (finance) => finance.paymentApprovals)
|
||||
@JoinColumn({ name: 'finance_memo_id' })
|
||||
financeMemo: FinanceMemo;
|
||||
|
||||
@ -80,37 +81,4 @@ export class PaymentApproval {
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
}
|
||||
|
||||
@Entity('finance_memos')
|
||||
export class FinanceMemo {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'text',
|
||||
})
|
||||
memo_content: string;
|
||||
|
||||
@OneToMany(() => PaymentApproval, (paymentApproval) => paymentApproval.financeMemo)
|
||||
paymentApprovals: PaymentApproval[];
|
||||
|
||||
@ManyToOne(() => User, (user) => user.id, { nullable: false })
|
||||
@JoinColumn({ name: 'created_by' })
|
||||
createdBy: User;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: 'uuid',
|
||||
})
|
||||
created_by: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
}
|
||||
}
|
||||
@ -63,6 +63,7 @@ import {Asset} from './entity/assets'
|
||||
import { GoodsHandover } from "./entity/goods_handover";
|
||||
import { AssetJournalEntry } from "./entity/journal_entries";
|
||||
import { PaymentApproval } from "./entity/payment_approval";
|
||||
import { FinanceMemo } from "./entity/finance_memo";
|
||||
|
||||
export {
|
||||
User, //
|
||||
@ -119,6 +120,7 @@ export {
|
||||
GoodsHandover,
|
||||
AssetJournalEntry,
|
||||
PaymentApproval,
|
||||
FinanceMemo,
|
||||
Department,
|
||||
GoodsReceipt,
|
||||
RequestSubmission,
|
||||
|
||||
Reference in New Issue
Block a user