forked from syntaxbullet/aurorabot
refactor: consolidate config types and remove file-based config
Tickets: #2, #3 - Remove duplicate type definitions from shared/lib/config.ts - Import types from schema files (game-settings.ts, guild-settings.ts) - Add GuildConfig interface to guild-settings.ts schema - Rename ModerationConfig to ModerationCaseConfig in moderation.service.ts - Delete shared/config/config.json and shared/scripts/migrate-config-to-db.ts - Update settings API to use gameSettingsService exclusively - Return DB format (strings) from API instead of runtime BigInts - Fix moderation service tests to pass config as parameter Breaking Changes: - Removes legacy file-based configuration system - API now returns database format with string values for BigInt fields
This commit is contained in:
@@ -10,6 +10,26 @@ import { relations, type InferSelectModel, type InferInsertModel } from 'drizzle
|
||||
export type GuildSettings = InferSelectModel<typeof guildSettings>;
|
||||
export type GuildSettingsInsert = InferInsertModel<typeof guildSettings>;
|
||||
|
||||
export interface GuildConfig {
|
||||
studentRole?: string;
|
||||
visitorRole?: string;
|
||||
colorRoles: string[];
|
||||
welcomeChannelId?: string;
|
||||
welcomeMessage?: string;
|
||||
feedbackChannelId?: string;
|
||||
terminal?: {
|
||||
channelId: string;
|
||||
messageId: string;
|
||||
};
|
||||
moderation: {
|
||||
cases: {
|
||||
dmOnWarn: boolean;
|
||||
logChannelId?: string;
|
||||
autoTimeoutThreshold?: number;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export const guildSettings = pgTable('guild_settings', {
|
||||
guildId: bigint('guild_id', { mode: 'bigint' }).primaryKey(),
|
||||
studentRoleId: bigint('student_role_id', { mode: 'bigint' }),
|
||||
|
||||
Reference in New Issue
Block a user