# Specification: Jomblo 2-Wochen GO-LIVE & Qualitäts-Sprint

## 1. Overview
The goal of this track is to make the Jomblo E-Commerce platform live-ready within 14 days by resolving technical debt, enforcing architecture standards, and achieving 100% test coverage for critical flows.

## 2. Functional Requirements

### Part 1: All-Scan Phase (Days 1-3)
- **Day 1: Strictness & Type-Scan**
    - Execute `tsc --noEmit` and resolve all TypeScript errors.
    - Execute `pnpm lint` and resolve all linter warnings/errors.
    - **Note**: This is the top priority for the first 48 hours.
- **Day 2: Architecture & Pattern-Scan**
    - Scan all actions in `app/`. Ensure they use the `createServerAction` wrapper from `@/lib/actions`.
    - Scan all database calls. Ensure no raw SQL exists outside of `lib/db/repositories/`.
    - Sync all Zod schemas with database enums/types to prevent validation crashes. **Memory Hint**: Use `z.coerce.number()` for numeric fields as PostgreSQL returns them as strings.
- **Day 3: UI/UX & Mobile-Scan**
    - Audit all dashboard and shop views for responsive design (Standard widths).
    - Ensure `flex-wrap` is applied to action buttons in restricted containers.
    - Verify skeletons and error boundaries for all pages.
    - Implement "mounted" checks for dynamic UI components to prevent hydration mismatches.

### Part 2: Quality & Aesthetics (Days 4-14)
- **Day 4-5: Anti-Mocking Test-Sprint**
    - Focus on **Admin Product CRUD**.
    - Implement integration tests using real database instances. **Memory Hint**: Use `resetPool()` in `lib/db.ts`.
- **Day 6: UI State & Performance**
    - Audit `useEffect`, `useMemo`, and `useCallback` usage to prevent infinite loops and redundant re-renders.
- **Day 7: Security & Dependency Audit**
    - Run `pnpm audit` and resolve vulnerabilities.
    - Verify route protection and authentication flows.
- **Week 2**: Aesthetics & Final Polish (to be refined after Week 1).

## 3. Non-Functional Requirements
- **Performance**: 
    - Dashboard pages must load within 1s (P95).
    - All charts/BI summaries must be wrapped in `Suspense` boundaries.
- **Reliability**: 100% test coverage for the **Admin Product CRUD** flow.
- **Design**: Adhere to `Uncodixfy` standards (e.g., `hover:scale-[1.02]`, border radius `0.5rem`).

## 4. Acceptance Criteria
1. `tsc --noEmit` and `pnpm lint` pass with zero errors/warnings.
2. All Server Actions use the `createServerAction` wrapper.
3. All DB access is encapsulated in repositories.
4. Admin Product CRUD flow has 100% test coverage with real DB tests.
5. Dashboard and Shop are fully responsive across standard breakpoints.

## 5. Implementation Protocol
- **No Ambiguity Clause**: Implementers MUST provide line numbers and code snippets for all proposed changes. No speculative inference allowed.
- **Resource Budgets**: 
    - API Latency: <200ms for CRUD operations.
    - Bundle Size: Main entry point <200kB (Gzipped).
