# Cursor IDE rules for LOMA-PORTAL
# Mirrors the essentials of CLAUDE.md. Keep both files in sync.

## Stack
- Frontend: Angular 19 (Signals, Standalone) primary; Next.js 15 (App Router) secondary.
- Backend: .NET 9 (Clean Architecture, MediatR, EF Core) primary; NestJS 11 secondary.
- DB: PostgreSQL (Prisma) primary; SQL Server (EF) secondary; Redis cache.
- Realtime: SignalR + WebSocket. Queue: Hangfire (.NET) + BullMQ (Node).

## Hard rules
- TypeScript strict, C# nullable enabled.
- No magic strings. Centralize constants under `*/constants/`.
- API response shape: `{ success, message, data }` (+ `page, pageSize, total` for lists).
- Soft delete with `deletedAt`. Audit fields on all entities.
- Angular components: Standalone + `ChangeDetectionStrategy.OnPush` + Signals. Separate `.html`/`.scss`.
- HTTP from frontend goes through `ApiService` wrapper. Never inject `HttpClient` into components.
- All controller methods are `async Task<...>` with `CancellationToken` threaded to EF.
- EF reads: `AsNoTracking() + .Select()` projection directly to response DTOs.
- UI text is never hardcoded — route through i18n (Transloco for Angular, next-intl for Next).
- Do not edit `.env*`, `appsettings.*.json`, or `platform/secrets/**`.

## Generation hygiene
- No speculative features. Implement only what is asked.
- No backwards-compat shims unless explicitly requested.
- No defensive fluff (no try/catch around things that can't fail).
- Comments only when WHY is non-obvious. Never narrate WHAT.
- Prefer editing existing files over creating new ones.

## Architecture direction
- Direction: app → package → enterprise-module. Never the reverse.
- Apps MUST NOT import from other apps.
- Modules MUST NOT depend on `apps/` or on other modules' internals.

See `CLAUDE.md` and `AGENTS.md` for the full charter.
