Add challenges background preference support: Extend site preferences and related components to include challengesBackground, update API and UI to handle new background image settings for challenges.
Some checks failed
Deploy with Docker Compose / deploy (push) Failing after 2m23s

This commit is contained in:
Julien Froidefond
2025-12-15 21:26:30 +01:00
parent 83446759fe
commit d3a4fa7cf5
25 changed files with 8373 additions and 12328 deletions

View File

@@ -1,53 +1,54 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
// @ts-nocheck
/*
* This file should be your main import to use Prisma-related types and utilities in a browser.
* This file should be your main import to use Prisma-related types and utilities in a browser.
* Use it to get access to models, enums, and input types.
*
*
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
* See `client.ts` for the standard, server-side entry point.
*
* 🟢 You can import this file directly.
*/
import * as Prisma from "./internal/prismaNamespaceBrowser";
export { Prisma };
export * as $Enums from "./enums";
export * from "./enums";
import * as Prisma from './internal/prismaNamespaceBrowser'
export { Prisma }
export * as $Enums from './enums'
export * from './enums';
/**
* Model User
*
*
*/
export type User = Prisma.UserModel;
export type User = Prisma.UserModel
/**
* Model UserPreferences
*
*
*/
export type UserPreferences = Prisma.UserPreferencesModel;
export type UserPreferences = Prisma.UserPreferencesModel
/**
* Model Event
*
*
*/
export type Event = Prisma.EventModel;
export type Event = Prisma.EventModel
/**
* Model EventRegistration
*
*
*/
export type EventRegistration = Prisma.EventRegistrationModel;
export type EventRegistration = Prisma.EventRegistrationModel
/**
* Model EventFeedback
*
*
*/
export type EventFeedback = Prisma.EventFeedbackModel;
export type EventFeedback = Prisma.EventFeedbackModel
/**
* Model SitePreferences
*
*
*/
export type SitePreferences = Prisma.SitePreferencesModel;
export type SitePreferences = Prisma.SitePreferencesModel
/**
* Model Challenge
*
*
*/
export type Challenge = Prisma.ChallengeModel;
export type Challenge = Prisma.ChallengeModel

View File

