fix: Align NestJS entities with actual DB schema — 12 files, 5 entities
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Root cause of all remaining 500s: TypeORM entities were scaffolded with "ideal" column names that don't match the Postgres columns created by the Rust migrations. Every query generated SQL referencing non-existent columns. Entity fixes: - notifications_config: email_enabled→email_alerts_enabled, removed 6 phantom columns (email_address, notify_on_start, notify_on_stop, notify_on_player_threshold, player_threshold), renamed 4 notify columns to match DB (notify_server_crash, notify_wipe_start, etc), added 3 missing columns (notify_server_offline, notify_store_purchase, notify_player_report) - team_members: joined_at→accepted_at (nullable, matches DB) - roles: removed description column (doesn't exist in DB) - scheduled_tasks: is_enabled→is_active, removed phantom last_run - wipe_profiles: pre/post_wipe_config nullable→NOT NULL with default Service/DTO fixes: - Updated all property references across notifications, team, schedules services and DTOs to match corrected entity names - Added is_active to UpdateTaskDto (frontend sends it, was being rejected by forbidNonWhitelisted validation) - Removed description from CreateRoleDto Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,24 +21,6 @@ export class UpdateConfigDto {
|
||||
@IsOptional()
|
||||
discord_webhook_url?: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Enable email notifications',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
email_enabled?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Email address for notifications',
|
||||
example: 'admin@example.com',
|
||||
required: false,
|
||||
})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
email_address?: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Enable Pushbullet notifications',
|
||||
example: false,
|
||||
@@ -58,31 +40,13 @@ export class UpdateConfigDto {
|
||||
pushbullet_api_key?: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on server start',
|
||||
description: 'Enable email alert notifications',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_start?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on server stop',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_stop?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on server crash',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_crash?: boolean;
|
||||
email_alerts_enabled?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on wipe start',
|
||||
@@ -91,7 +55,7 @@ export class UpdateConfigDto {
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_wipe_start?: boolean;
|
||||
notify_wipe_start?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on wipe complete',
|
||||
@@ -100,7 +64,7 @@ export class UpdateConfigDto {
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_wipe_complete?: boolean;
|
||||
notify_wipe_complete?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on wipe failure',
|
||||
@@ -109,23 +73,41 @@ export class UpdateConfigDto {
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_wipe_failure?: boolean;
|
||||
notify_wipe_failed?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on player count threshold',
|
||||
description: 'Notify on server crash',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_server_crash?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify when server goes offline',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_server_offline?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on store purchase',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_store_purchase?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notify on player report',
|
||||
example: false,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
notify_on_player_threshold?: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Player count threshold',
|
||||
example: '100',
|
||||
required: false,
|
||||
})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
player_threshold?: string;
|
||||
notify_player_report?: boolean;
|
||||
}
|
||||
|
||||
@@ -22,18 +22,16 @@ export class NotificationsService {
|
||||
license_id: licenseId,
|
||||
discord_enabled: false,
|
||||
discord_webhook_url: null,
|
||||
email_enabled: false,
|
||||
email_address: null,
|
||||
pushbullet_enabled: false,
|
||||
pushbullet_api_key: null,
|
||||
notify_on_start: true,
|
||||
notify_on_stop: true,
|
||||
notify_on_crash: true,
|
||||
notify_on_wipe_start: true,
|
||||
notify_on_wipe_complete: true,
|
||||
notify_on_wipe_failure: true,
|
||||
notify_on_player_threshold: false,
|
||||
player_threshold: null,
|
||||
email_alerts_enabled: true,
|
||||
notify_wipe_start: true,
|
||||
notify_wipe_complete: true,
|
||||
notify_wipe_failed: true,
|
||||
notify_server_crash: true,
|
||||
notify_server_offline: true,
|
||||
notify_store_purchase: true,
|
||||
notify_player_report: false,
|
||||
});
|
||||
|
||||
config = await this.configRepository.save(config);
|
||||
|
||||
Reference in New Issue
Block a user