# Mocking Library (`src/mocking`)

This directory contains the mocking infrastructure for the API Cloud Core. It provides realistic data generation for testing and demo purposes without requiring a real backend.

## Key Components

### `ProjectMock`
The main entry point for mocking a project environment. It aggregates various sub-mocks to simulate a complete project context.

**Usage:**
```typescript
import { ProjectMock } from './ProjectMock';

const mock = new ProjectMock();
// Access sub-mocks
console.log(mock.user);
console.log(mock.projectRequest);
```

### `ModelingMock` & `LegacyMock`
Specialized mocks for specific domains:
- `ModelingMock`: Logic for API domain modeling.
- `LegacyMock`: Support for older systems or deprecated interfaces.

## Directory Structure

- **`lib/`**: Contains the individual mock implementations.
    - `DataCatalog.ts`: Generates `DataCatalogSchema` objects using `faker`.
    - `File.ts`, `User.ts`, `Request.ts`: Other domain-specific entities.
    - **Pattern**: Classes in `lib/` usually provide methods like `entityName(init)` and `entityNames(size, init)` to generate single or multiple mock objects.
- **`legacy/`**: Old mock implementations kept for backward compatibility. Use with caution.

## Developing Mocks

When adding a new mock:
1. Create a class in `lib/` (e.g., `NewEntity.ts`).
2. Use `@faker-js/faker` for realistic random data.
3. Allow overrides via a partial `init` parameter.
4. Export single and list generation methods.
5. Register it in `ProjectMock.ts` if it belongs to the global project context.
