summary refs log tree commit diff
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-21 18:50:12 +0300
committerErkin Alp Güney <erkinalp9035@gmail.com>2022-04-21 18:50:12 +0300
commitf60ffd3c412482ea38dc68cec45ab1d4d8f6656b (patch)
tree22382a26ca2eb1a533dc7c2c1021aa85fb484e63
parentTry catch cpu log (diff)
downloadserver-f60ffd3c412482ea38dc68cec45ab1d4d8f6656b.tar.xz
user groups - first steps
-rw-r--r--util/src/entities/UserGroup.ts44
1 files changed, 44 insertions, 0 deletions
diff --git a/util/src/entities/UserGroup.ts b/util/src/entities/UserGroup.ts
new file mode 100644
index 00000000..b32c2d6d
--- /dev/null
+++ b/util/src/entities/UserGroup.ts
@@ -0,0 +1,44 @@
+import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
+
+import { BaseClass } from "./BaseClass";
+import { Guild } from "./Guild";
+import { User } from "./User";
+
+@Entity("groups")
+export class UserGroup extends BaseClass {
+	@Column()
+	color: number;
+
+	@Column()
+	hoist: boolean;
+	
+	@JoinColumn({ name: "controller", referencedColumnName: "id" })
+	@ManyToOne(() => User)
+	controller?: User;
+	 
+	@Column()
+	mentionable_by?: string;
+
+	@Column()
+	name: string;
+
+	@Column()
+	rights: string;
+
+	@Column({ nullable: true })
+	icon: string;
+
+	@Column({ type: "simple-json", nullable: true })
+	tags?: {
+		bot_id?: string;
+		integration_id?: string;
+		premium_subscriber?: boolean;
+	};
+	
+	@Column({ nullable: true })
+	parent?: string;
+	
+	@Column({ type: "simple-array", nullable: true})
+	associciations: string[];
+
+}