feat(platform): add the notification inbox and deterministic match search

This commit is contained in:
shira committed 2026-10-09 13:14:46 +03:00
1 parent 5edff21d2d
commit 0b11021b16
169 files changed
+17083 -443

No files matched your search

+6
View File
@@ -124,6 +124,12 @@ The tests take their fixtures from the named contract examples in `api/core/open
Candidates can use `/candidate/support/cases/manual-assessment` to submit a support request with a specialization, desired grade, and description. This does not run automatic assessment, create an attempt, change C3, or grant a confirmed grade. The hint under the specialization and grade selectors uses the published grades from the catalog but does not promise a rubric: the server pins the version on submission. The case page displays the status and rubric version returned by the server and, for `null`, says plainly that no published rubric existed when the request was made; the client does not create an outcome. After a page reload the form loses its idempotency key, and a repeated submission while a manual assessment of the same specialization is open receives 409; the page explains this and links to "My cases" without creating a second request.
## Notifications
`features/notifications` shows the inbox of the signed-in account at `/candidate/notifications` and `/employer/notifications`, and each shell links to it. `NotificationInbox` takes a scope: the candidate cabinet, or one organization. `OrganizationNotificationInbox` chooses the organization from the active memberships of the account (the `organization_id` parameter keeps the choice across reloads) and renders the inbox. The list is read on every visit and window focus and is never kept (`gcTime: 0`); the cached pages are keyed by account and cabinet and dropped when the account or the session changes or when the server refuses access.
The server resolves the text of every item from its current source. An item without content stays in the list with a generic line, and the client never shows an earlier copy. The read state is a word ("Не прочитано" or "Прочитано"), not only a style. "Отметить прочитанным" is a native button, sends the CSRF token of the session (read at call time; after a 403 it reads the session again and retries once, and only a 401 or 404 counts as lost access), and moves focus to the heading of the item after it succeeds, with a polite status message. A content link opens only if it is a same-origin path inside the cabinet that shows it. States: loading, empty, error with retry, forbidden (including a membership that ended), and "Показать еще" for the next page. Component tests render markup in Node; the keyboard path and the delivery of a real event are checked by `frontend/e2e/notifications.spec.ts`.
## API client generation
`make -C frontend generate` runs Orval with `codegen/orval.config.ts` and then `codegen/mock-patterns.ts`. For a string with a `pattern`, Orval 8.40 writes `faker.helpers.fromRegExp(pattern)` into the MSW mock: faker prints the `^` and `$` anchors and `(?:...)` groups as plain text, and Orval ignores `minLength` and `maxLength` when a `pattern` is present. The second step replaces such calls with `fakeFromPattern(pattern, {minLength, maxLength})` from `src/shared/api/mock-pattern.ts`. It takes the length bounds from the OpenAPI contract by the name of the property that holds the call and by the pattern. The step fails when a call has an unexpected form, when the contract has no such property with that pattern, or when the matching schemas disagree on the length bounds. It leaves its own output unchanged, so generation is reproducible and `make check-generated` stays stable. Enums in the mocks are written as literals (`enumGenerationType: "union"`): `Object.values` of a `zod.enum` returns Zod internals, not the values.