diff --git a/src/entity/trx_costs.ts b/src/entity/trx_costs.ts new file mode 100644 index 0000000..7b69686 --- /dev/null +++ b/src/entity/trx_costs.ts @@ -0,0 +1,74 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { Status } from "../types/status"; +import { TrxTypeCost } from "../types/trx"; + +@Entity("trx_costs", { schema: "trx" }) +export class TrxCost { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: true, + length: 256, + }) + code: string; + + @Column({ + type: "float8", + }) + min_amount: number; + + @Column({ + type: "float8", + }) + max_amount: number; + + @Column({ + nullable: true, + length: 256, + }) + type: TrxTypeCost; + + @Column({ + type: "float8", + }) + cost: number; + + @Column({ + type: "float8", + }) + min_cost: number; + + @Column({ + type: "float8", + }) + max_cost: number; + + @Column({ + nullable: true, + length: 64, + default: Status.Active, + }) + 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; +} diff --git a/src/schema/trx.ts b/src/schema/trx.ts index 92dfc9a..dc3474f 100644 --- a/src/schema/trx.ts +++ b/src/schema/trx.ts @@ -10,6 +10,7 @@ export * from "../entity/trx_customer_user_refresh_tokens"; export * from "../entity/trx_customer_user_activities"; export * from "../entity/trx_customer_costs"; export * from "../entity/trx_customer_slas"; +export * from "../entity/trx_costs"; export * from "../entity/trx_countries"; export * from "../entity/trx_currencies"; export * from "../entity/trx_country_currencies"; diff --git a/src/types/trx.ts b/src/types/trx.ts index d35a034..9a28493 100644 --- a/src/types/trx.ts +++ b/src/types/trx.ts @@ -14,6 +14,11 @@ export enum TrxVerificationStatus { "expire" = "expire", } +export enum TrxTypeCost { + "fix" = "fix", + "percentage" = "percentage", +} + export enum TrxCustomerStatus { "pending_supervisor" = "pending_supervisor", "pending_manager" = "pending_manager",