update
This commit is contained in:
@ -1,63 +1,75 @@
|
|||||||
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;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, unique: true })
|
@Column({ type: "varchar", length: 255, unique: true })
|
||||||
code: string;
|
code: string;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
@Column({ type: "varchar", length: 255 })
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
@Column({
|
||||||
type: BrilinkDiscountType;
|
type: "float8",
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
min_trans_amount: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: 'float8',
|
type: "float8",
|
||||||
nullable: false,
|
nullable: true,
|
||||||
default: 0
|
})
|
||||||
})
|
max_trans_amount: number;
|
||||||
amount: number;
|
|
||||||
|
|
||||||
@Column({ nullable: false })
|
@Column({ type: "varchar", length: 255 })
|
||||||
start_date: Date;
|
type: BrilinkDiscountType;
|
||||||
|
|
||||||
@Column({ nullable: false })
|
@Column({
|
||||||
end_date: Date;
|
type: "float8",
|
||||||
|
nullable: false,
|
||||||
|
default: 0,
|
||||||
|
})
|
||||||
|
amount: number;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 10 })
|
@Column({ nullable: false })
|
||||||
status: BrilinkDiscountStatus;
|
start_date: Date;
|
||||||
|
|
||||||
@Column()
|
@Column({ nullable: false })
|
||||||
@CreateDateColumn()
|
end_date: Date;
|
||||||
created_at: Date;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255 })
|
@Column({ type: "varchar", length: 10 })
|
||||||
created_by: string;
|
status: BrilinkDiscountStatus;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column()
|
||||||
@UpdateDateColumn()
|
@CreateDateColumn()
|
||||||
updated_at: Date;
|
created_at: Date;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, nullable: true })
|
@Column({ type: "varchar", length: 255 })
|
||||||
updated_by: string;
|
created_by: string;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@DeleteDateColumn()
|
@UpdateDateColumn()
|
||||||
deleted_at: Date;
|
updated_at: Date;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 255, nullable: true })
|
@Column({ type: "varchar", length: 255, nullable: true })
|
||||||
deleted_by: string;
|
updated_by: string;
|
||||||
}
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 255, nullable: true })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user