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:
@@ -1,4 +1,14 @@
|
||||
import { PartialType } from '@nestjs/swagger';
|
||||
import { PartialType, ApiProperty } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsOptional } from 'class-validator';
|
||||
import { CreateTaskDto } from './create-task.dto';
|
||||
|
||||
export class UpdateTaskDto extends PartialType(CreateTaskDto) {}
|
||||
export class UpdateTaskDto extends PartialType(CreateTaskDto) {
|
||||
@ApiProperty({
|
||||
description: 'Enable or disable the task',
|
||||
example: true,
|
||||
required: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
is_active?: boolean;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,7 @@ export class SchedulesService {
|
||||
cron_expression: dto.cron_expression,
|
||||
timezone: timezone,
|
||||
task_config: dto.task_config || {},
|
||||
is_enabled: true,
|
||||
last_run: null,
|
||||
is_active: true,
|
||||
next_run: null, // Would be calculated by scheduler
|
||||
created_at: new Date(),
|
||||
});
|
||||
@@ -114,7 +113,7 @@ export class SchedulesService {
|
||||
throw new NotFoundException(`Scheduled task ${taskId} not found`);
|
||||
}
|
||||
|
||||
task.is_enabled = enabled;
|
||||
task.is_active = enabled;
|
||||
const updated = await this.taskRepository.save(task);
|
||||
|
||||
// TODO: Enable/disable task in scheduler
|
||||
|
||||
Reference in New Issue
Block a user