@@ -1,7 +1,8 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
// @ts-nocheck
/*
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
@@ -9,21 +10,21 @@
* 🟢 You can import this file directly.
*/
import * as process from "node:process";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
globalThis["__dirname"] = path.dirname(fileURLToPath(import.meta.url));
import * as process from 'node:process'
import * as path from 'node:path'
import { fileURLToPath } from 'node:url'
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
import * as runtime from "@prisma/client/runtime/client";
import * as $Enums from "./enums";
import * as $Class from "./internal/class";
import * as Prisma from "./internal/prismaNamespace";
import * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums"
import * as $Class from "./internal/class"
import * as Prisma from "./internal/prismaNamespace"
export * as $Enums from "./enums";
export * from "./enums";
export * as $Enums from './enums'
export * from "./enums"
/**
* ## Prisma Client
*
*
* Type-safe database client for TypeScript
* @example
* ```
@@ -31,51 +32,45 @@ export * from "./enums";
* // Fetch zero or more Users
* const users = await prisma.user.findMany()
* ```
*
*
* Read more in our [docs](https://pris.ly/d/client).
*/
export const PrismaClient = $Class.getPrismaClientClass();
export type PrismaClient<
LogOpts extends Prisma.LogLevel = never,
OmitOpts extends Prisma.PrismaClientOptions["omit"] =
Prisma.PrismaClientOptions["omit"],
ExtArgs extends runtime.Types.Extensions.InternalArgs =
runtime.Types.Extensions.DefaultArgs,
> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
export { Prisma };
export const PrismaClient = $Class.getPrismaClientClass()
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
export { Prisma }
/**
* Model User
*
*
*/
export type User = Prisma.UserModel;
export type User = Prisma.UserModel
/**
* Model UserPreferences
*
*
*/
export type UserPreferences = Prisma.UserPreferencesModel;
export type UserPreferences = Prisma.UserPreferencesModel
/**
* Model Event
*
*
*/
export type Event = Prisma.EventModel;
export type Event = Prisma.EventModel
/**
* Model EventRegistration
*
*
*/
export type EventRegistration = Prisma.EventRegistrationModel;
export type EventRegistration = Prisma.EventRegistrationModel
/**
* Model EventFeedback
*
*
*/
export type EventFeedback = Prisma.EventFeedbackModel;
export type EventFeedback = Prisma.EventFeedbackModel
/**
* Model SitePreferences
*
*
*/
export type SitePreferences = Prisma.SitePreferencesModel;
export type SitePreferences = Prisma.SitePreferencesModel
/**
* Model Challenge
*
*
*/
export type Challenge = Prisma.ChallengeModel;
export type Challenge = Prisma.ChallengeModel

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +1,54 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
// @ts-nocheck
/*
* This file exports all enum related types from the schema.
*
* 🟢 You can import this file directly.
*/
* This file exports all enum related types from the schema.
*
* 🟢 You can import this file directly.
*/
export const Role = {
USER: "USER",
ADMIN: "ADMIN",
} as const;
USER: 'USER',
ADMIN: 'ADMIN'
} as const
export type Role = (typeof Role)[keyof typeof Role]
export type Role = (typeof Role)[keyof typeof Role];
export const EventType = {
ATELIER: "ATELIER",
KATA: "KATA",
PRESENTATION: "PRESENTATION",
LEARNING_HOUR: "LEARNING_HOUR",
} as const;
ATELIER: 'ATELIER',
KATA: 'KATA',
PRESENTATION: 'PRESENTATION',
LEARNING_HOUR: 'LEARNING_HOUR'
} as const
export type EventType = (typeof EventType)[keyof typeof EventType]
export type EventType = (typeof EventType)[keyof typeof EventType];
export const CharacterClass = {
WARRIOR: "WARRIOR",
MAGE: "MAGE",
ROGUE: "ROGUE",
RANGER: "RANGER",
PALADIN: "PALADIN",
ENGINEER: "ENGINEER",
MERCHANT: "MERCHANT",
SCHOLAR: "SCHOLAR",
BERSERKER: "BERSERKER",
NECROMANCER: "NECROMANCER",
} as const;
WARRIOR: 'WARRIOR',
MAGE: 'MAGE',
ROGUE: 'ROGUE',
RANGER: 'RANGER',
PALADIN: 'PALADIN',
ENGINEER: 'ENGINEER',
MERCHANT: 'MERCHANT',
SCHOLAR: 'SCHOLAR',
BERSERKER: 'BERSERKER',
NECROMANCER: 'NECROMANCER'
} as const
export type CharacterClass = (typeof CharacterClass)[keyof typeof CharacterClass]
export type CharacterClass =
(typeof CharacterClass)[keyof typeof CharacterClass];
export const ChallengeStatus = {
PENDING: "PENDING",
ACCEPTED: "ACCEPTED",
COMPLETED: "COMPLETED",
REJECTED: "REJECTED",
CANCELLED: "CANCELLED",
} as const;
PENDING: 'PENDING',
ACCEPTED: 'ACCEPTED',
COMPLETED: 'COMPLETED',
REJECTED: 'REJECTED',
CANCELLED: 'CANCELLED'
} as const
export type ChallengeStatus =
(typeof ChallengeStatus)[keyof typeof ChallengeStatus];
export type ChallengeStatus = (typeof ChallengeStatus)[keyof typeof ChallengeStatus]

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
// @ts-nocheck
/*
* WARNING: This is an internal file that is subject to change!
*
@@ -14,185 +15,184 @@
* model files in the `model` directory!
*/
import * as runtime from "@prisma/client/runtime/index-browser";
import * as runtime from "@prisma/client/runtime/index-browser"
export type * from "../models";
export type * from "./prismaNamespace";
export type * from '../models'
export type * from './prismaNamespace'
export const Decimal = runtime.Decimal
export const Decimal = runtime.Decimal;
export const NullTypes = {
DbNull: runtime.NullTypes.DbNull as new (
secret: never
) => typeof runtime.DbNull,
JsonNull: runtime.NullTypes.JsonNull as new (
secret: never
) => typeof runtime.JsonNull,
AnyNull: runtime.NullTypes.AnyNull as new (
secret: never
) => typeof runtime.AnyNull,
};
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
}
/**
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const DbNull = runtime.DbNull;
export const DbNull = runtime.DbNull
/**
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const JsonNull = runtime.JsonNull;
export const JsonNull = runtime.JsonNull
/**
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
*
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
*/
export const AnyNull = runtime.AnyNull;
export const AnyNull = runtime.AnyNull
export const ModelName = {
User: "User",
UserPreferences: "UserPreferences",
Event: "Event",
EventRegistration: "EventRegistration",
EventFeedback: "EventFeedback",
SitePreferences: "SitePreferences",
Challenge: "Challenge",
} as const;
User: 'User',
UserPreferences: 'UserPreferences',
Event: 'Event',
EventRegistration: 'EventRegistration',
EventFeedback: 'EventFeedback',
SitePreferences: 'SitePreferences',
Challenge: 'Challenge'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName];
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
/*
* Enums
*/
export const TransactionIsolationLevel = {
Serializable: "Serializable",
} as const;
Serializable: 'Serializable'
} as const
export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel]
export type TransactionIsolationLevel =
(typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel];
export const UserScalarFieldEnum = {
id: "id",
email: "email",
password: "password",
username: "username",
role: "role",
score: "score",
level: "level",
hp: "hp",
maxHp: "maxHp",
xp: "xp",
maxXp: "maxXp",
avatar: "avatar",
createdAt: "createdAt",
updatedAt: "updatedAt",
bio: "bio",
characterClass: "characterClass",
} as const;
id: 'id',
email: 'email',
password: 'password',
username: 'username',
role: 'role',
score: 'score',
level: 'level',
hp: 'hp',
maxHp: 'maxHp',
xp: 'xp',
maxXp: 'maxXp',
avatar: 'avatar',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
bio: 'bio',
characterClass: 'characterClass'
} as const
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
export type UserScalarFieldEnum =
(typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum];
export const UserPreferencesScalarFieldEnum = {
id: "id",
userId: "userId",
homeBackground: "homeBackground",
eventsBackground: "eventsBackground",
leaderboardBackground: "leaderboardBackground",
theme: "theme",
createdAt: "createdAt",
updatedAt: "updatedAt",
} as const;
id: 'id',
userId: 'userId',
homeBackground: 'homeBackground',
eventsBackground: 'eventsBackground',
leaderboardBackground: 'leaderboardBackground',
theme: 'theme',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type UserPreferencesScalarFieldEnum = (typeof UserPreferencesScalarFieldEnum)[keyof typeof UserPreferencesScalarFieldEnum]
export type UserPreferencesScalarFieldEnum =
(typeof UserPreferencesScalarFieldEnum)[keyof typeof UserPreferencesScalarFieldEnum];
export const EventScalarFieldEnum = {
id: "id",
date: "date",
name: "name",
description: "description",
type: "type",
room: "room",
time: "time",
maxPlaces: "maxPlaces",
createdAt: "createdAt",
updatedAt: "updatedAt",
} as const;
id: 'id',
date: 'date',
name: 'name',
description: 'description',
type: 'type',
room: 'room',
time: 'time',
maxPlaces: 'maxPlaces',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type EventScalarFieldEnum = (typeof EventScalarFieldEnum)[keyof typeof EventScalarFieldEnum]
export type EventScalarFieldEnum =
(typeof EventScalarFieldEnum)[keyof typeof EventScalarFieldEnum];
export const EventRegistrationScalarFieldEnum = {
id: "id",
userId: "userId",
eventId: "eventId",
createdAt: "createdAt",
} as const;
id: 'id',
userId: 'userId',
eventId: 'eventId',
createdAt: 'createdAt'
} as const
export type EventRegistrationScalarFieldEnum = (typeof EventRegistrationScalarFieldEnum)[keyof typeof EventRegistrationScalarFieldEnum]
export type EventRegistrationScalarFieldEnum =
(typeof EventRegistrationScalarFieldEnum)[keyof typeof EventRegistrationScalarFieldEnum];
export const EventFeedbackScalarFieldEnum = {
id: "id",
userId: "userId",
eventId: "eventId",
rating: "rating",
comment: "comment",
createdAt: "createdAt",
updatedAt: "updatedAt",
} as const;
id: 'id',
userId: 'userId',
eventId: 'eventId',
rating: 'rating',
comment: 'comment',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type EventFeedbackScalarFieldEnum = (typeof EventFeedbackScalarFieldEnum)[keyof typeof EventFeedbackScalarFieldEnum]
export type EventFeedbackScalarFieldEnum =
(typeof EventFeedbackScalarFieldEnum)[keyof typeof EventFeedbackScalarFieldEnum];
export const SitePreferencesScalarFieldEnum = {
id: "id",
homeBackground: "homeBackground",
eventsBackground: "eventsBackground",
leaderboardBackground: "leaderboardBackground",
createdAt: "createdAt",
updatedAt: "updatedAt",
} as const;
id: 'id',
homeBackground: 'homeBackground',
eventsBackground: 'eventsBackground',
leaderboardBackground: 'leaderboardBackground',
challengesBackground: 'challengesBackground',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type SitePreferencesScalarFieldEnum = (typeof SitePreferencesScalarFieldEnum)[keyof typeof SitePreferencesScalarFieldEnum]
export type SitePreferencesScalarFieldEnum =
(typeof SitePreferencesScalarFieldEnum)[keyof typeof SitePreferencesScalarFieldEnum];
export const ChallengeScalarFieldEnum = {
id: "id",
challengerId: "challengerId",
challengedId: "challengedId",
title: "title",
description: "description",
pointsReward: "pointsReward",
status: "status",
adminId: "adminId",
adminComment: "adminComment",
winnerId: "winnerId",
createdAt: "createdAt",
acceptedAt: "acceptedAt",
completedAt: "completedAt",
updatedAt: "updatedAt",
} as const;
id: 'id',
challengerId: 'challengerId',
challengedId: 'challengedId',
title: 'title',
description: 'description',
pointsReward: 'pointsReward',
status: 'status',
adminId: 'adminId',
adminComment: 'adminComment',
winnerId: 'winnerId',
createdAt: 'createdAt',
acceptedAt: 'acceptedAt',
completedAt: 'completedAt',
updatedAt: 'updatedAt'
} as const
export type ChallengeScalarFieldEnum = (typeof ChallengeScalarFieldEnum)[keyof typeof ChallengeScalarFieldEnum]
export type ChallengeScalarFieldEnum =
(typeof ChallengeScalarFieldEnum)[keyof typeof ChallengeScalarFieldEnum];
export const SortOrder = {
asc: "asc",
desc: "desc",
} as const;
asc: 'asc',
desc: 'desc'
} as const
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder];
export const NullsOrder = {
first: "first",
last: "last",
} as const;
first: 'first',
last: 'last'
} as const
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder]
export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder];

