Cwiczenia: usuniecie martwego pola trudnosc z katalogu (trudnosc pozostaje tylko jako ocena cwiczacego per seria 1-5; migracja DROP kolumny Exercise.difficulty)

This commit is contained in:
tisachi
2026-10-17 08:51:12 +02:00
parent 03e0ace10a
commit 4001aab977
16 changed files with 15 additions and 455 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,6 @@ const exerciseSchema = z.object({
description: z.string().max(2000).nullable().optional(),
howTo: z.string().max(2000).nullable().optional(),
commonMistakes: z.string().max(2000).nullable().optional(),
difficulty: z.number().int().min(1).max(10).optional(),
equipmentIds: z.array(z.string().min(1)).max(50).optional(),
...hasFlagsSchema,
});
@@ -46,7 +45,6 @@ const exerciseUpdateSchema = z.object({
description: z.string().max(2000).nullable().optional(),
howTo: z.string().max(2000).nullable().optional(),
commonMistakes: z.string().max(2000).nullable().optional(),
difficulty: z.number().int().min(1).max(10).optional(),
equipmentIds: z.array(z.string().min(1)).max(50).optional(),
...hasFlagsSchema,
});

View File

@@ -142,7 +142,6 @@ async function seedExercises() {
description: ex.description,
howTo: ex.howTo,
commonMistakes: ex.commonMistakes,
difficulty: ex.difficulty,
source: 'BUILTIN',
seedVersion: SEED_VERSION,
},
@@ -164,7 +163,6 @@ async function seedExercises() {
description: ex.description,
howTo: ex.howTo,
commonMistakes: ex.commonMistakes,
difficulty: ex.difficulty,
source: 'BUILTIN',
seedVersion: SEED_VERSION,
},

View File

@@ -9,7 +9,6 @@ export interface ExerciseInput {
description?: string | null;
howTo?: string | null;
commonMistakes?: string | null;
difficulty?: number;
/** Equipment ids to link (replaces the current set when provided). */
equipmentIds?: string[];
hasReps?: boolean;
@@ -86,7 +85,6 @@ export async function createExercise(prisma: PrismaClient, data: ExerciseInput)
description: data.description ?? null,
howTo: data.howTo ?? null,
commonMistakes: data.commonMistakes ?? null,
difficulty: data.difficulty ?? 3,
source: 'BUILTIN',
// undefined → Prisma default (has* pozostają przy domyślnych kombinacjach)
hasReps: data.hasReps,
@@ -125,7 +123,6 @@ export async function updateExercise(
description: data.description,
howTo: data.howTo,
commonMistakes: data.commonMistakes,
difficulty: data.difficulty,
hasReps: data.hasReps,
hasLoad: data.hasLoad,
hasRest: data.hasRest,

View File

@@ -622,7 +622,6 @@ export const openapi: Record<string, unknown> = {
description: { type: 'string', nullable: true },
howTo: { type: 'string', nullable: true },
commonMistakes: { type: 'string', nullable: true },
difficulty: { type: 'integer', minimum: 1, maximum: 10 },
equipmentIds: { type: 'array', items: { type: 'string' } },
hasReps: { type: 'boolean' },
hasLoad: { type: 'boolean' },