This commit is contained in:
fro1991
2025-06-30 15:32:46 +07:00
parent c60debc2f9
commit 9b5b07f0a9

View File

@ -1,53 +1,59 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { BrilinkMerchantSettlementStatus } from '../types/brilink';
import { BrilinkMerchant } from './brilink_merchants';
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { BrilinkMerchantSettlementStatus, BrilinkTransactionType } from "../types/brilink";
import { BrilinkMerchant } from "./brilink_merchants";
@Entity('brilink_merchant_settlements', { schema: 'brilinks' })
@Entity("brilink_merchant_settlements", { schema: "brilinks" })
export class BrilinkMerchantSettlement {
@PrimaryGeneratedColumn('uuid')
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' })
@ManyToOne(() => BrilinkMerchant, { onDelete: "RESTRICT" })
@JoinTable()
merchant: BrilinkMerchant
merchant: BrilinkMerchant;
@Column({
nullable: false,
length: 128
length: 128,
})
code: string;
@Column({
type: 'float8',
nullable: true,
length: 64,
})
type: BrilinkTransactionType;
@Column({
type: "float8",
nullable: false,
default: 0
default: 0,
})
amount: number;
@Column({
type: 'float8',
type: "float8",
nullable: false,
default: 0
default: 0,
})
discount: number;
@Column({
type: 'float8',
type: "float8",
nullable: false,
default: 0
default: 0,
})
fee: number;
@Column({
type: 'float8',
type: "float8",
nullable: false,
default: 0
default: 0,
})
total: number;
@Column({
nullable: false,
length: 64
length: 64,
})
status: BrilinkMerchantSettlementStatus;