# Fix TypeScript errors in test mocks Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Update mock data IDs from numbers to UUID strings and add missing 'code: number' property to ActionResponse mocks in specified test files.

**Architecture:** Systematic update of test files to comply with `ActionResponse` type definitions and ID string requirements.

**Tech Stack:** TypeScript, Vitest, Next.js 15

---

### Task 1: Update app/api/dashboard/eu-responsible-persons/route.test.ts

**Files:**
- Modify: `app/api/dashboard/eu-responsible-persons/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'` in `mockPerson` and payload.
  - Add `code: 200` to `ActionSuccessResponse` mocks (or `201` for POST if appropriate).
  - Ensure `ActionErrorResponse` mocks have `code: 400` or `500`.

### Task 2: Update app/api/dashboard/manufacturers/route.test.ts

**Files:**
- Modify: `app/api/dashboard/manufacturers/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'`.
  - Add `code: 201` for POST success mock.
  - Add `code: 200` for PUT/DELETE success mocks.

### Task 3: Update app/api/dashboard/suppliers/route.test.ts

**Files:**
- Modify: `app/api/dashboard/suppliers/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'`.
  - Add `code` property to all `ActionResponse` mocks.

### Task 4: Update app/api/dashboard/tax-classes/route.test.ts

**Files:**
- Modify: `app/api/dashboard/tax-classes/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'`.
  - Add `code` property to all `ActionResponse` mocks.

### Task 5: Update app/api/dashboard/users/route.test.ts

**Files:**
- Modify: `app/api/dashboard/users/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'`.
  - Add `code` property to all `ActionResponse` mocks.

### Task 6: Update tests/api/dashboard/attributes/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/attributes/route.test.ts`

- [ ] **Step 1: Add code property to ActionResponse mocks**
  - IDs are already strings, just add `code: 201` for POST and `code: 200` for PUT/DELETE.

### Task 7: Update tests/api/dashboard/brands/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/brands/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**

### Task 8: Update tests/api/dashboard/customers/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/customers/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**

### Task 9: Update tests/api/dashboard/eu-responsible-persons/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/eu-responsible-persons/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**

### Task 10: Update tests/api/dashboard/manufacturers/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/manufacturers/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**

### Task 11: Update tests/api/dashboard/suppliers/route.test.ts

**Files:**
- Modify: `tests/api/dashboard/suppliers/route.test.ts`

- [ ] **Step 1: Update mock IDs and add code property to ActionResponse mocks**

### Task 12: Update tests/regression/actions-redirect.test.ts

**Files:**
- Modify: `tests/regression/actions-redirect.test.ts`

- [ ] **Step 1: Update IDs passed to server actions from numbers to UUID strings**
  - Change `id: 1` to `id: '550e8400-e29b-41d4-a716-446655440000'`.

### Task 13: Final Verification

- [ ] **Step 1: Run type checking to ensure all errors are fixed**
  - Run `pnpm tsc --noEmit` or similar.
- [ ] **Step 2: Run the updated tests to ensure they pass**
  - Run `pnpm vitest run [file_paths]`.
