{
    "info": {
      "name": "Unison - Unified Tech Stack Recommendation Service",
      "_postman_id": "unison-api-complete-2025",
      "description": "Complete API collection for Unison service - unified tech stack and template recommendations",
      "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
      {
        "key": "baseUrl",
        "value": "http://localhost:8010",
        "type": "string",
        "description": "Base URL for Unison service"
      },
      {
        "key": "templateId",
        "value": "123e4567-e89b-12d3-a456-426614174000",
        "type": "string",
        "description": "Sample template ID for testing"
      },
      {
        "key": "recommendationId",
        "value": "",
        "type": "string",
        "description": "Store recommendation ID from unified request"
      }
    ],
    "item": [
      {
        "name": "Service Health & Info",
        "item": [
          {
            "name": "Root Endpoint - Service Info",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/",
                "host": ["{{baseUrl}}"]
              }
            },
            "event": [
              {
                "listen": "test",
                "script": {
                  "exec": [
                    "pm.test(\"Status code is 200\", function () {",
                    "    pm.response.to.have.status(200);",
                    "});",
                    "",
                    "pm.test(\"Response has service info\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    pm.expect(jsonData).to.have.property('message');",
                    "    pm.expect(jsonData).to.have.property('version');",
                    "    pm.expect(jsonData).to.have.property('status');",
                    "});"
                  ]
                }
              }
            ]
          },
          {
            "name": "Health Check",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/health",
                "host": ["{{baseUrl}}"],
                "path": ["health"]
              }
            },
            "event": [
              {
                "listen": "test",
                "script": {
                  "exec": [
                    "pm.test(\"Health check responds\", function () {",
                    "    pm.response.to.have.status.oneOf([200, 503]);",
                    "});",
                    "",
                    "pm.test(\"Has health status\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    pm.expect(jsonData).to.have.property('status');",
                    "    pm.expect(jsonData).to.have.property('service', 'unison');",
                    "});"
                  ]
                }
              }
            ]
          },
          {
            "name": "Detailed Health Check",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/health/detailed",
                "host": ["{{baseUrl}}"],
                "path": ["health", "detailed"]
              }
            }
          }
        ]
      },
      {
        "name": "Unified Recommendations",
        "item": [
          {
            "name": "Unified - Domain Only (Basic)",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"domain\": \"healthcare\",\n  \"budget\": 10000\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            },
            "event": [
              {
                "listen": "test",
                "script": {
                  "exec": [
                    "pm.test(\"Status code is 200\", function () {",
                    "    pm.response.to.have.status(200);",
                    "});",
                    "",
                    "pm.test(\"Response has recommendation data\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    pm.expect(jsonData).to.have.property('success', true);",
                    "    pm.expect(jsonData).to.have.property('data');",
                    "    pm.expect(jsonData.data).to.have.property('stack_name');",
                    "});",
                    "",
                    "pm.test(\"Save request ID\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    if (jsonData.requestId) {",
                    "        pm.collectionVariables.set('recommendationId', jsonData.requestId);",
                    "    }",
                    "});"
                  ]
                }
              }
            ]
          },
          {
            "name": "Unified - With Template ID",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"domain\": \"ecommerce\",\n  \"budget\": 15000,\n  \"templateId\": \"{{templateId}}\",\n  \"preferredTechnologies\": [\"React\", \"Node.js\"],\n  \"includeSimilar\": true,\n  \"includeKeywords\": true,\n  \"forceRefresh\": false\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          },
          {
            "name": "Unified - Full Parameters",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"domain\": \"fintech\",\n  \"budget\": 25000,\n  \"templateId\": \"{{templateId}}\",\n  \"preferredTechnologies\": [\"React\", \"Python\", \"PostgreSQL\"],\n  \"includeSimilar\": true,\n  \"includeKeywords\": true,\n  \"forceRefresh\": true\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          },
          {
            "name": "Unified - Minimal Request",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          }
        ]
      },
      {
        "name": "Individual Service Recommendations",
        "item": [
          {
            "name": "Tech Stack Only - Basic",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/tech-stack?domain=healthcare&budget=10000",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "tech-stack"],
                "query": [
                  {
                    "key": "domain",
                    "value": "healthcare"
                  },
                  {
                    "key": "budget",
                    "value": "10000"
                  }
                ]
              }
            }
          },
          {
            "name": "Tech Stack Only - With Preferences",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/tech-stack?domain=ecommerce&budget=15000&preferredTechnologies=React,Node.js,PostgreSQL",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "tech-stack"],
                "query": [
                  {
                    "key": "domain",
                    "value": "ecommerce"
                  },
                  {
                    "key": "budget",
                    "value": "15000"
                  },
                  {
                    "key": "preferredTechnologies",
                    "value": "React,Node.js,PostgreSQL"
                  }
                ]
              }
            }
          },
          {
            "name": "Template Only - Basic",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/template/{{templateId}}",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "template", "{{templateId}}"]
              }
            }
          },
          {
            "name": "Template Only - Force Refresh",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/template/{{templateId}}?force_refresh=true",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "template", "{{templateId}}"],
                "query": [
                  {
                    "key": "force_refresh",
                    "value": "true"
                  }
                ]
              }
            }
          }
        ]
      },
      {
        "name": "Stored Recommendations",
        "item": [
          {
            "name": "Get Recent Recommendations",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/stored?limit=10",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "stored"],
                "query": [
                  {
                    "key": "limit",
                    "value": "10"
                  }
                ]
              }
            }
          },
          {
            "name": "Get Recommendations by Domain",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/stored?domain=healthcare&limit=5",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "stored"],
                "query": [
                  {
                    "key": "domain",
                    "value": "healthcare"
                  },
                  {
                    "key": "limit",
                    "value": "5"
                  }
                ]
              }
            }
          },
          {
            "name": "Get Recommendations by Template ID",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/stored?templateId={{templateId}}&limit=5",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "stored"],
                "query": [
                  {
                    "key": "templateId",
                    "value": "{{templateId}}"
                  },
                  {
                    "key": "limit",
                    "value": "5"
                  }
                ]
              }
            }
          },
          {
            "name": "Get Specific Recommendation by ID",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/stored/{{recommendationId}}",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "stored", "{{recommendationId}}"]
              }
            }
          },
          {
            "name": "Get Recommendation Statistics",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/stats",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "stats"]
              }
            }
          }
        ]
      },
      {
        "name": "Schemas & Validation",
        "item": [
          {
            "name": "Get Available Schemas",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/schemas",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "schemas"]
              }
            }
          }
        ]
      },
      {
        "name": "Error Testing",
        "item": [
          {
            "name": "Invalid Template ID",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/template/invalid-uuid",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "template", "invalid-uuid"]
              }
            },
            "event": [
              {
                "listen": "test",
                "script": {
                  "exec": [
                    "pm.test(\"Should return error for invalid UUID\", function () {",
                    "    pm.response.to.have.status.oneOf([400, 500]);",
                    "});",
                    "",
                    "pm.test(\"Error response has success false\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    pm.expect(jsonData).to.have.property('success', false);",
                    "});"
                  ]
                }
              }
            ]
          },
          {
            "name": "Invalid Unified Request",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"budget\": \"invalid-budget\",\n  \"preferredTechnologies\": \"not-an-array\"\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          },
          {
            "name": "404 Test - Invalid Route",
            "request": {
              "method": "GET",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "url": {
                "raw": "{{baseUrl}}/api/nonexistent-endpoint",
                "host": ["{{baseUrl}}"],
                "path": ["api", "nonexistent-endpoint"]
              }
            },
            "event": [
              {
                "listen": "test",
                "script": {
                  "exec": [
                    "pm.test(\"Status code is 404\", function () {",
                    "    pm.response.to.have.status(404);",
                    "});",
                    "",
                    "pm.test(\"Has error message\", function () {",
                    "    const jsonData = pm.response.json();",
                    "    pm.expect(jsonData).to.have.property('error');",
                    "});"
                  ]
                }
              }
            ]
          }
        ]
      },
      {
        "name": "Load Testing Scenarios",
        "item": [
          {
            "name": "Multiple Domains Test",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"domain\": \"{{$randomArrayElement(['healthcare', 'ecommerce', 'fintech', 'education', 'gaming'])}}\",\n  \"budget\": {{$randomInt}}\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          },
          {
            "name": "Concurrent Request Simulation",
            "request": {
              "method": "POST",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": {
                "mode": "raw",
                "raw": "{\n  \"domain\": \"stress-test\",\n  \"budget\": 5000,\n  \"preferredTechnologies\": [\"React\", \"Node.js\"]\n}"
              },
              "url": {
                "raw": "{{baseUrl}}/api/recommendations/unified",
                "host": ["{{baseUrl}}"],
                "path": ["api", "recommendations", "unified"]
              }
            }
          }
        ]
      }
    ],
    "event": [
      {
        "listen": "prerequest",
        "script": {
          "type": "text/javascript",
          "exec": [
            "// Log request details",
            "console.log('Making request to:', pm.request.url.toString());"
          ]
        }
      },
      {
        "listen": "test",
        "script": {
          "type": "text/javascript",
          "exec": [
            "// Global test - log response time",
            "const responseTime = pm.response.responseTime;",
            "console.log('Response time:', responseTime + 'ms');",
            "",
            "// Global test - check for valid JSON",
            "pm.test('Response is valid JSON', function () {",
            "    pm.response.to.be.json;",
            "});"
          ]
        }
      }
    ]
  }