# Task 022 — Settings

## Objective

Implement settings area for profile, locale, integration status, pipeline stage config, and admin user management basics.

## Scope

- Settings API for non-secret org config
- UI `/settings` with sections: Profile, Integrations, Pipeline, Users (admin)
- Display integration configured yes/no from env (never show secrets)
- Optional: editable pipeline stage labels/order

**Out of scope:** Full SSO, billing.

## Requirements

1. Locale preference `ar` | `en` stored on user.
2. Admin can deactivate users.
3. Pipeline stages readable by opportunity module.

## Files to create or modify

| Path | Action |
|------|--------|
| `src/app/settings/**` | Create |
| `src/app/api/settings/**` | Create |
| `src/models/settings.ts` | Create |
| `docs/04-ui-pages.md` | Settings |
| `docs/07-leads-pipeline.md` | Configurable stages note |
| `docs/16-changelog.md` | Entry |

## Acceptance criteria

- [ ] User updates profile and locale
- [ ] Admin sees SMTP/IMAP/n8n configured status
- [ ] Pipeline stages update reflects in kanban

## Documentation updates required

- `docs/04-ui-pages.md`
- `docs/02-database-schema.md` (settings)
- `docs/16-changelog.md`
