Refactor event status handling: Remove EventStatus enum from the Prisma schema and update related API routes and UI components to calculate event status dynamically based on event date. This change simplifies event management and enhances data integrity by ensuring status is always derived from the date.
This commit is contained in:
@@ -174,13 +174,6 @@ export type EnumEventTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType
|
||||
}
|
||||
|
||||
export type EnumEventStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.EventStatus | Prisma.EnumEventStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.EventStatus[]
|
||||
notIn?: $Enums.EventStatus[]
|
||||
not?: Prisma.NestedEnumEventStatusFilter<$PrismaModel> | $Enums.EventStatus
|
||||
}
|
||||
|
||||
export type IntNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
@@ -202,16 +195,6 @@ export type EnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumEventTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type EnumEventStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.EventStatus | Prisma.EnumEventStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.EventStatus[]
|
||||
notIn?: $Enums.EventStatus[]
|
||||
not?: Prisma.NestedEnumEventStatusWithAggregatesFilter<$PrismaModel> | $Enums.EventStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumEventStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumEventStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type IntNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
@@ -405,13 +388,6 @@ export type NestedEnumEventTypeFilter<$PrismaModel = never> = {
|
||||
not?: Prisma.NestedEnumEventTypeFilter<$PrismaModel> | $Enums.EventType
|
||||
}
|
||||
|
||||
export type NestedEnumEventStatusFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.EventStatus | Prisma.EnumEventStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.EventStatus[]
|
||||
notIn?: $Enums.EventStatus[]
|
||||
not?: Prisma.NestedEnumEventStatusFilter<$PrismaModel> | $Enums.EventStatus
|
||||
}
|
||||
|
||||
export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.EventType | Prisma.EnumEventTypeFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.EventType[]
|
||||
@@ -422,16 +398,6 @@ export type NestedEnumEventTypeWithAggregatesFilter<$PrismaModel = never> = {
|
||||
_max?: Prisma.NestedEnumEventTypeFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedEnumEventStatusWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: $Enums.EventStatus | Prisma.EnumEventStatusFieldRefInput<$PrismaModel>
|
||||
in?: $Enums.EventStatus[]
|
||||
notIn?: $Enums.EventStatus[]
|
||||
not?: Prisma.NestedEnumEventStatusWithAggregatesFilter<$PrismaModel> | $Enums.EventStatus
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedEnumEventStatusFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedEnumEventStatusFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
||||
@@ -28,15 +28,6 @@ export const EventType = {
|
||||
export type EventType = (typeof EventType)[keyof typeof EventType]
|
||||
|
||||
|
||||
export const EventStatus = {
|
||||
UPCOMING: 'UPCOMING',
|
||||
LIVE: 'LIVE',
|
||||
PAST: 'PAST'
|
||||
} as const
|
||||
|
||||
export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus]
|
||||
|
||||
|
||||
export const CharacterClass = {
|
||||
WARRIOR: 'WARRIOR',
|
||||
MAGE: 'MAGE',
|
||||
|
||||
@@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
"clientVersion": "7.1.0",
|
||||
"engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
|
||||
"activeProvider": "sqlite",
|
||||
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nenum Role {\n USER\n ADMIN\n}\n\nenum EventType {\n SUMMIT\n LAUNCH\n FESTIVAL\n COMPETITION\n CODE_KATA\n}\n\nenum EventStatus {\n UPCOMING\n LIVE\n PAST\n}\n\nenum CharacterClass {\n WARRIOR\n MAGE\n ROGUE\n RANGER\n PALADIN\n ENGINEER\n MERCHANT\n SCHOLAR\n BERSERKER\n NECROMANCER\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n password String\n username String @unique\n role Role @default(USER)\n score Int @default(0)\n level Int @default(1)\n hp Int @default(1000)\n maxHp Int @default(1000)\n xp Int @default(0)\n maxXp Int @default(5000)\n avatar String?\n bio String?\n characterClass CharacterClass?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n preferences UserPreferences?\n eventRegistrations EventRegistration[]\n\n @@index([score])\n @@index([email])\n}\n\nmodel UserPreferences {\n id String @id @default(cuid())\n userId String @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n // Background images for each page\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n\n // Other UI preferences can be added here\n theme String? @default(\"default\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nmodel Event {\n id String @id @default(cuid())\n date DateTime\n name String\n description String\n type EventType\n status EventStatus\n room String?\n time String?\n maxPlaces Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n registrations EventRegistration[]\n\n @@index([status])\n @@index([date])\n}\n\nmodel EventRegistration {\n id String @id @default(cuid())\n userId String\n eventId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n}\n\nmodel SitePreferences {\n id String @id @default(\"global\")\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n",
|
||||
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nenum Role {\n USER\n ADMIN\n}\n\nenum EventType {\n SUMMIT\n LAUNCH\n FESTIVAL\n COMPETITION\n CODE_KATA\n}\n\nenum CharacterClass {\n WARRIOR\n MAGE\n ROGUE\n RANGER\n PALADIN\n ENGINEER\n MERCHANT\n SCHOLAR\n BERSERKER\n NECROMANCER\n}\n\nmodel User {\n id String @id @default(cuid())\n email String @unique\n password String\n username String @unique\n role Role @default(USER)\n score Int @default(0)\n level Int @default(1)\n hp Int @default(1000)\n maxHp Int @default(1000)\n xp Int @default(0)\n maxXp Int @default(5000)\n avatar String?\n bio String?\n characterClass CharacterClass?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n preferences UserPreferences?\n eventRegistrations EventRegistration[]\n\n @@index([score])\n @@index([email])\n}\n\nmodel UserPreferences {\n id String @id @default(cuid())\n userId String @unique\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n\n // Background images for each page\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n\n // Other UI preferences can be added here\n theme String? @default(\"default\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n\nmodel Event {\n id String @id @default(cuid())\n date DateTime\n name String\n description String\n type EventType\n room String?\n time String?\n maxPlaces Int?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n registrations EventRegistration[]\n\n @@index([date])\n}\n\nmodel EventRegistration {\n id String @id @default(cuid())\n userId String\n eventId String\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)\n createdAt DateTime @default(now())\n\n @@unique([userId, eventId])\n @@index([userId])\n @@index([eventId])\n}\n\nmodel SitePreferences {\n id String @id @default(\"global\")\n homeBackground String?\n eventsBackground String?\n leaderboardBackground String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n}\n",
|
||||
"runtimeDataModel": {
|
||||
"models": {},
|
||||
"enums": {},
|
||||
@@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
}
|
||||
}
|
||||
|
||||
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"score\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"level\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"hp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"maxHp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"xp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"maxXp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avatar\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bio\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"characterClass\",\"kind\":\"enum\",\"type\":\"CharacterClass\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"preferences\",\"kind\":\"object\",\"type\":\"UserPreferences\",\"relationName\":\"UserToUserPreferences\"},{\"name\":\"eventRegistrations\",\"kind\":\"object\",\"type\":\"EventRegistration\",\"relationName\":\"EventRegistrationToUser\"}],\"dbName\":null},\"UserPreferences\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserPreferences\"},{\"name\":\"homeBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventsBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"leaderboardBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"theme\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Event\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"EventType\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"EventStatus\"},{\"name\":\"room\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"time\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"maxPlaces\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"registrations\",\"kind\":\"object\",\"type\":\"EventRegistration\",\"relationName\":\"EventToEventRegistration\"}],\"dbName\":null},\"EventRegistration\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"EventRegistrationToUser\"},{\"name\":\"event\",\"kind\":\"object\",\"type\":\"Event\",\"relationName\":\"EventToEventRegistration\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"SitePreferences\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"homeBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventsBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"leaderboardBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
|
||||
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Role\"},{\"name\":\"score\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"level\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"hp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"maxHp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"xp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"maxXp\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avatar\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bio\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"characterClass\",\"kind\":\"enum\",\"type\":\"CharacterClass\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"preferences\",\"kind\":\"object\",\"type\":\"UserPreferences\",\"relationName\":\"UserToUserPreferences\"},{\"name\":\"eventRegistrations\",\"kind\":\"object\",\"type\":\"EventRegistration\",\"relationName\":\"EventRegistrationToUser\"}],\"dbName\":null},\"UserPreferences\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"UserToUserPreferences\"},{\"name\":\"homeBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventsBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"leaderboardBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"theme\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"Event\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"EventType\"},{\"name\":\"room\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"time\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"maxPlaces\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"registrations\",\"kind\":\"object\",\"type\":\"EventRegistration\",\"relationName\":\"EventToEventRegistration\"}],\"dbName\":null},\"EventRegistration\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"EventRegistrationToUser\"},{\"name\":\"event\",\"kind\":\"object\",\"type\":\"Event\",\"relationName\":\"EventToEventRegistration\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null},\"SitePreferences\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"homeBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"eventsBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"leaderboardBackground\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}")
|
||||
|
||||
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
||||
const { Buffer } = await import('node:buffer')
|
||||
|
||||
@@ -856,7 +856,6 @@ export const EventScalarFieldEnum = {
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
type: 'type',
|
||||
status: 'status',
|
||||
room: 'room',
|
||||
time: 'time',
|
||||
maxPlaces: 'maxPlaces',
|
||||
@@ -953,13 +952,6 @@ export type EnumEventTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$Prisma
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'EventStatus'
|
||||
*/
|
||||
export type EnumEventStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'EventStatus'>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Float'
|
||||
*/
|
||||
|
||||
@@ -113,7 +113,6 @@ export const EventScalarFieldEnum = {
|
||||
name: 'name',
|
||||
description: 'description',
|
||||
type: 'type',
|
||||
status: 'status',
|
||||
room: 'room',
|
||||
time: 'time',
|
||||
maxPlaces: 'maxPlaces',
|
||||
|
||||
@@ -40,7 +40,6 @@ export type EventMinAggregateOutputType = {
|
||||
name: string | null
|
||||
description: string | null
|
||||
type: $Enums.EventType | null
|
||||
status: $Enums.EventStatus | null
|
||||
room: string | null
|
||||
time: string | null
|
||||
maxPlaces: number | null
|
||||
@@ -54,7 +53,6 @@ export type EventMaxAggregateOutputType = {
|
||||
name: string | null
|
||||
description: string | null
|
||||
type: $Enums.EventType | null
|
||||
status: $Enums.EventStatus | null
|
||||
room: string | null
|
||||
time: string | null
|
||||
maxPlaces: number | null
|
||||
@@ -68,7 +66,6 @@ export type EventCountAggregateOutputType = {
|
||||
name: number
|
||||
description: number
|
||||
type: number
|
||||
status: number
|
||||
room: number
|
||||
time: number
|
||||
maxPlaces: number
|
||||
@@ -92,7 +89,6 @@ export type EventMinAggregateInputType = {
|
||||
name?: true
|
||||
description?: true
|
||||
type?: true
|
||||
status?: true
|
||||
room?: true
|
||||
time?: true
|
||||
maxPlaces?: true
|
||||
@@ -106,7 +102,6 @@ export type EventMaxAggregateInputType = {
|
||||
name?: true
|
||||
description?: true
|
||||
type?: true
|
||||
status?: true
|
||||
room?: true
|
||||
time?: true
|
||||
maxPlaces?: true
|
||||
@@ -120,7 +115,6 @@ export type EventCountAggregateInputType = {
|
||||
name?: true
|
||||
description?: true
|
||||
type?: true
|
||||
status?: true
|
||||
room?: true
|
||||
time?: true
|
||||
maxPlaces?: true
|
||||
@@ -221,7 +215,6 @@ export type EventGroupByOutputType = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room: string | null
|
||||
time: string | null
|
||||
maxPlaces: number | null
|
||||
@@ -258,7 +251,6 @@ export type EventWhereInput = {
|
||||
name?: Prisma.StringFilter<"Event"> | string
|
||||
description?: Prisma.StringFilter<"Event"> | string
|
||||
type?: Prisma.EnumEventTypeFilter<"Event"> | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFilter<"Event"> | $Enums.EventStatus
|
||||
room?: Prisma.StringNullableFilter<"Event"> | string | null
|
||||
time?: Prisma.StringNullableFilter<"Event"> | string | null
|
||||
maxPlaces?: Prisma.IntNullableFilter<"Event"> | number | null
|
||||
@@ -273,7 +265,6 @@ export type EventOrderByWithRelationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
description?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
room?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
time?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
maxPlaces?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -291,7 +282,6 @@ export type EventWhereUniqueInput = Prisma.AtLeast<{
|
||||
name?: Prisma.StringFilter<"Event"> | string
|
||||
description?: Prisma.StringFilter<"Event"> | string
|
||||
type?: Prisma.EnumEventTypeFilter<"Event"> | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFilter<"Event"> | $Enums.EventStatus
|
||||
room?: Prisma.StringNullableFilter<"Event"> | string | null
|
||||
time?: Prisma.StringNullableFilter<"Event"> | string | null
|
||||
maxPlaces?: Prisma.IntNullableFilter<"Event"> | number | null
|
||||
@@ -306,7 +296,6 @@ export type EventOrderByWithAggregationInput = {
|
||||
name?: Prisma.SortOrder
|
||||
description?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
room?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
time?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
maxPlaces?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||
@@ -328,7 +317,6 @@ export type EventScalarWhereWithAggregatesInput = {
|
||||
name?: Prisma.StringWithAggregatesFilter<"Event"> | string
|
||||
description?: Prisma.StringWithAggregatesFilter<"Event"> | string
|
||||
type?: Prisma.EnumEventTypeWithAggregatesFilter<"Event"> | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusWithAggregatesFilter<"Event"> | $Enums.EventStatus
|
||||
room?: Prisma.StringNullableWithAggregatesFilter<"Event"> | string | null
|
||||
time?: Prisma.StringNullableWithAggregatesFilter<"Event"> | string | null
|
||||
maxPlaces?: Prisma.IntNullableWithAggregatesFilter<"Event"> | number | null
|
||||
@@ -342,7 +330,6 @@ export type EventCreateInput = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room?: string | null
|
||||
time?: string | null
|
||||
maxPlaces?: number | null
|
||||
@@ -357,7 +344,6 @@ export type EventUncheckedCreateInput = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room?: string | null
|
||||
time?: string | null
|
||||
maxPlaces?: number | null
|
||||
@@ -372,7 +358,6 @@ export type EventUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -387,7 +372,6 @@ export type EventUncheckedUpdateInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -402,7 +386,6 @@ export type EventCreateManyInput = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room?: string | null
|
||||
time?: string | null
|
||||
maxPlaces?: number | null
|
||||
@@ -416,7 +399,6 @@ export type EventUpdateManyMutationInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -430,7 +412,6 @@ export type EventUncheckedUpdateManyInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -444,7 +425,6 @@ export type EventCountOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
description?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
room?: Prisma.SortOrder
|
||||
time?: Prisma.SortOrder
|
||||
maxPlaces?: Prisma.SortOrder
|
||||
@@ -462,7 +442,6 @@ export type EventMaxOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
description?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
room?: Prisma.SortOrder
|
||||
time?: Prisma.SortOrder
|
||||
maxPlaces?: Prisma.SortOrder
|
||||
@@ -476,7 +455,6 @@ export type EventMinOrderByAggregateInput = {
|
||||
name?: Prisma.SortOrder
|
||||
description?: Prisma.SortOrder
|
||||
type?: Prisma.SortOrder
|
||||
status?: Prisma.SortOrder
|
||||
room?: Prisma.SortOrder
|
||||
time?: Prisma.SortOrder
|
||||
maxPlaces?: Prisma.SortOrder
|
||||
@@ -497,10 +475,6 @@ export type EnumEventTypeFieldUpdateOperationsInput = {
|
||||
set?: $Enums.EventType
|
||||
}
|
||||
|
||||
export type EnumEventStatusFieldUpdateOperationsInput = {
|
||||
set?: $Enums.EventStatus
|
||||
}
|
||||
|
||||
export type NullableIntFieldUpdateOperationsInput = {
|
||||
set?: number | null
|
||||
increment?: number
|
||||
@@ -529,7 +503,6 @@ export type EventCreateWithoutRegistrationsInput = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room?: string | null
|
||||
time?: string | null
|
||||
maxPlaces?: number | null
|
||||
@@ -543,7 +516,6 @@ export type EventUncheckedCreateWithoutRegistrationsInput = {
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room?: string | null
|
||||
time?: string | null
|
||||
maxPlaces?: number | null
|
||||
@@ -573,7 +545,6 @@ export type EventUpdateWithoutRegistrationsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -587,7 +558,6 @@ export type EventUncheckedUpdateWithoutRegistrationsInput = {
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
description?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
type?: Prisma.EnumEventTypeFieldUpdateOperationsInput | $Enums.EventType
|
||||
status?: Prisma.EnumEventStatusFieldUpdateOperationsInput | $Enums.EventStatus
|
||||
room?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
time?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
maxPlaces?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
@@ -632,7 +602,6 @@ export type EventSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
||||
name?: boolean
|
||||
description?: boolean
|
||||
type?: boolean
|
||||
status?: boolean
|
||||
room?: boolean
|
||||
time?: boolean
|
||||
maxPlaces?: boolean
|
||||
@@ -648,7 +617,6 @@ export type EventSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
||||
name?: boolean
|
||||
description?: boolean
|
||||
type?: boolean
|
||||
status?: boolean
|
||||
room?: boolean
|
||||
time?: boolean
|
||||
maxPlaces?: boolean
|
||||
@@ -662,7 +630,6 @@ export type EventSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensi
|
||||
name?: boolean
|
||||
description?: boolean
|
||||
type?: boolean
|
||||
status?: boolean
|
||||
room?: boolean
|
||||
time?: boolean
|
||||
maxPlaces?: boolean
|
||||
@@ -676,7 +643,6 @@ export type EventSelectScalar = {
|
||||
name?: boolean
|
||||
description?: boolean
|
||||
type?: boolean
|
||||
status?: boolean
|
||||
room?: boolean
|
||||
time?: boolean
|
||||
maxPlaces?: boolean
|
||||
@@ -684,7 +650,7 @@ export type EventSelectScalar = {
|
||||
updatedAt?: boolean
|
||||
}
|
||||
|
||||
export type EventOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "date" | "name" | "description" | "type" | "status" | "room" | "time" | "maxPlaces" | "createdAt" | "updatedAt", ExtArgs["result"]["event"]>
|
||||
export type EventOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "date" | "name" | "description" | "type" | "room" | "time" | "maxPlaces" | "createdAt" | "updatedAt", ExtArgs["result"]["event"]>
|
||||
export type EventInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||
registrations?: boolean | Prisma.Event$registrationsArgs<ExtArgs>
|
||||
_count?: boolean | Prisma.EventCountOutputTypeDefaultArgs<ExtArgs>
|
||||
@@ -703,7 +669,6 @@ export type $EventPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
||||
name: string
|
||||
description: string
|
||||
type: $Enums.EventType
|
||||
status: $Enums.EventStatus
|
||||
room: string | null
|
||||
time: string | null
|
||||
maxPlaces: number | null
|
||||
@@ -1138,7 +1103,6 @@ export interface EventFieldRefs {
|
||||
readonly name: Prisma.FieldRef<"Event", 'String'>
|
||||
readonly description: Prisma.FieldRef<"Event", 'String'>
|
||||
readonly type: Prisma.FieldRef<"Event", 'EventType'>
|
||||
readonly status: Prisma.FieldRef<"Event", 'EventStatus'>
|
||||
readonly room: Prisma.FieldRef<"Event", 'String'>
|
||||
readonly time: Prisma.FieldRef<"Event", 'String'>
|
||||
readonly maxPlaces: Prisma.FieldRef<"Event", 'Int'>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
-- RedefineTables
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "_Event_new" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"date" DATETIME NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"description" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"room" TEXT,
|
||||
"time" TEXT,
|
||||
"maxPlaces" INTEGER,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "_Event_new" ("id", "date", "name", "description", "type", "room", "time", "maxPlaces", "createdAt", "updatedAt") SELECT "id", "date", "name", "description", "type", "room", "time", "maxPlaces", "createdAt", "updatedAt" FROM "Event";
|
||||
DROP TABLE "Event";
|
||||
ALTER TABLE "_Event_new" RENAME TO "Event";
|
||||
CREATE INDEX "Event_date_idx" ON "Event"("date");
|
||||
PRAGMA foreign_keys=ON;
|
||||
|
||||
@@ -23,12 +23,6 @@ enum EventType {
|
||||
CODE_KATA
|
||||
}
|
||||
|
||||
enum EventStatus {
|
||||
UPCOMING
|
||||
LIVE
|
||||
PAST
|
||||
}
|
||||
|
||||
enum CharacterClass {
|
||||
WARRIOR
|
||||
MAGE
|
||||
@@ -89,7 +83,6 @@ model Event {
|
||||
name String
|
||||
description String
|
||||
type EventType
|
||||
status EventStatus
|
||||
room String?
|
||||
time String?
|
||||
maxPlaces Int?
|
||||
@@ -97,7 +90,6 @@ model Event {
|
||||
updatedAt DateTime @updatedAt
|
||||
registrations EventRegistration[]
|
||||
|
||||
@@index([status])
|
||||
@@index([date])
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
PrismaClient,
|
||||
EventType,
|
||||
EventStatus,
|
||||
CharacterClass,
|
||||
} from "@/prisma/generated/prisma/client";
|
||||
import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";
|
||||
@@ -147,61 +146,12 @@ async function main() {
|
||||
|
||||
// Créer des événements (vérifier s'ils existent déjà)
|
||||
const eventData = [
|
||||
{
|
||||
date: new Date("2025-11-18"),
|
||||
name: "Sommet de l'Innovation Tech",
|
||||
description:
|
||||
"Rejoignez les leaders de l'industrie et les innovateurs pour une journée de discussions sur les technologies de pointe, les percées de l'IA et des opportunités de networking.",
|
||||
type: EventType.SUMMIT,
|
||||
status: EventStatus.PAST,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-12-03"),
|
||||
name: "Lancement de la Révolution IA",
|
||||
description:
|
||||
"Assistez au lancement de systèmes d'IA révolutionnaires qui vont remodeler le paysage du gaming. Aperçus exclusifs et opportunités d'accès anticipé.",
|
||||
type: EventType.LAUNCH,
|
||||
status: EventStatus.PAST,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-12-22"),
|
||||
name: "Festival du Code d'Hiver",
|
||||
description:
|
||||
"Une célébration de l'excellence en programmation avec des hackathons, des défis de codage et des prix. Montrez vos compétences et rivalisez avec les meilleurs développeurs.",
|
||||
type: EventType.FESTIVAL,
|
||||
status: EventStatus.PAST,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-01-15"),
|
||||
name: "Expo Informatique Quantique",
|
||||
description:
|
||||
"Explorez l'avenir de l'informatique quantique dans le gaming. Démonstrations interactives, conférences d'experts et ateliers pratiques pour tous les niveaux.",
|
||||
type: EventType.SUMMIT,
|
||||
status: EventStatus.UPCOMING,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-02-08"),
|
||||
name: "Championnat Cyber Arena",
|
||||
description:
|
||||
"L'événement de gaming compétitif ultime. Compétissez pour la gloire, des récompenses exclusives et le titre de Champion Cyber Arena. Inscriptions ouvertes.",
|
||||
type: EventType.COMPETITION,
|
||||
status: EventStatus.UPCOMING,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-03-12"),
|
||||
name: "Gala Tech du Printemps",
|
||||
description:
|
||||
"Une soirée élégante célébrant les réalisations technologiques. Cérémonie de remise de prix, networking et annonces exclusives des plus grandes entreprises tech.",
|
||||
type: EventType.FESTIVAL,
|
||||
status: EventStatus.UPCOMING,
|
||||
},
|
||||
{
|
||||
date: new Date("2025-12-15"),
|
||||
name: "Builder pattern : construction et refactoring",
|
||||
description:
|
||||
"Lors de cet atelier, nous utiliserons le design pattern Builder pour structurer pas à pas la création d'objets complexes… sans transformer notre code en film digne de Red Is Dead.\n\nVous découvrirez comment ce pattern permet de découpler proprement la logique de construction, d'améliorer la lisibilité et de faciliter l'évolution du code — notamment lors de phases de refactoring où les responsabilités se mélangent plus vite que la foule au Palais des Festivals.\n\nL'objectif : poser les fondations pour introduire un vrai modèle, sans rien casser du comportement existant.\n\nQue vous souhaitiez renforcer vos compétences en conception, préparer votre prochain refactoring, ou simplement coder avec plus de style que Serge Karamazov dansant la carioca, venez construire avec nous.",
|
||||
type: EventType.CODE_KATA,
|
||||
status: EventStatus.UPCOMING,
|
||||
room: "Nautilus",
|
||||
time: "11h-12h",
|
||||
maxPlaces: 25,
|
||||
@@ -212,7 +162,6 @@ async function main() {
|
||||
description:
|
||||
"Nous manipulons tous, au quotidien, des données que nous devons combiner : additionner des montants, calculer des moyennes, regrouper des résultats, agréger des indicateurs. Pourtant, derrière ces opérations, se cachent souvent des règles implicites, des exceptions, amenant une complexité qui rend le code difficile à comprendre et à faire évoluer.\n\nLes monoids permettent d'aborder ces problématiques avec une grille de lecture claire et structurante. Ils reposent sur une idée simple : pour agréger correctement des valeurs, il faut savoir comment elles se combinent et définir ce qui représente une valeur neutre.\n\nCet atelier propose une approche progressive pour comprendre comment ce concept peut transformer la manière de modéliser et de concevoir des comportements métier. Nous découvrirons comment les monoids aident à réduire la charge cognitive et à rendre le code plus cohérent avec l'intention métier.",
|
||||
type: EventType.CODE_KATA,
|
||||
status: EventStatus.UPCOMING,
|
||||
room: "Nautilus",
|
||||
time: "11h-12h",
|
||||
maxPlaces: 25,
|
||||
@@ -223,7 +172,6 @@ async function main() {
|
||||
description:
|
||||
"Rech. proj. pr proj. priv. self-dem.brt. poss. S'adr.à l'hôt. MART.\n\nBien sûr, S'adr.à l'hôt. MART. et plus si affinités, c'est plus humain… mais pas forcément plus compréhensible : on a beau lire et relire le contenu de la méthode, on est quasiment sûr que son nom, il bluffe !\n\nFaut-il pour autant laisser de mauvais noms tromper 1000 fois 1000 personnes ?\n\nDans cette nouvelle session, nous appliquerons Naming as a Process, une méthode de refactoring progressive centrée sur le nommage.\n\nObjectif : faire émerger la logique métier à travers des noms clairs, précis et alignés avec l'intention réelle du code. Au fil des étapes, nous transformerons un bloc obscur en fonctions lisibles, maintenables et prêtes à danser la carioca.\n\nPrenez un chewing-gum, ouvrez votre IDE, et venez explorer un moyen simple de refactorer vers un code plus respectueux des principes S, puis O, D, I et L ...",
|
||||
type: EventType.CODE_KATA,
|
||||
status: EventStatus.UPCOMING,
|
||||
room: "Nautilus",
|
||||
time: "11h-12h",
|
||||
maxPlaces: 25,
|
||||
@@ -234,7 +182,6 @@ async function main() {
|
||||
description:
|
||||
"Les ateliers d'Event Storming permettent de faire émerger des Policies : des règles métier qui traduisent comment le système réagit à un événement ou déclenche une action. Sur le papier, tout est clair — mais au moment de coder, ces règles se diluent souvent dans des if/else, des services surchargés ou des comportements implicites.\n\nLe design pattern Rule offre une façon concrète de ramener ces Policies au cœur du code, sous une forme explicite, modulaire et testable. Chaque règle devient un objet du domaine, capable de dire si elle s'applique et d'exécuter sa logique, en respectant les invariants du modèle.\n\nCe pattern facilite la traduction du langage métier en code exécutable : les règles deviennent lisibles, combinables et extensibles en limitant la complexité.\n\nEn explorant le Rule Pattern, nous découvrirons ainsi comment faire vivre les Policies dans notre code, au service d'un modèle plus riche, plus compréhensible, et mieux aligné avec la connaissance du métier.",
|
||||
type: EventType.CODE_KATA,
|
||||
status: EventStatus.UPCOMING,
|
||||
room: "Nautilus",
|
||||
time: "11h-12h",
|
||||
maxPlaces: 25,
|
||||
@@ -245,24 +192,18 @@ async function main() {
|
||||
description:
|
||||
"Lorsque le code commence à vieillir, il arrive qu'une méthode ou une classe devienne trop risquée à modifier directement : effets de bord, dépendances invisibles, tests manquants... le moindre changement entraîne des régressions.\n\nLes Wrap Techniques offrent une approche sûre et progressive : plutôt que de changer directement le code existant, on l'enveloppe dans une nouvelle abstraction ou une nouvelle méthode. On peut alors introduire de la logique ou un nouveau comportement, en changeant le contrat initial, sans casser les tests.\n\nDurant cette session nous verrons comment et quand utiliser ces techniques et nous en explorerons leurs bénéfices : isolation du risque, refactorings incrémentaux, amélioration de la testabilité.\n\nNous mettrons bien sûr en pratique sur un exemple de code pour comprendre comment ces refactorings facilitent les transitions vers un meilleur design.",
|
||||
type: EventType.CODE_KATA,
|
||||
status: EventStatus.UPCOMING,
|
||||
room: "Nautilus",
|
||||
time: "11h-12h",
|
||||
maxPlaces: 25,
|
||||
},
|
||||
];
|
||||
|
||||
// Supprimer tous les événements existants avant de les recréer
|
||||
await prisma.event.deleteMany({});
|
||||
|
||||
// Créer les nouveaux événements (le statut est calculé automatiquement côté client)
|
||||
const events = await Promise.all(
|
||||
eventData.map(async (data) => {
|
||||
const existing = await prisma.event.findFirst({
|
||||
where: { name: data.name },
|
||||
});
|
||||
if (existing) {
|
||||
return prisma.event.update({
|
||||
where: { id: existing.id },
|
||||
data,
|
||||
});
|
||||
}
|
||||
return prisma.event.create({ data });
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user