This commit is contained in:
fro1991
2025-10-08 15:33:05 +07:00
parent 41fb37dba9
commit 30c28672ba

View File

@ -1,16 +1,16 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { BrilinkDiscountModule, BrilinkDiscountStatus, BrilinkDiscountType } from '../types/brilink'; import { BrilinkDiscountModule, BrilinkDiscountStatus, BrilinkDiscountType } from "../types/brilink";
import { BrilinkMerchant } from './brilink_merchants'; import { BrilinkMerchant } from "./brilink_merchants";
@Entity('brilink_discounts', { schema: 'brilinks' }) @Entity("brilink_discounts", { schema: "brilinks" })
export class BrilinkDiscount { export class BrilinkDiscount {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn("uuid")
id: string; id: string;
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' }) @ManyToOne(() => BrilinkMerchant, { onDelete: "RESTRICT" })
@JoinTable() @JoinTable()
merchant: BrilinkMerchant merchant: BrilinkMerchant;
@Column({ type: "varchar", length: 255 }) @Column({ type: "varchar", length: 255 })
module: BrilinkDiscountModule; module: BrilinkDiscountModule;
@ -21,13 +21,25 @@ export class BrilinkDiscount {
@Column({ type: "varchar", length: 255 }) @Column({ type: "varchar", length: 255 })
name: string; name: string;
@Column({
type: "float8",
nullable: true,
})
min_trans_amount: number;
@Column({
type: "float8",
nullable: true,
})
max_trans_amount: number;
@Column({ type: "varchar", length: 255 }) @Column({ type: "varchar", length: 255 })
type: BrilinkDiscountType; type: BrilinkDiscountType;
@Column({ @Column({
type: 'float8', type: "float8",
nullable: false, nullable: false,
default: 0 default: 0,
}) })
amount: number; amount: number;