Перейти к основному содержимому

competitions ↔ identity

Зачем нужно

Файл фиксирует, как олимпиадный домен использует organization context из identity, не становясь владельцем организаций, членства, команд, official organization students или учебных групп преподавателя.

Источник истины

ДанныеВладелец
organization, organization_referenceidentity
organization_membership, organization_team, organization_permission_grantidentity
organization_studentidentity, только официальный контур организации
student_protected_attributesidentity, защищённые official поля ребёнка
family_contact_records, parent_account_invitesidentity, родительские контакты и pending parent flow
educator_profileidentity, анкета без прав
learning_group, learning_group_participantLMS / Learning Workspace
competition_participant, competition_registration, competition_resultcompetitions

Что competitions читает

  • organization by id;
  • organization student by id;
  • organization membership permissions;
  • organization/team grant context;
  • identity user account and family context where needed.
  • official data package readiness for a participant: child SNILS, child birth date, parent email and parent phone.

Competitions stores these identity refs explicitly:

  • identity_organization_id;
  • organization_student_id;
  • organization_membership_id.
  • official_data_ref;
  • parent_contact_ref;
  • parent_invite_ref.

educator_profile_id читается через identity. Learning Workspace refs (learning_group_id, learning_group_participant_id) are read through the LMS/Learning Workspace integration.

Что competitions пишет

Competitions не пишет в identity tables. Он создаёт и меняет только:

  • competition_participant;
  • competition_registration;
  • competition_season_participation;
  • competition_tour_participation;
  • competition_submission;
  • competition_result;
  • competition_award_document.

competition_participant may reference organization_student_id as an external identity ref and stores organization_student_snapshot for historical result/document stability.

Для official data package competitions инициирует identity collection session или parent invite, но raw values сохраняются в identity protected attributes/contact records. Competitions получает status/ref, а не СНИЛС, дату рождения или контакты родителя.

If competitions keeps competition_group, it is only a season/tour access projection or snapshot. It is not the canonical «my students / my groups» list and must not be reused as Learning Workspace source data.

Сценарии

  1. Организация проводит олимпиаду: competitions проверяет organization membership/permission и создаёт competition-owned season/venue/access records.
  2. Официальная организация добавляет ученика: identity создаёт organization_student; competitions связывает участника с organization_student_id только после явной регистрации.
  3. Преподаватель выбирает группу из Learning Workspace: competitions получает snapshot через competitions--lms.md и создаёт competition participants, но не меняет learning_group.
  4. Организация смотрит результаты своих учеников: competitions проверяет competitions.results.read.organization через organization context.
  5. Администратор площадки управляет venue: competitions владеет venue, identity даёт actor context и permissions.
  6. Official data package для ГИР:
    • competitions определяет, что package требуется по registration policy;
    • identity проверяет наличие СНИЛС ребёнка, даты рождения ребёнка, email родителя и телефона родителя;
    • competitions показывает missing fields без получения raw values;
    • родитель, ученик, администратор или учитель в разрешённом official flow вводит данные через identity collection session;
    • identity сохраняет protected attributes/contact records;
    • если родитель ещё не пользователь, создаётся parent_account_invite;
    • после подтверждения родителем identity создаёт family/claim access;
    • competitions получает official_data_package_status и refs.

События identity

Competitions подписывается на:

  • identity.organization.updated;
  • identity.organization.archived;
  • identity.organization.merged;
  • identity.organization_membership.activated;
  • identity.organization_membership.suspended;
  • identity.organization_student.created;
  • identity.organization_student.updated;
  • identity.organization_student.archived;
  • identity.student_protected_attribute.updated;
  • identity.parent_account_invite.accepted;
  • identity.organization_permission_grant.created;
  • identity.organization_permission_grant.revoked.

Правила

  • organization_student не становится competition_participant автоматически.
  • organization_student не является общим списком «мои ученики»; это только official organization contour.
  • competition_group не является каноническим списком учеников и не заменяет learning_group.
  • Архивация organization student не удаляет исторические competition results.
  • При identity.organization.merged historical participants/results не удаляются, новые регистрации идут в primary organization, а existing competition_organization snapshot остаётся историческим до явного admin relink.
  • Product permissions вроде competitions.results.manage.organization принадлежат competitions catalog.
  • Identity не владеет олимпиадной регистрацией, работой или результатом.
  • Raw official data package fields не передаются в competitions events or API responses.
  • Учительский official flow не создаёт parent rights; parent invite остаётся pending до подтверждения родителем или trusted flow.

Идемпотентность и ошибки

  • события обрабатываются по messageId;
  • cache organization context инвалидируется по organization/membership/grant events;
  • если identity недоступен, write actions в organization context должны fail-closed;
  • read-only исторические страницы могут использовать последний безопасный snapshot.

Связанные документы