From beb4894626e9fbed4bedf0da6a986a6385e7ed02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A7=81Ash=C3=BB=EA=A7=82?= <30575805+Ashu11-A@users.noreply.github.com> Date: Sat, 15 Jun 2024 04:58:48 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9B=A9=20Add=20new=20table=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/tickets/src/entity/Template.entry.ts | 170 +++++++++++-------- 1 file changed, 95 insertions(+), 75 deletions(-) diff --git a/plugins/tickets/src/entity/Template.entry.ts b/plugins/tickets/src/entity/Template.entry.ts index e92c4004..ede7a31d 100644 --- a/plugins/tickets/src/entity/Template.entry.ts +++ b/plugins/tickets/src/entity/Template.entry.ts @@ -1,5 +1,5 @@ import { APIEmbed } from "discord.js"; -import { BaseEntity, Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, Relation } from "typeorm"; +import { BaseEntity, Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, Relation, UpdateDateColumn } from "typeorm"; import Guild from "./Guild.entry.js"; import Ticket from "./Ticket.entry.js"; @@ -19,84 +19,104 @@ export interface Select { emoji: string } -interface Category { +export interface Category { title: string emoji: string } +export interface System { + name: string + isEnabled: boolean +} + @Entity({ name: 'tickets_templates' }) export default class Template extends BaseEntity { - @PrimaryGeneratedColumn() - id!: number - - @ManyToOne(() => Guild, (guild) => guild.templates, { cascade: true }) - guild!: Relation - - @OneToMany(() => Ticket, (ticket) => ticket.template) - tickets!: Relation