Commit Graph

14 Commits

Author SHA1 Message Date
01b4ed7633 feat(backend): voice extraction endpoint
POST /voice/extract behind JwtAuthGuard + ClinicOrgGuard, plus
GET /voice/availability so the frontend can decide whether to render the
microphone — it cannot learn that from NEXT_PUBLIC_*, which are baked in at
build time.

Audio is held in memory for the request only: never written to disk, never a
Prisma row. The transcript goes back to the client and is not persisted. What
is logged is structured and patient-free — clip length, which fields resolved,
unresolved count, vendor cost, outcome — with log lines as the interim sink
until this repo has metrics infrastructure.

On extraction failure the transcript still travels back in the error details,
so the words the clinician already paid for can be salvaged into a note.

v1 ships ungated beyond a configured locale profile; the Plan.features design
is deferred, not dropped.

From review of this commit, four of which were load-bearing:

- Express's 100 kb default body limit rejected any recording past ~20 seconds,
  making the endpoint unusable at its own 2-minute cap. Body parsers are now
  registered explicitly with a 10 MB limit scoped to the voice route only.
  Verified empirically: 600 KB reaches /api/voice/extract, while /api/auth/login
  still 413s.
- ThrottlerGuard keys on req.ip, so behind nginx the whole deployment would
  share one bucket and an abuser rotating IPs would bypass it. VoiceThrottlerGuard
  keys on the user id instead — with no plan gate, this is the only control on
  metered vendor spend.
- ThrottlerException had no 429 fallback and surfaced as INTERNAL_ERROR; the
  guard now throws VOICE_RATE_LIMITED directly.
- durationMs was optional, so omitting it bypassed VOICE_MAX_RECORDING_MS
  entirely. It is required.
- VOICE_UNSUPPORTED_FORMAT was dead code — the DTO's @IsIn already rejects
  unknown containers — so it is gone rather than left unreachable.

ThrottlerModule is deliberately not bound as a global APP_GUARD: a global
ThrottlerGuard rate-limits every route against every named throttler, which
would have capped the whole API at the voice limit.

All seven remaining VOICE_* codes have errors.* keys in en, fa and nl.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 18:27:14 +03:30
9f6ec193d2 feature: version one notification feature implemented. 2026-07-18 01:09:54 +03:30
2ad572f4c8 improvement: notify counter badge added to treatment and tasks tabs for upadted and edited cases. 2026-07-13 17:44:44 +03:30
22466490bf Add Today dashboard foundation with permission-aware KPI summary API.
Replace hardcoded Today cards with a backend summary endpoint and composable frontend widgets filtered by org type and tab permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 00:07:48 +03:30
cb63ced4e3 improvement: tasks and cases feature updated based on the new prosthesis types and their steps. the whole assignment proccess removed from the flow. 2026-07-07 15:31:09 +03:30
667b08ed0c TreatmentType and ProsthesisType database shcema and data updated. Lab dispatch wired through new data. 2026-07-06 20:40:19 +03:30
2a48946a51 feature: Tasks tab added for lab organizations. tasks now can be assigned and their status can be updated by the assignee. 2026-06-28 22:56:56 +03:30
21f545ebdb feature: Phase3 - Task templates + generation on send 2026-06-28 16:46:42 +03:30
f743046b38 feature: a minimal v1 backend implemented for treatments feature. 2026-05-19 22:29:29 +03:30
8123a94a3d feature: a minimal implementation of the appointment feature done. 2026-05-06 23:05:37 +03:30
adfb5b436e feature: clinic & lab invitation flow added. minimal ui implemented for organizations tab. 2026-05-05 19:50:07 +03:30
c39bd872bd feature: a minimal implementation of staff management is done. 2026-04-30 00:52:05 +03:30
6a3addd1ca feature: a very minimal patients feature implemented. it needs lots of improvments though 2026-04-29 13:32:22 +03:30
26bd35ae3c Initial commit: Full project structure
- Backend: NestJS with Docker
- Frontend: Next.js with Docker
- Nginx configuration for reverse proxy
- PostgreSQL setup
- Docker compose for orchestration
- Development environment configuration
2026-04-23 15:33:11 +03:30