View File

@@ -1,17 +1,18 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck
// @ts-nocheck
/*
* This is a barrel export file for all models and their related types.
*
* 🟢 You can import this file directly.
*/
export type * from "./models/User";
export type * from "./models/UserPreferences";
export type * from "./models/Event";
export type * from "./models/EventRegistration";
export type * from "./models/EventFeedback";
export type * from "./models/SitePreferences";
export type * from "./models/Challenge";
export type * from "./commonInputTypes";
export type * from './models/User'
export type * from './models/UserPreferences'
export type * from './models/Event'
export type * from './models/EventRegistration'
export type * from './models/EventFeedback'
export type * from './models/SitePreferences'
export type * from './models/Challenge'
export type * from './commonInputTypes'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_SitePreferences" (
"id" TEXT NOT NULL PRIMARY KEY DEFAULT 'global',
"homeBackground" TEXT,
"eventsBackground" TEXT,
"leaderboardBackground" TEXT,
"challengesBackground" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_SitePreferences" ("createdAt", "eventsBackground", "homeBackground", "id", "leaderboardBackground", "updatedAt") SELECT "createdAt", "eventsBackground", "homeBackground", "id", "leaderboardBackground", "updatedAt" FROM "SitePreferences";
DROP TABLE "SitePreferences";
ALTER TABLE "new_SitePreferences" RENAME TO "SitePreferences";
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -99,6 +99,7 @@ model SitePreferences {
homeBackground String?
eventsBackground String?
leaderboardBackground String?
challengesBackground String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}