This commit is contained in:
2025-09-18 06:27:38 +07:00
parent 81b55b27ab
commit 54ca5d7948
6 changed files with 383 additions and 97 deletions

View File

@ -1,136 +1,129 @@
import { import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, JoinTable } from "typeorm";
Entity, import { AssetRequestOrderCategory } from "./asset_request_order_category";
PrimaryGeneratedColumn, import { AssetSupplier } from "./asset_supplier";
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
JoinTable
} from 'typeorm';
import { AssetRequestOrderCategory } from './asset_request_order_category';
import { AssetSupplier } from './asset_supplier';
@Entity('asset_request_orders') @Entity("asset_request_orders")
export class AssetRequestOrder { export class AssetRequestOrder {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn("uuid")
id: string; id: string;
@ManyToOne(() => AssetRequestOrderCategory, { onDelete: 'CASCADE' }) @ManyToOne(() => AssetRequestOrderCategory, { onDelete: "CASCADE" })
@JoinTable() @JoinTable()
request_order_category: AssetRequestOrderCategory; request_order_category: AssetRequestOrderCategory;
@Column({ type: 'varchar', length: 255 }) @Column({ type: "varchar", length: 255 })
department_id: string; department_id: string;
@Column({ type: 'varchar', length: 255 }) @Column({ type: "varchar", length: 255 })
department_name: string; department_name: string;
@ManyToOne(() => AssetSupplier, { onDelete: 'NO ACTION', nullable: true }) @ManyToOne(() => AssetSupplier, { onDelete: "NO ACTION", nullable: true })
@JoinTable() @JoinTable()
supplier: AssetSupplier; supplier: AssetSupplier;
@Column({ type: 'varchar', length: 50, unique: true, nullable: true }) @Column({ type: "varchar", length: 50, unique: true, nullable: true })
code: string; code: string;
@Column({ type: 'varchar', length: 50 }) @Column({ type: "varchar", length: 50 })
type: string; type: string;
@Column({ @Column({
type: 'date', nullable: true, type: "date",
}) nullable: true,
request_at: Date; })
request_at: Date;
@Column({ type: 'text', nullable: true }) @Column({ type: "text", nullable: true })
description: string; description: string;
@Column({ type: 'float8', nullable: false, default: 0 }) @Column({ type: "float8", nullable: false, default: 0 })
rate_idr: number; rate_idr: number;
@Column({ type: 'int2' }) @Column({ type: "int2" })
quantity: number; quantity: number;
@Column({ type: 'float8', nullable: true }) @Column({ type: "float8", nullable: true })
sub_total: number; sub_total: number;
@Column({ @Column({
type: 'float8', nullable: false, default: 0 type: "float8",
}) nullable: false,
discount: number; default: 0,
})
discount: number;
@Column({ type: 'int2', nullable: true }) @Column({ type: "int2", nullable: true })
tax_percent: number; tax_percent: number;
@Column({ type: 'float8', nullable: true }) @Column({ type: "float8", nullable: true })
tax_amount: number; tax_amount: number;
@Column({ type: 'float8' }) @Column({ type: "float8" })
total: number; total: number;
@Column({ nullable: true, length: 4096 }) @Column({ nullable: true, length: 4096 })
file: string; file: string;
@Column({ nullable: true, length: 256 }) @Column({ nullable: true, length: 256 })
nota_dinas: string; nota_dinas: string;
@Column({ type: 'varchar', length: 50, default: 'pending' }) @Column({ type: "varchar", length: 50, default: "pending" })
status: string; status: string;
@Column({ type: 'boolean', nullable: true }) @Column({ type: "boolean", nullable: true })
is_spv_approved: boolean; is_spv_approved: boolean;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
spv_approved_by: string; spv_approved_by: string;
@Column({ nullable: true }) @Column({ nullable: true })
spv_approved_at: Date; spv_approved_at: Date;
@Column({ type: 'text', nullable: true }) @Column({ type: "text", nullable: true })
spv_approved_note: string; spv_approved_note: string;
@Column({ type: 'boolean', nullable: true }) @Column({ type: "boolean", nullable: true })
is_ga_approved: boolean; is_ga_approved: boolean;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
ga_approved_by: string; ga_approved_by: string;
@Column({ nullable: true }) @Column({ nullable: true })
ga_approved_at: Date; ga_approved_at: Date;
@Column({ type: 'text', nullable: true }) @Column({ type: "text", nullable: true })
ga_approved_note: string; ga_approved_note: string;
@Column({ type: 'boolean', nullable: true }) @Column({ type: "boolean", nullable: true })
is_gm_approved: boolean; is_gm_approved: boolean;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
gm_approved_by: string; gm_approved_by: string;
@Column({ nullable: true }) @Column({ nullable: true })
gm_approved_at: Date; gm_approved_at: Date;
@Column({ type: 'text', nullable: true }) @Column({ type: "text", nullable: true })
gm_approved_note: string; gm_approved_note: string;
@Column() @Column()
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
created_by: string; created_by: string;
@Column({ nullable: true }) @Column({ nullable: true })
@UpdateDateColumn() @UpdateDateColumn()
updated_at: Date;; updated_at: Date;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
updated_by: string; updated_by: string;
@Column({ nullable: true }) @Column({ nullable: true })
@DeleteDateColumn() @DeleteDateColumn()
deleted_at: Date;; deleted_at: Date;
@Column({ type: 'varchar', length: 100, nullable: true }) @Column({ type: "varchar", length: 100, nullable: true })
deleted_by: string; deleted_by: string;
} }

