# Implementation Plan: Global Test Stabilization

## Phase 1: Core Action Stabilization
- [x] Task: **Mock Stabilization**
    - Refactor `vi.mock("@/actions/catalog")` and `vi.mock("@/lib/auth-utils")` project-wide to match new exports.
- [x] Task: **Fulfillment & Checkout (Internal)**
    - Refactor `lib/internal/fulfillment.ts` to Repository Pattern.
    - Standardize actions in `actions/checkout.ts`.
    - Achieve 100% test pass rate in `tests/unit/lib/internal/fulfillment*`.

## Phase 2: Action Refactoring & Testing
- [x] Task: **Orders Action Refactoring**
    - Refactor `actions/orders.ts` to Repository Pattern.
    - Standardize `orders.ts` with `createServerAction`.
    - Achive 100% TDD coverage.
- [x] Task: **Customers Action Refactoring**
    - Refactor `actions/customers.ts` to Repository Pattern.
    - Standardize `customers.ts` with `createServerAction`.
    - Achive 100% TDD coverage.
- [x] Task: **Sales & Settings Action Refactoring**
    - Refactor `actions/sales.ts` and `actions/settings.ts` to Repository Pattern.
    - Standardize with `createServerAction`.
    - Achive 100% TDD coverage.

## Phase 3: Component & Integration Fixes
- [x] Task: **Dashboard Components Integration**
    - Fix all failing dashboard component tests (`ProductForm`, `UserForm`) by updating Server Action mock signatures.
- [x] Task: **API Route Stabilization**
    - Standardize `app/api/dashboard/*` to handle new `ActionResponse` format consistently.

## Phase 4: Final Verification
- [x] Task: **Global CI Check**
    - Run `pnpm run build`.
    - Run `pnpm run test` (Expecting 0 failures).
    - Generate Final Coverage Report.

## Phase: Review Fixes
- [x] Task: Apply review suggestions cb47fc7
