Initial marketplace implementation
Full-stack marketplace for buying/selling second-hand items. React 19 + TypeScript + Tailwind CSS v4 frontend with 17 screens, Express + Prisma + Socket.io backend, Stripe payments, JWT auth. Deployed at https://marketplace.173.212.212.157.sslip.io/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
13
server/src/validators/listing.ts
Normal file
13
server/src/validators/listing.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const createListingSchema = z.object({
|
||||
title: z.string().min(3, 'Title must be at least 3 characters').max(100),
|
||||
description: z.string().min(10, 'Description must be at least 10 characters').max(2000),
|
||||
price: z.number().positive('Price must be positive'),
|
||||
obo: z.boolean().optional().default(false),
|
||||
category: z.enum(['ELECTRONICS', 'FURNITURE', 'CLOTHING', 'HOME_GARDEN', 'SPORTS', 'BOOKS', 'GAMES', 'VEHICLES', 'OTHER']),
|
||||
condition: z.enum(['NEW', 'LIKE_NEW', 'GENTLY_USED', 'USED', 'FAIR']),
|
||||
location: z.string().min(2, 'Location is required'),
|
||||
});
|
||||
|
||||
export const updateListingSchema = createListingSchema.partial();
|
||||
Reference in New Issue
Block a user