View File

@ -0,0 +1,78 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { TrxCompany } from "./trx_companies";
import { Status } from "../types/status";
import { TrxCif } from "./trx_cifs";
import { TrxConfigNationality } from "./trx_config_nationalities";
import { TrxTransaction } from "./trx_transactions";
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
import { TrxTransactionType, TrxTransactionCorrespondentFees } from "./../types/trx";
@Entity("trx_transaction_recepients", { schema: "trx" })
export class TrxTransactionRecepient {
@PrimaryGeneratedColumn("uuid")
id: string;
@OneToOne(() => TrxTransaction, (transaction) => transaction.recepient, { onDelete: "CASCADE" })
transaction: TrxTransaction;
@Column({
nullable: false,
length: 256,
})
name: string;
@Column({
nullable: false,
length: 256,
})
phone: string;
@Column({
nullable: false,
length: 256,
})
bank: string;
@Column({
nullable: false,
length: 256,
})
account_number: string;
@Column({
nullable: true,
length: 4096,
})
address: string;
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
nationality: TrxConfigNationality;
@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;
}

View File

@ -0,0 +1,73 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Status } from "../types/status";
import { TrxConfigNationality } from "./trx_config_nationalities";
import { TrxCompanyAccount } from "./trx_company_accounts";
import { TrxTransaction } from "./trx_transactions";
@Entity("trx_transaction_senders", { schema: "trx" })
export class TrxTransactionSender {
@PrimaryGeneratedColumn("uuid")
id: string;
@OneToOne(() => TrxTransaction, (transaction) => transaction.sender, { onDelete: "CASCADE" })
transaction: TrxTransaction;
@Column({
nullable: false,
length: 256,
})
name: string;
@Column({
nullable: false,
length: 256,
})
phone: string;
@Column({
nullable: false,
length: 256,
})
bank: string;
@Column({
nullable: true,
length: 4096,
})
address: string;
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
nationality: TrxConfigNationality;
@ManyToOne(() => TrxCompanyAccount, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
company_account: TrxCompanyAccount;
@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;
}

View File

@ -0,0 +1,125 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { TrxCompany } from "./trx_companies";
import { Status } from "../types/status";
import { TrxCif } from "./trx_cifs";
import { TrxCompanyAccount } from "./trx_company_accounts";
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
import { TrxTransactionSender } from "./trx_transaction_senders";
import { TrxTransactionRecepient } from "./trx_transaction_recepients";
import { TrxTransactionType, TrxTransactionCorrespondentFees, TrxTransactionStatusType } from "./../types/trx";
@Entity("trx_transactions", { schema: "trx" })
export class TrxTransaction {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
nullable: false,
length: 256,
unique: true,
})
code: string;
@Column({
nullable: false,
length: 256,
})
type: TrxTransactionType;
@Column({
nullable: true,
length: 256,
})
correspondent_fees: string;
@Column({ type: "float8" })
amount_overbooking: number;
@Column({ type: "float8", nullable: true })
transfer_amount: number;
@Column({ type: "float8", nullable: true })
transfer_total: number;
@Column({ type: "float8", nullable: true })
commission: number;
@Column({ type: "float8", nullable: true })
cost_of_sender: number;
@Column({ type: "float8", nullable: true })
sub_total: number;
@Column({ type: "float8", nullable: false, default: 0 })
rate_idr: number;
@Column({
nullable: true,
length: 4096,
})
signatures: String;
@Column({ type: "boolean", nullable: true })
is_teller_approved: boolean;
@Column({ type: "varchar", length: 100, nullable: true })
teller_approved_by: string;
@Column({ nullable: true })
teller_approved_at: Date;
@Column({
nullable: true,
length: 4096,
})
teller_signatures: String;
@ManyToOne(() => TrxConfigSourceIncome, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
source_income: TrxConfigSourceIncome;
@OneToOne(() => TrxTransactionSender, (sender) => sender.transaction, { cascade: true })
@JoinColumn()
sender: TrxTransactionSender;
@OneToOne(() => TrxTransactionRecepient, (recepient) => recepient.transaction, { cascade: true })
@JoinColumn()
recepient: TrxTransactionRecepient;
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION", nullable: false })
@JoinColumn()
company: TrxCompany;
@Column({
nullable: false,
length: 64,
})
status: TrxTransactionStatusType;
@Column({ nullable: true })
transaction_at: Date;
@Column({ nullable: true, length: 256 })
transaction_by: string;
@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;
}

View File

@ -27,3 +27,7 @@ export * from "../entity/trx_region_administrativus";
export * from "../entity/trx_region_aldeias"; export * from "../entity/trx_region_aldeias";
export * from "../entity/trx_region_sucos"; export * from "../entity/trx_region_sucos";
export * from "../entity/trx_registration"; export * from "../entity/trx_registration";
export * from "../entity/trx_transaction_senders";
export * from "../entity/trx_transaction_recepients";
export * from "../entity/trx_transactions";
export * from "../types/trx";

View File

@ -6,3 +6,16 @@ export enum TrxTransactionStatusType {
"reject" = "reject", "reject" = "reject",
"approved" = "approved", "approved" = "approved",
} }
export enum TrxTransactionType {
"deposit" = "deposit",
"transfer" = "transfer",
"clearing" = "clearing",
"rtgs" = "rtgs",
}
export enum TrxTransactionCorrespondentFees {
"sender" = "sender",
"recepient" = "recepient",
"other" = "other",
}