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

+16 -1
View File
@@ -278,7 +278,12 @@ schemas:
- domain
MatchUnknownReason:
type: string
description: Bounded explanation for an unknown component, not a hiding reason.
description: >-
Bounded explanation for an unknown component, not a hiding reason.
`cohort_below_30` is reported only while the comparable real cohort of
the category is smaller than the versioned minimum; once the cohort
reaches the minimum but the percentile is still not computed, the reason
is `percentile_not_computed`. In both cases T is the neutral 0.5.
enum:
- ml_unavailable
- cohort_below_30
@@ -287,6 +292,7 @@ schemas:
- need_field_unconfirmed
- no_freshness_history
- no_response_history
- percentile_not_computed
MatchUnknownFlag:
type: object
description: A safe, bounded explanation for one unavailable component.
@@ -567,8 +573,17 @@ schemas:
required:
- source
- groups
- truncated
properties:
source:
$ref: "#/schemas/MatchSearchSource"
groups:
$ref: "#/schemas/MatchSearchGroups"
truncated:
type: boolean
description: >-
True when the groups are not the whole ranked result: a group exceeded
the versioned per-group limit, or the organization's card-view
allowance ended while the entries were being revealed. The entries
returned are in rank order and already counted as card views. It
carries no total, so it does not reveal how many candidates match.
@@ -0,0 +1,131 @@
schemas:
NotificationKind:
type: string
description: |-
Which event put the notification into the inbox. The inbox stores a reference to the event, never its text.
- invitation_delivered: an invitation reached the candidate's inbox. This is the in-platform delivery state of the invitation: it does not depend on any email, and a failed or missing email never blocks it. The invitation operations are planned; no invitation produces a notification yet.
- synthetic: a synthetic notice that exercises the inbox path (the event, the read-time visibility check, the list, and the read state). It has no product meaning, needs no action, and is never produced by a user action.
Adding a value is a contract change; a client shows an unknown kind with the generic text of an item without content.
enum:
- invitation_delivered
- synthetic
NotificationContent:
type: object
description: >-
The text of a notification as the current source shows it to the
recipient now. It is computed on every read and never stored, so a
hiding, a revoked membership, or a withdrawn source removes it from the
next read. It holds no contact, no score, and no result of an
assessment.
additionalProperties: false
required:
- title
- summary
- link_path
properties:
title:
type: string
minLength: 1
maxLength: 120
description: Short heading in Russian.
summary:
type: string
minLength: 1
maxLength: 500
description: One or two sentences in Russian. Plain text, never markup.
link_path:
type:
- string
- "null"
maxLength: 256
pattern: "^/[A-Za-z0-9/_-]{0,255}$"
description: >-
Same-origin absolute path of the screen that the notification
opens, or null when there is none. It has no origin, query,
fragment, or escape; a client opens it only as a path of its own
router.
examples:
- /candidate/invitations
Notification:
type: object
description: >-
One item of the inbox of the current account. Its identity, kind,
organization, delivery time, and read state are stored; its content is
resolved from the current source on every read.
additionalProperties: false
required:
- id
- kind
- organization_id
- delivered_at
- read_at
- content
properties:
id:
type: string
format: uuid
description: >-
Identifier of the item. It equals the identifier of the event that
produced it, so a repeated delivery of the same event is the same
item.
kind:
$ref: "#/schemas/NotificationKind"
organization_id:
type: string
format: uuid
description: >-
The organization context of the item: the organization that sent it
to a candidate, or the organization whose cabinet holds it for an
employer. The identifier is not a right to read the organization.
delivered_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
read_at:
description: >-
When the recipient first marked the item read, or null while it is
unread. A repeated mark keeps the first time.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
content:
description: >-
The current content, or null when the source is gone or the
recipient may not see it now. A client then shows a generic line
such as "The content is no longer available" and never an old
copy. The item stays in the list and can be marked read.
oneOf:
- $ref: "#/schemas/NotificationContent"
- type: "null"
NotificationList:
type: object
description: One page of the inbox, newest delivery first.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Items of the page.
items:
$ref: "#/schemas/Notification"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
NotificationReadReceipt:
type: object
description: >-
The read state of one item after a mark. It carries no content, so
marking never reads the source.
additionalProperties: false
required:
- id
- read_at
properties:
id:
type: string
format: uuid
description: Identifier of the marked item.
read_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"