feat: add payment module and factory

This commit is contained in:
mahyargdz
2025-02-03 15:41:53 +03:30
parent 8fb587f976
commit 31368610dd
48 changed files with 931 additions and 81 deletions
@@ -0,0 +1,13 @@
import { Column, Entity, ManyToOne } from "typeorm";
import { TicketMessage } from "./ticket-message.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
@Entity()
export class TicketMessageAttachment extends BaseEntity {
@Column({ type: "varchar", length: 150, nullable: true, default: null })
attachmentUrl: string;
@ManyToOne(() => TicketMessage, (ticketMessage) => ticketMessage.attachments, { onDelete: "CASCADE", nullable: false })
ticketMessage: TicketMessage;
}
@@ -1,5 +1,6 @@
import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from "typeorm";
import { TicketMessageAttachment } from "./ticket-message-attachment";
import { Ticket } from "./ticket.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { User } from "../../users/entities/user.entity";
@@ -9,8 +10,8 @@ export class TicketMessage extends BaseEntity {
@Column({ type: "text", nullable: false })
content: string;
@Column({ type: "varchar", length: 150, nullable: true, default: null })
attachmentUrl: string;
@OneToMany(() => TicketMessageAttachment, (attachment) => attachment.ticketMessage, { cascade: true })
attachments: TicketMessageAttachment[];
@JoinColumn()
@ManyToOne(() => Ticket, (ticket) => ticket.messages, { onDelete: "CASCADE", nullable: false })
@@ -13,8 +13,8 @@ export class Ticket extends BaseEntity {
@Column({ type: "int", generated: "identity", insert: false })
numericId: number;
@Column({ type: "varchar", length: 150, nullable: false })
title: string;
// @Column({ type: "varchar", length: 150, nullable: false })
// title: string;
@Column({ type: "varchar", length: 150, nullable: false })
subject: string;