diff --git a/src/lib/admin/carbets.ts b/src/lib/admin/carbets.ts index 6873d2a..b6e1a92 100644 --- a/src/lib/admin/carbets.ts +++ b/src/lib/admin/carbets.ts @@ -3,8 +3,9 @@ */ import "server-only"; +import { Prisma } from "@/generated/prisma/client"; import { prisma } from "@/lib/prisma"; -import { AccessType, CarbetStatus, TransportMode, UserRole } from "@/generated/prisma/enums"; +import { AccessType, CarbetStatus, UserRole } from "@/generated/prisma/enums"; export type AdminCarbetListItem = { id: string; @@ -29,7 +30,7 @@ export type AdminCarbetFilters = { }; export async function listCarbetsAdmin(filters: AdminCarbetFilters = {}): Promise { - const where: Parameters[0]["where"] = {}; + const where: Prisma.CarbetWhereInput = {}; if (filters.q) { where.OR = [ { title: { contains: filters.q, mode: "insensitive" } }, @@ -112,19 +113,5 @@ export async function getCarbetForEdit(id: string) { }); } -export const ACCESS_TYPE_OPTIONS: { value: AccessType; label: string }[] = [ - { value: AccessType.ROAD_AND_RIVER, label: "🛣️ Route + fleuve" }, - { value: AccessType.RIVER_ONLY, label: "🛶 Expédition fleuve" }, -]; - -export const TRANSPORT_MODE_OPTIONS: { value: TransportMode; label: string }[] = [ - { value: TransportMode.SELF_ARRANGE, label: "🗺️ À organiser par le voyageur" }, - { value: TransportMode.OWNER_PROVIDES, label: "👤 Le loueur fournit" }, - { value: TransportMode.PARTNER_PROVIDER, label: "🤝 Partenaire référencé" }, -]; - -export const STATUS_OPTIONS: { value: CarbetStatus; label: string }[] = [ - { value: CarbetStatus.DRAFT, label: "Brouillon" }, - { value: CarbetStatus.PUBLISHED, label: "Publié" }, - { value: CarbetStatus.ARCHIVED, label: "Archivé" }, -]; +// Options enum déplacées dans `./carbet-options.ts` pour être importables +// depuis les composants client (ce fichier-ci est server-only).