Files
dzone-api/src/modules/payments/entities/payment-gateway.entity.ts
T
2025-05-19 16:15:15 +03:30

26 lines
863 B
TypeScript
Executable File

import { Entity, EntityRepositoryType, Enum, Opt, Property } from "@mikro-orm/core";
import { BaseEntity } from "../../../common/entities/base.entity";
import { GatewayEnum } from "../enums/gateway.enum";
import { PaymentGatewaysRepository } from "../repositories/payment-gateway.repository";
@Entity({ repository: () => PaymentGatewaysRepository })
export class PaymentGateway extends BaseEntity {
@Enum({ items: () => GatewayEnum, nullable: false, unique: true })
name!: GatewayEnum;
@Property({ type: "varchar", length: 150, nullable: false })
nameFa!: string;
@Property({ type: "varchar", length: 150, nullable: false })
logoUrl!: string;
@Property({ type: "boolean", default: true })
isActive: boolean & Opt;
@Property({ type: "text", nullable: true })
description?: string;
[EntityRepositoryType]?: PaymentGatewaysRepository;
}