feat(guild-model): add member and role base entities

This commit is contained in:
nav
2026-05-12 09:02:21 +00:00
parent 46f138328e
commit e53c943991
5 changed files with 74 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('guild_member_roles')
export class GuildMemberRole {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'char', length: 36 })
guildId!: string;
@Column({ type: 'char', length: 36 })
memberId!: string;
@Column({ type: 'char', length: 36 })
roleId!: string;
@CreateDateColumn()
createdAt!: Date;
}

View File

@@ -0,0 +1,19 @@
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('guild_members')
export class GuildMember {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'char', length: 36 })
guildId!: string;
@Column({ type: 'varchar', length: 64 })
userId!: string;
@Column({ type: 'varchar', length: 16, default: 'active' })
status!: 'active' | 'left' | 'blocked';
@CreateDateColumn()
createdAt!: Date;
}

View File

@@ -0,0 +1,22 @@
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('guild_roles')
export class GuildRole {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'char', length: 36 })
guildId!: string;
@Column({ type: 'varchar', length: 64 })
code!: string;
@Column({ type: 'varchar', length: 120 })
name!: string;
@Column({ type: 'boolean', default: false })
isSystem!: boolean;
@CreateDateColumn()
createdAt!: Date;
}