{
  "generatedAt": "2026-11-06T20:27:25.983Z",
  "fastifyVersion": "5.12.8",
  "nodeVersion": "v24.19.0",
  "transport": "HTTP over loopback TCP; fresh seed before each scenario",
  "scenarios": [
    {
      "id": "services",
      "passed": true,
      "request": {
        "method": "GET",
        "path": "/api/services?q=аудит&page=1&limit=4"
      },
      "response": {
        "status": 200,
        "body": {
          "ok": true,
          "data": [
            {
              "id": "SVC-01",
              "title": "Аудит интерфейса",
              "category": "audit",
              "priceMinor": 1200000,
              "active": true
            },
            {
              "id": "SVC-02",
              "title": "Аудит скорости сайта",
              "category": "audit",
              "priceMinor": 950000,
              "active": true
            }
          ],
          "requestId": "9ae9cc53-71db-4b40-b371-a509e5860472",
          "meta": {
            "page": 1,
            "limit": 4,
            "total": 2,
            "pages": 1
          }
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "9ae9cc53-71db-4b40-b371-a509e5860472"
        }
      }
    },
    {
      "id": "create",
      "passed": true,
      "request": {
        "method": "POST",
        "path": "/api/requests",
        "body": {
          "customer": "Команда Кедр",
          "serviceId": "SVC-01",
          "quantity": 2,
          "note": "Проверить мобильную версию"
        },
        "headers": {
          "content-type": "application/json"
        }
      },
      "response": {
        "status": 201,
        "body": {
          "ok": true,
          "data": {
            "id": "RQ-1015",
            "customer": "Команда Кедр",
            "serviceId": "SVC-01",
            "serviceTitle": "Аудит интерфейса",
            "quantity": 2,
            "amountMinor": 2400000,
            "currency": "RUB",
            "status": "new",
            "note": "Проверить мобильную версию",
            "createdAt": "2026-11-06T20:27:25.796Z",
            "updatedAt": "2026-11-06T20:27:25.796Z",
            "version": 1
          },
          "requestId": "4059b724-8665-4897-95d0-c13e839012e0"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "4059b724-8665-4897-95d0-c13e839012e0",
          "location": "/api/requests/RQ-1015"
        }
      }
    },
    {
      "id": "validation",
      "passed": true,
      "request": {
        "method": "POST",
        "path": "/api/requests",
        "body": {
          "customer": "К",
          "serviceId": "SVC-01",
          "quantity": 0
        },
        "headers": {
          "content-type": "application/json"
        }
      },
      "response": {
        "status": 400,
        "body": {
          "ok": false,
          "error": {
            "code": "VALIDATION_ERROR",
            "message": "Проверьте поля запроса.",
            "details": [
              {
                "field": "body.customer",
                "message": "Минимальная длина: 2."
              }
            ]
          },
          "requestId": "f40748c4-867b-460e-a352-8528497825db"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "f40748c4-867b-460e-a352-8528497825db"
        }
      }
    },
    {
      "id": "details",
      "passed": true,
      "request": {
        "method": "GET",
        "path": "/api/requests/RQ-1001"
      },
      "response": {
        "status": 200,
        "body": {
          "ok": true,
          "data": {
            "id": "RQ-1001",
            "customer": "Команда Кедр",
            "serviceId": "SVC-01",
            "serviceTitle": "Аудит интерфейса",
            "quantity": 1,
            "amountMinor": 1200000,
            "currency": "RUB",
            "status": "new",
            "note": "Вымышленная учебная заявка",
            "createdAt": "2026-11-01T09:00:00.000Z",
            "updatedAt": "2026-11-01T09:00:00.000Z",
            "version": 1
          },
          "requestId": "5ecd5b49-5bf3-469c-9135-a4490b3ee8a6"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "5ecd5b49-5bf3-469c-9135-a4490b3ee8a6"
        }
      }
    },
    {
      "id": "update",
      "passed": true,
      "request": {
        "method": "PATCH",
        "path": "/api/requests/RQ-1001",
        "body": {
          "status": "in_progress",
          "version": 1
        },
        "headers": {
          "content-type": "application/json"
        }
      },
      "response": {
        "status": 200,
        "body": {
          "ok": true,
          "data": {
            "id": "RQ-1001",
            "customer": "Команда Кедр",
            "serviceId": "SVC-01",
            "serviceTitle": "Аудит интерфейса",
            "quantity": 1,
            "amountMinor": 1200000,
            "currency": "RUB",
            "status": "in_progress",
            "note": "Вымышленная учебная заявка",
            "createdAt": "2026-11-01T09:00:00.000Z",
            "updatedAt": "2026-11-06T20:27:25.874Z",
            "version": 2
          },
          "requestId": "c26f5335-9850-46a9-890d-bd2b3d5138a8"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "c26f5335-9850-46a9-890d-bd2b3d5138a8"
        }
      }
    },
    {
      "id": "notfound",
      "passed": true,
      "request": {
        "method": "GET",
        "path": "/api/requests/RQ-9999"
      },
      "response": {
        "status": 404,
        "body": {
          "ok": false,
          "error": {
            "code": "REQUEST_NOT_FOUND",
            "message": "Заявка с таким ID не найдена."
          },
          "requestId": "9751398a-ca74-4651-a836-ff275fca5403"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "9751398a-ca74-4651-a836-ff275fca5403"
        }
      }
    },
    {
      "id": "stats",
      "passed": true,
      "request": {
        "method": "GET",
        "path": "/api/stats"
      },
      "response": {
        "status": 200,
        "body": {
          "ok": true,
          "data": {
            "totalRequests": 14,
            "totalAmountMinor": 32000000,
            "servicesCount": 12,
            "byStatus": [
              {
                "status": "new",
                "count": 4,
                "amountMinor": 12150000
              },
              {
                "status": "in_progress",
                "count": 4,
                "amountMinor": 6610000
              },
              {
                "status": "done",
                "count": 3,
                "amountMinor": 6340000
              },
              {
                "status": "cancelled",
                "count": 3,
                "amountMinor": 6900000
              }
            ]
          },
          "requestId": "3dcb3268-f001-42a6-80b8-c6f0a03130bf"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "3dcb3268-f001-42a6-80b8-c6f0a03130bf"
        }
      }
    },
    {
      "id": "protected",
      "passed": true,
      "request": {
        "method": "GET",
        "path": "/api/internal/summary"
      },
      "response": {
        "status": 401,
        "body": {
          "ok": false,
          "error": {
            "code": "DEMO_KEY_REQUIRED",
            "message": "Добавьте учебный заголовок x-demo-key: demo-local-key."
          },
          "requestId": "0744ff2a-9b54-486b-8bb7-e1757351207f"
        },
        "headers": {
          "content-type": "application/json; charset=utf-8",
          "x-request-id": "0744ff2a-9b54-486b-8bb7-e1757351207f"
        }
      }
    }
  ]
}
