{
  "version": 1,
  "taskId": "TASK-PRIME-007",
  "source": {
    "repository": "FaceX-geo/mau-education",
    "branch": "codex/staging",
    "commit": "aa774b8587f8944d5a5a0220502b8446300d2b83",
    "principle": "models/schemas/service/routes → registry → API chapters → generated React documentation"
  },
  "domains": {
    "identity": "Личность и доступ",
    "organizations": "Организация и каталог",
    "workforce": "Команда и расписание",
    "booking": "Запись и время",
    "experience": "Визит и приватность",
    "payments": "Расчёты и чеки",
    "club": "Клуб и привилегии",
    "operations": "Поддержка и надёжность"
  },
  "summary": {
    "models": 68,
    "relations": 115,
    "graphCommands": 74,
    "runtimeOperations": 79,
    "implementedGraphCommands": 51,
    "contractGraphCommands": 23,
    "nodes": 186
  },
  "models": [
    {
      "id": "DB-absence-incidents",
      "table": "absence_incidents",
      "name": "AbsenceIncident",
      "domain": "workforce",
      "description": "Отсутствие без диагноза; блокирует новые holds и открывает impact queue.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "open",
        "resolved"
      ],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "category",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "open",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_absence_incidents_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_absence_incidents_interval",
        "ck_absence_incidents_positive_revision",
        "ck_absence_incidents_status_values",
        "fk_absence_incidents_membership_id_staff_memberships",
        "pk_absence_incidents"
      ],
      "ddl": "CREATE TABLE absence_incidents (\n\tmembership_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tcategory VARCHAR(32) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_absence_incidents PRIMARY KEY (id),\n\tCONSTRAINT ck_absence_incidents_interval CHECK (ends_at > starts_at),\n\tCONSTRAINT fk_absence_incidents_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT ck_absence_incidents_status_values CHECK (status IN ('open', 'resolved')),\n\tCONSTRAINT ck_absence_incidents_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "barber собственный membership",
        "read": "barber own; owner affected scope",
        "update": "resolve с передачей визитов",
        "delete": "hard delete запрещён до разрешения"
      },
      "commandIds": [
        "CMD-HOLD",
        "CMD-ABSENCE",
        "CMD-REASSIGN",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "B08",
        "B09",
        "C04",
        "C07",
        "C08",
        "C14",
        "C15",
        "G03",
        "G09",
        "O15",
        "O16",
        "S01"
      ]
    },
    {
      "id": "DB-arrival-updates",
      "table": "arrival_updates",
      "name": "ArrivalUpdate",
      "domain": "booking",
      "description": "ETA не переносит следующие визиты и не превращается в no-show.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "estimated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_arrival_updates_booking_id",
          "columns": [
            "booking_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_arrival_updates_positive_revision",
        "fk_arrival_updates_booking_id_bookings",
        "pk_arrival_updates"
      ],
      "ddl": "CREATE TABLE arrival_updates (\n\tbooking_id UUID NOT NULL,\n\testimated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_arrival_updates PRIMARY KEY (id),\n\tCONSTRAINT fk_arrival_updates_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_arrival_updates_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client собственный booking",
        "read": "client и assigned staff",
        "update": "новое ETA, не перезапись расписания",
        "delete": "retention после визита"
      },
      "commandIds": [
        "CMD-LATE"
      ],
      "nodeIds": [
        "C26",
        "C27",
        "C30",
        "C31"
      ]
    },
    {
      "id": "DB-attendance-reviews",
      "table": "attendance_reviews",
      "name": "AttendanceReview",
      "domain": "booking",
      "description": "Наблюдение отсутствия; решение человека, без автоматического штрафа.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "needs_review",
        "resolved"
      ],
      "fields": [
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "author_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "contact_attempts",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "needs_review",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_attendance_reviews_booking_id",
          "columns": [
            "booking_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_attendance_reviews_positive_revision",
        "ck_attendance_reviews_status_values",
        "fk_attendance_reviews_author_id_identities",
        "fk_attendance_reviews_booking_id_bookings",
        "pk_attendance_reviews"
      ],
      "ddl": "CREATE TABLE attendance_reviews (\n\tbooking_id UUID NOT NULL,\n\tauthor_id UUID NOT NULL,\n\tcontact_attempts INTEGER NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_attendance_reviews PRIMARY KEY (id),\n\tCONSTRAINT fk_attendance_reviews_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT fk_attendance_reviews_author_id_identities FOREIGN KEY(author_id) REFERENCES identities (id),\n\tCONSTRAINT ck_attendance_reviews_status_values CHECK (status IN ('needs_review', 'resolved')),\n\tCONSTRAINT ck_attendance_reviews_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "assigned barber",
        "read": "client own; staff scope",
        "update": "человек рассматривает факт отсутствия",
        "delete": "не удалять как замену исправлению"
      },
      "commandIds": [
        "CMD-NOSHOW"
      ],
      "nodeIds": [
        "C28"
      ]
    },
    {
      "id": "DB-audit-events",
      "table": "audit_events",
      "name": "AuditEvent",
      "domain": "operations",
      "description": "Append-only метаданные действия; без токенов, фото, тела запроса и контактов.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "actor_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "operation",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "object_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "object_type",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "object_revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_audit_events_actor_id",
          "columns": [
            "actor_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_audit_events_positive_revision",
        "fk_audit_events_actor_id_identities",
        "pk_audit_events"
      ],
      "ddl": "CREATE TABLE audit_events (\n\tactor_id UUID NOT NULL,\n\toperation VARCHAR(160) NOT NULL,\n\tobject_id UUID NOT NULL,\n\tobject_type VARCHAR(80) NOT NULL,\n\tobject_revision INTEGER NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_audit_events PRIMARY KEY (id),\n\tCONSTRAINT fk_audit_events_actor_id_identities FOREIGN KEY(actor_id) REFERENCES identities (id),\n\tCONSTRAINT ck_audit_events_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "server transaction",
        "read": "только authorized audit scope",
        "update": "запрещено: append-only",
        "delete": "раздельная утверждённая retention"
      },
      "commandIds": [],
      "nodeIds": []
    },
    {
      "id": "DB-auth-transactions",
      "table": "auth_transactions",
      "name": "AuthTransaction",
      "domain": "identity",
      "description": "Одноразовый state/PKCE; секреты хешируются, права не выдаются OAuth-профилем.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [
        "created",
        "provider_pending",
        "verified",
        "consumed",
        "canceled",
        "expired",
        "rejected"
      ],
      "fields": [
        {
          "name": "provider",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "state_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "created",
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "consumed_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_auth_transactions_positive_revision",
        "ck_auth_transactions_status_values",
        "pk_auth_transactions",
        "uq_auth_transactions_state_digest"
      ],
      "ddl": "CREATE TABLE auth_transactions (\n\tprovider VARCHAR(24) NOT NULL,\n\tstate_digest VARCHAR(64) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tconsumed_at TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_auth_transactions PRIMARY KEY (id),\n\tCONSTRAINT uq_auth_transactions_state_digest UNIQUE (state_digest),\n\tCONSTRAINT ck_auth_transactions_status_values CHECK (status IN ('created', 'provider_pending', 'verified', 'consumed', 'canceled', 'expired', 'rejected')),\n\tCONSTRAINT ck_auth_transactions_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "adapter создаёт state/PKCE",
        "read": "публичный статус по секрету транзакции",
        "update": "однократные verified/consumed",
        "delete": "TTL cleanup"
      },
      "commandIds": [
        "CMD-AUTH",
        "CMD-AUTH-CALLBACK",
        "CMD-IDENTITY-LINK",
        "CMD-RECOVERY"
      ],
      "nodeIds": [
        "A00",
        "A01",
        "A02",
        "A03",
        "A04",
        "A08",
        "A09",
        "A10",
        "R07"
      ]
    },
    {
      "id": "DB-bookings",
      "table": "bookings",
      "name": "Booking",
      "domain": "booking",
      "description": "Авторитетная запись. Перенос атомарно заменяет резерв; отмена не удаляет историю.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "confirmed",
        "arrived",
        "in_service",
        "service_completed",
        "closed",
        "canceled",
        "missed_review",
        "interrupted"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "quote_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "quotes.id"
          ],
          "sensitive": false
        },
        {
          "name": "hold_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "slot_holds.id"
          ],
          "sensitive": false
        },
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "resource_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "resources.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": "confirmed",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_bookings_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        },
        {
          "name": "ix_bookings_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        },
        {
          "name": "ix_bookings_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_bookings_positive_revision",
        "ck_bookings_status_values",
        "fk_bookings_branch_id_branches",
        "fk_bookings_client_id_identities",
        "fk_bookings_hold_id_slot_holds",
        "fk_bookings_membership_id_staff_memberships",
        "fk_bookings_quote_id_quotes",
        "fk_bookings_resource_id_resources",
        "pk_bookings",
        "uq_bookings_hold_id",
        "uq_bookings_quote_id"
      ],
      "ddl": "CREATE TABLE bookings (\n\tbranch_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tquote_id UUID NOT NULL,\n\thold_id UUID NOT NULL,\n\tmembership_id UUID NOT NULL,\n\tresource_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(32) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_bookings PRIMARY KEY (id),\n\tCONSTRAINT fk_bookings_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT fk_bookings_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT uq_bookings_quote_id UNIQUE (quote_id),\n\tCONSTRAINT fk_bookings_quote_id_quotes FOREIGN KEY(quote_id) REFERENCES quotes (id),\n\tCONSTRAINT uq_bookings_hold_id UNIQUE (hold_id),\n\tCONSTRAINT fk_bookings_hold_id_slot_holds FOREIGN KEY(hold_id) REFERENCES slot_holds (id),\n\tCONSTRAINT fk_bookings_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT fk_bookings_resource_id_resources FOREIGN KEY(resource_id) REFERENCES resources (id),\n\tCONSTRAINT ck_bookings_status_values CHECK (status IN ('confirmed', 'arrived', 'in_service', 'service_completed', 'closed', 'canceled', 'missed_review', 'interrupted')),\n\tCONSTRAINT ck_bookings_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client own quote/hold + policy acceptance",
        "read": "client own; assigned barber; scoped owner",
        "update": "move/cancel/arrive/service events с revision",
        "delete": "hard delete запрещён; cancel"
      },
      "commandIds": [
        "CMD-BOOK",
        "CMD-MOVE",
        "CMD-CANCEL",
        "CMD-ARRIVE",
        "CMD-SERVICE",
        "CMD-DELETE",
        "CMD-ABSENCE",
        "CMD-OFFBOARD",
        "CMD-OPERATIONS",
        "CMD-REASSIGN",
        "CMD-DAY",
        "CMD-INCIDENT",
        "CMD-SHIFT-CLOSE",
        "CMD-LATE",
        "CMD-NOSHOW",
        "CMD-REFUND-QUOTE",
        "CMD-REMINDER",
        "CMD-ENTITLEMENT",
        "CMD-VISIT-CLOSE"
      ],
      "nodeIds": [
        "B06",
        "B08",
        "B09",
        "B10",
        "B11",
        "B13",
        "B15",
        "B18",
        "B19",
        "B23",
        "C10",
        "C23",
        "C24",
        "C25",
        "C26",
        "C27",
        "C28",
        "C30",
        "C31",
        "C34",
        "C42",
        "L03",
        "N01",
        "N04",
        "N06",
        "N07",
        "O13",
        "O15",
        "O16",
        "O17",
        "O18",
        "O23",
        "P16",
        "P24",
        "R04",
        "R05",
        "S00",
        "S07"
      ]
    },
    {
      "id": "DB-branches",
      "table": "branches",
      "name": "Branch",
      "domain": "organizations",
      "description": "Филиал с IANA timezone; publication — отдельная проверка готовности.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "draft",
        "published",
        "archived"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "name",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "address",
          "type": "VARCHAR(400)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "timezone",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "draft",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_branches_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_branches_positive_revision",
        "ck_branches_status_values",
        "fk_branches_organization_id_organizations",
        "pk_branches",
        "uq_branches_organization_id"
      ],
      "ddl": "CREATE TABLE branches (\n\torganization_id UUID NOT NULL,\n\tname VARCHAR(160) NOT NULL,\n\taddress VARCHAR(400) NOT NULL,\n\ttimezone VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_branches PRIMARY KEY (id),\n\tCONSTRAINT uq_branches_organization_id UNIQUE (organization_id, id),\n\tCONSTRAINT fk_branches_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT ck_branches_status_values CHECK (status IN ('draft', 'published', 'archived')),\n\tCONSTRAINT ck_branches_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner своей организации",
        "read": "public published; owner свои",
        "update": "owner PUT и readiness publication",
        "delete": "архивировать после переноса обязательств"
      },
      "commandIds": [
        "CMD-BRANCH",
        "CMD-PUBLISH",
        "CMD-PUBLIC-CATALOG"
      ],
      "nodeIds": [
        "C01",
        "C02",
        "C03",
        "G00",
        "G01",
        "G02",
        "G04",
        "G08",
        "O02",
        "O12",
        "O19"
      ]
    },
    {
      "id": "DB-cancellation-quotes",
      "table": "cancellation_quotes",
      "name": "CancellationQuote",
      "domain": "booking",
      "description": "Расчёт последствий отмены для точной revision записи; не возвращает деньги.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "settlement_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_cancellation_quotes_booking_id",
          "columns": [
            "booking_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_cancellation_quotes_positive_revision",
        "fk_cancellation_quotes_booking_id_bookings",
        "pk_cancellation_quotes"
      ],
      "ddl": "CREATE TABLE cancellation_quotes (\n\tbooking_id UUID NOT NULL,\n\tbooking_revision INTEGER NOT NULL,\n\tsettlement_minor INTEGER NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_cancellation_quotes PRIMARY KEY (id),\n\tCONSTRAINT fk_cancellation_quotes_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_cancellation_quotes_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client собственный booking revision",
        "read": "client own",
        "update": "expire, immutable settlement",
        "delete": "TTL после исполнения/отказа"
      },
      "commandIds": [
        "CMD-CANCEL",
        "CMD-REFUND-QUOTE"
      ],
      "nodeIds": [
        "C24",
        "C25",
        "P16"
      ]
    },
    {
      "id": "DB-candidates",
      "table": "candidates",
      "name": "Candidate",
      "domain": "workforce",
      "description": "Кандидат с согласием на обработку; проба не выдаёт staff membership.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "candidate",
        "reviewed",
        "trial",
        "offered",
        "accepted",
        "declined"
      ],
      "fields": [
        {
          "name": "vacancy_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "vacancies.id"
          ],
          "sensitive": false
        },
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "consent_version",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "candidate",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_candidates_vacancy_id",
          "columns": [
            "vacancy_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_candidates_positive_revision",
        "ck_candidates_status_values",
        "fk_candidates_identity_id_identities",
        "fk_candidates_vacancy_id_vacancies",
        "pk_candidates"
      ],
      "ddl": "CREATE TABLE candidates (\n\tvacancy_id UUID NOT NULL,\n\tidentity_id UUID NOT NULL,\n\tconsent_version VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_candidates PRIMARY KEY (id),\n\tCONSTRAINT fk_candidates_vacancy_id_vacancies FOREIGN KEY(vacancy_id) REFERENCES vacancies (id),\n\tCONSTRAINT fk_candidates_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_candidates_status_values CHECK (status IN ('candidate', 'reviewed', 'trial', 'offered', 'accepted', 'declined')),\n\tCONSTRAINT ck_candidates_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner + consent",
        "read": "owner scope; кандидат свои условия",
        "update": "consider/trial/offer/reject с revision",
        "delete": "retention после закрытия"
      },
      "commandIds": [
        "CMD-INVITE",
        "CMD-CANDIDATE"
      ],
      "nodeIds": [
        "O07",
        "O08",
        "O09",
        "O10",
        "O11"
      ]
    },
    {
      "id": "DB-club-memberships",
      "table": "club_memberships",
      "name": "ClubMembership",
      "domain": "club",
      "description": "Покупка pending до подтверждённого расчёта; история остаётся при отмене.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "pending_payment",
        "active",
        "paused",
        "canceled",
        "expired"
      ],
      "fields": [
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "plan_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "club_plans.id"
          ],
          "sensitive": false
        },
        {
          "name": "order_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "orders.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending_payment",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_club_memberships_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_club_memberships_positive_revision",
        "ck_club_memberships_status_values",
        "fk_club_memberships_client_id_identities",
        "fk_club_memberships_order_id_orders",
        "fk_club_memberships_plan_id_club_plans",
        "pk_club_memberships",
        "uq_club_memberships_order_id"
      ],
      "ddl": "CREATE TABLE club_memberships (\n\tclient_id UUID NOT NULL,\n\tplan_id UUID NOT NULL,\n\torder_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_club_memberships PRIMARY KEY (id),\n\tCONSTRAINT fk_club_memberships_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_club_memberships_plan_id_club_plans FOREIGN KEY(plan_id) REFERENCES club_plans (id),\n\tCONSTRAINT uq_club_memberships_order_id UNIQUE (order_id),\n\tCONSTRAINT fk_club_memberships_order_id_orders FOREIGN KEY(order_id) REFERENCES orders (id),\n\tCONSTRAINT ck_club_memberships_status_values CHECK (status IN ('pending_payment', 'active', 'paused', 'canceled', 'expired')),\n\tCONSTRAINT ck_club_memberships_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client принимает plan version",
        "read": "client own; owner scope",
        "update": "settlement activation, pause/cancel",
        "delete": "не удалять ledger и историю клиента"
      },
      "commandIds": [
        "CMD-CLUB",
        "CMD-MEMBERSHIP",
        "CMD-RENEWAL"
      ],
      "nodeIds": [
        "L01",
        "L04",
        "L05",
        "L06",
        "L07"
      ]
    },
    {
      "id": "DB-club-plans",
      "table": "club_plans",
      "name": "ClubPlan",
      "domain": "club",
      "description": "Опубликованная версия плана; неизвестные условия не активируют membership.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "draft",
        "published",
        "archived"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "name",
          "type": "VARCHAR(120)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "number",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "price_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "visits",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "terms",
          "type": "VARCHAR(4000)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "draft",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_club_plans_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_club_plans_positive_revision",
        "ck_club_plans_status_values",
        "fk_club_plans_organization_id_organizations",
        "pk_club_plans",
        "uq_club_plans_organization_id"
      ],
      "ddl": "CREATE TABLE club_plans (\n\torganization_id UUID NOT NULL,\n\tname VARCHAR(120) NOT NULL,\n\tnumber INTEGER NOT NULL,\n\tprice_minor INTEGER NOT NULL,\n\tvisits INTEGER NOT NULL,\n\tterms VARCHAR(4000) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_club_plans PRIMARY KEY (id),\n\tCONSTRAINT uq_club_plans_organization_id UNIQUE (organization_id, name, number),\n\tCONSTRAINT fk_club_plans_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT ck_club_plans_status_values CHECK (status IN ('draft', 'published', 'archived')),\n\tCONSTRAINT ck_club_plans_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner versioned terms",
        "read": "public published; owner свои",
        "update": "новая версия/архивирование",
        "delete": "сохранять принятые plan versions"
      },
      "commandIds": [
        "CMD-CLUB"
      ],
      "nodeIds": [
        "L01"
      ]
    },
    {
      "id": "DB-command-receipts",
      "table": "command_receipts",
      "name": "CommandReceipt",
      "domain": "operations",
      "description": "Идемпотентность identity + operation + key; другой payload даёт 409.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "operation",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "key",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "request_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "result",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_command_receipts_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_command_receipts_positive_revision",
        "fk_command_receipts_identity_id_identities",
        "pk_command_receipts",
        "uq_command_receipts_identity_id"
      ],
      "ddl": "CREATE TABLE command_receipts (\n\tidentity_id UUID NOT NULL,\n\toperation VARCHAR(160) NOT NULL,\n\tkey VARCHAR(160) NOT NULL,\n\trequest_digest VARCHAR(64) NOT NULL,\n\tresult JSON NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_command_receipts PRIMARY KEY (id),\n\tCONSTRAINT uq_command_receipts_identity_id UNIQUE (identity_id, operation, key),\n\tCONSTRAINT fk_command_receipts_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_command_receipts_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "в одной транзакции успешной команды",
        "read": "только identity + operation/key",
        "update": "запрещено менять результат",
        "delete": "retention дольше допустимого retry window"
      },
      "commandIds": [
        "CMD-BOOK"
      ],
      "nodeIds": [
        "C10",
        "S00"
      ]
    },
    {
      "id": "DB-consents",
      "table": "consents",
      "name": "Consent",
      "domain": "experience",
      "description": "Текущее согласие на конкретную цель; audit сохраняет историю изменения.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "purpose",
          "type": "VARCHAR(40)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "terms_version",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "accepted",
          "type": "BOOLEAN",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_consents_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_consents_positive_revision",
        "fk_consents_identity_id_identities",
        "pk_consents",
        "uq_consents_identity_id"
      ],
      "ddl": "CREATE TABLE consents (\n\tidentity_id UUID NOT NULL,\n\tpurpose VARCHAR(40) NOT NULL,\n\tterms_version VARCHAR(80) NOT NULL,\n\taccepted BOOLEAN NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_consents PRIMARY KEY (id),\n\tCONSTRAINT uq_consents_identity_id UNIQUE (identity_id, purpose),\n\tCONSTRAINT fk_consents_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_consents_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "identity own purpose",
        "read": "собственные; service проверяет purpose",
        "update": "accepted/revoked с terms version",
        "delete": "история отзыва в audit; retention отдельно"
      },
      "commandIds": [
        "CMD-PASSPORT",
        "CMD-CONSENT",
        "CMD-WAITLIST",
        "CMD-MEDIA",
        "CMD-NOTIFICATION",
        "CMD-REMINDER",
        "CMD-PASSPORT-READ"
      ],
      "nodeIds": [
        "B17",
        "C05",
        "C13",
        "C18",
        "C20",
        "C38",
        "C39",
        "C40",
        "C42",
        "N00",
        "N01",
        "N02",
        "N03",
        "N04",
        "N06",
        "N07",
        "N08",
        "R01",
        "R02"
      ]
    },
    {
      "id": "DB-counter-payments",
      "table": "counter_payments",
      "name": "CounterPayment",
      "domain": "payments",
      "description": "Подтверждённый кассиром cash/terminal факт, не API списания карты.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "order_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "orders.id"
          ],
          "sensitive": false
        },
        {
          "name": "cashier_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "amount_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "method",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "receipt_reference",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_counter_payments_order_id",
          "columns": [
            "order_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_counter_payments_positive",
        "ck_counter_payments_positive_revision",
        "fk_counter_payments_cashier_id_identities",
        "fk_counter_payments_order_id_orders",
        "pk_counter_payments",
        "uq_counter_payments_order_id"
      ],
      "ddl": "CREATE TABLE counter_payments (\n\torder_id UUID NOT NULL,\n\tcashier_id UUID NOT NULL,\n\tamount_minor INTEGER NOT NULL,\n\tmethod VARCHAR(24) NOT NULL,\n\treceipt_reference VARCHAR(200) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_counter_payments PRIMARY KEY (id),\n\tCONSTRAINT ck_counter_payments_positive CHECK (amount_minor > 0),\n\tCONSTRAINT uq_counter_payments_order_id UNIQUE (order_id, receipt_reference),\n\tCONSTRAINT fk_counter_payments_order_id_orders FOREIGN KEY(order_id) REFERENCES orders (id),\n\tCONSTRAINT fk_counter_payments_cashier_id_identities FOREIGN KEY(cashier_id) REFERENCES identities (id),\n\tCONSTRAINT ck_counter_payments_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "cashier capability + order revision",
        "read": "client order; scoped owner/cashier",
        "update": "корректирующее обязательство",
        "delete": "запрещено: immutable"
      },
      "commandIds": [
        "CMD-CASH"
      ],
      "nodeIds": [
        "P14",
        "P15"
      ]
    },
    {
      "id": "DB-data-exports",
      "table": "data_exports",
      "name": "DataExport",
      "domain": "operations",
      "description": "Запрос выгрузки; готовность только после private export worker.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [
        "requested",
        "processing",
        "ready",
        "expired",
        "failed"
      ],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "format",
          "type": "VARCHAR(16)",
          "nullable": false,
          "primary": false,
          "default": "json",
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "requested",
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "object_key",
          "type": "VARCHAR(240)",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_data_exports_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_data_exports_positive_revision",
        "ck_data_exports_status_values",
        "fk_data_exports_identity_id_identities",
        "pk_data_exports"
      ],
      "ddl": "CREATE TABLE data_exports (\n\tidentity_id UUID NOT NULL,\n\tformat VARCHAR(16) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE,\n\tobject_key VARCHAR(240),\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_data_exports PRIMARY KEY (id),\n\tCONSTRAINT fk_data_exports_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_data_exports_status_values CHECK (status IN ('requested', 'processing', 'ready', 'expired', 'failed')),\n\tCONSTRAINT ck_data_exports_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "identity own request",
        "read": "только requester",
        "update": "worker processing/ready/expire",
        "delete": "private artifact TTL purge"
      },
      "commandIds": [
        "CMD-EXPORT"
      ],
      "nodeIds": [
        "R03"
      ]
    },
    {
      "id": "DB-deletion-requests",
      "table": "deletion_requests",
      "name": "DeletionRequest",
      "domain": "operations",
      "description": "Saga проверяет обязательства и purge; requested не означает данные удалены.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [
        "obligations_review",
        "erasing",
        "completed",
        "blocked"
      ],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": "obligations_review",
          "references": [],
          "sensitive": false
        },
        {
          "name": "completed_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_deletion_requests_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_deletion_requests_positive_revision",
        "ck_deletion_requests_status_values",
        "fk_deletion_requests_identity_id_identities",
        "pk_deletion_requests"
      ],
      "ddl": "CREATE TABLE deletion_requests (\n\tidentity_id UUID NOT NULL,\n\tstatus VARCHAR(32) NOT NULL,\n\tcompleted_at TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_deletion_requests PRIMARY KEY (id),\n\tCONSTRAINT fk_deletion_requests_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_deletion_requests_status_values CHECK (status IN ('obligations_review', 'erasing', 'completed', 'blocked')),\n\tCONSTRAINT ck_deletion_requests_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "identity own acceptance",
        "read": "identity own; privacy worker",
        "update": "obligations review/erase/complete",
        "delete": "сохранить минимальное доказательство исполнения"
      },
      "commandIds": [
        "CMD-DELETE"
      ],
      "nodeIds": [
        "R04",
        "R05"
      ]
    },
    {
      "id": "DB-earning-lines",
      "table": "earning_lines",
      "name": "EarningLine",
      "domain": "workforce",
      "description": "Неизменяемая строка начисления; исправление отдельной строкой с причиной.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "payroll_period_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "payroll_periods.id"
          ],
          "sensitive": false
        },
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "amount_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "reason",
          "type": "VARCHAR(400)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "terms_version",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_earning_lines_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        },
        {
          "name": "ix_earning_lines_payroll_period_id",
          "columns": [
            "payroll_period_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_earning_lines_positive_revision",
        "fk_earning_lines_booking_id_bookings",
        "fk_earning_lines_membership_id_staff_memberships",
        "fk_earning_lines_payroll_period_id_payroll_periods",
        "pk_earning_lines"
      ],
      "ddl": "CREATE TABLE earning_lines (\n\tpayroll_period_id UUID NOT NULL,\n\tmembership_id UUID NOT NULL,\n\tbooking_id UUID,\n\tamount_minor INTEGER NOT NULL,\n\treason VARCHAR(400) NOT NULL,\n\tterms_version VARCHAR(80) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_earning_lines PRIMARY KEY (id),\n\tCONSTRAINT fk_earning_lines_payroll_period_id_payroll_periods FOREIGN KEY(payroll_period_id) REFERENCES payroll_periods (id),\n\tCONSTRAINT fk_earning_lines_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT fk_earning_lines_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_earning_lines_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner расчёт по termsVersion",
        "read": "barber own; owner tenant",
        "update": "компенсирующая строка",
        "delete": "запрещено: immutable"
      },
      "commandIds": [
        "CMD-PAYROLL",
        "CMD-EARNINGS"
      ],
      "nodeIds": [
        "B20",
        "O21"
      ]
    },
    {
      "id": "DB-entitlement-ledger",
      "table": "entitlement_ledger",
      "name": "EntitlementLedger",
      "domain": "club",
      "description": "Неизменяемые записи движения; уникальный operation_key исключает повтор.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "entitlement_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "entitlements.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "kind",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "units",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "operation_key",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_entitlement_ledger_entitlement_id",
          "columns": [
            "entitlement_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_entitlement_ledger_positive_revision",
        "fk_entitlement_ledger_booking_id_bookings",
        "fk_entitlement_ledger_entitlement_id_entitlements",
        "pk_entitlement_ledger",
        "uq_entitlement_ledger_operation_key"
      ],
      "ddl": "CREATE TABLE entitlement_ledger (\n\tentitlement_id UUID NOT NULL,\n\tbooking_id UUID,\n\tkind VARCHAR(24) NOT NULL,\n\tunits INTEGER NOT NULL,\n\toperation_key VARCHAR(200) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_entitlement_ledger PRIMARY KEY (id),\n\tCONSTRAINT fk_entitlement_ledger_entitlement_id_entitlements FOREIGN KEY(entitlement_id) REFERENCES entitlements (id),\n\tCONSTRAINT fk_entitlement_ledger_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT uq_entitlement_ledger_operation_key UNIQUE (operation_key),\n\tCONSTRAINT ck_entitlement_ledger_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "команда reserve/consume/release",
        "read": "client own; owner redacted scope",
        "update": "компенсирующая строка",
        "delete": "запрещено: immutable"
      },
      "commandIds": [
        "CMD-ENTITLEMENT",
        "CMD-GUEST-PASS",
        "CMD-REFERRAL",
        "CMD-VISIT-CLOSE"
      ],
      "nodeIds": [
        "C34",
        "G10",
        "L03",
        "L08",
        "L10",
        "L11",
        "P24",
        "S07"
      ]
    },
    {
      "id": "DB-entitlements",
      "table": "entitlements",
      "name": "Entitlement",
      "domain": "club",
      "description": "Счётчик привилегий, не денежный баланс; reserve/consume/release атомарны.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "club_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "remaining",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_entitlements_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_entitlements_nonnegative",
        "ck_entitlements_positive_revision",
        "fk_entitlements_membership_id_club_memberships",
        "pk_entitlements"
      ],
      "ddl": "CREATE TABLE entitlements (\n\tmembership_id UUID NOT NULL,\n\tremaining INTEGER NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_entitlements PRIMARY KEY (id),\n\tCONSTRAINT ck_entitlements_nonnegative CHECK (remaining >= 0),\n\tCONSTRAINT fk_entitlements_membership_id_club_memberships FOREIGN KEY(membership_id) REFERENCES club_memberships (id),\n\tCONSTRAINT ck_entitlements_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "verified membership settlement",
        "read": "client own; matching service",
        "update": "atomic reserve/consume/release",
        "delete": "expiry, не fictitious cash delete"
      },
      "commandIds": [
        "CMD-CLUB",
        "CMD-ENTITLEMENT",
        "CMD-GUEST-PASS",
        "CMD-GUEST-CLAIM"
      ],
      "nodeIds": [
        "G10",
        "L01",
        "L03",
        "L08",
        "L09",
        "P24"
      ]
    },
    {
      "id": "DB-guest-passes",
      "table": "guest_passes",
      "name": "GuestPass",
      "domain": "club",
      "description": "Одноразовый claim; получатель не раскрывает плательщику свою историю.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "issued",
        "claimed",
        "expired",
        "revoked"
      ],
      "fields": [
        {
          "name": "entitlement_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "entitlements.id"
          ],
          "sensitive": false
        },
        {
          "name": "issuer_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "recipient_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "token_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "issued",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_guest_passes_positive_revision",
        "ck_guest_passes_status_values",
        "fk_guest_passes_entitlement_id_entitlements",
        "fk_guest_passes_issuer_id_identities",
        "fk_guest_passes_recipient_id_identities",
        "pk_guest_passes",
        "uq_guest_passes_token_digest"
      ],
      "ddl": "CREATE TABLE guest_passes (\n\tentitlement_id UUID NOT NULL,\n\tissuer_id UUID NOT NULL,\n\trecipient_id UUID,\n\ttoken_digest VARCHAR(64) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_guest_passes PRIMARY KEY (id),\n\tCONSTRAINT fk_guest_passes_entitlement_id_entitlements FOREIGN KEY(entitlement_id) REFERENCES entitlements (id),\n\tCONSTRAINT fk_guest_passes_issuer_id_identities FOREIGN KEY(issuer_id) REFERENCES identities (id),\n\tCONSTRAINT fk_guest_passes_recipient_id_identities FOREIGN KEY(recipient_id) REFERENCES identities (id),\n\tCONSTRAINT uq_guest_passes_token_digest UNIQUE (token_digest),\n\tCONSTRAINT ck_guest_passes_status_values CHECK (status IN ('issued', 'claimed', 'expired', 'revoked')),\n\tCONSTRAINT ck_guest_passes_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client собственное entitlement",
        "read": "issuer status; recipient own claim",
        "update": "one-use claim/revoke/expire",
        "delete": "expire + release по policy"
      },
      "commandIds": [
        "CMD-GUEST-PASS",
        "CMD-GUEST-CLAIM"
      ],
      "nodeIds": [
        "G10",
        "L08",
        "L09"
      ]
    },
    {
      "id": "DB-identities",
      "table": "identities",
      "name": "Identity",
      "domain": "identity",
      "description": "Человек; роль не хранится в профиле и не приходит от клиента.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [
        "active",
        "suspended",
        "erased"
      ],
      "fields": [
        {
          "name": "display_name",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "active",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_identities_positive_revision",
        "ck_identities_status_values",
        "pk_identities"
      ],
      "ddl": "CREATE TABLE identities (\n\tdisplay_name VARCHAR(160) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_identities PRIMARY KEY (id),\n\tCONSTRAINT ck_identities_status_values CHECK (status IN ('active', 'suspended', 'erased')),\n\tCONSTRAINT ck_identities_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "проверенный вход либо оператор",
        "read": "собственный контекст",
        "update": "профиль/ограничение identity",
        "delete": "псевдонимизация по deletion saga"
      },
      "commandIds": [
        "CMD-AUTH",
        "CMD-DELETE",
        "CMD-AUTH-CALLBACK",
        "CMD-PROFILE",
        "CMD-SESSION",
        "CMD-RECOVERY",
        "CMD-GUEST-CLAIM",
        "CMD-EXPORT"
      ],
      "nodeIds": [
        "A00",
        "A01",
        "A02",
        "A03",
        "A04",
        "A06",
        "A07",
        "A10",
        "A11",
        "A13",
        "C00",
        "C44",
        "C45",
        "L09",
        "R03",
        "R04",
        "R05",
        "R07",
        "S03"
      ]
    },
    {
      "id": "DB-identity-links",
      "table": "identity_links",
      "name": "IdentityLink",
      "domain": "identity",
      "description": "Проверенный provider subject; совпадение email не объединяет аккаунты.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "provider",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "subject",
          "type": "VARCHAR(256)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_identity_links_positive_revision",
        "fk_identity_links_identity_id_identities",
        "pk_identity_links",
        "uq_identity_links_provider"
      ],
      "ddl": "CREATE TABLE identity_links (\n\tidentity_id UUID NOT NULL,\n\tprovider VARCHAR(24) NOT NULL,\n\tsubject VARCHAR(256) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_identity_links PRIMARY KEY (id),\n\tCONSTRAINT uq_identity_links_provider UNIQUE (provider, subject),\n\tCONSTRAINT fk_identity_links_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_identity_links_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "проверенный provider proof + step-up",
        "read": "свои связанные способы",
        "update": "перепроверка связи",
        "delete": "отвязать после проверки recovery"
      },
      "commandIds": [
        "CMD-AUTH",
        "CMD-AUTH-CALLBACK",
        "CMD-IDENTITY-LINK"
      ],
      "nodeIds": [
        "A00",
        "A01",
        "A02",
        "A03",
        "A04",
        "A08",
        "A09"
      ]
    },
    {
      "id": "DB-merchant-connections",
      "table": "merchant_connections",
      "name": "MerchantConnection",
      "domain": "organizations",
      "description": "Ссылка на vault, без ключей провайдера; readiness подтверждает адаптер.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "unverified",
        "verified",
        "disabled"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "environment",
          "type": "VARCHAR(16)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "vault_reference",
          "type": "VARCHAR(240)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "unverified",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_merchant_connections_positive_revision",
        "ck_merchant_connections_status_values",
        "fk_merchant_connections_organization_id_organizations",
        "pk_merchant_connections",
        "uq_merchant_connections_organization_id"
      ],
      "ddl": "CREATE TABLE merchant_connections (\n\torganization_id UUID NOT NULL,\n\tenvironment VARCHAR(16) NOT NULL,\n\tvault_reference VARCHAR(240) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_merchant_connections PRIMARY KEY (id),\n\tCONSTRAINT uq_merchant_connections_organization_id UNIQUE (organization_id),\n\tCONSTRAINT fk_merchant_connections_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT ck_merchant_connections_status_values CHECK (status IN ('unverified', 'verified', 'disabled')),\n\tCONSTRAINT ck_merchant_connections_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner + step-up + vault ref",
        "read": "redacted readiness owner",
        "update": "verified adapter status",
        "delete": "отключить, не удалять расчёты"
      },
      "commandIds": [
        "CMD-MERCHANT",
        "CMD-PUBLISH"
      ],
      "nodeIds": [
        "O05",
        "O12"
      ]
    },
    {
      "id": "DB-notifications",
      "table": "notifications",
      "name": "Notification",
      "domain": "experience",
      "description": "Доставка, открытие и отзыв согласия — разные факты.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [
        "queued",
        "sent",
        "delivered",
        "failed",
        "suppressed"
      ],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "deduplication_key",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "template_version",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "queued",
          "references": [],
          "sensitive": false
        },
        {
          "name": "read_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_notifications_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_notifications_positive_revision",
        "ck_notifications_status_values",
        "fk_notifications_booking_id_bookings",
        "fk_notifications_identity_id_identities",
        "pk_notifications",
        "uq_notifications_deduplication_key"
      ],
      "ddl": "CREATE TABLE notifications (\n\tidentity_id UUID NOT NULL,\n\tbooking_id UUID,\n\tdeduplication_key VARCHAR(160) NOT NULL,\n\ttemplate_version VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tread_at TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_notifications PRIMARY KEY (id),\n\tCONSTRAINT fk_notifications_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT fk_notifications_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT uq_notifications_deduplication_key UNIQUE (deduplication_key),\n\tCONSTRAINT ck_notifications_status_values CHECK (status IN ('queued', 'sent', 'delivered', 'failed', 'suppressed')),\n\tCONSTRAINT ck_notifications_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "outbox delivery worker",
        "read": "собственный inbox",
        "update": "delivery/read отдельно; suppress при revoke",
        "delete": "retention минимального payload"
      },
      "commandIds": [
        "CMD-NOTIFICATION",
        "CMD-REMINDER"
      ],
      "nodeIds": [
        "C42",
        "N00",
        "N01",
        "N02",
        "N03",
        "N04",
        "N06",
        "N07",
        "N08"
      ]
    },
    {
      "id": "DB-offers",
      "table": "offers",
      "name": "Offer",
      "domain": "workforce",
      "description": "Версия условий найма, принимаемая отдельно от роли.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "offered",
        "accepted",
        "declined",
        "withdrawn",
        "expired"
      ],
      "fields": [
        {
          "name": "candidate_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "candidates.id"
          ],
          "sensitive": false
        },
        {
          "name": "number",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "terms",
          "type": "VARCHAR(4000)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "offered",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_offers_positive_revision",
        "ck_offers_status_values",
        "fk_offers_candidate_id_candidates",
        "pk_offers",
        "uq_offers_candidate_id"
      ],
      "ddl": "CREATE TABLE offers (\n\tcandidate_id UUID NOT NULL,\n\tnumber INTEGER NOT NULL,\n\tterms VARCHAR(4000) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_offers PRIMARY KEY (id),\n\tCONSTRAINT uq_offers_candidate_id UNIQUE (candidate_id, number),\n\tCONSTRAINT fk_offers_candidate_id_candidates FOREIGN KEY(candidate_id) REFERENCES candidates (id),\n\tCONSTRAINT ck_offers_status_values CHECK (status IN ('offered', 'accepted', 'declined', 'withdrawn', 'expired')),\n\tCONSTRAINT ck_offers_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner через candidate event",
        "read": "owner и intended candidate",
        "update": "accept/decline/withdraw",
        "delete": "сохранить accepted terms"
      },
      "commandIds": [
        "CMD-INVITE",
        "CMD-CANDIDATE",
        "CMD-INVITE-ACCEPT"
      ],
      "nodeIds": [
        "B00",
        "B01",
        "B02",
        "B03",
        "B21",
        "O07",
        "O08",
        "O09",
        "O10",
        "O11"
      ]
    },
    {
      "id": "DB-orders",
      "table": "orders",
      "name": "Order",
      "domain": "payments",
      "description": "Денежное обязательство, отдельно от lifecycle записи.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "due",
        "partially_paid",
        "settled",
        "review_required",
        "disputed"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "due_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "currency",
          "type": "VARCHAR(3)",
          "nullable": false,
          "primary": false,
          "default": "RUB",
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "due",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_orders_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        },
        {
          "name": "ix_orders_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_orders_nonnegative",
        "ck_orders_positive_revision",
        "ck_orders_status_values",
        "fk_orders_booking_id_bookings",
        "fk_orders_client_id_identities",
        "fk_orders_organization_id_organizations",
        "pk_orders",
        "uq_orders_booking_id"
      ],
      "ddl": "CREATE TABLE orders (\n\torganization_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tbooking_id UUID,\n\tdue_minor INTEGER NOT NULL,\n\tcurrency VARCHAR(3) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_orders PRIMARY KEY (id),\n\tCONSTRAINT ck_orders_nonnegative CHECK (due_minor >= 0),\n\tCONSTRAINT fk_orders_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_orders_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT uq_orders_booking_id UNIQUE (booking_id),\n\tCONSTRAINT fk_orders_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_orders_status_values CHECK (status IN ('due', 'partially_paid', 'settled', 'review_required', 'disputed')),\n\tCONSTRAINT ck_orders_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "в транзакции booking/club",
        "read": "client own; cashier/owner scope",
        "update": "settlement due/paid/disputed",
        "delete": "hard delete запрещён"
      },
      "commandIds": [
        "CMD-BOOK",
        "CMD-MOVE",
        "CMD-CANCEL",
        "CMD-PAY",
        "CMD-REFUND",
        "CMD-SERVICE",
        "CMD-CLUB",
        "CMD-DELETE",
        "CMD-OPERATIONS",
        "CMD-SHIFT-CLOSE",
        "CMD-RECONCILE",
        "CMD-CASH",
        "CMD-REFUND-QUOTE",
        "CMD-PAYMENT-CAPTURE",
        "CMD-RECEIPT",
        "CMD-VISIT-CLOSE"
      ],
      "nodeIds": [
        "B13",
        "B15",
        "B18",
        "B19",
        "C10",
        "C23",
        "C24",
        "C25",
        "C34",
        "C37",
        "L01",
        "O13",
        "O22",
        "O23",
        "P06",
        "P09",
        "P10",
        "P13",
        "P14",
        "P15",
        "P16",
        "P17",
        "P19",
        "P20",
        "P21",
        "P25",
        "R04",
        "R05",
        "S00",
        "S07"
      ]
    },
    {
      "id": "DB-organizations",
      "table": "organizations",
      "name": "Organization",
      "domain": "organizations",
      "description": "Tenant PRIME; удаление заменяется архивом после передачи обязательств.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "active",
        "archived"
      ],
      "fields": [
        {
          "name": "name",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "active",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_organizations_positive_revision",
        "ck_organizations_status_values",
        "pk_organizations"
      ],
      "ddl": "CREATE TABLE organizations (\n\tname VARCHAR(160) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_organizations PRIMARY KEY (id),\n\tCONSTRAINT ck_organizations_status_values CHECK (status IN ('active', 'archived')),\n\tCONSTRAINT ck_organizations_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "provision grant + identity",
        "read": "owner своего tenant",
        "update": "переименование/архивирование после обязательств",
        "delete": "hard delete запрещён"
      },
      "commandIds": [
        "CMD-ORG",
        "CMD-BRANCH"
      ],
      "nodeIds": [
        "O00",
        "O01",
        "O02",
        "O19"
      ]
    },
    {
      "id": "DB-outbox-events",
      "table": "outbox_events",
      "name": "OutboxEvent",
      "domain": "operations",
      "description": "Транзакционное событие. Наличие записи не означает доставку сообщения.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [
        "pending",
        "processing",
        "delivered",
        "failed"
      ],
      "fields": [
        {
          "name": "aggregate_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "kind",
          "type": "VARCHAR(120)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "aggregate_revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "deduplication_key",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending",
          "references": [],
          "sensitive": false
        },
        {
          "name": "attempts",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "0",
          "references": [],
          "sensitive": false
        },
        {
          "name": "available_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_outbox_events_aggregate_id",
          "columns": [
            "aggregate_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_outbox_events_positive_revision",
        "ck_outbox_events_status_values",
        "pk_outbox_events",
        "uq_outbox_events_deduplication_key"
      ],
      "ddl": "CREATE TABLE outbox_events (\n\taggregate_id UUID NOT NULL,\n\tkind VARCHAR(120) NOT NULL,\n\taggregate_revision INTEGER NOT NULL,\n\tdeduplication_key VARCHAR(200) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tattempts INTEGER NOT NULL,\n\tavailable_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_outbox_events PRIMARY KEY (id),\n\tCONSTRAINT uq_outbox_events_deduplication_key UNIQUE (deduplication_key),\n\tCONSTRAINT ck_outbox_events_status_values CHECK (status IN ('pending', 'processing', 'delivered', 'failed')),\n\tCONSTRAINT ck_outbox_events_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "server transaction",
        "read": "service worker; не клиентский raw API",
        "update": "lease/retry/delivered/dead-letter",
        "delete": "retention после подтверждённой обработки"
      },
      "commandIds": [
        "CMD-NOTIFICATION"
      ],
      "nodeIds": [
        "N00",
        "N02",
        "N03",
        "N08"
      ]
    },
    {
      "id": "DB-ownership-transfers",
      "table": "ownership_transfers",
      "name": "OwnershipTransfer",
      "domain": "organizations",
      "description": "Два независимых участника принимают передачу; last owner сохраняется.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "pending",
        "accepted",
        "expired",
        "canceled"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "sender_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "recipient_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending",
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_ownership_transfers_positive_revision",
        "ck_ownership_transfers_status_values",
        "fk_ownership_transfers_organization_id_organizations",
        "fk_ownership_transfers_recipient_id_identities",
        "fk_ownership_transfers_sender_id_identities",
        "pk_ownership_transfers"
      ],
      "ddl": "CREATE TABLE ownership_transfers (\n\torganization_id UUID NOT NULL,\n\tsender_id UUID NOT NULL,\n\trecipient_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_ownership_transfers PRIMARY KEY (id),\n\tCONSTRAINT fk_ownership_transfers_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_ownership_transfers_sender_id_identities FOREIGN KEY(sender_id) REFERENCES identities (id),\n\tCONSTRAINT fk_ownership_transfers_recipient_id_identities FOREIGN KEY(recipient_id) REFERENCES identities (id),\n\tCONSTRAINT ck_ownership_transfers_status_values CHECK (status IN ('pending', 'accepted', 'expired', 'canceled')),\n\tCONSTRAINT ck_ownership_transfers_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner + step-up",
        "read": "два участника",
        "update": "accept обеими сторонами/expiry",
        "delete": "cancel/expire до commit"
      },
      "commandIds": [
        "CMD-TRANSFER"
      ],
      "nodeIds": [
        "O24"
      ]
    },
    {
      "id": "DB-passport-media",
      "table": "passport_media",
      "name": "PassportMedia",
      "domain": "experience",
      "description": "Связь приватного фото с revision; отдельная purpose-проверка при чтении.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "passport_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "passport_revisions.id"
          ],
          "sensitive": false
        },
        {
          "name": "media_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "private_media.id"
          ],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_passport_media_positive_revision",
        "fk_passport_media_media_id_private_media",
        "fk_passport_media_passport_id_passport_revisions",
        "pk_passport_media",
        "uq_passport_media_passport_id"
      ],
      "ddl": "CREATE TABLE passport_media (\n\tpassport_id UUID NOT NULL,\n\tmedia_id UUID NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_passport_media PRIMARY KEY (id),\n\tCONSTRAINT uq_passport_media_passport_id UNIQUE (passport_id, media_id),\n\tCONSTRAINT fk_passport_media_passport_id_passport_revisions FOREIGN KEY(passport_id) REFERENCES passport_revisions (id),\n\tCONSTRAINT fk_passport_media_media_id_private_media FOREIGN KEY(media_id) REFERENCES private_media (id),\n\tCONSTRAINT ck_passport_media_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "при создании passport + consent",
        "read": "только разрешённый private media read",
        "update": "новая revision ссылки",
        "delete": "purge после revoke, audit отдельно"
      },
      "commandIds": [
        "CMD-PASSPORT",
        "CMD-PASSPORT-READ"
      ],
      "nodeIds": [
        "B17",
        "C05",
        "C38",
        "C39",
        "C40"
      ]
    },
    {
      "id": "DB-passport-revisions",
      "table": "passport_revisions",
      "name": "PassportRevision",
      "domain": "experience",
      "description": "Append-only паспорт; доступ мастеру только на назначенный визит с согласием.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "visit_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "visits.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "author_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "number",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "parameters",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_passport_revisions_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        },
        {
          "name": "ix_passport_revisions_visit_id",
          "columns": [
            "visit_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_passport_revisions_positive_revision",
        "fk_passport_revisions_author_id_identities",
        "fk_passport_revisions_client_id_identities",
        "fk_passport_revisions_visit_id_visits",
        "pk_passport_revisions",
        "uq_passport_revisions_visit_id"
      ],
      "ddl": "CREATE TABLE passport_revisions (\n\tvisit_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tauthor_id UUID NOT NULL,\n\tnumber INTEGER NOT NULL,\n\tparameters JSON NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_passport_revisions PRIMARY KEY (id),\n\tCONSTRAINT uq_passport_revisions_visit_id UNIQUE (visit_id, number),\n\tCONSTRAINT fk_passport_revisions_visit_id_visits FOREIGN KEY(visit_id) REFERENCES visits (id),\n\tCONSTRAINT fk_passport_revisions_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_passport_revisions_author_id_identities FOREIGN KEY(author_id) REFERENCES identities (id),\n\tCONSTRAINT ck_passport_revisions_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "assigned barber + consent",
        "read": "client own; assigned purpose access",
        "update": "новая revision, не перезапись",
        "delete": "privacy redaction отдельным worker"
      },
      "commandIds": [
        "CMD-PASSPORT",
        "CMD-PASSPORT-READ"
      ],
      "nodeIds": [
        "B17",
        "C05",
        "C38",
        "C39",
        "C40"
      ]
    },
    {
      "id": "DB-payment-intents",
      "table": "payment_intents",
      "name": "PaymentIntent",
      "domain": "payments",
      "description": "Provider final status устанавливает только проверенный адаптер, не клиент.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "created",
        "provider_pending",
        "authorized",
        "succeeded",
        "canceled",
        "unknown"
      ],
      "fields": [
        {
          "name": "order_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "orders.id"
          ],
          "sensitive": false
        },
        {
          "name": "provider_id",
          "type": "VARCHAR(160)",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "purpose",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "amount_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "captured_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "0",
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "created",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_payment_intents_order_id",
          "columns": [
            "order_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_payment_intents_positive",
        "ck_payment_intents_positive_revision",
        "ck_payment_intents_status_values",
        "fk_payment_intents_order_id_orders",
        "pk_payment_intents",
        "uq_payment_intents_provider_id"
      ],
      "ddl": "CREATE TABLE payment_intents (\n\torder_id UUID NOT NULL,\n\tprovider_id VARCHAR(160),\n\tpurpose VARCHAR(24) NOT NULL,\n\tamount_minor INTEGER NOT NULL,\n\tcaptured_minor INTEGER NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_payment_intents PRIMARY KEY (id),\n\tCONSTRAINT ck_payment_intents_positive CHECK (amount_minor > 0),\n\tCONSTRAINT fk_payment_intents_order_id_orders FOREIGN KEY(order_id) REFERENCES orders (id),\n\tCONSTRAINT uq_payment_intents_provider_id UNIQUE (provider_id),\n\tCONSTRAINT ck_payment_intents_status_values CHECK (status IN ('created', 'provider_pending', 'authorized', 'succeeded', 'canceled', 'unknown')),\n\tCONSTRAINT ck_payment_intents_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client intent + server amount",
        "read": "client own; owner redacted",
        "update": "verified adapter status, monotonic final",
        "delete": "cancel у провайдера, не hard delete"
      },
      "commandIds": [
        "CMD-PAY",
        "CMD-WEBHOOK",
        "CMD-REFUND",
        "CMD-RECONCILE",
        "CMD-PAYMENT-CAPTURE",
        "CMD-RENEWAL"
      ],
      "nodeIds": [
        "C37",
        "L04",
        "L05",
        "L07",
        "O22",
        "P06",
        "P08",
        "P09",
        "P10",
        "P13",
        "P17",
        "P19",
        "P21",
        "P25"
      ]
    },
    {
      "id": "DB-payroll-periods",
      "table": "payroll_periods",
      "name": "PayrollPeriod",
      "domain": "workforce",
      "description": "Расчётный период; закрытие расчёта не переводит деньги.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "open",
        "closed",
        "disputed"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "open",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_payroll_periods_positive_revision",
        "ck_payroll_periods_status_values",
        "fk_payroll_periods_organization_id_organizations",
        "pk_payroll_periods"
      ],
      "ddl": "CREATE TABLE payroll_periods (\n\torganization_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_payroll_periods PRIMARY KEY (id),\n\tCONSTRAINT fk_payroll_periods_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT ck_payroll_periods_status_values CHECK (status IN ('open', 'closed', 'disputed')),\n\tCONSTRAINT ck_payroll_periods_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner tenant",
        "read": "owner; barber свои строки",
        "update": "close/dispute; transfer отдельно",
        "delete": "запрет удаления закрытого периода"
      },
      "commandIds": [
        "CMD-PAYROLL",
        "CMD-EARNINGS"
      ],
      "nodeIds": [
        "B20",
        "O21"
      ]
    },
    {
      "id": "DB-policy-versions",
      "table": "policy_versions",
      "name": "PolicyVersion",
      "domain": "organizations",
      "description": "Явно опубликованные условия, а не 16 предложений из графа.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "number",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "deposit_bps",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "hold_seconds",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "cancellation_hours",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "effective_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "approved_by",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "terms",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_policy_versions_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_policy_versions_deposit_range",
        "ck_policy_versions_hold_ttl",
        "ck_policy_versions_positive_revision",
        "fk_policy_versions_approved_by_identities",
        "fk_policy_versions_organization_id_organizations",
        "pk_policy_versions",
        "uq_policy_versions_organization_id"
      ],
      "ddl": "CREATE TABLE policy_versions (\n\torganization_id UUID NOT NULL,\n\tnumber INTEGER NOT NULL,\n\tdeposit_bps INTEGER NOT NULL,\n\thold_seconds INTEGER NOT NULL,\n\tcancellation_hours INTEGER NOT NULL,\n\teffective_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tapproved_by UUID NOT NULL,\n\tterms JSON NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_policy_versions PRIMARY KEY (id),\n\tCONSTRAINT uq_policy_versions_organization_id UNIQUE (organization_id, number),\n\tCONSTRAINT ck_policy_versions_deposit_range CHECK (deposit_bps BETWEEN 0 AND 10000),\n\tCONSTRAINT ck_policy_versions_hold_ttl CHECK (hold_seconds BETWEEN 30 AND 1800),\n\tCONSTRAINT fk_policy_versions_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_policy_versions_approved_by_identities FOREIGN KEY(approved_by) REFERENCES identities (id),\n\tCONSTRAINT ck_policy_versions_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner explicit approval/effective_at",
        "read": "принятая версия своего quote; owner",
        "update": "запрещено: новая версия",
        "delete": "запрещено: immutable"
      },
      "commandIds": [
        "CMD-QUOTE",
        "CMD-POLICY",
        "CMD-ONBOARD",
        "CMD-PUBLISH",
        "CMD-REFUND-QUOTE"
      ],
      "nodeIds": [
        "B04",
        "B05",
        "C06",
        "C24",
        "O04",
        "O12",
        "P16"
      ]
    },
    {
      "id": "DB-private-media",
      "table": "private_media",
      "name": "PrivateMedia",
      "domain": "experience",
      "description": "Private object key, consent, quarantine и подтверждённый purge; публичного URL нет.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [
        "upload_pending",
        "quarantine",
        "stored_private",
        "revoke_pending",
        "deleted"
      ],
      "fields": [
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "consent_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "consents.id"
          ],
          "sensitive": false
        },
        {
          "name": "object_key",
          "type": "VARCHAR(240)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "content_type",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "byte_length",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "upload_pending",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_private_media_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_private_media_positive_revision",
        "ck_private_media_status_values",
        "fk_private_media_client_id_identities",
        "fk_private_media_consent_id_consents",
        "pk_private_media",
        "uq_private_media_object_key"
      ],
      "ddl": "CREATE TABLE private_media (\n\tclient_id UUID NOT NULL,\n\tconsent_id UUID NOT NULL,\n\tobject_key VARCHAR(240) NOT NULL,\n\tcontent_type VARCHAR(64) NOT NULL,\n\tbyte_length INTEGER NOT NULL,\n\tdigest VARCHAR(64) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_private_media PRIMARY KEY (id),\n\tCONSTRAINT fk_private_media_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_private_media_consent_id_consents FOREIGN KEY(consent_id) REFERENCES consents (id),\n\tCONSTRAINT uq_private_media_object_key UNIQUE (object_key),\n\tCONSTRAINT ck_private_media_status_values CHECK (status IN ('upload_pending', 'quarantine', 'stored_private', 'revoke_pending', 'deleted')),\n\tCONSTRAINT ck_private_media_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "consented private upload",
        "read": "owner либо assigned purpose grant",
        "update": "quarantine/store/revoke/purge",
        "delete": "подтверждённый object purge"
      },
      "commandIds": [
        "CMD-PASSPORT",
        "CMD-CONSENT",
        "CMD-DELETE",
        "CMD-MEDIA"
      ],
      "nodeIds": [
        "B17",
        "C18",
        "C20",
        "C42",
        "R01",
        "R02",
        "R04",
        "R05"
      ]
    },
    {
      "id": "DB-profiles",
      "table": "profiles",
      "name": "Profile",
      "domain": "identity",
      "description": "Добровольный профиль; контакт не становится проверенным от PUT.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "preferences",
          "type": "VARCHAR(2000)",
          "nullable": false,
          "primary": false,
          "default": "",
          "references": [],
          "sensitive": true
        },
        {
          "name": "contact_hint",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": "",
          "references": [],
          "sensitive": true
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_profiles_positive_revision",
        "fk_profiles_identity_id_identities",
        "pk_profiles",
        "uq_profiles_identity_id"
      ],
      "ddl": "CREATE TABLE profiles (\n\tidentity_id UUID NOT NULL,\n\tpreferences VARCHAR(2000) NOT NULL,\n\tcontact_hint VARCHAR(200) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_profiles PRIMARY KEY (id),\n\tCONSTRAINT uq_profiles_identity_id UNIQUE (identity_id),\n\tCONSTRAINT fk_profiles_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT ck_profiles_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "собственный PUT expected_revision=0",
        "read": "собственный профиль",
        "update": "свой PUT с revision",
        "delete": "deletion saga"
      },
      "commandIds": [
        "CMD-PROFILE"
      ],
      "nodeIds": [
        "A06",
        "C44",
        "C45"
      ]
    },
    {
      "id": "DB-provider-inbox",
      "table": "provider_inbox",
      "name": "ProviderInbox",
      "domain": "payments",
      "description": "Дедупликация проверенных событий; тело webhook не является доказательством оплаты.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "received",
        "verified",
        "processed",
        "rejected"
      ],
      "fields": [
        {
          "name": "provider",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "event_id",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "object_id",
          "type": "VARCHAR(200)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "received",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_provider_inbox_positive_revision",
        "ck_provider_inbox_status_values",
        "pk_provider_inbox",
        "uq_provider_inbox_provider"
      ],
      "ddl": "CREATE TABLE provider_inbox (\n\tprovider VARCHAR(32) NOT NULL,\n\tevent_id VARCHAR(200) NOT NULL,\n\tobject_id VARCHAR(200) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_provider_inbox PRIMARY KEY (id),\n\tCONSTRAINT uq_provider_inbox_provider UNIQUE (provider, event_id),\n\tCONSTRAINT ck_provider_inbox_status_values CHECK (status IN ('received', 'verified', 'processed', 'rejected')),\n\tCONSTRAINT ck_provider_inbox_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "verified provider ingress",
        "read": "только service identity",
        "update": "verify/process/deduplicate",
        "delete": "retention с audit"
      },
      "commandIds": [
        "CMD-WEBHOOK",
        "CMD-RECONCILE"
      ],
      "nodeIds": [
        "O22",
        "P08",
        "P13",
        "P19",
        "P21",
        "P25"
      ]
    },
    {
      "id": "DB-provision-grants",
      "table": "provision_grants",
      "name": "ProvisionGrant",
      "domain": "identity",
      "description": "Одноразовое право bootstrap от оператора, не публичная регистрация owner.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "token_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "consumed_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_provision_grants_positive_revision",
        "fk_provision_grants_identity_id_identities",
        "pk_provision_grants",
        "uq_provision_grants_token_digest"
      ],
      "ddl": "CREATE TABLE provision_grants (\n\tidentity_id UUID NOT NULL,\n\ttoken_digest VARCHAR(64) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tconsumed_at TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_provision_grants PRIMARY KEY (id),\n\tCONSTRAINT fk_provision_grants_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT uq_provision_grants_token_digest UNIQUE (token_digest),\n\tCONSTRAINT ck_provision_grants_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "только оператор",
        "read": "только provision service",
        "update": "однократный consume",
        "delete": "TTL cleanup"
      },
      "commandIds": [
        "CMD-ORG"
      ],
      "nodeIds": [
        "O00",
        "O01"
      ]
    },
    {
      "id": "DB-quote-lines",
      "table": "quote_lines",
      "name": "QuoteLine",
      "domain": "booking",
      "description": "Неизменяемые строки quote с внешним ключом на версию услуги.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "quote_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "quotes.id"
          ],
          "sensitive": false
        },
        {
          "name": "service_version_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "service_versions.id"
          ],
          "sensitive": false
        },
        {
          "name": "price_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_quote_lines_quote_id",
          "columns": [
            "quote_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_quote_lines_positive_revision",
        "fk_quote_lines_quote_id_quotes",
        "fk_quote_lines_service_version_id_service_versions",
        "pk_quote_lines"
      ],
      "ddl": "CREATE TABLE quote_lines (\n\tquote_id UUID NOT NULL,\n\tservice_version_id UUID NOT NULL,\n\tprice_minor INTEGER NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_quote_lines PRIMARY KEY (id),\n\tCONSTRAINT fk_quote_lines_quote_id_quotes FOREIGN KEY(quote_id) REFERENCES quotes (id),\n\tCONSTRAINT fk_quote_lines_service_version_id_service_versions FOREIGN KEY(service_version_id) REFERENCES service_versions (id),\n\tCONSTRAINT ck_quote_lines_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "в транзакции quote",
        "read": "владелец quote",
        "update": "запрещено: immutable",
        "delete": "запрещено для принятого расчёта"
      },
      "commandIds": [
        "CMD-QUOTE"
      ],
      "nodeIds": [
        "C06"
      ]
    },
    {
      "id": "DB-quotes",
      "table": "quotes",
      "name": "Quote",
      "domain": "booking",
      "description": "Серверный расчёт в копейках; сроки и депозит заданы опубликованной policy.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "calculated",
        "accepted",
        "expired",
        "superseded"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "policy_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "policy_versions.id"
          ],
          "sensitive": false
        },
        {
          "name": "total_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "deposit_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "duration_minutes",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "buffer_minutes",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "currency",
          "type": "VARCHAR(3)",
          "nullable": false,
          "primary": false,
          "default": "RUB",
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "calculated",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_quotes_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        },
        {
          "name": "ix_quotes_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_quotes_money",
        "ck_quotes_positive_revision",
        "ck_quotes_status_values",
        "fk_quotes_branch_id_branches",
        "fk_quotes_client_id_identities",
        "fk_quotes_policy_id_policy_versions",
        "pk_quotes"
      ],
      "ddl": "CREATE TABLE quotes (\n\tbranch_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tpolicy_id UUID NOT NULL,\n\ttotal_minor INTEGER NOT NULL,\n\tdeposit_minor INTEGER NOT NULL,\n\tduration_minutes INTEGER NOT NULL,\n\tbuffer_minutes INTEGER NOT NULL,\n\tcurrency VARCHAR(3) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_quotes PRIMARY KEY (id),\n\tCONSTRAINT ck_quotes_money CHECK (total_minor >= 0 AND deposit_minor >= 0 AND deposit_minor <= total_minor),\n\tCONSTRAINT fk_quotes_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT fk_quotes_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_quotes_policy_id_policy_versions FOREIGN KEY(policy_id) REFERENCES policy_versions (id),\n\tCONSTRAINT ck_quotes_status_values CHECK (status IN ('calculated', 'accepted', 'expired', 'superseded')),\n\tCONSTRAINT ck_quotes_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client свои service IDs",
        "read": "владелец quote",
        "update": "accept/supersede/expire, сумма immutable",
        "delete": "TTL неподтверждённых без обязательств"
      },
      "commandIds": [
        "CMD-QUOTE",
        "CMD-HOLD",
        "CMD-BOOK",
        "CMD-MOVE",
        "CMD-SCOPE"
      ],
      "nodeIds": [
        "B12",
        "B14",
        "C06",
        "C07",
        "C10",
        "C23",
        "C33",
        "P23",
        "S00",
        "S01"
      ]
    },
    {
      "id": "DB-reassignments",
      "table": "reassignments",
      "name": "Reassignment",
      "domain": "booking",
      "description": "Предложение замены из incident; клиент принимает новой командой move.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "offered",
        "accepted",
        "declined",
        "expired"
      ],
      "fields": [
        {
          "name": "incident_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "absence_incidents.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "hold_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "slot_holds.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "offered",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_reassignments_booking_id",
          "columns": [
            "booking_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_reassignments_positive_revision",
        "ck_reassignments_status_values",
        "fk_reassignments_booking_id_bookings",
        "fk_reassignments_hold_id_slot_holds",
        "fk_reassignments_incident_id_absence_incidents",
        "pk_reassignments"
      ],
      "ddl": "CREATE TABLE reassignments (\n\tincident_id UUID NOT NULL,\n\tbooking_id UUID NOT NULL,\n\thold_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_reassignments PRIMARY KEY (id),\n\tCONSTRAINT fk_reassignments_incident_id_absence_incidents FOREIGN KEY(incident_id) REFERENCES absence_incidents (id),\n\tCONSTRAINT fk_reassignments_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT fk_reassignments_hold_id_slot_holds FOREIGN KEY(hold_id) REFERENCES slot_holds (id),\n\tCONSTRAINT ck_reassignments_status_values CHECK (status IN ('offered', 'accepted', 'declined', 'expired')),\n\tCONSTRAINT ck_reassignments_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner affected incident",
        "read": "owner и affected client",
        "update": "client accept/decline, затем move",
        "delete": "expire; исходную запись не удалять"
      },
      "commandIds": [
        "CMD-REASSIGN"
      ],
      "nodeIds": [
        "O15",
        "O16"
      ]
    },
    {
      "id": "DB-receipts",
      "table": "receipts",
      "name": "Receipt",
      "domain": "payments",
      "description": "Регистрация чека отдельна от платежа; повтор не создаёт charge.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "needed",
        "queued",
        "submitted",
        "registered",
        "retrying",
        "failed_needs_human"
      ],
      "fields": [
        {
          "name": "order_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "orders.id"
          ],
          "sensitive": false
        },
        {
          "name": "kind",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "provider_id",
          "type": "VARCHAR(160)",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": "needed",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_receipts_order_id",
          "columns": [
            "order_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_receipts_positive_revision",
        "ck_receipts_status_values",
        "fk_receipts_order_id_orders",
        "pk_receipts",
        "uq_receipts_provider_id"
      ],
      "ddl": "CREATE TABLE receipts (\n\torder_id UUID NOT NULL,\n\tkind VARCHAR(24) NOT NULL,\n\tprovider_id VARCHAR(160),\n\tstatus VARCHAR(32) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_receipts PRIMARY KEY (id),\n\tCONSTRAINT fk_receipts_order_id_orders FOREIGN KEY(order_id) REFERENCES orders (id),\n\tCONSTRAINT uq_receipts_provider_id UNIQUE (provider_id),\n\tCONSTRAINT ck_receipts_status_values CHECK (status IN ('needed', 'queued', 'submitted', 'registered', 'retrying', 'failed_needs_human')),\n\tCONSTRAINT ck_receipts_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "settlement worker",
        "read": "client own; owner scope",
        "update": "fiscal adapter status",
        "delete": "не удалять как замену корректирующему чеку"
      },
      "commandIds": [
        "CMD-WEBHOOK",
        "CMD-RECONCILE",
        "CMD-CASH",
        "CMD-PAYMENT-CAPTURE",
        "CMD-RECEIPT",
        "CMD-VISIT-CLOSE"
      ],
      "nodeIds": [
        "C34",
        "O22",
        "P08",
        "P09",
        "P10",
        "P13",
        "P14",
        "P15",
        "P19",
        "P20",
        "P21",
        "P25",
        "S07"
      ]
    },
    {
      "id": "DB-recovery-cases",
      "table": "recovery_cases",
      "name": "RecoveryCase",
      "domain": "operations",
      "description": "Восстановление доступа требует доказательства; не сливает identities по контакту.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [
        "pending_review",
        "verified",
        "rejected",
        "closed"
      ],
      "fields": [
        {
          "name": "reference",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending_review",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_recovery_cases_positive_revision",
        "ck_recovery_cases_status_values",
        "pk_recovery_cases",
        "uq_recovery_cases_reference"
      ],
      "ddl": "CREATE TABLE recovery_cases (\n\treference VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_recovery_cases PRIMARY KEY (id),\n\tCONSTRAINT uq_recovery_cases_reference UNIQUE (reference),\n\tCONSTRAINT ck_recovery_cases_status_values CHECK (status IN ('pending_review', 'verified', 'rejected', 'closed')),\n\tCONSTRAINT ck_recovery_cases_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "public adapter + anti-abuse",
        "read": "по защищённой case reference",
        "update": "verified human/adapter decision",
        "delete": "retention recovery evidence"
      },
      "commandIds": [
        "CMD-RECOVERY"
      ],
      "nodeIds": [
        "A10",
        "R07"
      ]
    },
    {
      "id": "DB-referrals",
      "table": "referrals",
      "name": "Referral",
      "domain": "club",
      "description": "Ссылка на qualifying visit; условия награды пока отдельная policy.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "pending_review",
        "qualified",
        "rewarded",
        "reversed",
        "rejected"
      ],
      "fields": [
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "code",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "qualifying_visit_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "visits.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending_review",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_referrals_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_referrals_positive_revision",
        "ck_referrals_status_values",
        "fk_referrals_client_id_identities",
        "fk_referrals_qualifying_visit_id_visits",
        "pk_referrals",
        "uq_referrals_qualifying_visit_id"
      ],
      "ddl": "CREATE TABLE referrals (\n\tclient_id UUID NOT NULL,\n\tcode VARCHAR(80) NOT NULL,\n\tqualifying_visit_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_referrals PRIMARY KEY (id),\n\tCONSTRAINT fk_referrals_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT uq_referrals_qualifying_visit_id UNIQUE (qualifying_visit_id),\n\tCONSTRAINT fk_referrals_qualifying_visit_id_visits FOREIGN KEY(qualifying_visit_id) REFERENCES visits (id),\n\tCONSTRAINT ck_referrals_status_values CHECK (status IN ('pending_review', 'qualified', 'rewarded', 'reversed', 'rejected')),\n\tCONSTRAINT ck_referrals_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client qualifying visit",
        "read": "client own",
        "update": "qualify/reward/reverse по policy",
        "delete": "сохранять reversal"
      },
      "commandIds": [
        "CMD-REFERRAL"
      ],
      "nodeIds": [
        "L10",
        "L11"
      ]
    },
    {
      "id": "DB-refunds",
      "table": "refunds",
      "name": "Refund",
      "domain": "payments",
      "description": "Pending + succeeded резервируют captured под блокировкой исходного payment.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "requested",
        "authorized",
        "pending",
        "succeeded",
        "canceled",
        "review_required"
      ],
      "fields": [
        {
          "name": "payment_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "payment_intents.id"
          ],
          "sensitive": false
        },
        {
          "name": "amount_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "reason",
          "type": "VARCHAR(400)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "provider_id",
          "type": "VARCHAR(160)",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "requested",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_refunds_payment_id",
          "columns": [
            "payment_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_refunds_positive",
        "ck_refunds_positive_revision",
        "ck_refunds_status_values",
        "fk_refunds_payment_id_payment_intents",
        "pk_refunds",
        "uq_refunds_provider_id"
      ],
      "ddl": "CREATE TABLE refunds (\n\tpayment_id UUID NOT NULL,\n\tamount_minor INTEGER NOT NULL,\n\treason VARCHAR(400) NOT NULL,\n\tprovider_id VARCHAR(160),\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_refunds PRIMARY KEY (id),\n\tCONSTRAINT ck_refunds_positive CHECK (amount_minor > 0),\n\tCONSTRAINT fk_refunds_payment_id_payment_intents FOREIGN KEY(payment_id) REFERENCES payment_intents (id),\n\tCONSTRAINT uq_refunds_provider_id UNIQUE (provider_id),\n\tCONSTRAINT ck_refunds_status_values CHECK (status IN ('requested', 'authorized', 'pending', 'succeeded', 'canceled', 'review_required')),\n\tCONSTRAINT ck_refunds_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "scoped owner + captured balance",
        "read": "client order; owner scope",
        "update": "verified provider result",
        "delete": "cancel/review, не удалить ledger"
      },
      "commandIds": [
        "CMD-WEBHOOK",
        "CMD-REFUND",
        "CMD-RECONCILE"
      ],
      "nodeIds": [
        "O22",
        "P08",
        "P13",
        "P17",
        "P19",
        "P21",
        "P25"
      ]
    },
    {
      "id": "DB-reminder-preferences",
      "table": "reminder_preferences",
      "name": "ReminderPreference",
      "domain": "experience",
      "description": "Настройка своего booking, не факт доставки или прочтения.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "channel",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "disabled",
          "type": "BOOLEAN",
          "nullable": false,
          "primary": false,
          "default": "False",
          "references": [],
          "sensitive": false
        },
        {
          "name": "snooze_until",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_reminder_preferences_positive_revision",
        "fk_reminder_preferences_booking_id_bookings",
        "pk_reminder_preferences",
        "uq_reminder_preferences_booking_id"
      ],
      "ddl": "CREATE TABLE reminder_preferences (\n\tbooking_id UUID NOT NULL,\n\tchannel VARCHAR(24) NOT NULL,\n\tdisabled BOOLEAN NOT NULL,\n\tsnooze_until TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_reminder_preferences PRIMARY KEY (id),\n\tCONSTRAINT uq_reminder_preferences_booking_id UNIQUE (booking_id),\n\tCONSTRAINT fk_reminder_preferences_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_reminder_preferences_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client собственный booking",
        "read": "client own",
        "update": "channel/snooze/disable",
        "delete": "удаление настройки не отменяет booking"
      },
      "commandIds": [
        "CMD-NOTIFICATION",
        "CMD-REMINDER"
      ],
      "nodeIds": [
        "C42",
        "N00",
        "N01",
        "N02",
        "N03",
        "N04",
        "N06",
        "N07",
        "N08"
      ]
    },
    {
      "id": "DB-renewal-attempts",
      "table": "renewal_attempts",
      "name": "RenewalAttempt",
      "domain": "club",
      "description": "Одна попытка на период; unknown не повторяет charge новым ключом.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "pending",
        "succeeded",
        "failed",
        "unknown"
      ],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "club_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "period_key",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "payment_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "payment_intents.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_renewal_attempts_positive_revision",
        "ck_renewal_attempts_status_values",
        "fk_renewal_attempts_membership_id_club_memberships",
        "fk_renewal_attempts_payment_id_payment_intents",
        "pk_renewal_attempts",
        "uq_renewal_attempts_membership_id"
      ],
      "ddl": "CREATE TABLE renewal_attempts (\n\tmembership_id UUID NOT NULL,\n\tperiod_key VARCHAR(80) NOT NULL,\n\tpayment_id UUID,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_renewal_attempts PRIMARY KEY (id),\n\tCONSTRAINT uq_renewal_attempts_membership_id UNIQUE (membership_id, period_key),\n\tCONSTRAINT fk_renewal_attempts_membership_id_club_memberships FOREIGN KEY(membership_id) REFERENCES club_memberships (id),\n\tCONSTRAINT fk_renewal_attempts_payment_id_payment_intents FOREIGN KEY(payment_id) REFERENCES payment_intents (id),\n\tCONSTRAINT ck_renewal_attempts_status_values CHECK (status IN ('pending', 'succeeded', 'failed', 'unknown')),\n\tCONSTRAINT ck_renewal_attempts_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "worker один periodKey",
        "read": "client own operation; service",
        "update": "verified result/reconcile unknown",
        "delete": "ledger retention, не новый charge"
      },
      "commandIds": [
        "CMD-RENEWAL"
      ],
      "nodeIds": [
        "L04",
        "L05",
        "L07"
      ]
    },
    {
      "id": "DB-renewal-mandates",
      "table": "renewal_mandates",
      "name": "RenewalMandate",
      "domain": "club",
      "description": "Отдельное разрешение на автопродление; unlink останавливает mandate.",
      "source": "apps/backend/app/club/models.py",
      "status": "schema-implemented",
      "states": [
        "active",
        "revoked"
      ],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "club_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "payment_method_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "saved_payment_methods.id"
          ],
          "sensitive": false
        },
        {
          "name": "consent_version",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "active",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_renewal_mandates_positive_revision",
        "ck_renewal_mandates_status_values",
        "fk_renewal_mandates_membership_id_club_memberships",
        "fk_renewal_mandates_payment_method_id_saved_payment_methods",
        "pk_renewal_mandates",
        "uq_renewal_mandates_membership_id"
      ],
      "ddl": "CREATE TABLE renewal_mandates (\n\tmembership_id UUID NOT NULL,\n\tpayment_method_id UUID NOT NULL,\n\tconsent_version VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_renewal_mandates PRIMARY KEY (id),\n\tCONSTRAINT uq_renewal_mandates_membership_id UNIQUE (membership_id),\n\tCONSTRAINT fk_renewal_mandates_membership_id_club_memberships FOREIGN KEY(membership_id) REFERENCES club_memberships (id),\n\tCONSTRAINT fk_renewal_mandates_payment_method_id_saved_payment_methods FOREIGN KEY(payment_method_id) REFERENCES saved_payment_methods (id),\n\tCONSTRAINT ck_renewal_mandates_status_values CHECK (status IN ('active', 'revoked')),\n\tCONSTRAINT ck_renewal_mandates_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client separate renewal consent",
        "read": "client own",
        "update": "revoke при cancel/unlink",
        "delete": "retention consent proof"
      },
      "commandIds": [
        "CMD-UNLINK-CARD",
        "CMD-MEMBERSHIP",
        "CMD-RENEWAL"
      ],
      "nodeIds": [
        "L04",
        "L05",
        "L06",
        "L07",
        "P05"
      ]
    },
    {
      "id": "DB-reservations",
      "table": "reservations",
      "name": "Reservation",
      "domain": "booking",
      "description": "Единый inventory для holds и bookings, [start,end). Два независимых EXCLUDE.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "hold_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "slot_holds.id"
          ],
          "sensitive": false
        },
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "resource_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "resources.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "active",
          "type": "BOOLEAN",
          "nullable": false,
          "primary": false,
          "default": "True",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_reservations_booking_id",
          "columns": [
            "booking_id"
          ],
          "unique": false
        },
        {
          "name": "ix_reservations_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        },
        {
          "name": "ix_reservations_resource_id",
          "columns": [
            "resource_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_reservations_interval",
        "ck_reservations_positive_revision",
        "fk_reservations_booking_id_bookings",
        "fk_reservations_hold_id_slot_holds",
        "fk_reservations_membership_id_staff_memberships",
        "fk_reservations_resource_id_resources",
        "pk_reservations",
        "reservations_resource_no_overlap",
        "reservations_staff_no_overlap",
        "uq_reservations_hold_id"
      ],
      "ddl": "CREATE TABLE reservations (\n\thold_id UUID NOT NULL,\n\tbooking_id UUID,\n\tmembership_id UUID NOT NULL,\n\tresource_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tactive BOOLEAN NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_reservations PRIMARY KEY (id),\n\tCONSTRAINT ck_reservations_interval CHECK (ends_at > starts_at),\n\tCONSTRAINT uq_reservations_hold_id UNIQUE (hold_id),\n\tCONSTRAINT fk_reservations_hold_id_slot_holds FOREIGN KEY(hold_id) REFERENCES slot_holds (id),\n\tCONSTRAINT fk_reservations_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT fk_reservations_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT fk_reservations_resource_id_resources FOREIGN KEY(resource_id) REFERENCES resources (id),\n\tCONSTRAINT ck_reservations_positive_revision CHECK (revision >= 1),\n\tCONSTRAINT reservations_staff_no_overlap EXCLUDE USING gist (membership_id WITH =, tstzrange(starts_at, ends_at, '[)') WITH &&) WHERE (active),\n\tCONSTRAINT reservations_resource_no_overlap EXCLUDE USING gist (resource_id WITH =, tstzrange(starts_at, ends_at, '[)') WITH &&) WHERE (active)\n)",
      "crud": {
        "create": "в транзакции hold/booking",
        "read": "только availability projection без PII",
        "update": "active=false при release; atomic move",
        "delete": "retention после истечения обязательств"
      },
      "commandIds": [
        "CMD-SHIFT",
        "CMD-HOLD",
        "CMD-BOOK",
        "CMD-MOVE",
        "CMD-CANCEL",
        "CMD-SCOPE",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "B12",
        "B14",
        "C04",
        "C07",
        "C08",
        "C10",
        "C14",
        "C15",
        "C23",
        "C25",
        "C33",
        "G03",
        "G09",
        "O14",
        "P23",
        "S00",
        "S01",
        "S04"
      ]
    },
    {
      "id": "DB-resources",
      "table": "resources",
      "name": "Resource",
      "domain": "organizations",
      "description": "Кресло/ресурс филиала; резервируется вместе с мастером.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "active",
        "blocked",
        "archived"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "name",
          "type": "VARCHAR(120)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "active",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_resources_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_resources_positive_revision",
        "ck_resources_status_values",
        "fk_resources_branch_id_branches",
        "pk_resources"
      ],
      "ddl": "CREATE TABLE resources (\n\tbranch_id UUID NOT NULL,\n\tname VARCHAR(120) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_resources PRIMARY KEY (id),\n\tCONSTRAINT fk_resources_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT ck_resources_status_values CHECK (status IN ('active', 'blocked', 'archived')),\n\tCONSTRAINT ck_resources_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner своего филиала",
        "read": "owner свой филиал",
        "update": "block/unblock с impact review",
        "delete": "архив, не удаление прошлых reservations"
      },
      "commandIds": [
        "CMD-SHIFT",
        "CMD-BRANCH",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "C04",
        "C08",
        "C14",
        "C15",
        "G03",
        "G09",
        "O02",
        "O14",
        "O19",
        "S01",
        "S04"
      ]
    },
    {
      "id": "DB-safety-incidents",
      "table": "safety_incidents",
      "name": "SafetyIncident",
      "domain": "experience",
      "description": "Минимальное описание инцидента; приостановка не создаёт медицинский диагноз.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "visit_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "visits.id"
          ],
          "sensitive": false
        },
        {
          "name": "author_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "category",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "assistance",
          "type": "VARCHAR(400)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_safety_incidents_visit_id",
          "columns": [
            "visit_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_safety_incidents_positive_revision",
        "fk_safety_incidents_author_id_identities",
        "fk_safety_incidents_visit_id_visits",
        "pk_safety_incidents"
      ],
      "ddl": "CREATE TABLE safety_incidents (\n\tvisit_id UUID NOT NULL,\n\tauthor_id UUID NOT NULL,\n\tcategory VARCHAR(32) NOT NULL,\n\tassistance VARCHAR(400) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_safety_incidents PRIMARY KEY (id),\n\tCONSTRAINT fk_safety_incidents_visit_id_visits FOREIGN KEY(visit_id) REFERENCES visits (id),\n\tCONSTRAINT fk_safety_incidents_author_id_identities FOREIGN KEY(author_id) REFERENCES identities (id),\n\tCONSTRAINT ck_safety_incidents_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "assigned barber",
        "read": "минимально необходимый assigned scope",
        "update": "follow-up через support case",
        "delete": "retention по purpose"
      },
      "commandIds": [
        "CMD-INCIDENT"
      ],
      "nodeIds": [
        "B23"
      ]
    },
    {
      "id": "DB-saved-payment-methods",
      "table": "saved_payment_methods",
      "name": "SavedPaymentMethod",
      "domain": "payments",
      "description": "Только provider token reference и маска; PAN/CVV запрещены.",
      "source": "apps/backend/app/payments/models.py",
      "status": "schema-implemented",
      "states": [
        "active",
        "disabled"
      ],
      "fields": [
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "vault_reference",
          "type": "VARCHAR(240)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "label",
          "type": "VARCHAR(80)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "active",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_saved_payment_methods_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_saved_payment_methods_positive_revision",
        "ck_saved_payment_methods_status_values",
        "fk_saved_payment_methods_client_id_identities",
        "pk_saved_payment_methods"
      ],
      "ddl": "CREATE TABLE saved_payment_methods (\n\tclient_id UUID NOT NULL,\n\tvault_reference VARCHAR(240) NOT NULL,\n\tlabel VARCHAR(80) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_saved_payment_methods PRIMARY KEY (id),\n\tCONSTRAINT fk_saved_payment_methods_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT ck_saved_payment_methods_status_values CHECK (status IN ('active', 'disabled')),\n\tCONSTRAINT ck_saved_payment_methods_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "verified adapter + save consent",
        "read": "client own redacted label",
        "update": "disable/revalidate",
        "delete": "unlink + revoke mandate; vault purge отдельно"
      },
      "commandIds": [
        "CMD-PAY",
        "CMD-METHODS",
        "CMD-UNLINK-CARD"
      ],
      "nodeIds": [
        "C37",
        "P03",
        "P04",
        "P05",
        "P06"
      ]
    },
    {
      "id": "DB-service-versions",
      "table": "service_versions",
      "name": "ServiceVersion",
      "domain": "organizations",
      "description": "Снимок тарифа. Старые quote/booking ссылаются на прежнюю версию.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "service_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "services.id"
          ],
          "sensitive": false
        },
        {
          "name": "number",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "name",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "price_minor",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "duration_minutes",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "buffer_minutes",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "0",
          "references": [],
          "sensitive": false
        },
        {
          "name": "required_skills",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": "list",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_service_versions_service_id",
          "columns": [
            "service_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_service_versions_positive_duration",
        "ck_service_versions_positive_revision",
        "ck_service_versions_price_nonnegative",
        "fk_service_versions_service_id_services",
        "pk_service_versions",
        "uq_service_versions_service_id"
      ],
      "ddl": "CREATE TABLE service_versions (\n\tservice_id UUID NOT NULL,\n\tnumber INTEGER NOT NULL,\n\tname VARCHAR(160) NOT NULL,\n\tprice_minor INTEGER NOT NULL,\n\tduration_minutes INTEGER NOT NULL,\n\tbuffer_minutes INTEGER NOT NULL,\n\trequired_skills JSON NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_service_versions PRIMARY KEY (id),\n\tCONSTRAINT uq_service_versions_service_id UNIQUE (service_id, number),\n\tCONSTRAINT ck_service_versions_price_nonnegative CHECK (price_minor >= 0),\n\tCONSTRAINT ck_service_versions_positive_duration CHECK (duration_minutes > 0 AND buffer_minutes >= 0),\n\tCONSTRAINT fk_service_versions_service_id_services FOREIGN KEY(service_id) REFERENCES services (id),\n\tCONSTRAINT ck_service_versions_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "новая версия через catalog command",
        "read": "в составе каталога/собственного quote",
        "update": "запрещено: immutable",
        "delete": "запрещено: immutable"
      },
      "commandIds": [
        "CMD-QUOTE",
        "CMD-CATALOG",
        "CMD-PUBLIC-CATALOG",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "C01",
        "C02",
        "C03",
        "C04",
        "C06",
        "C08",
        "C14",
        "C15",
        "G00",
        "G01",
        "G02",
        "G03",
        "G04",
        "G08",
        "G09",
        "O03",
        "S01"
      ]
    },
    {
      "id": "DB-services",
      "table": "services",
      "name": "Service",
      "domain": "organizations",
      "description": "Стабильная услуга; цена и длительность находятся в неизменяемой версии.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "draft",
        "published",
        "archived"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "name",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "draft",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_services_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_services_positive_revision",
        "ck_services_status_values",
        "fk_services_branch_id_branches",
        "pk_services"
      ],
      "ddl": "CREATE TABLE services (\n\tbranch_id UUID NOT NULL,\n\tname VARCHAR(160) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_services PRIMARY KEY (id),\n\tCONSTRAINT fk_services_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT ck_services_status_values CHECK (status IN ('draft', 'published', 'archived')),\n\tCONSTRAINT ck_services_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner своего филиала",
        "read": "public published; owner свои",
        "update": "новая ServiceVersion и publication",
        "delete": "архив, версии сохраняются"
      },
      "commandIds": [
        "CMD-QUOTE",
        "CMD-CATALOG",
        "CMD-PUBLISH",
        "CMD-PUBLIC-CATALOG",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "C01",
        "C02",
        "C03",
        "C04",
        "C06",
        "C08",
        "C14",
        "C15",
        "G00",
        "G01",
        "G02",
        "G03",
        "G04",
        "G08",
        "G09",
        "O03",
        "O12",
        "S01"
      ]
    },
    {
      "id": "DB-sessions",
      "table": "sessions",
      "name": "Session",
      "domain": "identity",
      "description": "Отзываемая серверная сессия. В БД хранится только SHA-256 случайного токена.",
      "source": "apps/backend/app/identity/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "token_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "revoked_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_sessions_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_sessions_positive_revision",
        "fk_sessions_identity_id_identities",
        "pk_sessions",
        "uq_sessions_token_digest"
      ],
      "ddl": "CREATE TABLE sessions (\n\tidentity_id UUID NOT NULL,\n\ttoken_digest VARCHAR(64) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\trevoked_at TIMESTAMP WITH TIME ZONE,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_sessions PRIMARY KEY (id),\n\tCONSTRAINT fk_sessions_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT uq_sessions_token_digest UNIQUE (token_digest),\n\tCONSTRAINT ck_sessions_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "проверенный вход либо server fixture",
        "read": "свои метаданные, без token digest",
        "update": "expiry/revoke",
        "delete": "retention worker после отзыва"
      },
      "commandIds": [
        "CMD-AUTH",
        "CMD-OFFBOARD",
        "CMD-TRANSFER",
        "CMD-AUTH-CALLBACK",
        "CMD-SESSION",
        "CMD-LOGOUT"
      ],
      "nodeIds": [
        "A00",
        "A01",
        "A02",
        "A03",
        "A04",
        "A07",
        "A11",
        "A12",
        "A13",
        "C00",
        "O17",
        "O18",
        "O24",
        "S03"
      ]
    },
    {
      "id": "DB-shift-requests",
      "table": "shift_requests",
      "name": "ShiftRequest",
      "domain": "workforce",
      "description": "Просьба об отпуске/уходе — ещё не отмена будущих визитов.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "requested",
        "accepted",
        "declined",
        "withdrawn"
      ],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "kind",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "requested",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_shift_requests_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_shift_requests_positive_revision",
        "ck_shift_requests_status_values",
        "fk_shift_requests_membership_id_staff_memberships",
        "pk_shift_requests"
      ],
      "ddl": "CREATE TABLE shift_requests (\n\tmembership_id UUID NOT NULL,\n\tkind VARCHAR(24) NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_shift_requests PRIMARY KEY (id),\n\tCONSTRAINT fk_shift_requests_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT ck_shift_requests_status_values CHECK (status IN ('requested', 'accepted', 'declined', 'withdrawn')),\n\tCONSTRAINT ck_shift_requests_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "barber собственный membership",
        "read": "barber own; owner scope",
        "update": "approve/decline/withdraw",
        "delete": "архив resolved request"
      },
      "commandIds": [
        "CMD-SHIFT-REQUEST"
      ],
      "nodeIds": [
        "B07",
        "B22"
      ]
    },
    {
      "id": "DB-shifts",
      "table": "shifts",
      "name": "Shift",
      "domain": "workforce",
      "description": "UTC-интервал назначенного мастера и кресла; конфликты визитов не скрываются.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "open",
        "closed",
        "canceled"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "resource_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "resources.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "open",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_shifts_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        },
        {
          "name": "ix_shifts_membership_id",
          "columns": [
            "membership_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_shifts_interval",
        "ck_shifts_positive_revision",
        "ck_shifts_status_values",
        "fk_shifts_branch_id_branches",
        "fk_shifts_membership_id_staff_memberships",
        "fk_shifts_resource_id_resources",
        "pk_shifts"
      ],
      "ddl": "CREATE TABLE shifts (\n\tbranch_id UUID NOT NULL,\n\tmembership_id UUID NOT NULL,\n\tresource_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_shifts PRIMARY KEY (id),\n\tCONSTRAINT ck_shifts_interval CHECK (ends_at > starts_at),\n\tCONSTRAINT fk_shifts_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT fk_shifts_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT fk_shifts_resource_id_resources FOREIGN KEY(resource_id) REFERENCES resources (id),\n\tCONSTRAINT ck_shifts_status_values CHECK (status IN ('open', 'closed', 'canceled')),\n\tCONSTRAINT ck_shifts_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner branch scope",
        "read": "barber own; owner scope; public slots",
        "update": "revision, запрет молча терять визиты",
        "delete": "cancel/close с impact queue"
      },
      "commandIds": [
        "CMD-SHIFT",
        "CMD-HOLD",
        "CMD-PUBLISH",
        "CMD-DAY",
        "CMD-SHIFT-CLOSE",
        "CMD-AVAILABILITY"
      ],
      "nodeIds": [
        "B06",
        "B10",
        "B19",
        "C04",
        "C07",
        "C08",
        "C14",
        "C15",
        "G03",
        "G09",
        "O12",
        "O14",
        "S01",
        "S04"
      ]
    },
    {
      "id": "DB-slot-holds",
      "table": "slot_holds",
      "name": "SlotHold",
      "domain": "booking",
      "description": "TTL только по серверу; SQL exclusion защищает мастера и кресло.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "held",
        "consumed",
        "expired",
        "released"
      ],
      "fields": [
        {
          "name": "quote_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "quotes.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "shift_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "shifts.id"
          ],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "held",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_slot_holds_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        },
        {
          "name": "ix_slot_holds_quote_id",
          "columns": [
            "quote_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_slot_holds_interval",
        "ck_slot_holds_positive_revision",
        "ck_slot_holds_status_values",
        "fk_slot_holds_client_id_identities",
        "fk_slot_holds_quote_id_quotes",
        "fk_slot_holds_shift_id_shifts",
        "pk_slot_holds"
      ],
      "ddl": "CREATE TABLE slot_holds (\n\tquote_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tshift_id UUID NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_slot_holds PRIMARY KEY (id),\n\tCONSTRAINT ck_slot_holds_interval CHECK (ends_at > starts_at),\n\tCONSTRAINT fk_slot_holds_quote_id_quotes FOREIGN KEY(quote_id) REFERENCES quotes (id),\n\tCONSTRAINT fk_slot_holds_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_slot_holds_shift_id_shifts FOREIGN KEY(shift_id) REFERENCES shifts (id),\n\tCONSTRAINT ck_slot_holds_status_values CHECK (status IN ('held', 'consumed', 'expired', 'released')),\n\tCONSTRAINT ck_slot_holds_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client own quote + серверная availability",
        "read": "client own",
        "update": "consume/release/expire",
        "delete": "retention без потери booking history"
      },
      "commandIds": [
        "CMD-HOLD",
        "CMD-BOOK",
        "CMD-MOVE",
        "CMD-REASSIGN",
        "CMD-WAITLIST-OFFER",
        "CMD-WAITLIST-CLAIM"
      ],
      "nodeIds": [
        "C07",
        "C10",
        "C14",
        "C15",
        "C23",
        "O15",
        "O16",
        "S00",
        "S01"
      ]
    },
    {
      "id": "DB-staff-invitations",
      "table": "staff_invitations",
      "name": "Invitation",
      "domain": "workforce",
      "description": "Одноразовое приглашение конкретному identity и версии offer.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "pending",
        "claimed",
        "expired",
        "revoked"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "offer_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "offers.id"
          ],
          "sensitive": false
        },
        {
          "name": "token_digest",
          "type": "VARCHAR(64)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "pending",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_staff_invitations_positive_revision",
        "ck_staff_invitations_status_values",
        "fk_staff_invitations_branch_id_branches",
        "fk_staff_invitations_identity_id_identities",
        "fk_staff_invitations_offer_id_offers",
        "fk_staff_invitations_organization_id_organizations",
        "pk_staff_invitations",
        "uq_staff_invitations_token_digest"
      ],
      "ddl": "CREATE TABLE staff_invitations (\n\torganization_id UUID NOT NULL,\n\tbranch_id UUID NOT NULL,\n\tidentity_id UUID NOT NULL,\n\toffer_id UUID NOT NULL,\n\ttoken_digest VARCHAR(64) NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_staff_invitations PRIMARY KEY (id),\n\tCONSTRAINT fk_staff_invitations_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_staff_invitations_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT fk_staff_invitations_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT fk_staff_invitations_offer_id_offers FOREIGN KEY(offer_id) REFERENCES offers (id),\n\tCONSTRAINT uq_staff_invitations_token_digest UNIQUE (token_digest),\n\tCONSTRAINT ck_staff_invitations_status_values CHECK (status IN ('pending', 'claimed', 'expired', 'revoked')),\n\tCONSTRAINT ck_staff_invitations_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner, конкретные identity/offer/branch",
        "read": "owner + intended recipient без digest",
        "update": "single-use claim/revoke/expire",
        "delete": "TTL очистка секретной части"
      },
      "commandIds": [
        "CMD-INVITE",
        "CMD-INVITE-ACCEPT"
      ],
      "nodeIds": [
        "B00",
        "B01",
        "B02",
        "B03",
        "B21",
        "O10"
      ]
    },
    {
      "id": "DB-staff-memberships",
      "table": "staff_memberships",
      "name": "Membership",
      "domain": "organizations",
      "description": "Роль и scope из БД; offboarding немедленно прекращает доступ.",
      "source": "apps/backend/app/organizations/models.py",
      "status": "schema-implemented",
      "states": [
        "onboarding",
        "active",
        "suspended",
        "revoked"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "identity_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "role",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "onboarding",
          "references": [],
          "sensitive": false
        },
        {
          "name": "cashier",
          "type": "BOOLEAN",
          "nullable": false,
          "primary": false,
          "default": "False",
          "references": [],
          "sensitive": false
        },
        {
          "name": "bookable",
          "type": "BOOLEAN",
          "nullable": false,
          "primary": false,
          "default": "False",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_staff_memberships_identity_id",
          "columns": [
            "identity_id"
          ],
          "unique": false
        },
        {
          "name": "ix_staff_memberships_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_staff_memberships_positive_revision",
        "ck_staff_memberships_role_values",
        "ck_staff_memberships_status_values",
        "fk_staff_memberships_branch_id_branches",
        "fk_staff_memberships_identity_id_identities",
        "fk_staff_memberships_organization_id_organizations",
        "pk_staff_memberships",
        "uq_staff_memberships_organization_id"
      ],
      "ddl": "CREATE TABLE staff_memberships (\n\torganization_id UUID NOT NULL,\n\tidentity_id UUID NOT NULL,\n\tbranch_id UUID,\n\trole VARCHAR(24) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tcashier BOOLEAN NOT NULL,\n\tbookable BOOLEAN NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_staff_memberships PRIMARY KEY (id),\n\tCONSTRAINT uq_staff_memberships_organization_id UNIQUE (organization_id, identity_id, role),\n\tCONSTRAINT fk_staff_memberships_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_staff_memberships_identity_id_identities FOREIGN KEY(identity_id) REFERENCES identities (id),\n\tCONSTRAINT fk_staff_memberships_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT ck_staff_memberships_status_values CHECK (status IN ('onboarding', 'active', 'suspended', 'revoked')),\n\tCONSTRAINT ck_staff_memberships_positive_revision CHECK (revision >= 1),\n\tCONSTRAINT ck_staff_memberships_role_values CHECK (role IN ('owner','barber'))\n)",
      "crud": {
        "create": "claim принятого invitation либо provision owner",
        "read": "свой context; owner scope",
        "update": "onboarding/readiness/offboarding",
        "delete": "revoke, история сохраняется"
      },
      "commandIds": [
        "CMD-INVITE",
        "CMD-SHIFT",
        "CMD-ABSENCE",
        "CMD-OFFBOARD",
        "CMD-ORG",
        "CMD-INVITE-ACCEPT",
        "CMD-ONBOARD",
        "CMD-PUBLISH",
        "CMD-SHIFT-REQUEST",
        "CMD-DAY",
        "CMD-EARNINGS",
        "CMD-TRANSFER",
        "CMD-SESSION",
        "CMD-CASH"
      ],
      "nodeIds": [
        "A07",
        "A11",
        "A13",
        "B00",
        "B01",
        "B02",
        "B03",
        "B04",
        "B05",
        "B06",
        "B07",
        "B08",
        "B09",
        "B10",
        "B20",
        "B21",
        "B22",
        "C00",
        "O00",
        "O01",
        "O10",
        "O12",
        "O14",
        "O17",
        "O18",
        "O24",
        "P14",
        "P15",
        "S03",
        "S04"
      ]
    },
    {
      "id": "DB-staff-onboarding",
      "table": "staff_onboarding",
      "name": "Onboarding",
      "domain": "workforce",
      "description": "Навыки и принятые правила; bookable подтверждает владелец.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "submitted",
        "verified"
      ],
      "fields": [
        {
          "name": "membership_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "staff_memberships.id"
          ],
          "sensitive": false
        },
        {
          "name": "skills",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "accepted_policy_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "policy_versions.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "submitted",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_staff_onboarding_positive_revision",
        "ck_staff_onboarding_status_values",
        "fk_staff_onboarding_accepted_policy_id_policy_versions",
        "fk_staff_onboarding_membership_id_staff_memberships",
        "pk_staff_onboarding",
        "uq_staff_onboarding_membership_id"
      ],
      "ddl": "CREATE TABLE staff_onboarding (\n\tmembership_id UUID NOT NULL,\n\tskills JSON NOT NULL,\n\taccepted_policy_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_staff_onboarding PRIMARY KEY (id),\n\tCONSTRAINT uq_staff_onboarding_membership_id UNIQUE (membership_id),\n\tCONSTRAINT fk_staff_onboarding_membership_id_staff_memberships FOREIGN KEY(membership_id) REFERENCES staff_memberships (id),\n\tCONSTRAINT fk_staff_onboarding_accepted_policy_id_policy_versions FOREIGN KEY(accepted_policy_id) REFERENCES policy_versions (id),\n\tCONSTRAINT ck_staff_onboarding_status_values CHECK (status IN ('submitted', 'verified')),\n\tCONSTRAINT ck_staff_onboarding_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "собственный membership",
        "read": "свой; owner branch scope",
        "update": "свой submission; owner verification",
        "delete": "сохранить evidence до retention"
      },
      "commandIds": [
        "CMD-ONBOARD"
      ],
      "nodeIds": [
        "B04",
        "B05"
      ]
    },
    {
      "id": "DB-support-cases",
      "table": "support_cases",
      "name": "SupportCase",
      "domain": "operations",
      "description": "Обращение с ответственным и сроком; resolved требует конкретного результата.",
      "source": "apps/backend/app/operations/models.py",
      "status": "schema-implemented",
      "states": [
        "open",
        "in_progress",
        "resolved"
      ],
      "fields": [
        {
          "name": "organization_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "organizations.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "category",
          "type": "VARCHAR(32)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "description",
          "type": "VARCHAR(4000)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": true
        },
        {
          "name": "assignee_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "due_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "resolution",
          "type": "VARCHAR(2000)",
          "nullable": true,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "open",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_support_cases_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        },
        {
          "name": "ix_support_cases_organization_id",
          "columns": [
            "organization_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_support_cases_positive_revision",
        "ck_support_cases_status_values",
        "fk_support_cases_assignee_id_identities",
        "fk_support_cases_client_id_identities",
        "fk_support_cases_organization_id_organizations",
        "pk_support_cases"
      ],
      "ddl": "CREATE TABLE support_cases (\n\torganization_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tcategory VARCHAR(32) NOT NULL,\n\tdescription VARCHAR(4000) NOT NULL,\n\tassignee_id UUID NOT NULL,\n\tdue_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tresolution VARCHAR(2000),\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_support_cases PRIMARY KEY (id),\n\tCONSTRAINT fk_support_cases_organization_id_organizations FOREIGN KEY(organization_id) REFERENCES organizations (id),\n\tCONSTRAINT fk_support_cases_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT fk_support_cases_assignee_id_identities FOREIGN KEY(assignee_id) REFERENCES identities (id),\n\tCONSTRAINT ck_support_cases_status_values CHECK (status IN ('open', 'in_progress', 'resolved')),\n\tCONSTRAINT ck_support_cases_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client; owner назначается сервером",
        "read": "client own; scoped owner",
        "update": "ответственный/due_at/resolution",
        "delete": "закрытие и retention, не скрытое удаление"
      },
      "commandIds": [
        "CMD-CASE",
        "CMD-OPERATIONS",
        "CMD-INCIDENT",
        "CMD-CASE-RESOLVE"
      ],
      "nodeIds": [
        "B23",
        "C43",
        "O13",
        "O20",
        "O23",
        "P22",
        "S05",
        "S06"
      ]
    },
    {
      "id": "DB-vacancies",
      "table": "vacancies",
      "name": "Vacancy",
      "domain": "workforce",
      "description": "Набор в филиал; архивирование не удаляет принятые предложения.",
      "source": "apps/backend/app/workforce/models.py",
      "status": "schema-implemented",
      "states": [
        "open",
        "closed",
        "archived"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "title",
          "type": "VARCHAR(160)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "terms",
          "type": "VARCHAR(4000)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "open",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_vacancies_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_vacancies_positive_revision",
        "ck_vacancies_status_values",
        "fk_vacancies_branch_id_branches",
        "pk_vacancies"
      ],
      "ddl": "CREATE TABLE vacancies (\n\tbranch_id UUID NOT NULL,\n\ttitle VARCHAR(160) NOT NULL,\n\tterms VARCHAR(4000) NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_vacancies PRIMARY KEY (id),\n\tCONSTRAINT fk_vacancies_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT ck_vacancies_status_values CHECK (status IN ('open', 'closed', 'archived')),\n\tCONSTRAINT ck_vacancies_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "owner branch scope",
        "read": "owner scope; public после publication",
        "update": "условия новой версией/close",
        "delete": "архив с сохранением offer"
      },
      "commandIds": [
        "CMD-HIRING",
        "CMD-CANDIDATE"
      ],
      "nodeIds": [
        "O06",
        "O07",
        "O08",
        "O09",
        "O11"
      ]
    },
    {
      "id": "DB-visit-feedback",
      "table": "visit_feedback",
      "name": "Feedback",
      "domain": "experience",
      "description": "Отзыв своего завершённого визита; reward не зависит от положительной оценки.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [],
      "fields": [
        {
          "name": "visit_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "visits.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "score",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "text",
          "type": "VARCHAR(2000)",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "visibility",
          "type": "VARCHAR(16)",
          "nullable": false,
          "primary": false,
          "default": "private",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_visit_feedback_positive_revision",
        "fk_visit_feedback_client_id_identities",
        "fk_visit_feedback_visit_id_visits",
        "pk_visit_feedback",
        "uq_visit_feedback_visit_id"
      ],
      "ddl": "CREATE TABLE visit_feedback (\n\tvisit_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tscore INTEGER NOT NULL,\n\ttext VARCHAR(2000) NOT NULL,\n\tvisibility VARCHAR(16) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_visit_feedback PRIMARY KEY (id),\n\tCONSTRAINT uq_visit_feedback_visit_id UNIQUE (visit_id),\n\tCONSTRAINT fk_visit_feedback_visit_id_visits FOREIGN KEY(visit_id) REFERENCES visits (id),\n\tCONSTRAINT fk_visit_feedback_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT ck_visit_feedback_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client own completed visit",
        "read": "client own; public approved projection",
        "update": "редакция/withdraw по moderation policy",
        "delete": "withdraw + privacy retention"
      },
      "commandIds": [
        "CMD-REVIEW"
      ],
      "nodeIds": [
        "C35",
        "C36",
        "C37"
      ]
    },
    {
      "id": "DB-visit-scope-quotes",
      "table": "visit_scope_quotes",
      "name": "ScopeQuote",
      "domain": "experience",
      "description": "Дополнительный scope до выполнения: новая цена, время и отдельное согласие клиента.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [
        "proposed",
        "accepted",
        "declined",
        "expired"
      ],
      "fields": [
        {
          "name": "visit_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "visits.id"
          ],
          "sensitive": false
        },
        {
          "name": "quote_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "quotes.id"
          ],
          "sensitive": false
        },
        {
          "name": "visit_revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "proposed",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_visit_scope_quotes_visit_id",
          "columns": [
            "visit_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_visit_scope_quotes_positive_revision",
        "ck_visit_scope_quotes_status_values",
        "fk_visit_scope_quotes_quote_id_quotes",
        "fk_visit_scope_quotes_visit_id_visits",
        "pk_visit_scope_quotes"
      ],
      "ddl": "CREATE TABLE visit_scope_quotes (\n\tvisit_id UUID NOT NULL,\n\tquote_id UUID NOT NULL,\n\tvisit_revision INTEGER NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_visit_scope_quotes PRIMARY KEY (id),\n\tCONSTRAINT fk_visit_scope_quotes_visit_id_visits FOREIGN KEY(visit_id) REFERENCES visits (id),\n\tCONSTRAINT fk_visit_scope_quotes_quote_id_quotes FOREIGN KEY(quote_id) REFERENCES quotes (id),\n\tCONSTRAINT ck_visit_scope_quotes_status_values CHECK (status IN ('proposed', 'accepted', 'declined', 'expired')),\n\tCONSTRAINT ck_visit_scope_quotes_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "assigned barber предлагает",
        "read": "barber assigned; client own",
        "update": "client acceptance + reserve delta",
        "delete": "decline/expire"
      },
      "commandIds": [
        "CMD-SCOPE"
      ],
      "nodeIds": [
        "B12",
        "B14",
        "C33",
        "P23"
      ]
    },
    {
      "id": "DB-visits",
      "table": "visits",
      "name": "Visit",
      "domain": "experience",
      "description": "Консультация и выполнение услуги; фотографии необязательны.",
      "source": "apps/backend/app/experience/models.py",
      "status": "schema-implemented",
      "states": [
        "consultation",
        "agreed",
        "started",
        "completed",
        "interrupted"
      ],
      "fields": [
        {
          "name": "booking_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "bookings.id"
          ],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "consultation",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [],
      "constraints": [
        "ck_visits_positive_revision",
        "ck_visits_status_values",
        "fk_visits_booking_id_bookings",
        "pk_visits",
        "uq_visits_booking_id"
      ],
      "ddl": "CREATE TABLE visits (\n\tbooking_id UUID NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_visits PRIMARY KEY (id),\n\tCONSTRAINT uq_visits_booking_id UNIQUE (booking_id),\n\tCONSTRAINT fk_visits_booking_id_bookings FOREIGN KEY(booking_id) REFERENCES bookings (id),\n\tCONSTRAINT ck_visits_status_values CHECK (status IN ('consultation', 'agreed', 'started', 'completed', 'interrupted')),\n\tCONSTRAINT ck_visits_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "assigned barber arrive",
        "read": "client own; assigned barber",
        "update": "agree/start/complete/interrupt",
        "delete": "hard delete запрещён"
      },
      "commandIds": [
        "CMD-ARRIVE",
        "CMD-SERVICE",
        "CMD-PASSPORT",
        "CMD-SCOPE",
        "CMD-INCIDENT",
        "CMD-REFERRAL",
        "CMD-REVIEW",
        "CMD-VISIT-CLOSE"
      ],
      "nodeIds": [
        "B11",
        "B12",
        "B13",
        "B14",
        "B15",
        "B17",
        "B18",
        "B23",
        "C33",
        "C34",
        "C35",
        "C36",
        "C37",
        "L10",
        "L11",
        "P23",
        "S07"
      ]
    },
    {
      "id": "DB-waitlist-entries",
      "table": "waitlist_entries",
      "name": "WaitlistEntry",
      "domain": "booking",
      "description": "Предпочтения времени не резервируют ресурс; отзыв согласия останавливает delivery.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "waiting",
        "offered",
        "claimed",
        "withdrawn",
        "expired"
      ],
      "fields": [
        {
          "name": "branch_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "branches.id"
          ],
          "sensitive": false
        },
        {
          "name": "client_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "identities.id"
          ],
          "sensitive": false
        },
        {
          "name": "service_ids",
          "type": "JSON",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "starts_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "ends_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "waiting",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_waitlist_entries_branch_id",
          "columns": [
            "branch_id"
          ],
          "unique": false
        },
        {
          "name": "ix_waitlist_entries_client_id",
          "columns": [
            "client_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_waitlist_entries_positive_revision",
        "ck_waitlist_entries_status_values",
        "fk_waitlist_entries_branch_id_branches",
        "fk_waitlist_entries_client_id_identities",
        "pk_waitlist_entries"
      ],
      "ddl": "CREATE TABLE waitlist_entries (\n\tbranch_id UUID NOT NULL,\n\tclient_id UUID NOT NULL,\n\tservice_ids JSON NOT NULL,\n\tstarts_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tends_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_waitlist_entries PRIMARY KEY (id),\n\tCONSTRAINT fk_waitlist_entries_branch_id_branches FOREIGN KEY(branch_id) REFERENCES branches (id),\n\tCONSTRAINT fk_waitlist_entries_client_id_identities FOREIGN KEY(client_id) REFERENCES identities (id),\n\tCONSTRAINT ck_waitlist_entries_status_values CHECK (status IN ('waiting', 'offered', 'claimed', 'withdrawn', 'expired')),\n\tCONSTRAINT ck_waitlist_entries_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "client + notification consent",
        "read": "client own; scoped matching worker",
        "update": "withdraw/expire/offer",
        "delete": "withdraw; затем retention"
      },
      "commandIds": [
        "CMD-WAITLIST",
        "CMD-WAITLIST-OFFER",
        "CMD-WAITLIST-CLAIM"
      ],
      "nodeIds": [
        "C13",
        "C14",
        "C15"
      ]
    },
    {
      "id": "DB-waitlist-offers",
      "table": "waitlist_offers",
      "name": "WaitlistOffer",
      "domain": "booking",
      "description": "Один получатель, TTL и одноразовый claim; не равен booking.",
      "source": "apps/backend/app/booking/models.py",
      "status": "schema-implemented",
      "states": [
        "offered",
        "claimed",
        "expired",
        "declined"
      ],
      "fields": [
        {
          "name": "entry_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "waitlist_entries.id"
          ],
          "sensitive": false
        },
        {
          "name": "hold_id",
          "type": "UUID",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [
            "slot_holds.id"
          ],
          "sensitive": false
        },
        {
          "name": "expires_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": null,
          "references": [],
          "sensitive": false
        },
        {
          "name": "status",
          "type": "VARCHAR(24)",
          "nullable": false,
          "primary": false,
          "default": "offered",
          "references": [],
          "sensitive": false
        },
        {
          "name": "id",
          "type": "UUID",
          "nullable": false,
          "primary": true,
          "default": "uuid4",
          "references": [],
          "sensitive": false
        },
        {
          "name": "revision",
          "type": "INTEGER",
          "nullable": false,
          "primary": false,
          "default": "1",
          "references": [],
          "sensitive": false
        },
        {
          "name": "created_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        },
        {
          "name": "updated_at",
          "type": "TIMESTAMP WITH TIME ZONE",
          "nullable": false,
          "primary": false,
          "default": "now",
          "references": [],
          "sensitive": false
        }
      ],
      "indexes": [
        {
          "name": "ix_waitlist_offers_entry_id",
          "columns": [
            "entry_id"
          ],
          "unique": false
        }
      ],
      "constraints": [
        "ck_waitlist_offers_positive_revision",
        "ck_waitlist_offers_status_values",
        "fk_waitlist_offers_entry_id_waitlist_entries",
        "fk_waitlist_offers_hold_id_slot_holds",
        "pk_waitlist_offers",
        "uq_waitlist_offers_hold_id"
      ],
      "ddl": "CREATE TABLE waitlist_offers (\n\tentry_id UUID NOT NULL,\n\thold_id UUID NOT NULL,\n\texpires_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tstatus VARCHAR(24) NOT NULL,\n\tid UUID NOT NULL,\n\trevision INTEGER NOT NULL,\n\tcreated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tupdated_at TIMESTAMP WITH TIME ZONE NOT NULL,\n\tCONSTRAINT pk_waitlist_offers PRIMARY KEY (id),\n\tCONSTRAINT fk_waitlist_offers_entry_id_waitlist_entries FOREIGN KEY(entry_id) REFERENCES waitlist_entries (id),\n\tCONSTRAINT uq_waitlist_offers_hold_id UNIQUE (hold_id),\n\tCONSTRAINT fk_waitlist_offers_hold_id_slot_holds FOREIGN KEY(hold_id) REFERENCES slot_holds (id),\n\tCONSTRAINT ck_waitlist_offers_status_values CHECK (status IN ('offered', 'claimed', 'expired', 'declined')),\n\tCONSTRAINT ck_waitlist_offers_positive_revision CHECK (revision >= 1)\n)",
      "crud": {
        "create": "matching worker",
        "read": "только адресат",
        "update": "atomic claim/decline/expire",
        "delete": "TTL; claim history сохраняется"
      },
      "commandIds": [
        "CMD-WAITLIST-OFFER",
        "CMD-WAITLIST-CLAIM"
      ],
      "nodeIds": [
        "C14",
        "C15"
      ]
    }
  ],
  "operations": [
    {
      "id": "CMD-AUTH",
      "route": "POST /v1/auth/transactions",
      "role": "guest",
      "aggregate": "Identity",
      "consistency": "state + PKCE; callback consume once",
      "nodeIds": [
        "A00",
        "A04"
      ],
      "payload": "state, expiresAt, provider, continuation",
      "failures": [
        "unauthorized",
        "expired",
        "replay",
        "provider_unavailable"
      ],
      "events": [
        "AuthVerified",
        "AuthRejected"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "identities",
        "identity_links",
        "auth_transactions",
        "sessions"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": [
        "SCR-002"
      ]
    },
    {
      "id": "CMD-INVITE",
      "route": "POST /v1/organizations/{org}/staff-invites",
      "role": "owner",
      "aggregate": "Invitation",
      "consistency": "Idempotency-Key + organization revision",
      "nodeIds": [
        "O10"
      ],
      "payload": "candidateId, intendedScope, offerVersion, expiry; token generated on server, hash at rest",
      "failures": [
        "forbidden",
        "version_conflict",
        "consumed",
        "revoked"
      ],
      "events": [
        "StaffInvited"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "staff_invitations",
        "candidates",
        "offers",
        "staff_memberships"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-SHIFT",
      "route": "PUT /v1/branches/{branch}/shifts/{id}",
      "role": "owner",
      "aggregate": "Shift",
      "consistency": "If-Match + audit reason",
      "nodeIds": [
        "O14",
        "S04"
      ],
      "payload": "interval, skills, resources, affectedBookings",
      "failures": [
        "forbidden",
        "overlap",
        "version_conflict"
      ],
      "events": [
        "ShiftChanged",
        "AvailabilityInvalidated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "shifts",
        "staff_memberships",
        "resources",
        "reservations"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/branches/{branch}/shifts/{id}",
        "operationId": "shifts.put",
        "commandId": "CMD-SHIFT",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftPut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-QUOTE",
      "route": "POST /v1/quotes",
      "role": "client",
      "aggregate": "Quote",
      "consistency": "Deterministic quote inputs + expiry",
      "nodeIds": [
        "C06"
      ],
      "payload": "services, recipient, branch, currency, policyVersion",
      "failures": [
        "stale_catalog",
        "invalid_entitlement",
        "missing_contact"
      ],
      "events": [
        "QuoteCreated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "quotes",
        "quote_lines",
        "services",
        "service_versions",
        "policy_versions"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/quotes",
        "operationId": "quotes.create",
        "commandId": "CMD-QUOTE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-HOLD",
      "route": "POST /v1/slot-holds",
      "role": "client",
      "aggregate": "SlotHold",
      "consistency": "Idempotency-Key + resource exclusion constraint",
      "nodeIds": [
        "C07",
        "S01"
      ],
      "payload": "start/end UTC, timezone, quoteId, expiresAt",
      "failures": [
        "slot_conflict",
        "expired",
        "resource_unavailable"
      ],
      "events": [
        "SlotHeld",
        "SlotReleased"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "slot_holds",
        "reservations",
        "shifts",
        "quotes",
        "absence_incidents"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/slot-holds",
        "operationId": "holds.create",
        "commandId": "CMD-HOLD",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HoldCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotHoldView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-BOOK",
      "route": "POST /v1/bookings",
      "role": "client",
      "aggregate": "BookingSaga",
      "consistency": "Idempotency-Key + If-Match quote/hold",
      "nodeIds": [
        "C10",
        "S00"
      ],
      "payload": "quoteId, holdId, paymentIntentId, policyAcceptance",
      "failures": [
        "unknown",
        "conflict",
        "expired",
        "payment_unresolved"
      ],
      "events": [
        "BookingConfirmed",
        "CompensationRequired"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "slot_holds",
        "reservations",
        "quotes",
        "orders",
        "command_receipts"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings",
        "operationId": "bookings.create",
        "commandId": "CMD-BOOK",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-MOVE",
      "route": "POST /v1/bookings/{id}/move",
      "role": "client",
      "aggregate": "Booking",
      "consistency": "Idempotency-Key + expectedRevision; old stays until commit",
      "nodeIds": [
        "C23"
      ],
      "payload": "newHoldId, quoteId, acceptedDelta",
      "failures": [
        "conflict",
        "stale_revision",
        "delta_unpaid"
      ],
      "events": [
        "BookingMoved",
        "PaymentAdjustmentRequested"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "slot_holds",
        "reservations",
        "quotes",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/move",
        "operationId": "bookings.move",
        "commandId": "CMD-MOVE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Move"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CANCEL",
      "route": "POST /v1/bookings/{id}/cancel",
      "role": "client",
      "aggregate": "Booking",
      "consistency": "Idempotency-Key + expectedRevision + cancelQuote",
      "nodeIds": [
        "C25"
      ],
      "payload": "reason optional, cancellationQuoteId",
      "failures": [
        "in_service",
        "stale_quote",
        "stale_revision"
      ],
      "events": [
        "BookingCanceled",
        "RefundRequested",
        "WaitlistSlotOpened"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "cancellation_quotes",
        "reservations",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/cancel",
        "operationId": "bookings.cancel",
        "commandId": "CMD-CANCEL",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Cancel"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PAY",
      "route": "POST /v1/payment-intents",
      "role": "client",
      "aggregate": "Payment",
      "consistency": "Unique operation + persisted provider idempotence key; tips require an enabled verified recipient channel and separate quote/ledger",
      "nodeIds": [
        "P06",
        "C37"
      ],
      "payload": "purpose, quoteId, ownedMethodId optional, saveConsent",
      "failures": [
        "unknown",
        "declined",
        "duplicate",
        "amount_changed",
        "tip_channel_unavailable"
      ],
      "events": [
        "PaymentPending",
        "PaymentSucceeded",
        "PaymentCanceled"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "payment_intents",
        "orders",
        "saved_payment_methods"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-WEBHOOK",
      "route": "POST /v1/integrations/yookassa/events",
      "role": "system",
      "aggregate": "ProviderInbox",
      "consistency": "Dedupe object id+type+state; verify authenticated GET before mutation",
      "nodeIds": [
        "P08"
      ],
      "payload": "provider object reference, verified shop/amount/currency",
      "failures": [
        "invalid_object",
        "mismatched_merchant",
        "unavailable"
      ],
      "events": [
        "ProviderStateReconciled"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "payments",
      "tables": [
        "provider_inbox",
        "payment_intents",
        "refunds",
        "receipts"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-REFUND",
      "route": "POST /v1/orders/{id}/refunds",
      "role": "owner",
      "aggregate": "Refund",
      "consistency": "Idempotency-Key, authorized entitlement, bounded pending+successful amount",
      "nodeIds": [
        "P17"
      ],
      "payload": "paymentId, amountMinor, reason, orderRevision",
      "failures": [
        "over_refund",
        "unknown",
        "already_pending"
      ],
      "events": [
        "RefundPending",
        "RefundSucceeded",
        "RefundAttentionRequired"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "refunds",
        "payment_intents",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/orders/{id}/refunds",
        "operationId": "refunds.request",
        "commandId": "CMD-REFUND",
        "tags": [
          "payments"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/payments/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-ARRIVE",
      "route": "POST /v1/bookings/{id}/arrive",
      "role": "barber",
      "aggregate": "Booking",
      "consistency": "Assignment/cashier scope as appropriate + revision",
      "nodeIds": [
        "B11"
      ],
      "payload": "observed arrival, server timestamp",
      "failures": [
        "forbidden",
        "canceled",
        "wrong_branch"
      ],
      "events": [
        "ClientArrived"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "visits"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/arrive",
        "operationId": "bookings.arrive",
        "commandId": "CMD-ARRIVE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Version"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-SERVICE",
      "route": "POST /v1/bookings/{id}/service-events",
      "role": "barber",
      "aggregate": "VisitSession",
      "consistency": "Idempotency-Key + expected state/revision",
      "nodeIds": [
        "B13",
        "B15",
        "B18"
      ],
      "payload": "start, acceptedScope, complete, interruption reason",
      "failures": [
        "forbidden",
        "invalid_state",
        "price_unaccepted"
      ],
      "events": [
        "ServiceStarted",
        "ServiceCompleted"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "visits",
        "bookings",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/service-events",
        "operationId": "visits.serviceEvent",
        "commandId": "CMD-SERVICE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceEvent"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PASSPORT",
      "route": "POST /v1/visits/{id}/passport-revisions",
      "role": "barber",
      "aggregate": "Passport",
      "consistency": "Assignment + consent + expectedRevision",
      "nodeIds": [
        "B17"
      ],
      "payload": "parameters, privateMediaIds, author",
      "failures": [
        "consent_revoked",
        "media_not_ready",
        "revision_conflict"
      ],
      "events": [
        "PassportSaved"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "passport_revisions",
        "passport_media",
        "private_media",
        "consents",
        "visits"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/visits/{id}/passport-revisions",
        "operationId": "passports.createRevision",
        "commandId": "CMD-PASSPORT",
        "tags": [
          "experience"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassportCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportRevisionView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/experience/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-020"
      ]
    },
    {
      "id": "CMD-CONSENT",
      "route": "PUT /v1/me/consents/{purpose}",
      "role": "client",
      "aggregate": "Consent",
      "consistency": "Idempotency-Key + version; revoke propagates",
      "nodeIds": [
        "C42",
        "R02"
      ],
      "payload": "purpose, channel/media scope, version, accepted",
      "failures": [
        "invalid_scope",
        "stale_version"
      ],
      "events": [
        "ConsentChanged",
        "MediaPurgeRequested"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "consents",
        "private_media"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/me/consents/{purpose}",
        "operationId": "privacy.putConsent",
        "commandId": "CMD-CONSENT",
        "tags": [
          "experience"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentPut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "purpose",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Purpose"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/experience/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-015"
      ]
    },
    {
      "id": "CMD-CLUB",
      "route": "POST /v1/club/memberships",
      "role": "client",
      "aggregate": "Membership/Entitlement",
      "consistency": "Versioned plan, mandate, immutable ledger and unique period key",
      "nodeIds": [
        "L01"
      ],
      "payload": "planVersion, acceptedTerms, renewalConsent; activation only after verified settlement",
      "failures": [
        "plan_unpublished",
        "mandate_revoked",
        "entitlement_used"
      ],
      "events": [
        "MembershipPending",
        "MembershipActivated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "club_memberships",
        "club_plans",
        "orders",
        "entitlements"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/club/memberships",
        "operationId": "club.requestMembership",
        "commandId": "CMD-CLUB",
        "tags": [
          "club"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubMembershipView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/club/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CASE",
      "route": "POST /v1/support/cases",
      "role": "client",
      "aggregate": "SupportCase",
      "consistency": "Idempotency-Key + accessible references",
      "nodeIds": [
        "C43",
        "S05"
      ],
      "payload": "category, operationId, contact consent, description",
      "failures": [
        "forbidden_reference",
        "duplicate"
      ],
      "events": [
        "CaseOpened",
        "CaseEscalated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "operations",
      "tables": [
        "support_cases"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/support/cases",
        "operationId": "support.createCase",
        "commandId": "CMD-CASE",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportCaseView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-DELETE",
      "route": "POST /v1/me/deletion-requests",
      "role": "client",
      "aggregate": "DeletionSaga",
      "consistency": "Step-up auth + operation identity",
      "nodeIds": [
        "R04",
        "R05"
      ],
      "payload": "accepted consequences, pending obligations",
      "failures": [
        "reauth_required",
        "active_operation",
        "last_owner"
      ],
      "events": [
        "DeletionRequested",
        "ErasureCompleted"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "operations",
      "tables": [
        "deletion_requests",
        "identities",
        "private_media",
        "bookings",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/me/deletion-requests",
        "operationId": "privacy.requestDeletion",
        "commandId": "CMD-DELETE",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeletionCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequestView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-ABSENCE",
      "route": "POST /v1/staff/me/absence-incidents",
      "role": "barber",
      "aggregate": "AbsenceIncident",
      "consistency": "Idempotency-Key + active membership",
      "nodeIds": [
        "B08",
        "B09"
      ],
      "payload": "time interval, category without diagnosis",
      "failures": [
        "forbidden",
        "invalid_interval"
      ],
      "events": [
        "AvailabilityBlocked",
        "ReassignmentRequired"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "absence_incidents",
        "staff_memberships",
        "bookings"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/staff/me/absence-incidents",
        "operationId": "staff.reportAbsence",
        "commandId": "CMD-ABSENCE",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AbsenceIncidentView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-OFFBOARD",
      "route": "POST /v1/staff/{id}/offboarding",
      "role": "owner",
      "aggregate": "Membership",
      "consistency": "Step-up, expectedRevision, dependent booking handover",
      "nodeIds": [
        "O17",
        "O18"
      ],
      "payload": "effectiveAt, capabilities, affectedBookingIds",
      "failures": [
        "last_owner",
        "forbidden",
        "stale_revision"
      ],
      "events": [
        "MembershipRevoked",
        "SessionsRevoked"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "staff_memberships",
        "sessions",
        "bookings"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/staff/{id}/offboarding",
        "operationId": "staff.offboard",
        "commandId": "CMD-OFFBOARD",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Offboarding"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-ORG",
      "route": "POST /v1/organizations",
      "role": "owner",
      "aggregate": "Organization",
      "consistency": "Provisioning entitlement + step-up; public identity cannot self-grant owner",
      "nodeIds": [
        "O00",
        "O01"
      ],
      "payload": "legalDisplayName, provisionToken; no payment secrets",
      "failures": [
        "forbidden",
        "duplicate"
      ],
      "events": [
        "OrganizationProvisioned"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "organizations",
        "staff_memberships",
        "provision_grants"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/organizations",
        "operationId": "organizations.create",
        "commandId": "CMD-ORG",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-BRANCH",
      "route": "PUT /v1/organizations/{org}/branches/{id}",
      "role": "owner",
      "aggregate": "Branch",
      "consistency": "Tenant scope, If-Match, audit; closure schedules compensation before publication",
      "nodeIds": [
        "O02",
        "O19"
      ],
      "payload": "address, timezone IANA, openingHours, resources, closure interval/reason",
      "failures": [
        "forbidden",
        "version_conflict",
        "affected_bookings"
      ],
      "events": [
        "BranchChanged",
        "BranchClosurePlanned"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "branches",
        "organizations",
        "resources"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/organizations/{org}/branches/{id}",
        "operationId": "branches.put",
        "commandId": "CMD-BRANCH",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchPut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CATALOG",
      "route": "PUT /v1/branches/{branch}/catalog/{id}",
      "role": "owner",
      "aggregate": "ServiceCatalog",
      "consistency": "Versioned catalog; issued quotes immutable until expiry",
      "nodeIds": [
        "O03"
      ],
      "payload": "name, durationMinutes, bufferMinutes, priceMinor, staffSkills, publication",
      "failures": [
        "invalid_price",
        "invalid_duration",
        "version_conflict"
      ],
      "events": [
        "CatalogVersionPublished"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "services",
        "service_versions"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/branches/{branch}/catalog/{id}",
        "operationId": "catalog.putService",
        "commandId": "CMD-CATALOG",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServicePut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-POLICY",
      "route": "POST /v1/organizations/{org}/policy-versions",
      "role": "owner",
      "aggregate": "ServicePolicy",
      "consistency": "Append-only publication; financial changes require owner approval and effectiveAt",
      "nodeIds": [
        "O04"
      ],
      "payload": "cancellation, deposit, grace, noShow, waitlist, notifications, club terms",
      "failures": [
        "incomplete_policy",
        "version_conflict"
      ],
      "events": [
        "PolicyVersionPublished"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "policy_versions"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/organizations/{org}/policy-versions",
        "operationId": "policies.publish",
        "commandId": "CMD-POLICY",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyVersionView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-MERCHANT",
      "route": "POST /v1/organizations/{org}/merchant-connections",
      "role": "owner",
      "aggregate": "MerchantConnection",
      "consistency": "Step-up, tenant secret vault reference; sandbox/live mode explicit; no credentials in graph or logs",
      "nodeIds": [
        "O05"
      ],
      "payload": "merchantReference, environment, authorized vault reference, fiscal configuration",
      "failures": [
        "credentials_invalid",
        "merchant_mismatch",
        "fiscal_not_ready"
      ],
      "events": [
        "MerchantVerified"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "merchant_connections"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-HIRING",
      "route": "POST /v1/organizations/{org}/vacancies",
      "role": "owner",
      "aggregate": "Vacancy",
      "consistency": "Scoped owner, versioned job conditions, applicant consent and retention",
      "nodeIds": [
        "O06"
      ],
      "payload": "skills, branch, capacity, offerVersion",
      "failures": [
        "forbidden",
        "invalid_terms"
      ],
      "events": [
        "VacancyOpened"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "vacancies"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/organizations/{org}/vacancies",
        "operationId": "workforce.createVacancy",
        "commandId": "CMD-HIRING",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VacancyView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CANDIDATE",
      "route": "POST /v1/vacancies/{id}/candidate-events",
      "role": "owner",
      "aggregate": "Candidate",
      "consistency": "Revision + consent; trial is explicitly supervised, no client-data access by default",
      "nodeIds": [
        "O07",
        "O08",
        "O09",
        "O11"
      ],
      "payload": "consider, trial, offer, reject; reason, termsVersion, permitted contact",
      "failures": [
        "consent_missing",
        "invalid_transition",
        "version_conflict"
      ],
      "events": [
        "CandidateReviewed",
        "TrialScheduled",
        "OfferIssued",
        "CandidateRejected"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "candidates",
        "offers",
        "vacancies"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/vacancies/{id}/candidate-events",
        "operationId": "workforce.candidateEvent",
        "commandId": "CMD-CANDIDATE",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandidateEvent"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-INVITE-ACCEPT",
      "route": "POST /v1/staff-invites/{token}/accept",
      "role": "authenticated",
      "aggregate": "StaffMembership",
      "consistency": "Token hashed, expiry/single-use, intended identity and scope, accepted offer version; atomic grant",
      "nodeIds": [
        "B00",
        "B01",
        "B02",
        "B03",
        "B21"
      ],
      "payload": "authenticated identity, offerVersion, acceptance; no caller role field",
      "failures": [
        "expired",
        "revoked",
        "already_consumed",
        "identity_mismatch",
        "offer_changed"
      ],
      "events": [
        "StaffJoined",
        "InviteRejected"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "staff_invitations",
        "offers",
        "staff_memberships"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-ONBOARD",
      "route": "PUT /v1/staff/me/onboarding",
      "role": "barber",
      "aggregate": "StaffOnboarding",
      "consistency": "Current membership; owner verifies required skills before bookable=true",
      "nodeIds": [
        "B04",
        "B05"
      ],
      "payload": "profile, skills evidence, accepted policies, onboarding progress",
      "failures": [
        "forbidden",
        "requirements_missing"
      ],
      "events": [
        "OnboardingSubmitted",
        "StaffReady"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "staff_onboarding",
        "staff_memberships",
        "policy_versions"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/staff/me/onboarding",
        "operationId": "staff.submitOnboarding",
        "commandId": "CMD-ONBOARD",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PUBLISH",
      "route": "POST /v1/branches/{branch}/publication",
      "role": "owner",
      "aggregate": "Bookability",
      "consistency": "Atomic readiness check of services, staff, shifts, policy and payment configuration",
      "nodeIds": [
        "O12"
      ],
      "payload": "expected configuration versions, publish flag",
      "failures": [
        "staff_missing",
        "no_shifts",
        "policy_unapproved",
        "payment_not_ready"
      ],
      "events": [
        "BookingOpened"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "branches",
        "services",
        "shifts",
        "staff_memberships",
        "policy_versions",
        "merchant_connections"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/branches/{branch}/publication",
        "operationId": "branches.publish",
        "commandId": "CMD-PUBLISH",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Publication"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-OPERATIONS",
      "route": "GET /v1/branches/{branch}/operations",
      "role": "owner",
      "aggregate": "OperationsReadModel",
      "consistency": "Server scope + redaction; pagination, asOf/version, no merchant status inferred from UI",
      "nodeIds": [
        "O13",
        "O23"
      ],
      "payload": "branch, range UTC, cursor",
      "failures": [
        "forbidden",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "orders",
        "support_cases"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/branches/{branch}/operations",
        "operationId": "operations.getBranch",
        "commandId": "CMD-OPERATIONS",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-SHIFT-REQUEST",
      "route": "POST /v1/staff/me/shift-requests",
      "role": "barber",
      "aggregate": "ShiftRequest",
      "consistency": "Membership, expected schedule revision; request does not silently drop assigned bookings",
      "nodeIds": [
        "B07",
        "B22"
      ],
      "payload": "leave/resignation, interval, reason optional",
      "failures": [
        "forbidden",
        "invalid_interval"
      ],
      "events": [
        "ShiftChangeRequested"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "shift_requests",
        "staff_memberships"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/staff/me/shift-requests",
        "operationId": "staff.requestShiftChange",
        "commandId": "CMD-SHIFT-REQUEST",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShiftRequestCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftRequestView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-REASSIGN",
      "route": "POST /v1/absence-incidents/{id}/reassignments",
      "role": "owner",
      "aggregate": "ReassignmentSaga",
      "consistency": "Reserve compatible resource; client acceptance for material change; old booking retained until commit",
      "nodeIds": [
        "O15",
        "O16"
      ],
      "payload": "affectedBookingIds, alternative holds, contact status",
      "failures": [
        "conflict",
        "consent_pending",
        "no_alternative"
      ],
      "events": [
        "AlternativeOffered",
        "BookingReassigned",
        "CompensationRequired"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "reassignments",
        "absence_incidents",
        "bookings",
        "slot_holds"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-DAY",
      "route": "GET /v1/staff/me/day",
      "role": "barber",
      "aggregate": "StaffDayReadModel",
      "consistency": "Assignment and branch scopes, privacy-redacted projection, no public client directory",
      "nodeIds": [
        "B06",
        "B10"
      ],
      "payload": "localDate, branchId, revision",
      "failures": [
        "forbidden",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "bookings",
        "shifts",
        "staff_memberships"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/staff/me/day",
        "operationId": "staff.getDay",
        "commandId": "CMD-DAY",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "branch_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch Id"
            }
          },
          {
            "name": "local_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Local Date"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-018",
        "SCR-019"
      ]
    },
    {
      "id": "CMD-SCOPE",
      "route": "POST /v1/visits/{id}/scope-quotes",
      "role": "barber",
      "aggregate": "VisitScopeQuote",
      "consistency": "Expected visit revision; next booking protected; client accepts new price/time before mutation",
      "nodeIds": [
        "B12",
        "B14",
        "C33",
        "P23"
      ],
      "payload": "requested change, estimated duration; separate clientAcceptance token",
      "failures": [
        "next_booking_conflict",
        "price_not_accepted",
        "revision_conflict"
      ],
      "events": [
        "ScopeQuoted",
        "ScopeAccepted"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "visit_scope_quotes",
        "visits",
        "quotes",
        "reservations"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-INCIDENT",
      "route": "POST /v1/visits/{id}/incidents",
      "role": "barber",
      "aggregate": "SafetyIncident",
      "consistency": "Assignment, minimally necessary facts, audited escalation; safety precedes payment workflow",
      "nodeIds": [
        "B23"
      ],
      "payload": "category, pauseService, immediate assistance action",
      "failures": [
        "forbidden",
        "invalid_visit"
      ],
      "events": [
        "ServicePaused",
        "IncidentEscalated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "safety_incidents",
        "visits",
        "bookings",
        "support_cases"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/visits/{id}/incidents",
        "operationId": "visits.reportIncident",
        "commandId": "CMD-INCIDENT",
        "tags": [
          "experience"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SafetyIncidentView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/experience/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-SHIFT-CLOSE",
      "route": "POST /v1/shifts/{id}/close",
      "role": "barber",
      "aggregate": "ShiftClose",
      "consistency": "Own shift, exception queue retained; never implies all payments captured",
      "nodeIds": [
        "B19"
      ],
      "payload": "expectedRevision, unresolvedVisitIds",
      "failures": [
        "forbidden",
        "active_visit"
      ],
      "events": [
        "ShiftClosed",
        "ShiftExceptionRecorded"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "shifts",
        "bookings",
        "orders"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/shifts/{id}/close",
        "operationId": "shifts.close",
        "commandId": "CMD-SHIFT-CLOSE",
        "tags": [
          "workforce"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Version"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/workforce/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PAYROLL",
      "route": "POST /v1/organizations/{org}/payroll-periods/{id}/close",
      "role": "owner",
      "aggregate": "BarberSettlement",
      "consistency": "Versioned remuneration terms + immutable ledger; actual transfer is separate explicit operation",
      "nodeIds": [
        "O21"
      ],
      "payload": "period, verified earningLines, adjustments with reasons",
      "failures": [
        "unresolved_dispute",
        "incomplete_period",
        "version_conflict"
      ],
      "events": [
        "SettlementCalculated",
        "SettlementApproved"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "payroll_periods",
        "earning_lines"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-EARNINGS",
      "route": "GET /v1/staff/me/earnings",
      "role": "barber",
      "aggregate": "EarningsReadModel",
      "consistency": "Own staff identity; correction as append-only dispute, no editing ledger",
      "nodeIds": [
        "B20"
      ],
      "payload": "period, cursor",
      "failures": [
        "forbidden",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "earning_lines",
        "payroll_periods",
        "staff_memberships"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/staff/me/earnings",
        "operationId": "staff.getEarnings",
        "commandId": "CMD-EARNINGS",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Organization Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-RECONCILE",
      "route": "POST /internal/jobs/settlement-reconciliation",
      "role": "system",
      "aggregate": "Settlement",
      "consistency": "Service identity, durable operation identity; provider GET and outbox retries; no public caller",
      "nodeIds": [
        "O22",
        "P13",
        "P19",
        "P21",
        "P25"
      ],
      "payload": "operationId, provider object IDs, cursor",
      "failures": [
        "provider_unavailable",
        "mismatch",
        "unknown"
      ],
      "events": [
        "SettlementReconciled",
        "ReconciliationAttentionRequired"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "payments",
      "tables": [
        "orders",
        "payment_intents",
        "refunds",
        "receipts",
        "provider_inbox"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-TRANSFER",
      "route": "POST /v1/organizations/{org}/ownership-transfers",
      "role": "owner",
      "aggregate": "OwnershipTransfer",
      "consistency": "Step-up on both parties, intended recipient acceptance, two-party transaction; at least one owner at commit",
      "nodeIds": [
        "O24"
      ],
      "payload": "recipientIdentity, expectedRevision, acceptanceProof",
      "failures": [
        "last_owner",
        "recipient_unverified",
        "forbidden",
        "version_conflict"
      ],
      "events": [
        "OwnershipTransferred",
        "SessionsRevoked"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "ownership_transfers",
        "staff_memberships",
        "sessions"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-PUBLIC-CATALOG",
      "route": "GET /v1/public/branches/{branch}/catalog",
      "role": "guest",
      "aggregate": "PublicCatalog",
      "consistency": "Published, non-personal data only; no candidate/staff private fields",
      "nodeIds": [
        "G00",
        "G01",
        "G02",
        "G04",
        "G08",
        "C01",
        "C02",
        "C03"
      ],
      "payload": "branch, language, cursor",
      "failures": [
        "not_found",
        "unpublished",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "organizations",
      "tables": [
        "branches",
        "services",
        "service_versions"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/public/branches/{branch}/catalog",
        "operationId": "catalog.getPublic",
        "commandId": "CMD-PUBLIC-CATALOG",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Catalog.Getpublic"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-001",
        "SCR-004",
        "SCR-005",
        "SCR-011"
      ]
    },
    {
      "id": "CMD-AVAILABILITY",
      "route": "GET /v1/public/availability",
      "role": "guest",
      "aggregate": "AvailabilityProjection",
      "consistency": "UTC interval + branch timezone; projection is indicative, authoritative exclusion at hold commit",
      "nodeIds": [
        "G03",
        "G09",
        "C04",
        "C08",
        "C14",
        "C15",
        "S01"
      ],
      "payload": "branchId, serviceIds, barber preference, date",
      "failures": [
        "no_capacity",
        "stale_catalog",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "workforce",
      "tables": [
        "shifts",
        "reservations",
        "absence_incidents",
        "services",
        "service_versions",
        "resources"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/public/availability",
        "operationId": "availability.list",
        "commandId": "CMD-AVAILABILITY",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "branch_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch Id"
            }
          },
          {
            "name": "local_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Local Date"
            }
          },
          {
            "name": "service_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              },
              "minItems": 1,
              "maxItems": 10,
              "title": "Service Ids"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Availability.List"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-006"
      ]
    },
    {
      "id": "CMD-AUTH-CALLBACK",
      "route": "POST /v1/auth/transactions/{id}/complete",
      "role": "guest",
      "aggregate": "AuthTransaction",
      "consistency": "Consume state once, code+PKCE backend exchange, issuer/audience/expiry checks; MAX gated until spike",
      "nodeIds": [
        "A01",
        "A02",
        "A03",
        "A04"
      ],
      "payload": "provider response, transactionId; no trusted client role or email merge",
      "failures": [
        "expired",
        "replay",
        "invalid_signature",
        "provider_unavailable",
        "feature_disabled"
      ],
      "events": [
        "IdentityVerified",
        "SessionIssued"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "auth_transactions",
        "identity_links",
        "identities",
        "sessions"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-PROFILE",
      "route": "PUT /v1/me/profile",
      "role": "authenticated",
      "aggregate": "Profile",
      "consistency": "If-Match, field minimization, contact verification; recipient consent distinct from purchaser identity",
      "nodeIds": [
        "A06",
        "C44",
        "C45"
      ],
      "payload": "name, verified contact, accessibility preferences, recipient relationship",
      "failures": [
        "unverified_contact",
        "forbidden_field",
        "version_conflict"
      ],
      "events": [
        "ProfileUpdated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "profiles",
        "identities"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/me/profile",
        "operationId": "identity.putProfile",
        "commandId": "CMD-PROFILE",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfilePut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-SESSION",
      "route": "GET /v1/me/context",
      "role": "authenticated",
      "aggregate": "SessionContext",
      "consistency": "Server grants + scope + revision; role switch only selects existing capability",
      "nodeIds": [
        "A07",
        "A11",
        "A13",
        "C00",
        "S03"
      ],
      "payload": "organization context, sinceVersion",
      "failures": [
        "unauthorized",
        "forbidden",
        "revoked"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "sessions",
        "identities",
        "staff_memberships"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/context",
        "operationId": "identity.getContext",
        "commandId": "CMD-SESSION",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Identity.Getcontext"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-003"
      ]
    },
    {
      "id": "CMD-IDENTITY-LINK",
      "route": "POST /v1/me/identity-links",
      "role": "authenticated",
      "aggregate": "IdentityLink",
      "consistency": "Recent reauth + verified second provider; never merge by display name or unverified email/phone",
      "nodeIds": [
        "A08",
        "A09"
      ],
      "payload": "new provider transaction proof",
      "failures": [
        "identity_already_linked",
        "reauth_required",
        "conflict"
      ],
      "events": [
        "IdentityLinked",
        "IdentityLinkConflict"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "identity_links",
        "auth_transactions"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-RECOVERY",
      "route": "POST /v1/auth/recovery-cases",
      "role": "guest",
      "aggregate": "IdentityRecovery",
      "consistency": "Rate limits, minimum proof, revoke lost session; no public account-existence leak",
      "nodeIds": [
        "A10",
        "R07"
      ],
      "payload": "provider proof or recovery case, safe contact",
      "failures": [
        "invalid_proof",
        "rate_limited",
        "manual_review"
      ],
      "events": [
        "RecoveryStarted",
        "SessionsRevoked"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "operations",
      "tables": [
        "recovery_cases",
        "auth_transactions",
        "identities"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-LOGOUT",
      "route": "POST /v1/me/sessions/revoke",
      "role": "authenticated",
      "aggregate": "Session",
      "consistency": "Current verified identity, per-session/all scope; invalidate refresh family and push device association",
      "nodeIds": [
        "A12"
      ],
      "payload": "sessionIds or all; current session last",
      "failures": [
        "unauthorized"
      ],
      "events": [
        "SessionsRevoked"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "identity",
      "tables": [
        "sessions"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/me/sessions/revoke",
        "operationId": "identity.revokeSessions",
        "commandId": "CMD-LOGOUT",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeSessions"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Identity.Revokesessions"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-WAITLIST",
      "route": "POST /v1/waitlist-entries",
      "role": "client",
      "aggregate": "WaitlistEntry",
      "consistency": "Deduplicate client preference; expires/cancelable, opt-in channel; no slot promised",
      "nodeIds": [
        "C13"
      ],
      "payload": "branch/services/time windows/barber preference, notification consent",
      "failures": [
        "consent_missing",
        "invalid_window"
      ],
      "events": [
        "WaitlistJoined"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "waitlist_entries",
        "consents"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/waitlist-entries",
        "operationId": "waitlist.create",
        "commandId": "CMD-WAITLIST",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WaitlistCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistEntryView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-WAITLIST-OFFER",
      "route": "POST /internal/jobs/waitlist-offers",
      "role": "system",
      "aggregate": "WaitlistOffer",
      "consistency": "Atomic ordered claim, offer expiry from server; capacity hold exclusive; expire once then offer next",
      "nodeIds": [
        "C14",
        "C15"
      ],
      "payload": "vacated resource interval, policyVersion, queue cursor",
      "failures": [
        "no_capacity",
        "expired",
        "already_claimed"
      ],
      "events": [
        "WaitlistOffered",
        "WaitlistOfferExpired"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "booking",
      "tables": [
        "waitlist_offers",
        "waitlist_entries",
        "slot_holds"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-WAITLIST-CLAIM",
      "route": "POST /v1/waitlist-offers/{id}/claim",
      "role": "client",
      "aggregate": "WaitlistOffer",
      "consistency": "Owner of entry, current server expiry, atomic claim to hold; booking still requires quote acceptance",
      "nodeIds": [
        "C14"
      ],
      "payload": "expected offer version",
      "failures": [
        "expired",
        "already_claimed",
        "forbidden"
      ],
      "events": [
        "WaitlistOfferClaimed"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "waitlist_offers",
        "slot_holds",
        "waitlist_entries"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-MEDIA",
      "route": "POST /v1/me/media-uploads",
      "role": "client",
      "aggregate": "PrivateMedia",
      "consistency": "Purpose-scoped consent; private short-lived upload URL; type/size scan, checksum, ACL, deletion propagation",
      "nodeIds": [
        "C18",
        "C20",
        "R01"
      ],
      "payload": "purpose, contentType, byteLength, digest; no public URL",
      "failures": [
        "consent_missing",
        "too_large",
        "unsupported_type",
        "scan_failed"
      ],
      "events": [
        "PrivateMediaReady",
        "MediaRejected"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "private_media",
        "consents"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-LATE",
      "route": "POST /v1/bookings/{id}/arrival-updates",
      "role": "client",
      "aggregate": "ArrivalEstimate",
      "consistency": "Own booking + revision; no automatic repricing or shortening without agreement",
      "nodeIds": [
        "C26",
        "C27",
        "C30",
        "C31"
      ],
      "payload": "estimated arrival, reason category optional; no diagnosis",
      "failures": [
        "canceled",
        "stale_revision",
        "wrong_branch"
      ],
      "events": [
        "ArrivalEstimateChanged",
        "AssistanceRequested"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "arrival_updates",
        "bookings"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/arrival-updates",
        "operationId": "bookings.updateArrival",
        "commandId": "CMD-LATE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Arrival"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArrivalUpdateView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-NOSHOW",
      "route": "POST /v1/bookings/{id}/no-show-reviews",
      "role": "barber",
      "aggregate": "AttendanceReview",
      "consistency": "Assigned staff/owner, server grace elapsed, manual confirmation and audit; disputed arrival preserved",
      "nodeIds": [
        "C28"
      ],
      "payload": "observed absence, contact attempts, expectedRevision",
      "failures": [
        "grace_not_elapsed",
        "arrived",
        "version_conflict"
      ],
      "events": [
        "NoShowRecorded",
        "NoShowDisputed"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "attendance_reviews",
        "bookings"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/no-show-reviews",
        "operationId": "bookings.reviewNoShow",
        "commandId": "CMD-NOSHOW",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoShow"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttendanceReviewView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CASH",
      "route": "POST /v1/orders/{id}/counter-payments",
      "role": "barber",
      "aggregate": "CounterPayment",
      "consistency": "Explicit cashier capability, expected amount/version, idempotency; assigned barber alone insufficient",
      "nodeIds": [
        "P14",
        "P15"
      ],
      "payload": "amountMinor, cash/external_terminal, receipt reference",
      "failures": [
        "cashier_scope_required",
        "amount_mismatch",
        "duplicate"
      ],
      "events": [
        "CounterPaymentRecorded",
        "ReceiptRequested"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "counter_payments",
        "orders",
        "receipts",
        "staff_memberships"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/orders/{id}/counter-payments",
        "operationId": "payments.recordCounterPayment",
        "commandId": "CMD-CASH",
        "tags": [
          "payments"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CounterPaymentCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CounterPaymentView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/payments/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-METHODS",
      "route": "GET /v1/me/payment-methods",
      "role": "client",
      "aggregate": "SavedPaymentMethod",
      "consistency": "Identity owns token; masked details only, no PAN/CVV; reusable only if provider.saved=true",
      "nodeIds": [
        "P03",
        "P04"
      ],
      "payload": "cursor",
      "failures": [
        "unauthorized",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "saved_payment_methods"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/payment-methods",
        "operationId": "payments.listMethods",
        "commandId": "CMD-METHODS",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-UNLINK-CARD",
      "route": "DELETE /v1/me/payment-methods/{id}",
      "role": "client",
      "aggregate": "SavedPaymentMethod",
      "consistency": "Ownership + reauth where needed; disable local future use, cancel dependent renewal mandate, audit",
      "nodeIds": [
        "P05"
      ],
      "payload": "expectedRevision, acknowledge affected mandates",
      "failures": [
        "forbidden",
        "active_charge",
        "version_conflict"
      ],
      "events": [
        "PaymentMethodDisabled",
        "RenewalMandateRevoked"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "saved_payment_methods",
        "renewal_mandates"
      ],
      "runtime": {
        "method": "DELETE",
        "path": "/v1/me/payment-methods/{id}",
        "operationId": "payments.unlinkMethod",
        "commandId": "CMD-UNLINK-CARD",
        "tags": [
          "payments"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlinkCard"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedPaymentMethodView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/payments/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-REFUND-QUOTE",
      "route": "POST /v1/bookings/{id}/cancellation-quotes",
      "role": "client",
      "aggregate": "CancellationQuote",
      "consistency": "Versioned policy captured at booking; exact refund bound, pending adjustments included",
      "nodeIds": [
        "C24",
        "P16"
      ],
      "payload": "bookingRevision, reason optional",
      "failures": [
        "in_service",
        "stale_revision",
        "unavailable"
      ],
      "events": [
        "CancellationQuoted"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "booking",
      "tables": [
        "cancellation_quotes",
        "bookings",
        "orders",
        "policy_versions"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/bookings/{id}/cancellation-quotes",
        "operationId": "bookings.quoteCancellation",
        "commandId": "CMD-REFUND-QUOTE",
        "tags": [
          "booking"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Version"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancellationQuoteView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PAYMENT-CAPTURE",
      "route": "POST /internal/jobs/payment-settlements",
      "role": "system",
      "aggregate": "PaymentSettlement",
      "consistency": "Authenticated worker, reservation allocation confirmed, provider current state/expiry, persisted idempotence key",
      "nodeIds": [
        "P09",
        "P10"
      ],
      "payload": "authorized paymentId, capture amount or cancellation decision",
      "failures": [
        "expired",
        "canceled",
        "amount_exceeded",
        "unknown"
      ],
      "events": [
        "PaymentCaptured",
        "AuthorizationCanceled"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "payments",
      "tables": [
        "payment_intents",
        "orders",
        "receipts"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-RECEIPT",
      "route": "GET /v1/me/orders/{id}/receipts",
      "role": "client",
      "aggregate": "FiscalReceipt",
      "consistency": "Owned order; receipt pending/ready/failed distinct from successful payment",
      "nodeIds": [
        "P20",
        "P21"
      ],
      "payload": "orderId",
      "failures": [
        "forbidden",
        "pending",
        "unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "payments",
      "tables": [
        "receipts",
        "orders"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/orders/{id}/receipts",
        "operationId": "receipts.list",
        "commandId": "CMD-RECEIPT",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-NOTIFICATION",
      "route": "POST /internal/jobs/notification-deliveries",
      "role": "system",
      "aggregate": "NotificationDelivery",
      "consistency": "Outbox+dedupe booking/version/channel; current schedule and consent, quiet hours; no mass fallback without consent",
      "nodeIds": [
        "N00",
        "N02",
        "N03",
        "N08"
      ],
      "payload": "templateVersion, minimal payload, recipient reference",
      "failures": [
        "channel_denied",
        "unreachable",
        "stale_booking",
        "retry_exhausted"
      ],
      "events": [
        "NotificationDelivered",
        "NotificationFailed"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "experience",
      "tables": [
        "notifications",
        "reminder_preferences",
        "consents",
        "outbox_events"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-REMINDER",
      "route": "PUT /v1/me/bookings/{id}/reminders",
      "role": "client",
      "aggregate": "ReminderPreference",
      "consistency": "Own booking; preferences distinct from OS permission and actual delivery",
      "nodeIds": [
        "N01",
        "N04",
        "N06",
        "N07",
        "C42"
      ],
      "payload": "channel, snoozeUntil, disabled, read event",
      "failures": [
        "forbidden",
        "invalid_time",
        "channel_unavailable"
      ],
      "events": [
        "ReminderPreferenceChanged"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "reminder_preferences",
        "bookings",
        "consents",
        "notifications"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/me/bookings/{id}/reminders",
        "operationId": "notifications.putReminder",
        "commandId": "CMD-REMINDER",
        "tags": [
          "experience"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReminderPut"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderPreferenceView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/experience/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-015"
      ]
    },
    {
      "id": "CMD-MEMBERSHIP",
      "route": "PUT /v1/me/club/membership",
      "role": "client",
      "aggregate": "ClubMembership",
      "consistency": "Versioned plan and separate renewal mandate; respect paid period and reserved credits",
      "nodeIds": [
        "L04",
        "L06"
      ],
      "payload": "autoRenew consent, pause/cancel effective date",
      "failures": [
        "plan_changed",
        "active_entitlement_conflict"
      ],
      "events": [
        "RenewalMandateChanged",
        "MembershipPaused"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "club_memberships",
        "renewal_mandates"
      ],
      "runtime": {
        "method": "PUT",
        "path": "/v1/me/club/membership",
        "operationId": "club.changeMembership",
        "commandId": "CMD-MEMBERSHIP",
        "tags": [
          "club"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipChange"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubMembershipView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/club/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-RENEWAL",
      "route": "POST /internal/jobs/club-renewals",
      "role": "system",
      "aggregate": "RenewalAttempt",
      "consistency": "One attempt per membership/period; valid current mandate; no overlap/charge after revocation, bounded retries",
      "nodeIds": [
        "L04",
        "L05",
        "L07"
      ],
      "payload": "membershipId, periodKey",
      "failures": [
        "mandate_revoked",
        "payment_failed",
        "unknown"
      ],
      "events": [
        "RenewalSucceeded",
        "RenewalFailed",
        "MembershipExpired"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "club",
      "tables": [
        "renewal_attempts",
        "renewal_mandates",
        "payment_intents",
        "club_memberships"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-ENTITLEMENT",
      "route": "POST /v1/club/entitlement-reservations",
      "role": "client",
      "aggregate": "EntitlementLedger",
      "consistency": "Atomic reserve one usable credit per booking; consume only once at completed service; release on cancel",
      "nodeIds": [
        "L03",
        "P24"
      ],
      "payload": "entitlementId, bookingId, expectedRevision",
      "failures": [
        "exhausted",
        "expired",
        "already_reserved"
      ],
      "events": [
        "EntitlementReserved",
        "EntitlementConsumed",
        "EntitlementReleased"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "entitlements",
        "entitlement_ledger",
        "bookings"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/club/entitlement-reservations",
        "operationId": "club.reserveEntitlement",
        "commandId": "CMD-ENTITLEMENT",
        "tags": [
          "club"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EntitlementReserve"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementLedgerView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/club/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-GUEST-PASS",
      "route": "POST /v1/club/guest-passes",
      "role": "client",
      "aggregate": "GuestPass",
      "consistency": "Eligible membership, quota, server-generated single-use token, expiry; no friend contact uploaded without consent",
      "nodeIds": [
        "L08",
        "G10"
      ],
      "payload": "entitlementId, optional display message",
      "failures": [
        "quota_exceeded",
        "expired"
      ],
      "events": [
        "GuestPassIssued"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "guest_passes",
        "entitlements",
        "entitlement_ledger"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-GUEST-CLAIM",
      "route": "POST /v1/club/guest-passes/{token}/claim",
      "role": "client",
      "aggregate": "GuestPass",
      "consistency": "Authenticated intended beneficiary, atomic single claim, expiry; not a transferable identity token",
      "nodeIds": [
        "L09"
      ],
      "payload": "verified identity, guest eligibility",
      "failures": [
        "expired",
        "already_claimed",
        "ineligible"
      ],
      "events": [
        "GuestPassClaimed"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "guest_passes",
        "entitlements",
        "identities"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": []
    },
    {
      "id": "CMD-REFERRAL",
      "route": "POST /v1/me/referrals",
      "role": "client",
      "aggregate": "Referral",
      "consistency": "Unique attribution, anti-self-referral; reward only after eligible completed non-refunded visit",
      "nodeIds": [
        "L10",
        "L11"
      ],
      "payload": "referralCode, qualifyingVisitId",
      "failures": [
        "self_referral",
        "duplicate",
        "ineligible",
        "refunded"
      ],
      "events": [
        "ReferralAttributed",
        "RewardGranted",
        "RewardReversed"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "club",
      "tables": [
        "referrals",
        "entitlement_ledger",
        "visits"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/me/referrals",
        "operationId": "club.registerReferral",
        "commandId": "CMD-REFERRAL",
        "tags": [
          "club"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferralView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/club/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-REVIEW",
      "route": "POST /v1/visits/{id}/feedback",
      "role": "client",
      "aggregate": "VisitFeedback",
      "consistency": "Own completed visit, one revisable review; visibility choice, no public photo by default",
      "nodeIds": [
        "C35",
        "C36",
        "C37"
      ],
      "payload": "score, text, private/public choice, category",
      "failures": [
        "visit_not_completed",
        "forbidden",
        "version_conflict"
      ],
      "events": [
        "FeedbackSubmitted",
        "CaseOpened"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "visit_feedback",
        "visits"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/visits/{id}/feedback",
        "operationId": "visits.createFeedback",
        "commandId": "CMD-REVIEW",
        "tags": [
          "experience"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/experience/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-PASSPORT-READ",
      "route": "GET /v1/me/passports/{id}",
      "role": "client",
      "aggregate": "PassportReadModel",
      "consistency": "Own immutable revision history; photos consent/expiry checked, suggestions optional",
      "nodeIds": [
        "C05",
        "C38",
        "C39",
        "C40"
      ],
      "payload": "revision, cursor",
      "failures": [
        "forbidden",
        "deleted",
        "media_unavailable"
      ],
      "events": [],
      "status": "implemented-local",
      "response": "Scoped read projection with asOf, revision and pagination when applicable; no state mutation.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "experience",
      "tables": [
        "passport_revisions",
        "passport_media",
        "consents"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/passports/{id}",
        "operationId": "passports.get",
        "commandId": "CMD-PASSPORT-READ",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportRevisionView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": [
        "SCR-013",
        "SCR-014"
      ]
    },
    {
      "id": "CMD-EXPORT",
      "route": "POST /v1/me/data-exports",
      "role": "authenticated",
      "aggregate": "DataExport",
      "consistency": "Step-up, asynchronous immutable snapshot, expiring authenticated download, audit",
      "nodeIds": [
        "R03"
      ],
      "payload": "format, scope",
      "failures": [
        "reauth_required",
        "already_running"
      ],
      "events": [
        "DataExportReady"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "operations",
      "tables": [
        "data_exports",
        "identities"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/me/data-exports",
        "operationId": "privacy.requestExport",
        "commandId": "CMD-EXPORT",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataExportView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-CASE-RESOLVE",
      "route": "POST /v1/support/cases/{id}/resolution",
      "role": "owner",
      "aggregate": "SupportCase",
      "consistency": "Authorized case scope, expected revision; escalation deadline, independent payment refund authority",
      "nodeIds": [
        "O20",
        "S05",
        "S06",
        "P22"
      ],
      "payload": "resolution, next action owner, dueAt, linked operationIds",
      "failures": [
        "forbidden",
        "unresolved_payment",
        "stale_revision"
      ],
      "events": [
        "CaseResolved",
        "CaseEscalated"
      ],
      "status": "implemented-local",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Backend verifies identity, capability and resource scope on every request; graph role is descriptive, never authority.",
      "domain": "operations",
      "tables": [
        "support_cases"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/support/cases/{id}/resolution",
        "operationId": "support.resolveCase",
        "commandId": "CMD-CASE-RESOLVE",
        "tags": [
          "operations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseResolve"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportCaseView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/operations/routes.py"
      },
      "implementationNote": "Локальный результат в PostgreSQL; внешние эффекты не подтверждаются.",
      "screenIds": []
    },
    {
      "id": "CMD-VISIT-CLOSE",
      "route": "POST /internal/jobs/visit-close",
      "role": "system",
      "aggregate": "VisitClosure",
      "consistency": "Service complete + final balanced settlement + entitlement ledger; unknown payments stay pending, outbox atomic",
      "nodeIds": [
        "C34",
        "S07"
      ],
      "payload": "visitId, expected revisions",
      "failures": [
        "payment_unresolved",
        "service_active",
        "ledger_mismatch"
      ],
      "events": [
        "VisitClosed",
        "RepeatSuggestionEligible"
      ],
      "status": "contract",
      "response": "Current aggregate state and revision; operationId for asynchronous commands; safe code + retryable + correlationId on failure.",
      "authorization": "Verified service identity only; never exposed as a client command.",
      "domain": "experience",
      "tables": [
        "visits",
        "bookings",
        "orders",
        "receipts",
        "entitlement_ledger"
      ],
      "runtime": null,
      "implementationNote": "Схема и контракт спроектированы. Исполняемый HTTP-обработчик отсутствует.",
      "screenIds": [
        "SCR-012"
      ]
    },
    {
      "id": "BE-system.getHealth",
      "route": "GET /health/live",
      "role": "guest",
      "aggregate": "system",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [],
      "runtime": {
        "method": "GET",
        "path": "/health/live",
        "operationId": "system.getHealth",
        "commandId": "",
        "tags": [],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response System.Gethealth"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "source": "apps/backend/app/main.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-system.getReadiness",
      "route": "GET /health/ready",
      "role": "guest",
      "aggregate": "system",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [],
      "runtime": {
        "method": "GET",
        "path": "/health/ready",
        "operationId": "system.getReadiness",
        "commandId": "",
        "tags": [],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "source": "apps/backend/app/main.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-catalog.listServices",
      "route": "GET /api/catalog/services",
      "role": "guest",
      "aggregate": "catalog",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [],
      "runtime": {
        "method": "GET",
        "path": "/api/catalog/services",
        "operationId": "catalog.listServices",
        "commandId": "",
        "tags": [],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Catalog.Listservices"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "source": "apps/backend/app/main.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-resources.create",
      "route": "POST /v1/branches/{branch}/resources",
      "role": "owner",
      "aggregate": "resources",
      "domain": "organizations",
      "consistency": "Transaction + revision + idempotency + audit + outbox",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "resources"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/branches/{branch}/resources",
        "operationId": "resources.create",
        "commandId": "",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-staff.verifyReadiness",
      "route": "POST /v1/staff/{id}/readiness",
      "role": "owner",
      "aggregate": "staff",
      "domain": "organizations",
      "consistency": "Transaction + revision + idempotency + audit + outbox",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "staff_memberships",
        "staff_onboarding"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/staff/{id}/readiness",
        "operationId": "staff.verifyReadiness",
        "commandId": "",
        "tags": [
          "organizations"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffReady"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/organizations/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-holds.release",
      "route": "DELETE /v1/slot-holds/{id}",
      "role": "authenticated",
      "aggregate": "holds",
      "domain": "booking",
      "consistency": "Transaction + revision + idempotency + audit + outbox",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "slot_holds",
        "reservations"
      ],
      "runtime": {
        "method": "DELETE",
        "path": "/v1/slot-holds/{id}",
        "operationId": "holds.release",
        "commandId": "",
        "tags": [
          "booking"
        ],
        "tables": [
          "slot_holds",
          "reservations"
        ],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Version"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotHoldView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/booking/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-club.createPlanVersion",
      "route": "POST /v1/organizations/{org}/club-plans",
      "role": "owner",
      "aggregate": "club",
      "domain": "club",
      "consistency": "Transaction + revision + idempotency + audit + outbox",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "club_plans"
      ],
      "runtime": {
        "method": "POST",
        "path": "/v1/organizations/{org}/club-plans",
        "operationId": "club.createPlanVersion",
        "commandId": "",
        "tags": [
          "club"
        ],
        "tables": [],
        "role": "",
        "request": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanCreate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClubPlanView"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/club/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-identity.getProfile",
      "route": "GET /v1/me/profile",
      "role": "authenticated",
      "aggregate": "identity",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "profiles"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/profile",
        "operationId": "identity.getProfile",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Identity.Getprofile"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-identity.listSessions",
      "route": "GET /v1/me/sessions",
      "role": "authenticated",
      "aggregate": "identity",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "sessions"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/sessions",
        "operationId": "identity.listSessions",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-bookings.listMine",
      "route": "GET /v1/me/bookings",
      "role": "authenticated",
      "aggregate": "bookings",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "bookings"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/bookings",
        "operationId": "bookings.listMine",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-bookings.get",
      "route": "GET /v1/bookings/{id}",
      "role": "authenticated",
      "aggregate": "bookings",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "bookings"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/bookings/{id}",
        "operationId": "bookings.get",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Bookings.Get"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-operations.getRequestStatus",
      "route": "GET /v1/me/operations/{id}",
      "role": "authenticated",
      "aggregate": "operations",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "command_receipts"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/operations/{id}",
        "operationId": "operations.getRequestStatus",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Operations.Getrequeststatus"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-operations.findRequestStatus",
      "route": "GET /v1/me/command-status",
      "role": "authenticated",
      "aggregate": "operations",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "command_receipts"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/command-status",
        "operationId": "operations.findRequestStatus",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "operation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Operation"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Operations.Findrequeststatus"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-privacy.listConsents",
      "route": "GET /v1/me/consents",
      "role": "authenticated",
      "aggregate": "privacy",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "consents"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/consents",
        "operationId": "privacy.listConsents",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "consents"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-orders.listMine",
      "route": "GET /v1/me/orders",
      "role": "authenticated",
      "aggregate": "orders",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "orders"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/orders",
        "operationId": "orders.listMine",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "orders"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-support.listMine",
      "route": "GET /v1/me/support-cases",
      "role": "authenticated",
      "aggregate": "support",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "support_cases"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/support-cases",
        "operationId": "support.listMine",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "support_cases"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-privacy.listDeletions",
      "route": "GET /v1/me/deletion-requests",
      "role": "authenticated",
      "aggregate": "privacy",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "deletion_requests"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/deletion-requests",
        "operationId": "privacy.listDeletions",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "deletion_requests"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-privacy.listExports",
      "route": "GET /v1/me/data-exports",
      "role": "authenticated",
      "aggregate": "privacy",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "data_exports"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/data-exports",
        "operationId": "privacy.listExports",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "data_exports"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-club.listMine",
      "route": "GET /v1/me/club-memberships",
      "role": "authenticated",
      "aggregate": "club",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "club_memberships"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/club-memberships",
        "operationId": "club.listMine",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "club_memberships"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-waitlist.listMine",
      "route": "GET /v1/me/waitlist-entries",
      "role": "authenticated",
      "aggregate": "waitlist",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "waitlist_entries"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/waitlist-entries",
        "operationId": "waitlist.listMine",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "waitlist_entries"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-notifications.listInbox",
      "route": "GET /v1/me/notifications",
      "role": "authenticated",
      "aggregate": "notifications",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "notifications"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/me/notifications",
        "operationId": "notifications.listInbox",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "notifications"
        ],
        "role": "",
        "request": {},
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-branches.list",
      "route": "GET /v1/organizations/{org}/branches",
      "role": "owner",
      "aggregate": "branches",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "branches"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/organizations/{org}/branches",
        "operationId": "branches.list",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "branches"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-policies.list",
      "route": "GET /v1/organizations/{org}/policy-versions",
      "role": "owner",
      "aggregate": "policies",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "policy_versions"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/organizations/{org}/policy-versions",
        "operationId": "policies.list",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "policy_versions"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-staff.list",
      "route": "GET /v1/organizations/{org}/staff",
      "role": "owner",
      "aggregate": "staff",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "staff_memberships"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/organizations/{org}/staff",
        "operationId": "staff.list",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "staff_memberships"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-resources.list",
      "route": "GET /v1/branches/{branch}/resources",
      "role": "owner",
      "aggregate": "resources",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "resources"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/branches/{branch}/resources",
        "operationId": "resources.list",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "resources"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-catalog.listManaged",
      "route": "GET /v1/branches/{branch}/catalog",
      "role": "owner",
      "aggregate": "catalog",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "services"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/branches/{branch}/catalog",
        "operationId": "catalog.listManaged",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "services"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-shifts.list",
      "route": "GET /v1/branches/{branch}/shifts",
      "role": "owner",
      "aggregate": "shifts",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "shifts"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/branches/{branch}/shifts",
        "operationId": "shifts.list",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "shifts"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    },
    {
      "id": "BE-workforce.listVacancies",
      "route": "GET /v1/branches/{branch}/vacancies",
      "role": "owner",
      "aggregate": "workforce",
      "domain": "operations",
      "consistency": "Read-only scope + pagination",
      "nodeIds": [],
      "screenIds": [],
      "payload": "Фактическая схема запроса — в OpenAPI.",
      "authorization": "Серверная identity и область видимости ресурса; health/demo catalog public.",
      "failures": [
        "authentication_required",
        "forbidden",
        "not_found",
        "revision_conflict",
        "invalid_request",
        "database_unavailable"
      ],
      "events": [],
      "response": "Фактическая схема ответа — в OpenAPI.",
      "status": "implemented-local",
      "tables": [
        "vacancies"
      ],
      "runtime": {
        "method": "GET",
        "path": "/v1/branches/{branch}/vacancies",
        "operationId": "workforce.listVacancies",
        "commandId": "",
        "tags": [
          "readmodels"
        ],
        "tables": [
          "vacancies"
        ],
        "role": "owner",
        "request": {},
        "parameters": [
          {
            "name": "branch",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Branch"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "source": "apps/backend/app/readmodels/routes.py"
      },
      "implementationNote": "Дополнение графа для чтения, CRUD конфигурации или восстановления результата."
    }
  ],
  "chapters": [
    {
      "id": "DOC-architecture",
      "title": "Архитектура",
      "path": "docs/backend/ARCHITECTURE.md",
      "markdown": "# Архитектура backend PRIME\n\nTASK-PRIME-007. Основание — 186 узлов и 74 команды `packages/journey-contracts`, четыре роли и независимые состояния агрегатов. Структура перенесена из МАУ Education на commit `aa774b8587f8944d5a5a0220502b8446300d2b83`: модули предметных областей, `models / schemas / service / routes`, общая конфигурация, request-scoped SQLAlchemy session, Alembic, OpenAPI, реестр контрактов и генерируемое представление документации. Учебные сущности и настройки интеграций МАУ не переносились.\n\n## Границы\n\n`identity` — человек, связанные способы входа, сессии и отдельное право создать организацию. `organizations` — tenant, филиалы, ресурсы, роли, услуги и версии правил. `workforce` — найм, предложения, приглашения, ввод сотрудника, смены и начисления. `booking` — расчёт, hold, общий inventory, запись, перенос, отмена и очередь ожидания. `experience` — проведение визита, согласия, паспорт, медиа, отзыв и напоминания. `payments` — обязательство, платёж, возврат, касса, чек и сохранённый способ оплаты. `club` — планы, членство, привилегии, продление и гостевой визит. `operations` — обращения, удаление, выгрузка, audit, outbox и квитанции команд. `readmodels` — разрешённые проекции этих данных.\n\nAPI вызывает доменные сервисы; сервисы владеют переходами и транзакцией. ORM не импортирует HTTP. Web-атлас читает сгенерированный контракт и не отправляет бизнес-команды. Мобильные демонстрации продолжают работать только в памяти. Наличие серверного кода не означает подключение транспорта iOS/Android.\n\n## Путь запроса\n\nBearer содержит случайный opaque token. В БД хранится SHA-256; сервер проверяет expiry, revoke и active identity. Права owner/barber берутся из active membership при каждом действии; client получает только собственные объекты. Заголовки роли, переключатель атласа, provider profile и переданный identity ID не выдаются за полномочие.\n\nОдна request-scoped `AsyncSession` и одна транзакция включают изменение объекта, audit, outbox и квитанцию команды. Исключение откатывает все изменения. Commit выполняется до отправки HTTP-ответа через [function-scoped dependency FastAPI](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#early-exit-and-scope); отложенный сбой commit отдельно проверяется тестом. `Idempotency-Key` обязателен для команд; ключ ограничен identity и operationId, а хеш включает тело и параметры пути. Один ключ с другим запросом возвращает 409. PostgreSQL advisory transaction lock сериализует одновременный повтор. Успешный повтор возвращает сохранённый результат.\n\n`expected_revision=0` означает создание адресуемого PUT-объекта. Для существующего объекта нужна его текущая положительная revision. Удаление записи, платежа, чека, проводки или audit через универсальный CRUD запрещено: используются отмена, новая версия, отзыв либо компенсирующая команда.\n\n## Время и деньги\n\nAPI принимает timezone-aware timestamps. PostgreSQL хранит timestamptz; IANA timezone филиала используется при выборе календарного дня. Интервал inventory — `[start,end)`, включая buffer. В `reservations` два GiST exclusion constraint: мастер + интервал и кресло + интервал. Поэтому параллельные процессы не могут занять один ресурс, даже если оба успели прочитать свободный слот. Истёкший hold освобождается в транзакции перед новой попыткой; public availability является консервативной проекцией, а не гарантией брони.\n\nНавыки услуги закреплены в `ServiceVersion.required_skills`. Hold и подтверждение записи требуют подтверждённого владельцем onboarding с нужными навыками. Повторная отправка навыков снимает bookable до новой проверки; сама отправка мастером права записи не выдаёт.\n\nQuote рассчитывается по неизменяемым ServiceVersion и PolicyVersion. Денежные суммы — целые копейки RUB. Цена клиента, экранная скидка или тело webhook не являются источником суммы. Уже рассчитанный quote сохраняет снимок до expiry; новый каталог применяется к следующему расчёту. Для переноса новый hold должен существовать; старый reserve освобождается только в транзакции успешного move. Неудача откатывает обе части.\n\nТекущий исполняемый путь записи допускает опубликованную policy с депозитом 0. При ненулевом депозите возвращается `payment_provider_unavailable`: YooKassa не подключена. Кассовая запись фиксирует факт, который подтвердил сотрудник с отдельной cashier capability; это не проведение платежа провайдером и не регистрация фискального чека. Refund в `requested` резервирует сумму и создаёт внутреннее обязательство, но не объявляется выполненным возвратом.\n\n## Источники и проверяемость\n\nМодели и ограничения — `apps/backend/app/*/models.py`, агрегированный импорт — `app/db/models.py`. Миграция `0001_service_graph` хранит неизменяемый снимок DDL, не вызывает текущий `Base.metadata.create_all`. OpenAPI публикует только реально зарегистрированные маршруты. Backend-атлас связывает каждый из 74 исходных CMD с моделями и фактической реализацией либо явно отмеченным контрактом.\n\nОфициальное основание защиты интервалов: [PostgreSQL 17, btree_gist](https://www.postgresql.org/docs/17/btree-gist.html). Транзакционные границы и блокировки ORM: [SQLAlchemy 2 Session](https://docs.sqlalchemy.org/en/20/orm/session.html).\n"
    },
    {
      "id": "DOC-access",
      "title": "Права и CRUD",
      "path": "docs/backend/ACCESS_MATRIX.md",
      "markdown": "# Права и CRUD\n\nCRUD означает допустимые операции над предметной моделью, а не четыре публичных HTTP-метода на каждую таблицу. FK-таблицы и ledger изменяются только внутри команды агрегата. В карточке каждой модели перечислены Create, Read, Update и Delete, включая запреты и основание замены удаления.\n\n| Область               | Гость                     | Клиент                             | Барбер                           | Владелец                                |\n| --------------------- | ------------------------- | ---------------------------------- | -------------------------------- | --------------------------------------- |\n| Каталог и доступность | опубликованная проекция   | опубликованная проекция            | опубликованная проекция          | версии и публикация своего scope        |\n| Identity и профиль    | нет private доступа       | свой профиль и свои сессии         | свои данные                      | свои данные, без списка клиентов        |\n| Организация и ресурсы | нет                       | нет                                | своё назначение                  | свой tenant и филиалы                   |\n| Найм и приглашения    | нет                       | конкретное приглашение после входа | свои принятые условия            | кандидаты и предложения своего scope    |\n| Расписание            | свободные окна            | свободные окна                     | свои смены и запросы             | смены своих филиалов                    |\n| Запись                | только локальный draft    | собственная запись                 | назначенные визиты               | операционная проекция своего филиала    |\n| Оплата и карты        | нет                       | собственные токены/обязательства   | cashier capability отдельно      | статус/возврат своего tenant            |\n| Паспорт и фото        | нет                       | свои данные и согласие             | назначение + purpose consent     | нет безусловного доступа                |\n| Клуб                  | опубликованные планы      | собственное членство               | нет финансовых прав по умолчанию | версии планов своего tenant             |\n| Поддержка             | публичный контакт вне API | свои обращения                     | собственный/назначенный incident | решение в своём tenant                  |\n| Audit и outbox        | нет                       | статус своей команды               | статус своей команды             | отдельный служебный доступ, не raw CRUD |\n\n## Правила удаления\n\nЧерновую конфигурацию можно архивировать; опубликованные цены и условия исправляются новой версией. Booking отменяется после расчёта последствий, hold освобождается, session отзывается, membership закрывается с сохранением истории. PassportRevision, ServiceVersion, PolicyVersion, QuoteLine, CounterPayment, EarningLine, EntitlementLedger и AuditEvent защищены DB trigger от UPDATE/DELETE. PassportRevision допускает только необратимое обнуление приватных параметров отдельным privacy worker; восстановить или заменить их этим путём нельзя. Hard delete истории через API отсутствует.\n\nDeletionRequest — запрос, не доказательство удаления. Последний владелец сначала передаёт организацию; активные визиты, возвраты и обязательства рассматриваются отдельно. Удаление фото завершается только подтверждённым purge объекта и ссылок. Retention для контактов, кандидатов, медиа и финансов требует утверждённой политики; здесь не назначены выдуманные юридические сроки.\n\n## Дополнительные CRUD-операции\n\nГраф фиксирует прежде всего действия пользователя. Для работы клиентов к нему добавлены чтение и пагинация записей, статусов команд, контекста, сессий, согласий, обращений и каталогов управления. Дополнения сохраняют тот же scope; каждый дополнительный метод указан в фактическом OpenAPI. Для остальных запланированных чтений и архивирования карточка модели явно отличает проектное правило от опубликованного маршрута.\n"
    },
    {
      "id": "DOC-api",
      "title": "HTTP и восстановление",
      "path": "docs/backend/api/OPENAPI.md",
      "markdown": "# API и протокол команд\n\nФактическая спецификация — `packages/api-contracts/openapi.json`. Целевые операции графа — `packages/journey-contracts/api-contracts.json`. Их сопоставление и дополнения CRUD — `packages/backend-atlas/atlas.json`. Не зарегистрированные маршруты отсутствуют в фактическом OpenAPI, а в атласе имеют статус `contract`.\n\n## Общий контракт\n\nДля private API нужен `Authorization: Bearer <opaque-session-token>`. Изменяющий запрос передаёт `Idempotency-Key` длиной 8–160 символов. Поля запросов заданы Pydantic; лишние поля, наивные даты и недопустимые суммы отвергаются. Клиент не передаёт роль или authoritative payment status. Ожидаемая версия объекта указывается в `expected_revision`.\n\nОшибка имеет envelope `{error: {code, retryable, correlation_id, details}}`. Валидация не возвращает введённые значения: токены, контактные данные и приватный текст не попадают в сообщение об ошибке. `401` — нет действующей сессии; `403` — нет capability; `404` — объект отсутствует или чужой; `409` — конфликт версии, времени, идемпотентности или состояния; `422` — неправильный запрос; `503` — БД или необходимая интеграция недоступна.\n\nСписки возвращают `items`, `next_cursor`, `as_of`. Cursor — UUID последнего выданного объекта; limit ограничен 1–100. Это keyset pagination, не snapshot isolation между HTTP-запросами. Все ответы `Cache-Control: no-store`. `GET /health/live` проверяет процесс; `/health/ready` — соединение с PostgreSQL и точное совпадение Alembic heads. Readiness не доказывает доступность провайдеров.\n\n## Запись и восстановление неизвестного результата\n\n1. Получить public catalog и availability.\n2. Создать quote по идентификаторам услуг.\n3. Создать hold на выбранную смену и время.\n4. Подтвердить quote, hold и конкретную policy.\n5. После потери ответа запросить `/v1/me/command-status?operation=bookings.create&key=...` либо повторить исходную команду с тем же ключом.\n\n`not_observed` при чтении статуса не означает отказ: незавершённая транзакция ещё может зафиксироваться. Повторять разрешается тот же ключ. Новый ключ может создать другое намерение. Не копировать ключ от одного operationId к другому в качестве ссылки на операцию.\n\n## Внешние адаптеры\n\nTelegram/Яндекс/MAX, YooKassa, vault, объектное хранилище, отправка уведомлений и purge worker не активированы. Их контракты, таблицы и узлы графа доступны в атласе. Фальшивых POST-success для этих действий нет. Настоящая авторизация клиента и внешний settlement требуют отдельной конфигурации адаптеров, проверки callback/webhook и разрешённых секретов. Сессия для интеграционных тестов создаётся только серверной fixture.\n"
    },
    {
      "id": "DOC-status",
      "title": "Состояние реализации",
      "path": "docs/backend/MVP_STATUS.md",
      "markdown": "# Состояние реализации\n\nTASK-PRIME-007 разделяет модель, реализацию сервиса, runtime-проверку и выпуск. Машинный реестр и страницы backend-атласа генерируются из кода; счётчики и списки фактических маршрутов не поддерживаются вручную.\n\n## Реализованный контур\n\nНормализованная схема PostgreSQL, frozen Alembic migration, opaque sessions, membership scope, optimistic revisions, idempotent commands, audit/outbox, каталог и версии цен/правил, график, найм, ввод/отзыв сотрудника, quote/hold/booking, перенос/отмена, проведение визита, согласия/паспорт, кассовый учёт, запрос возврата, членство и резервирование привилегий, обращения, запросы выгрузки/удаления и разрешённые read models.\n\nЗапросы возврата, членства, удаления и экспорта подтверждают только локальное принятие намерения. Их последующие внешние этапы отдельно отображены в статусах и контрактах. Членство не становится активным без settlement. Отправка outbox во внешние каналы не производится.\n\n## Контрактные границы\n\nProvider auth/callback/link/recovery, одноразовая доставка приглашения, merchant verification, онлайн-платёж/webhook/capture/reconciliation, worker уведомлений, media upload/purge, автоматический waitlist matching, согласованный scope change, guest pass и renewals, двухсторонняя передача владения, расчёт зарплаты по утверждённым условиям и автоматическое закрытие визита требуют отдельных реализаций и решений. У каждого соответствующего CMD есть карточка с таблицами, входом, ошибками и зависимостями; наличие таблицы не выдаётся за работающую интеграцию.\n\n16 бизнес-policy предложений графа остаются предложениями. Backend принимает явно опубликованную владельцем policy; тестовые числа существуют только в fixture и не являются ценами или условиями PRIME.\n\n## Проверки и выпуск\n\nФактические команды, результаты, ограничения и артефакты: `docs/qa/backend/VALIDATION.md`. Проверки PostgreSQL и браузера выполняются в изолированных контейнерах Bravo. Продакшен не развёрнут, GitHub PR не опубликован, мобильные приложения к серверу не подключены. Эти состояния не выводятся из успешного теста или сборки.\n"
    }
  ],
  "schemas": {
    "AbsenceCreate": {
      "properties": {
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "category": {
          "type": "string",
          "enum": [
            "illness",
            "late",
            "emergency",
            "unavailable"
          ],
          "title": "Category"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "starts_at",
        "ends_at",
        "membership_id",
        "category"
      ],
      "title": "AbsenceCreate"
    },
    "AbsenceIncidentView": {
      "properties": {
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "category": {
          "type": "string",
          "title": "Category"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "membership_id",
        "starts_at",
        "ends_at",
        "category",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "AbsenceIncidentView"
    },
    "Arrival": {
      "properties": {
        "estimated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Estimated At"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "estimated_at"
      ],
      "title": "Arrival"
    },
    "ArrivalUpdateView": {
      "properties": {
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        },
        "estimated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Estimated At"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "booking_id",
        "estimated_at",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ArrivalUpdateView"
    },
    "AttendanceReviewView": {
      "properties": {
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        },
        "author_id": {
          "type": "string",
          "format": "uuid",
          "title": "Author Id"
        },
        "contact_attempts": {
          "type": "integer",
          "title": "Contact Attempts"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "booking_id",
        "author_id",
        "contact_attempts",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "AttendanceReviewView"
    },
    "BookingCreate": {
      "properties": {
        "quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Quote Id"
        },
        "hold_id": {
          "type": "string",
          "format": "uuid",
          "title": "Hold Id"
        },
        "policy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Policy Id"
        },
        "accepted": {
          "type": "boolean",
          "const": true,
          "title": "Accepted"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "quote_id",
        "hold_id",
        "policy_id",
        "accepted"
      ],
      "title": "BookingCreate"
    },
    "BookingView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Quote Id"
        },
        "hold_id": {
          "type": "string",
          "format": "uuid",
          "title": "Hold Id"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "resource_id": {
          "type": "string",
          "format": "uuid",
          "title": "Resource Id"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "client_id",
        "quote_id",
        "hold_id",
        "membership_id",
        "resource_id",
        "starts_at",
        "ends_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "BookingView"
    },
    "BranchPut": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Name"
        },
        "address": {
          "type": "string",
          "maxLength": 400,
          "minLength": 1,
          "title": "Address"
        },
        "timezone": {
          "type": "string",
          "title": "Timezone"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "name",
        "address",
        "timezone"
      ],
      "title": "BranchPut"
    },
    "BranchView": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "address": {
          "type": "string",
          "title": "Address"
        },
        "timezone": {
          "type": "string",
          "title": "Timezone"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "organization_id",
        "name",
        "address",
        "timezone",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "BranchView"
    },
    "Cancel": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "cancellation_quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Cancellation Quote Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "cancellation_quote_id"
      ],
      "title": "Cancel"
    },
    "CancellationQuoteView": {
      "properties": {
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        },
        "booking_revision": {
          "type": "integer",
          "title": "Booking Revision"
        },
        "settlement_minor": {
          "type": "integer",
          "title": "Settlement Minor"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires At"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "booking_id",
        "booking_revision",
        "settlement_minor",
        "expires_at",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "CancellationQuoteView"
    },
    "CandidateEvent": {
      "properties": {
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "consent_version": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "Consent Version"
        },
        "event": {
          "type": "string",
          "enum": [
            "consider",
            "trial",
            "offer",
            "reject"
          ],
          "title": "Event"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "terms": {
          "type": "string",
          "maxLength": 4000,
          "title": "Terms",
          "default": ""
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "identity_id",
        "consent_version",
        "event",
        "expected_revision"
      ],
      "title": "CandidateEvent"
    },
    "CandidateView": {
      "properties": {
        "vacancy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Vacancy Id"
        },
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "consent_version": {
          "type": "string",
          "title": "Consent Version"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "vacancy_id",
        "identity_id",
        "consent_version",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "CandidateView"
    },
    "CaseCreate": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "category": {
          "type": "string",
          "enum": [
            "booking",
            "payment",
            "quality",
            "access",
            "privacy",
            "other"
          ],
          "title": "Category"
        },
        "description": {
          "type": "string",
          "maxLength": 4000,
          "minLength": 1,
          "title": "Description"
        },
        "contact_consent": {
          "type": "boolean",
          "const": true,
          "title": "Contact Consent"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "organization_id",
        "category",
        "description",
        "contact_consent"
      ],
      "title": "CaseCreate"
    },
    "CaseResolve": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "resolution": {
          "type": "string",
          "maxLength": 2000,
          "minLength": 10,
          "title": "Resolution"
        },
        "assignee_id": {
          "type": "string",
          "format": "uuid",
          "title": "Assignee Id"
        },
        "due_at": {
          "type": "string",
          "format": "date-time",
          "title": "Due At"
        },
        "resolved": {
          "type": "boolean",
          "title": "Resolved"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "resolution",
        "assignee_id",
        "due_at",
        "resolved"
      ],
      "title": "CaseResolve"
    },
    "ClubMembershipView": {
      "properties": {
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "plan_id": {
          "type": "string",
          "format": "uuid",
          "title": "Plan Id"
        },
        "order_id": {
          "type": "string",
          "format": "uuid",
          "title": "Order Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "client_id",
        "plan_id",
        "order_id",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ClubMembershipView"
    },
    "ClubPlanView": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "number": {
          "type": "integer",
          "title": "Number"
        },
        "price_minor": {
          "type": "integer",
          "title": "Price Minor"
        },
        "visits": {
          "type": "integer",
          "title": "Visits"
        },
        "terms": {
          "type": "string",
          "title": "Terms"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "organization_id",
        "name",
        "number",
        "price_minor",
        "visits",
        "terms",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ClubPlanView"
    },
    "ConsentPut": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "terms_version": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "Terms Version"
        },
        "accepted": {
          "type": "boolean",
          "title": "Accepted"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "terms_version",
        "accepted"
      ],
      "title": "ConsentPut"
    },
    "ConsentView": {
      "properties": {
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "purpose": {
          "type": "string",
          "title": "Purpose"
        },
        "terms_version": {
          "type": "string",
          "title": "Terms Version"
        },
        "accepted": {
          "type": "boolean",
          "title": "Accepted"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "identity_id",
        "purpose",
        "terms_version",
        "accepted",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ConsentView"
    },
    "CounterPaymentCreate": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "amount_minor": {
          "type": "integer",
          "maximum": 100000000.0,
          "exclusiveMinimum": 0.0,
          "title": "Amount Minor"
        },
        "method": {
          "type": "string",
          "enum": [
            "cash",
            "external_terminal"
          ],
          "title": "Method"
        },
        "receipt_reference": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1,
          "title": "Receipt Reference"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "amount_minor",
        "method",
        "receipt_reference"
      ],
      "title": "CounterPaymentCreate"
    },
    "CounterPaymentView": {
      "properties": {
        "order_id": {
          "type": "string",
          "format": "uuid",
          "title": "Order Id"
        },
        "cashier_id": {
          "type": "string",
          "format": "uuid",
          "title": "Cashier Id"
        },
        "amount_minor": {
          "type": "integer",
          "title": "Amount Minor"
        },
        "method": {
          "type": "string",
          "title": "Method"
        },
        "receipt_reference": {
          "type": "string",
          "title": "Receipt Reference"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "order_id",
        "cashier_id",
        "amount_minor",
        "method",
        "receipt_reference",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "CounterPaymentView"
    },
    "DataExportView": {
      "properties": {
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "format": {
          "type": "string",
          "title": "Format"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "identity_id",
        "format",
        "status",
        "expires_at",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "DataExportView"
    },
    "DeletionCreate": {
      "properties": {
        "accepted_consequences": {
          "type": "boolean",
          "const": true,
          "title": "Accepted Consequences"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "accepted_consequences"
      ],
      "title": "DeletionCreate"
    },
    "DeletionRequestView": {
      "properties": {
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "identity_id",
        "status",
        "completed_at",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "DeletionRequestView"
    },
    "EntitlementLedgerView": {
      "properties": {
        "entitlement_id": {
          "type": "string",
          "format": "uuid",
          "title": "Entitlement Id"
        },
        "booking_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Booking Id"
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "units": {
          "type": "integer",
          "title": "Units"
        },
        "operation_key": {
          "type": "string",
          "title": "Operation Key"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "entitlement_id",
        "booking_id",
        "kind",
        "units",
        "operation_key",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "EntitlementLedgerView"
    },
    "EntitlementReserve": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "entitlement_id": {
          "type": "string",
          "format": "uuid",
          "title": "Entitlement Id"
        },
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "entitlement_id",
        "booking_id"
      ],
      "title": "EntitlementReserve"
    },
    "ErrorEnvelope": {
      "properties": {
        "error": {
          "$ref": "#/components/schemas/Problem"
        }
      },
      "type": "object",
      "required": [
        "error"
      ],
      "title": "ErrorEnvelope"
    },
    "ExportCreate": {
      "properties": {
        "format": {
          "type": "string",
          "const": "json",
          "title": "Format",
          "default": "json"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "ExportCreate"
    },
    "FeedbackCreate": {
      "properties": {
        "score": {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0,
          "title": "Score"
        },
        "text": {
          "type": "string",
          "maxLength": 2000,
          "title": "Text"
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "public"
          ],
          "title": "Visibility",
          "default": "private"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "score",
        "text"
      ],
      "title": "FeedbackCreate"
    },
    "FeedbackView": {
      "properties": {
        "visit_id": {
          "type": "string",
          "format": "uuid",
          "title": "Visit Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "score": {
          "type": "integer",
          "title": "Score"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "visibility": {
          "type": "string",
          "title": "Visibility"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "visit_id",
        "client_id",
        "score",
        "text",
        "visibility",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "FeedbackView"
    },
    "HoldCreate": {
      "properties": {
        "quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Quote Id"
        },
        "shift_id": {
          "type": "string",
          "format": "uuid",
          "title": "Shift Id"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "quote_id",
        "shift_id",
        "starts_at"
      ],
      "title": "HoldCreate"
    },
    "IncidentCreate": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "category": {
          "type": "string",
          "enum": [
            "illness",
            "unsafe_behavior",
            "equipment",
            "other"
          ],
          "title": "Category"
        },
        "assistance": {
          "type": "string",
          "maxLength": 400,
          "minLength": 1,
          "title": "Assistance"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "category",
        "assistance"
      ],
      "title": "IncidentCreate"
    },
    "MembershipChange": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "action": {
          "type": "string",
          "enum": [
            "pause",
            "cancel"
          ],
          "title": "Action"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "membership_id",
        "action"
      ],
      "title": "MembershipChange"
    },
    "MembershipCreate": {
      "properties": {
        "plan_id": {
          "type": "string",
          "format": "uuid",
          "title": "Plan Id"
        },
        "accepted_terms": {
          "type": "boolean",
          "const": true,
          "title": "Accepted Terms"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "plan_id",
        "accepted_terms"
      ],
      "title": "MembershipCreate"
    },
    "MembershipView": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "branch_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Branch Id"
        },
        "role": {
          "type": "string",
          "title": "Role"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "cashier": {
          "type": "boolean",
          "title": "Cashier"
        },
        "bookable": {
          "type": "boolean",
          "title": "Bookable"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "organization_id",
        "identity_id",
        "branch_id",
        "role",
        "status",
        "cashier",
        "bookable",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "MembershipView"
    },
    "Move": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Quote Id"
        },
        "new_hold_id": {
          "type": "string",
          "format": "uuid",
          "title": "New Hold Id"
        },
        "policy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Policy Id"
        },
        "accepted": {
          "type": "boolean",
          "const": true,
          "title": "Accepted"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "quote_id",
        "new_hold_id",
        "policy_id",
        "accepted"
      ],
      "title": "Move"
    },
    "NoShow": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "contact_attempts": {
          "type": "integer",
          "maximum": 20.0,
          "minimum": 0.0,
          "title": "Contact Attempts"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "contact_attempts"
      ],
      "title": "NoShow"
    },
    "Offboarding": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "acknowledge_affected_bookings": {
          "type": "boolean",
          "const": true,
          "title": "Acknowledge Affected Bookings"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "acknowledge_affected_bookings"
      ],
      "title": "Offboarding"
    },
    "OnboardingPut": {
      "properties": {
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "policy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Policy Id"
        },
        "skills": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 30,
          "minItems": 1,
          "title": "Skills"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "membership_id",
        "policy_id",
        "skills",
        "expected_revision"
      ],
      "title": "OnboardingPut"
    },
    "OnboardingView": {
      "properties": {
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "skills": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Skills"
        },
        "accepted_policy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Accepted Policy Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "membership_id",
        "skills",
        "accepted_policy_id",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "OnboardingView"
    },
    "OrganizationCreate": {
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Name"
        },
        "provision_token": {
          "type": "string",
          "maxLength": 160,
          "minLength": 32,
          "title": "Provision Token"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name",
        "provision_token"
      ],
      "title": "OrganizationCreate"
    },
    "OrganizationView": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "name",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "OrganizationView"
    },
    "Page": {
      "properties": {
        "items": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Items"
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Cursor"
        },
        "as_of": {
          "type": "string",
          "format": "date-time",
          "title": "As Of"
        }
      },
      "type": "object",
      "required": [
        "items",
        "as_of"
      ],
      "title": "Page"
    },
    "PassportCreate": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "parameters": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "maxProperties": 30,
          "minProperties": 1,
          "title": "Parameters"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "parameters"
      ],
      "title": "PassportCreate"
    },
    "PassportRevisionView": {
      "properties": {
        "visit_id": {
          "type": "string",
          "format": "uuid",
          "title": "Visit Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "author_id": {
          "type": "string",
          "format": "uuid",
          "title": "Author Id"
        },
        "number": {
          "type": "integer",
          "title": "Number"
        },
        "parameters": {
          "additionalProperties": true,
          "type": "object",
          "title": "Parameters"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "visit_id",
        "client_id",
        "author_id",
        "number",
        "parameters",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "PassportRevisionView"
    },
    "PlanCreate": {
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Name"
        },
        "price_minor": {
          "type": "integer",
          "maximum": 100000000.0,
          "minimum": 0.0,
          "title": "Price Minor"
        },
        "visits": {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 1.0,
          "title": "Visits"
        },
        "terms": {
          "type": "string",
          "maxLength": 4000,
          "minLength": 10,
          "title": "Terms"
        },
        "published": {
          "type": "boolean",
          "title": "Published"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name",
        "price_minor",
        "visits",
        "terms",
        "published"
      ],
      "title": "PlanCreate"
    },
    "PolicyCreate": {
      "properties": {
        "deposit_bps": {
          "type": "integer",
          "maximum": 10000.0,
          "minimum": 0.0,
          "title": "Deposit Bps"
        },
        "hold_seconds": {
          "type": "integer",
          "maximum": 1800.0,
          "minimum": 30.0,
          "title": "Hold Seconds"
        },
        "cancellation_hours": {
          "type": "integer",
          "maximum": 720.0,
          "minimum": 0.0,
          "title": "Cancellation Hours"
        },
        "effective_at": {
          "type": "string",
          "format": "date-time",
          "title": "Effective At"
        },
        "terms": {
          "type": "string",
          "maxLength": 4000,
          "minLength": 10,
          "title": "Terms"
        },
        "approved": {
          "type": "boolean",
          "const": true,
          "title": "Approved"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "deposit_bps",
        "hold_seconds",
        "cancellation_hours",
        "effective_at",
        "terms",
        "approved"
      ],
      "title": "PolicyCreate"
    },
    "PolicyVersionView": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "number": {
          "type": "integer",
          "title": "Number"
        },
        "deposit_bps": {
          "type": "integer",
          "title": "Deposit Bps"
        },
        "hold_seconds": {
          "type": "integer",
          "title": "Hold Seconds"
        },
        "cancellation_hours": {
          "type": "integer",
          "title": "Cancellation Hours"
        },
        "effective_at": {
          "type": "string",
          "format": "date-time",
          "title": "Effective At"
        },
        "approved_by": {
          "type": "string",
          "format": "uuid",
          "title": "Approved By"
        },
        "terms": {
          "additionalProperties": true,
          "type": "object",
          "title": "Terms"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "organization_id",
        "number",
        "deposit_bps",
        "hold_seconds",
        "cancellation_hours",
        "effective_at",
        "approved_by",
        "terms",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "PolicyVersionView"
    },
    "Problem": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "retryable": {
          "type": "boolean",
          "title": "Retryable",
          "default": false
        },
        "correlation_id": {
          "type": "string",
          "title": "Correlation Id"
        },
        "details": {
          "additionalProperties": true,
          "type": "object",
          "title": "Details"
        }
      },
      "type": "object",
      "required": [
        "code",
        "correlation_id"
      ],
      "title": "Problem"
    },
    "ProfilePut": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "display_name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Display Name"
        },
        "preferences": {
          "type": "string",
          "maxLength": 2000,
          "title": "Preferences"
        },
        "contact_hint": {
          "type": "string",
          "maxLength": 200,
          "title": "Contact Hint"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "display_name",
        "preferences",
        "contact_hint"
      ],
      "title": "ProfilePut"
    },
    "ProfileView": {
      "properties": {
        "identity_id": {
          "type": "string",
          "format": "uuid",
          "title": "Identity Id"
        },
        "preferences": {
          "type": "string",
          "title": "Preferences"
        },
        "contact_hint": {
          "type": "string",
          "title": "Contact Hint"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "identity_id",
        "preferences",
        "contact_hint",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ProfileView"
    },
    "Publication": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "publish": {
          "type": "boolean",
          "title": "Publish"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "publish"
      ],
      "title": "Publication"
    },
    "QuoteCreate": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "service_ids": {
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "type": "array",
          "maxItems": 10,
          "minItems": 1,
          "title": "Service Ids"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "branch_id",
        "service_ids"
      ],
      "title": "QuoteCreate"
    },
    "QuoteView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "policy_id": {
          "type": "string",
          "format": "uuid",
          "title": "Policy Id"
        },
        "total_minor": {
          "type": "integer",
          "title": "Total Minor"
        },
        "deposit_minor": {
          "type": "integer",
          "title": "Deposit Minor"
        },
        "duration_minutes": {
          "type": "integer",
          "title": "Duration Minutes"
        },
        "buffer_minutes": {
          "type": "integer",
          "title": "Buffer Minutes"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "client_id",
        "policy_id",
        "total_minor",
        "deposit_minor",
        "duration_minutes",
        "buffer_minutes",
        "currency",
        "expires_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "QuoteView"
    },
    "ReferralCreate": {
      "properties": {
        "code": {
          "type": "string",
          "maxLength": 80,
          "minLength": 4,
          "title": "Code"
        },
        "qualifying_visit_id": {
          "type": "string",
          "format": "uuid",
          "title": "Qualifying Visit Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "code",
        "qualifying_visit_id"
      ],
      "title": "ReferralCreate"
    },
    "ReferralView": {
      "properties": {
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "code": {
          "type": "string",
          "title": "Code"
        },
        "qualifying_visit_id": {
          "type": "string",
          "format": "uuid",
          "title": "Qualifying Visit Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "client_id",
        "code",
        "qualifying_visit_id",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ReferralView"
    },
    "RefundCreate": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "payment_id": {
          "type": "string",
          "format": "uuid",
          "title": "Payment Id"
        },
        "amount_minor": {
          "type": "integer",
          "maximum": 100000000.0,
          "exclusiveMinimum": 0.0,
          "title": "Amount Minor"
        },
        "reason": {
          "type": "string",
          "maxLength": 400,
          "minLength": 1,
          "title": "Reason"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "payment_id",
        "amount_minor",
        "reason"
      ],
      "title": "RefundCreate"
    },
    "RefundView": {
      "properties": {
        "payment_id": {
          "type": "string",
          "format": "uuid",
          "title": "Payment Id"
        },
        "amount_minor": {
          "type": "integer",
          "title": "Amount Minor"
        },
        "reason": {
          "type": "string",
          "title": "Reason"
        },
        "provider_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "payment_id",
        "amount_minor",
        "reason",
        "provider_id",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "RefundView"
    },
    "ReminderPreferenceView": {
      "properties": {
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        },
        "channel": {
          "type": "string",
          "title": "Channel"
        },
        "disabled": {
          "type": "boolean",
          "title": "Disabled"
        },
        "snooze_until": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Snooze Until"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "booking_id",
        "channel",
        "disabled",
        "snooze_until",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ReminderPreferenceView"
    },
    "ReminderPut": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "channel": {
          "type": "string",
          "enum": [
            "inbox",
            "push",
            "email"
          ],
          "title": "Channel"
        },
        "disabled": {
          "type": "boolean",
          "title": "Disabled"
        },
        "snooze_until": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Snooze Until"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "channel",
        "disabled"
      ],
      "title": "ReminderPut"
    },
    "ResourceCreate": {
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Name"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name"
      ],
      "title": "ResourceCreate"
    },
    "ResourceView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "name",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ResourceView"
    },
    "RevokeSessions": {
      "properties": {
        "session_ids": {
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "type": "array",
          "maxItems": 50,
          "title": "Session Ids"
        },
        "all_sessions": {
          "type": "boolean",
          "title": "All Sessions",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "session_ids"
      ],
      "title": "RevokeSessions"
    },
    "SafetyIncidentView": {
      "properties": {
        "visit_id": {
          "type": "string",
          "format": "uuid",
          "title": "Visit Id"
        },
        "author_id": {
          "type": "string",
          "format": "uuid",
          "title": "Author Id"
        },
        "category": {
          "type": "string",
          "title": "Category"
        },
        "assistance": {
          "type": "string",
          "title": "Assistance"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "visit_id",
        "author_id",
        "category",
        "assistance",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "SafetyIncidentView"
    },
    "SavedPaymentMethodView": {
      "properties": {
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "client_id",
        "label",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "SavedPaymentMethodView"
    },
    "ServiceEvent": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "event": {
          "type": "string",
          "enum": [
            "agree",
            "start",
            "complete",
            "interrupt"
          ],
          "title": "Event"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "event"
      ],
      "title": "ServiceEvent"
    },
    "ServicePut": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "name": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Name"
        },
        "price_minor": {
          "type": "integer",
          "maximum": 100000000.0,
          "minimum": 0.0,
          "title": "Price Minor"
        },
        "duration_minutes": {
          "type": "integer",
          "maximum": 480.0,
          "minimum": 5.0,
          "title": "Duration Minutes"
        },
        "buffer_minutes": {
          "type": "integer",
          "maximum": 120.0,
          "minimum": 0.0,
          "title": "Buffer Minutes"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "published",
            "archived"
          ],
          "title": "Status"
        },
        "required_skills": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 30,
          "title": "Required Skills"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "name",
        "price_minor",
        "duration_minutes",
        "buffer_minutes",
        "status"
      ],
      "title": "ServicePut"
    },
    "ServiceView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "name",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ServiceView"
    },
    "ShiftPut": {
      "properties": {
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "expected_revision": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Expected Revision"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "resource_id": {
          "type": "string",
          "format": "uuid",
          "title": "Resource Id"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "starts_at",
        "ends_at",
        "expected_revision",
        "membership_id",
        "resource_id"
      ],
      "title": "ShiftPut"
    },
    "ShiftRequestCreate": {
      "properties": {
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "kind": {
          "type": "string",
          "enum": [
            "leave",
            "resignation",
            "schedule"
          ],
          "title": "Kind"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "starts_at",
        "ends_at",
        "membership_id",
        "kind"
      ],
      "title": "ShiftRequestCreate"
    },
    "ShiftRequestView": {
      "properties": {
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "membership_id",
        "kind",
        "starts_at",
        "ends_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ShiftRequestView"
    },
    "ShiftView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "membership_id": {
          "type": "string",
          "format": "uuid",
          "title": "Membership Id"
        },
        "resource_id": {
          "type": "string",
          "format": "uuid",
          "title": "Resource Id"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "membership_id",
        "resource_id",
        "starts_at",
        "ends_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "ShiftView"
    },
    "SlotHoldView": {
      "properties": {
        "quote_id": {
          "type": "string",
          "format": "uuid",
          "title": "Quote Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "shift_id": {
          "type": "string",
          "format": "uuid",
          "title": "Shift Id"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "title": "Expires At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "quote_id",
        "client_id",
        "shift_id",
        "starts_at",
        "ends_at",
        "expires_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "SlotHoldView"
    },
    "StaffReady": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "bookable": {
          "type": "boolean",
          "title": "Bookable"
        },
        "cashier": {
          "type": "boolean",
          "title": "Cashier",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "bookable"
      ],
      "title": "StaffReady"
    },
    "SupportCaseView": {
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "title": "Organization Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "category": {
          "type": "string",
          "title": "Category"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "assignee_id": {
          "type": "string",
          "format": "uuid",
          "title": "Assignee Id"
        },
        "due_at": {
          "type": "string",
          "format": "date-time",
          "title": "Due At"
        },
        "resolution": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolution"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "organization_id",
        "client_id",
        "category",
        "description",
        "assignee_id",
        "due_at",
        "resolution",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "SupportCaseView"
    },
    "UnlinkCard": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        },
        "acknowledge_mandates": {
          "type": "boolean",
          "const": true,
          "title": "Acknowledge Mandates"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision",
        "acknowledge_mandates"
      ],
      "title": "UnlinkCard"
    },
    "VacancyCreate": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "title": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Title"
        },
        "terms": {
          "type": "string",
          "maxLength": 4000,
          "minLength": 10,
          "title": "Terms"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "branch_id",
        "title",
        "terms"
      ],
      "title": "VacancyCreate"
    },
    "VacancyView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "terms": {
          "type": "string",
          "title": "Terms"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "title",
        "terms",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "VacancyView"
    },
    "Version": {
      "properties": {
        "expected_revision": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Expected Revision"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "expected_revision"
      ],
      "title": "Version"
    },
    "VisitView": {
      "properties": {
        "booking_id": {
          "type": "string",
          "format": "uuid",
          "title": "Booking Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "booking_id",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "VisitView"
    },
    "WaitlistCreate": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "service_ids": {
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "type": "array",
          "maxItems": 10,
          "minItems": 1,
          "title": "Service Ids"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "branch_id",
        "service_ids",
        "starts_at",
        "ends_at"
      ],
      "title": "WaitlistCreate"
    },
    "WaitlistEntryView": {
      "properties": {
        "branch_id": {
          "type": "string",
          "format": "uuid",
          "title": "Branch Id"
        },
        "client_id": {
          "type": "string",
          "format": "uuid",
          "title": "Client Id"
        },
        "service_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Service Ids"
        },
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "title": "Starts At"
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "title": "Ends At"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "revision": {
          "type": "integer",
          "title": "Revision"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "branch_id",
        "client_id",
        "service_ids",
        "starts_at",
        "ends_at",
        "status",
        "id",
        "revision",
        "created_at",
        "updated_at"
      ],
      "title": "WaitlistEntryView"
    }
  }
}
