# user-import/

## Files

| File | What | When to read |
| ---- | ---- | ------------ |
| `README.md` | Feature overview, architecture, API endpoints, performance benchmarks | Understanding user-import functionality, import modes, tradeoffs |
| `index.ts` | Feature barrel export | Importing user-import service or types |

## Subdirectories

| Directory | What | When to read |
| --------- | ---- | ------------ |
| `domain/` | Core business logic: import orchestration, archive extraction, types | Implementing import logic, understanding data flow |
| `api/` | HTTP handlers, route definitions, validation schemas | API endpoint development, request handling |
| `tests/` | Integration tests with performance benchmarks | Testing, understanding test scenarios |

## domain/

| File | What | When to read |
| ---- | ---- | ------------ |
| `user-import.types.ts` | Type definitions for manifest, validation, preview, results, config | Understanding data structures, import contracts |
| `user-import.service.ts` | Main import orchestration: merge/replace modes, batch operations | Import workflow, conflict resolution, transaction handling |
| `user-import-archive.service.ts` | Archive extraction, validation, manifest parsing | Archive format validation, file extraction logic |

## api/

| File | What | When to read |
| ---- | ---- | ------------ |
| `user-import.controller.ts` | HTTP handlers for upload, import, preview endpoints | Multipart upload handling, endpoint implementation |
| `user-import.routes.ts` | Fastify route registration | Route configuration, middleware setup |
| `user-import.validation.ts` | Zod schemas for request validation | Request validation rules |

## tests/

| File | What | When to read |
| ---- | ---- | ------------ |
| `user-import.integration.test.ts` | End-to-end tests: export-import cycle, performance, conflicts, replace mode | Test scenarios, performance requirements, error handling |
