Commit Graph

12 Commits

Author SHA1 Message Date
Ivan
422f5c4f29 feat(pos): add point of sale UI
- Add ProductGrid component with category filters and search
- Add Cart component with quantity controls and totals
- Add PaymentDialog with cash/card/transfer payment methods
- Add CashRegisterStatus for opening/closing register
- Add POS page with 70/30 layout (products/cart)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 07:03:59 +00:00
Ivan
cca3b50a6d feat(api): add sales and cash register endpoints
Add complete POS (Point of Sale) backend:
- Sales API: list with filters, create with atomicity (stock updates), void/cancel
- Cash register API: open/close registers, get details with payment breakdown
- Transactions API: list transactions, add manual deposits/withdrawals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:58:52 +00:00
Ivan
c298b23b35 feat(api): add products and categories endpoints
Add API endpoints for the POS module:
- GET/POST /api/products/categories - List and create product categories
- GET/POST /api/products - List products with filters and create new products
- GET/PUT/DELETE /api/products/[id] - CRUD operations for individual products
- POST /api/products/[id]/stock - Adjust product stock with validation

Features include:
- Zod validation for all inputs
- Organization-scoped access control
- Low stock indicator (stock < minStock)
- Soft delete for products (isActive = false)
- Stock adjustment with reason tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:54:35 +00:00
Ivan
cdf6e8ebe6 feat(bookings): add calendar UI with booking creation
- Add TimeSlot component with available/booked visual states
- Add BookingCalendar component with date navigation and court columns
- Add BookingDialog for creating bookings and viewing/cancelling existing ones
- Add bookings page with calendar integration
- Fix sidebar navigation paths for route group structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:50:22 +00:00
Ivan
ef21748191 feat(api): add bookings CRUD and payment endpoints
- Add bookings list/create API with filters (siteId, date, status)
- Add booking detail, update, and delete endpoints
- Add payment processing endpoint with transaction support
- Add clients list/search and create API
- Implement membership discounts (free hours and percentage)
- Validate requests with Zod schemas from shared package
- Include Spanish error messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:44:54 +00:00
Ivan
d3413c727f feat(api): add courts and availability endpoints
Add REST API endpoints for court management and availability:
- GET/POST /api/courts for listing and creating courts
- GET/PUT/DELETE /api/courts/[id] for single court operations
- GET /api/courts/[id]/availability for time slot availability
- GET /api/sites for listing organization sites

Features include organization-based filtering, role-based access control,
premium pricing for evening/weekend slots, and booking conflict detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:38:13 +00:00
Ivan
fd28bf67d8 feat(layout): add admin panel layout with sidebar and header
- Add Sidebar component with navigation items (dashboard, bookings, tournaments, pos, clients, memberships, reports, settings)
- Add Header component with SiteSwitcher and user info/logout
- Add SiteSwitcher component for SUPER_ADMIN multi-site selection
- Add admin layout wrapper with AuthProvider
- Add placeholder Dashboard page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:30:25 +00:00
Ivan
d1cc0c0b58 feat(ui): add shadcn/ui base components
- Add clsx, tailwind-merge, class-variance-authority dependencies
- Add Radix UI primitives (dialog, dropdown-menu, label, select, tabs, toast, slot)
- Add lucide-react for icons
- Create components.json for shadcn/ui configuration
- Create lib/utils.ts with cn(), formatCurrency(), formatDate(), formatTime()
- Create Button component with variants (default, destructive, outline, secondary, ghost, link, accent)
- Create Input component with focus ring styling
- Create Card components (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:26:25 +00:00
Ivan
a7284925e6 feat(auth): add NextAuth.js with credentials provider
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:24:07 +00:00
Ivan
981783babb feat(db): add Prisma schema with all models
Configure Prisma ORM with PostgreSQL database schema including:
- Organization, Site, Court models for multi-tenancy
- User with role-based access and Client for customers
- Booking and Payment models for reservations
- MembershipPlan and Membership for subscriptions
- Product, Sale, SaleItem, CashRegister for POS
- Tournament, TournamentInscription, Match for competitions
- All necessary enums, relations, indexes, and cascading deletes
- Prisma client singleton for Next.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:17:02 +00:00
Ivan
039c17352b feat(web): add Next.js 14 app with Tailwind CSS
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:10:02 +00:00
Ivan
a5a68cc54d chore: initialize monorepo with Turborepo and pnpm
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 06:08:36 +00:00