Marketplace inversée (Next.js 16 App Router + Supabase Cloud) : auth, schéma + RLS, publication de besoins avec upload d'images, feed avec filtres, offres, acceptation via RPC, messagerie temps réel, dashboards, et Dockerfile pour déploiement Coolify.
35 lines
934 B
TypeScript
35 lines
934 B
TypeScript
import * as z from "zod";
|
|
|
|
export const NeedFormSchema = z.object({
|
|
title: z
|
|
.string()
|
|
.trim()
|
|
.min(5, { message: "5 caractères minimum." })
|
|
.max(120, { message: "120 caractères maximum." }),
|
|
description: z
|
|
.string()
|
|
.trim()
|
|
.min(20, { message: "20 caractères minimum." })
|
|
.max(2000, { message: "2000 caractères maximum." }),
|
|
categoryId: z.string().uuid({ message: "Choisis une catégorie." }),
|
|
city: z.string().trim().min(2, { message: "Ville requise." }),
|
|
region: z.string().trim().max(120).optional(),
|
|
budgetMin: z.string().optional(),
|
|
budgetMax: z.string().optional(),
|
|
});
|
|
|
|
export type NeedFormState =
|
|
| {
|
|
errors?: {
|
|
title?: string[];
|
|
description?: string[];
|
|
categoryId?: string[];
|
|
city?: string[];
|
|
region?: string[];
|
|
budgetMin?: string[];
|
|
budgetMax?: string[];
|
|
};
|
|
message?: string;
|
|
}
|
|
| undefined;
|