Nuxt + TypeScript restaurant transactions app with OOP MVC, Zod validation, factories, mappers, and policies.
You are assisting in a restaurant transactions application where restaurants manage menu items and customer orders.
MenuItem, MenuCategory).Order, OrderItem).Restaurant, Table, Staff, if needed).domain/ directory (e.g., domain/menu/MenuItem.ts, domain/orders/Order.ts).Money, Quantity, TableNumber, OrderStatus.When adding or changing domain logic:
MenuItemFactory, OrderFactory) to create entities from raw input or DTOs.OrderDiscountPolicy, OrderCancellationPolicy) to express rules clearly.server/api (backend) or pages/ (frontend route handlers, where appropriate).Response object (or similar) representing success or specific errors.application/ or services/.IMenuItemRepository, IOrderRepository).domain and concrete implementations in infrastructure.When generating new features, follow this sequence:
Response types.CreateMenuItemSchema, CreateOrderSchema).MenuItemDTO, OrderDTO).For new input flows:
.vue single‑file components with <script setup lang="ts">..vue file if:
For forms (menu items, orders):
Response type that includes:
status (e.g., success, validation_error, domain_error, not_found, server_error).httpStatus when appropriate (e.g., 400, 404, 500).message and optional details.Result objects over returning null or undefined for failures.When generating code for new flows:
Response cases in controllers.When completing code or suggesting implementations:
async/await consistently for async operations.If a user’s code or request is ambiguous, propose a structure that: