feat(api): add support case and manual assessment request contract

This commit is contained in:
shira committed 2026-10-06 10:57:36 +03:00
1 parent 2db585fbff
commit ad4bb94426
65 files changed
+14629 -23

No files matched your search

+549
View File
@@ -2824,3 +2824,552 @@ CandidateQuestionnaireUpdate:
$ref: '#/QuestionnaireSpecialization'
work_context:
$ref: '#/WorkContext'
SupportCaseNumber:
type: string
minLength: 14
maxLength: 18
pattern: ^SC-[0-9]{4}-[0-9]{6,10}$
description: 'Human-readable case number that the server assigns on creation, for example `SC-2026-000123`: the prefix `SC`, the UTC year of creation, and a sequence number of at least six digits with leading zeros. The sequence is global and never reused, so the number is unique across every case and year and never changes. The user quotes it in letters and calls; the API addresses a case only by its `id`. Clients show the number as text and never parse it.'
examples:
- SC-2026-000123
SupportCaseType:
type: string
description: 'Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.
- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.
- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.
- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.
- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.
- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'
enum:
- support
- complaint
- grade_appeal
- anticheat_appeal
- manual_assessment
SupportCaseStatus:
type: string
description: 'Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.
- submitted: the case was accepted and waits in its queue.
- in_review: support or a moderator works on it.
- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.
- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.
- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.
- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'
enum:
- submitted
- in_review
- waiting_for_user
- waiting_expert
- resolved
- closed
SupportCaseObjectType:
type: string
description: 'Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.
- assessment_attempt: an assessment attempt of the caller.
- organization: an organization that the caller can see.
- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.
- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'
enum:
- assessment_attempt
- organization
- invitation
- support_case
SupportCaseObjectReference:
type: object
description: Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person's object exists. The case keeps only the type and the identifier, never a copy of the object.
additionalProperties: false
required:
- type
- id
properties:
type:
$ref: '#/SupportCaseObjectType'
id:
type: string
format: uuid
description: Identifier of the object.
SupportCaseAttemptReference:
type: object
description: Reference to an assessment attempt of the caller. Any other object type fails validation.
additionalProperties: false
required:
- type
- id
properties:
type:
type: string
enum:
- assessment_attempt
id:
type: string
format: uuid
description: Identifier of an assessment attempt of the caller.
SupportCaseGradeAppealReference:
type: object
description: 'Reference to the category that a grade appeal disputes: an assessment attempt of the caller in a terminal state, or a `manual_assessment` case of the caller that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt. Any other object type fails validation.'
additionalProperties: false
required:
- type
- id
properties:
type:
type: string
enum:
- assessment_attempt
- support_case
id:
type: string
format: uuid
description: Identifier of the attempt or the case.
SupportCaseComplaintReference:
type: object
description: 'Reference to the object of a complaint: an organization that the caller can see or an invitation addressed to the caller. Any other object type fails validation.'
additionalProperties: false
required:
- type
- id
properties:
type:
type: string
enum:
- organization
- invitation
id:
type: string
format: uuid
description: Identifier of the organization or the invitation.
SupportCaseAssessmentTarget:
type: object
description: 'Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/SpecializationCode'
grade:
$ref: '#/GradeCode'
SupportCaseComplaintReason:
type: string
description: 'Ground of a complaint (PRD FR18).
- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.
- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.
- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.
- data_disclosure: a disclosure of the caller''s personal data beyond what the caller granted.
- other: another ground, explained in the description.'
enum:
- organization_conduct
- offer_content
- salary_terms_violation
- data_disclosure
- other
SupportCaseDescription:
type: string
minLength: 1
maxLength: 4000
pattern: \S
description: 'What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people''s contact data into it. Generated
Zod validators count UTF-16 code units, so the server stays authoritative for the length.'
examples:
- Тест на Senior пока недоступен, хотя я сдал Middle полгода назад.
SupportCasePublicText:
type: string
minLength: 1
maxLength: 4000
description: 'Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'
SupportCaseCreateSupport:
type: object
description: New support case. Both the object reference and the assessment target are optional context; omit what does not apply.
additionalProperties: false
required:
- type
- description
properties:
type:
type: string
enum:
- support
description:
$ref: '#/SupportCaseDescription'
object:
$ref: '#/SupportCaseObjectReference'
assessment_target:
$ref: '#/SupportCaseAssessmentTarget'
SupportCaseCreateComplaint:
type: object
description: New complaint about an organization or an offer.
additionalProperties: false
required:
- type
- description
- complaint_reason
- object
properties:
type:
type: string
enum:
- complaint
description:
$ref: '#/SupportCaseDescription'
complaint_reason:
$ref: '#/SupportCaseComplaintReason'
object:
$ref: '#/SupportCaseComplaintReference'
SupportCaseCreateGradeAppeal:
type: object
description: 'New appeal of a category the caller received: the result of an own assessment attempt, or the outcome of an own resolved manual assessment.'
additionalProperties: false
required:
- type
- description
- object
properties:
type:
type: string
enum:
- grade_appeal
description:
$ref: '#/SupportCaseDescription'
object:
$ref: '#/SupportCaseGradeAppealReference'
SupportCaseCreateAnticheatAppeal:
type: object
description: New appeal of an anti-cheat review decision on an own assessment attempt.
additionalProperties: false
required:
- type
- description
- object
properties:
type:
type: string
enum:
- anticheat_appeal
description:
$ref: '#/SupportCaseDescription'
object:
$ref: '#/SupportCaseAttemptReference'
SupportCaseCreateManualAssessment:
type: object
description: 'New request for a manual assessment of a category by a subject expert. A prior attempt of the same category is optional context: a failed first test or no attempt at all never blocks the request.'
additionalProperties: false
required:
- type
- description
- assessment_target
properties:
type:
type: string
enum:
- manual_assessment
description:
$ref: '#/SupportCaseDescription'
assessment_target:
$ref: '#/SupportCaseAssessmentTarget'
object:
$ref: '#/SupportCaseAttemptReference'
SupportCaseCreate:
description: 'New case, selected by `type`. Each type fixes its required fields and the object types it accepts. The body carries only what the user states: the request has no status, decision, outcome, priority, response target, assignee, moderator, rubric, or contact field, and every variant rejects unknown fields, so a client cannot set any of them. The user and the account come only from the session.'
oneOf:
- $ref: '#/SupportCaseCreateSupport'
- $ref: '#/SupportCaseCreateComplaint'
- $ref: '#/SupportCaseCreateGradeAppeal'
- $ref: '#/SupportCaseCreateAnticheatAppeal'
- $ref: '#/SupportCaseCreateManualAssessment'
SupportResponseTarget:
type: object
description: 'Operational target for the answer to the case (PRD FR18: a case gets a number, a status, and a response deadline). The server fixes it on creation from the product policy version and the configured business calendar; it is a goal of the team, not a deadline set by law. The target is met by the first public reply, a decision, or a closure for `support` and `complaint`, and only by a decision or a closure for the appeals and `manual_assessment`. Missing the target never closes the case, never decides it, and never changes a grade.'
additionalProperties: false
required:
- kind
- business_days
- due_at
- answered_at
- late
- policy_version
properties:
kind:
type: string
enum:
- operational_goal
description: Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.
business_days:
type: integer
format: int32
minimum: 1
maximum: 60
description: Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.
due_at:
$ref: '#/Timestamp'
answered_at:
description: Time the target was met, or null while it is not.
oneOf:
- $ref: '#/Timestamp'
- type: 'null'
late:
type: boolean
description: 'Whether the target was missed: it was met after `due_at`, or it is not met and `due_at` has passed at the time of the response.'
policy_version:
type: integer
format: int32
minimum: 1
description: Number of the `product` policy version that fixed the target.
SupportCaseDecisionOutcome:
type: string
description: 'Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.
- upheld: the appeal or the complaint is upheld in full.
- partially_upheld: the appeal or the complaint is upheld in part.
- not_upheld: the appeal or the complaint is not upheld.
- answered: a support case was answered.
- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.'
enum:
- upheld
- partially_upheld
- not_upheld
- answered
- assessed
SupportCaseDecision:
type: object
description: 'Decision visible to the user. It exists only once the case is `resolved`. It holds the outcome and the public reason; it never names the moderator or the expert and never contains internal notes, evidence, sanctions against another party, or risk signals. An upheld grade appeal never rewrites the original result: the corrected result is a separate decision of the assessment, and both stay in the history of that attempt.'
additionalProperties: false
required:
- outcome
- reason
- decided_at
properties:
outcome:
$ref: '#/SupportCaseDecisionOutcome'
reason:
$ref: '#/SupportCasePublicText'
decided_at:
$ref: '#/Timestamp'
SupportCaseActorKind:
type: string
description: 'Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.
- user: the author of the case.
- support: a person of the support, moderation, or expert staff.
- system: the server, for example on creation or when it routes the case.'
enum:
- user
- support
- system
SupportCaseEventKind:
type: string
description: 'Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.
- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.
- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.
- reply: support replied; `message` holds the reply and `status` is null.
- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'
enum:
- created
- status_changed
- reply
- decision
SupportCaseEvent:
type: object
description: One public event of the case history. Internal notes, assignments, evidence requests, and risk signals are never history events.
additionalProperties: false
required:
- sequence
- kind
- actor
- occurred_at
- status
- message
properties:
sequence:
type: integer
format: int32
minimum: 1
description: Position of the event in the history, starting at 1 and increasing by one.
kind:
$ref: '#/SupportCaseEventKind'
actor:
$ref: '#/SupportCaseActorKind'
occurred_at:
$ref: '#/Timestamp'
status:
description: Status of the case after the event, or null for a reply.
oneOf:
- $ref: '#/SupportCaseStatus'
- type: 'null'
message:
description: Public text of the event, or null.
oneOf:
- $ref: '#/SupportCasePublicText'
- type: 'null'
SupportCase:
type: object
description: Case of the current account. It contains what the author sent, the public processing state, and the public history. It never contains the identity of a moderator, an expert, or a support agent, internal notes, evidence, assessment answers or anti-cheat signals, risk signals, or contact data of another person. Fields that do not apply to the type are null.
additionalProperties: false
required:
- id
- number
- type
- status
- description
- object
- assessment_target
- complaint_reason
- rubric_version
- response_target
- decision
- history
- created_at
- updated_at
properties:
id:
type: string
format: uuid
description: Case identifier.
number:
$ref: '#/SupportCaseNumber'
type:
$ref: '#/SupportCaseType'
status:
$ref: '#/SupportCaseStatus'
description:
$ref: '#/SupportCaseDescription'
object:
description: Object that the case is about, as sent on creation, or null when the case has none.
oneOf:
- $ref: '#/SupportCaseObjectReference'
- type: 'null'
assessment_target:
description: Category of a manual assessment, the optional category of a support case, or null.
oneOf:
- $ref: '#/SupportCaseAssessmentTarget'
- type: 'null'
complaint_reason:
description: Ground of a complaint, or null for other types.
oneOf:
- $ref: '#/SupportCaseComplaintReason'
- type: 'null'
rubric_version:
type:
- integer
- 'null'
format: int32
minimum: 1
description: 'For a manual assessment, the version of the published rubric of the category that the server fixed on creation; the expert assesses with it, the same rubric as the automated assessment. Null for other types, and null for a manual assessment whose category has no published rubric yet: the case then waits in `waiting_expert` and the client says so instead of promising a date.'
response_target:
$ref: '#/SupportResponseTarget'
decision:
description: Decision once the case is `resolved`, otherwise null.
oneOf:
- $ref: '#/SupportCaseDecision'
- type: 'null'
history:
type: array
minItems: 1
maxItems: 200
description: 'Every public event in the order it happened, starting with `created`; the list is never truncated. The server keeps a case within 200 events: it rejects a staff reply or status change that would leave no room for the terminal event, so a case always fits and can always be resolved or closed. Further correspondence goes into a new case that references this one as `support_case`.'
items:
$ref: '#/SupportCaseEvent'
created_at:
$ref: '#/Timestamp'
updated_at:
$ref: '#/Timestamp'
SupportCaseSummary:
type: object
description: 'Case in a list: the fields that a list of cases shows, without the description and the history. GetMySupportCase returns the full case.'
additionalProperties: false
required:
- id
- number
- type
- status
- object
- assessment_target
- response_target
- decision_outcome
- created_at
- updated_at
properties:
id:
type: string
format: uuid
description: Case identifier.
number:
$ref: '#/SupportCaseNumber'
type:
$ref: '#/SupportCaseType'
status:
$ref: '#/SupportCaseStatus'
object:
description: Object that the case is about, or null.
oneOf:
- $ref: '#/SupportCaseObjectReference'
- type: 'null'
assessment_target:
description: Category of the case, or null.
oneOf:
- $ref: '#/SupportCaseAssessmentTarget'
- type: 'null'
response_target:
$ref: '#/SupportResponseTarget'
decision_outcome:
description: Outcome of the decision once the case is `resolved`, otherwise null.
oneOf:
- $ref: '#/SupportCaseDecisionOutcome'
- type: 'null'
created_at:
$ref: '#/Timestamp'
updated_at:
$ref: '#/Timestamp'
SupportCaseList:
type: object
description: One page of the cases of the current account, newest first by creation time.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Case summaries of the page.
items:
$ref: '#/SupportCaseSummary'
page:
$ref: '#/PageInfo'