{
  "info": {
    "name": "efakt SANDBOX",
    "description": "Sandbox pro vývojáře integrací (docs/SANDBOX.md). Nic se neodesílá do skutečné sítě Peppol ani na finanční správu. Nastavte proměnné: portalUrl, erpToken (z sandbox-credentials.md), mockUrl (řídicí API mock-hubu, jen lokálně).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{erpToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "portalUrl",
      "value": "http://127.0.0.1:18300"
    },
    {
      "key": "baseUrl",
      "value": "{{portalUrl}}/api/v1"
    },
    {
      "key": "mockUrl",
      "value": "http://127.0.0.1:18303"
    },
    {
      "key": "erpToken",
      "value": ""
    },
    {
      "key": "dic",
      "value": "2023000100"
    },
    {
      "key": "invoiceId",
      "value": ""
    },
    {
      "key": "testRunId",
      "value": ""
    },
    {
      "key": "scenarioId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "1 Ověření sandboxu",
      "item": [
        {
          "name": "Kdo jsem (ERP token) - ověřte hlavičku X-Environment a test_only",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));",
                  "pm.test('X-Environment: sandbox', () => pm.response.to.have.header('X-Environment', 'sandbox'));",
                  "pm.test('integrace', () => pm.expect(pm.response.json().integration).to.be.an('object'));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/erp/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "me"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Zdraví portálu (bez přihlášení)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 401', () => pm.response.to.have.status(401));",
                  "pm.test('X-Environment: sandbox', () => pm.response.to.have.header('X-Environment', 'sandbox'));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{baseUrl}}/auth/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "me"
              ],
              "query": []
            }
          }
        }
      ]
    },
    {
      "name": "2 Odeslání faktury",
      "item": [
        {
          "name": "Odeslat fakturu (XML) - ostré odeslání do MOCK poštáře (sandbox)",
          "description": "V sandboxu jde odeslání vždy do mock-hubu. Stav sledujte přes GET /erp/outbox/changes nebo GET /invoices/{id}.",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 202', () => pm.response.to.have.status(202));",
                  "pm.collectionVariables.set('invoiceId', pm.response.json().id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/invoices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "invoices"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Vložte UBL 2.1 Peppol BIS 3.0 fakturu. Prodávající = váš sandbox tenant (DIČ v credentials), datum vystavení = DNES (Europe/Bratislava). Příklad: testdata/invoices/valid/*.xml vygenerované gen-invoices.mjs s --seller-dic/--buyer-dic tenantů sandboxu. -->"
            }
          }
        },
        {
          "name": "Odeslat fakturu - TESTOVACÍ režim (?test=true): nic se neuloží ani neodešle",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));",
                  "const r = pm.response.json(); pm.collectionVariables.set('testRunId', r.id); pm.test('would_send', () => pm.expect(r.would_send).to.be.an('object'));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/invoices?test=true&simulate=delivered",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "invoices"
              ],
              "query": [
                {
                  "key": "test",
                  "value": "true"
                },
                {
                  "key": "simulate",
                  "value": "delivered"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Vložte UBL 2.1 Peppol BIS 3.0 fakturu. Prodávající = váš sandbox tenant (DIČ v credentials), datum vystavení = DNES (Europe/Bratislava). Příklad: testdata/invoices/valid/*.xml vygenerované gen-invoices.mjs s --seller-dic/--buyer-dic tenantů sandboxu. -->"
            }
          }
        },
        {
          "name": "Test: simulace nedoručitelného příjemce (simulate=undeliverable)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/invoices?test=true&simulate=undeliverable",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "invoices"
              ],
              "query": [
                {
                  "key": "test",
                  "value": "true"
                },
                {
                  "key": "simulate",
                  "value": "undeliverable"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Vložte UBL 2.1 Peppol BIS 3.0 fakturu. Prodávající = váš sandbox tenant (DIČ v credentials), datum vystavení = DNES (Europe/Bratislava). Příklad: testdata/invoices/valid/*.xml vygenerované gen-invoices.mjs s --seller-dic/--buyer-dic tenantů sandboxu. -->"
            }
          }
        },
        {
          "name": "Test: simulace odmítnutí poskytovatelem (simulate=rejected)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/xml"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/invoices?test=true&simulate=rejected",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "invoices"
              ],
              "query": [
                {
                  "key": "test",
                  "value": "true"
                },
                {
                  "key": "simulate",
                  "value": "rejected"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Vložte UBL 2.1 Peppol BIS 3.0 fakturu. Prodávající = váš sandbox tenant (DIČ v credentials), datum vystavení = DNES (Europe/Bratislava). Příklad: testdata/invoices/valid/*.xml vygenerované gen-invoices.mjs s --seller-dic/--buyer-dic tenantů sandboxu. -->"
            }
          }
        },
        {
          "name": "Výsledek testu (24 h, pak 410 TEST_RUN_EXPIRED)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/erp/test-runs/{{testRunId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "test-runs",
                "{{testRunId}}"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Změny stavů odeslaných faktur (outbox/changes)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/erp/outbox/changes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "outbox",
                "changes"
              ],
              "query": []
            }
          }
        }
      ]
    },
    {
      "name": "3 Příjem a ACK",
      "item": [
        {
          "name": "Čekající příchozí doklady (pending)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/erp/inbox/pending",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "inbox",
                "pending"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Statistiky schránky",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/erp/inbox/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "inbox",
                "stats"
              ],
              "query": []
            }
          }
        },
        {
          "name": "ACK dokladů (po uložení v ERP)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/inbox/ack",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "inbox",
                "ack"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ids\": [\n    \"<uuid z pending>\"\n  ],\n  \"erp_reference\": {\n    \"id\": \"ERP-0001\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "NACK dokladu (s důvodem)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/erp/inbox/nack",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "erp",
                "inbox",
                "nack"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"<uuid>\",\n  \"reason\": \"Nelze zaúčtovat\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "4 Mock-hub: řízení (jen lokálně)",
      "item": [
        {
          "name": "Přehled (instance, scénáře, čas)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/state",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "state"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Nápověda: endpointy + tabulka magických hodnot",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/help",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "help"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Žurnál přijatých volání (posledních 50 poštáře ep24)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/journal?service=ep24&limit=50",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "journal"
              ],
              "query": [
                {
                  "key": "service",
                  "value": "ep24"
                },
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          }
        },
        {
          "name": "Vložit příchozí doklady (ePodatelna24; webhook se pošle do portálu)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/ep24/seed",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "ep24",
                "seed"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\",\n  \"n\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Vložit příchozí doklady (SOFTIP, pull)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/softip/seed",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "softip",
                "seed"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\",\n  \"n\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Vložit příchozí doklady (ePošťák)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/epostak/seed",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "epostak",
                "seed"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\",\n  \"n\": 2\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Vložit příchozí doklady (Verteco, retence secure 14 dní)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/verteco/seed",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "verteco",
                "seed"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\",\n  \"n\": 2,\n  \"retention\": \"secure\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Scénář: 503 jednou na odeslání ePodatelna24",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 201', () => pm.response.to.have.status(201));",
                  "pm.collectionVariables.set('scenarioId', pm.response.json().id);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"service\": \"ep24\",\n  \"dic\": \"{{dic}}\",\n  \"preset\": \"unavailable\",\n  \"method\": \"POST\",\n  \"path\": \"^/api/v1/outbox/documents$\",\n  \"times\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Scénář: 429 s Retry-After 30 s na všechna volání SOFTIP",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 201', () => pm.response.to.have.status(201));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"service\": \"softip\",\n  \"dic\": \"{{dic}}\",\n  \"preset\": \"rate_limited\",\n  \"retryAfter\": 30\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Scénář: 401 (neplatné přihlášení) pro Verteco",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 201', () => pm.response.to.have.status(201));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"service\": \"verteco\",\n  \"dic\": \"{{dic}}\",\n  \"preset\": \"unauthorized\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Scénář: timeout (spojení visí) pro ePošťák",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 201', () => pm.response.to.have.status(201));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"service\": \"epostak\",\n  \"dic\": \"{{dic}}\",\n  \"preset\": \"timeout\",\n  \"delayMs\": 60000\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Smazat scénář",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios/{{scenarioId}}",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios",
                "{{scenarioId}}"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Smazat všechny scénáře",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "DELETE",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/scenarios",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "scenarios"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Rotace tokenu poštáře (SOFTIP) - další volání se přihlásí znovu",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/softip/rotate-token",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "softip",
                "rotate-token"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Dodat pozdně doručené (magická částka 777,77)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/verteco/deliver-pending",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "verteco",
                "deliver-pending"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Vypršení retence Verteco (secure): smaže obsah příchozích",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/verteco/expire-retention",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "verteco",
                "expire-retention"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dic\": \"{{dic}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Posun času mock-hubu o 8 hodin (okno opakování)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/advance",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "advance"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"hours\": 8\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Okamžitě odeslat zadržené webhooky do portálu",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/webhooks/flush",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "webhooks",
                "flush"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Log odeslaných webhooků (status přijetí portálem)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/webhooks/log",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "webhooks",
                "log"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Reset jedné služby",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/reset?service=ep24",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "reset"
              ],
              "query": [
                {
                  "key": "service",
                  "value": "ep24"
                }
              ]
            }
          }
        },
        {
          "name": "Reset celého mock-hubu",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/reset",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "reset"
              ],
              "query": []
            }
          }
        }
      ]
    },
    {
      "name": "5 Mock-hub: služby přímo (registry, SMP, VIES, RPO, Ollama)",
      "item": [
        {
          "name": "SMP lookup 0245:<DIČ> (200 / 404)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/smp/iso6523-actorid-upis%3A%3A0245%3A{{dic}}",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "smp",
                "iso6523-actorid-upis%3A%3A0245%3A{{dic}}"
              ],
              "query": []
            }
          }
        },
        {
          "name": "FS export ds_dphs.zip (ETag/Last-Modified)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/fs-registry/ds_dphs.zip",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "fs-registry",
                "ds_dphs.zip"
              ],
              "query": []
            }
          }
        },
        {
          "name": "RPO (IČO)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/rpo/rpo/v1/search?identifier=35763469",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "rpo",
                "rpo",
                "v1",
                "search"
              ],
              "query": [
                {
                  "key": "identifier",
                  "value": "35763469"
                }
              ]
            }
          }
        },
        {
          "name": "VIES (platné)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/vies/taxation_customs/vies/rest-api/ms/CZ/vat/12345678",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "vies",
                "taxation_customs",
                "vies",
                "rest-api",
                "ms",
                "CZ",
                "vat",
                "12345678"
              ],
              "query": []
            }
          }
        },
        {
          "name": "VIES (neplatné: končí 0000)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/vies/taxation_customs/vies/rest-api/ms/CZ/vat/12340000",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "vies",
                "taxation_customs",
                "vies",
                "rest-api",
                "ms",
                "CZ",
                "vat",
                "12340000"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Ollama /api/tags",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/ollama/api/tags",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "ollama",
                "api",
                "tags"
              ],
              "query": []
            }
          }
        },
        {
          "name": "Ollama: model poslechne prompt injection",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/ollama/mode",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "ollama",
                "mode"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mode\": \"obey_injection\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Verteco reseller: FS verifikační webhook (neplatný podpis)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('status 200', () => pm.response.to.have.status(200));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "auth": {
              "type": "noauth"
            },
            "url": {
              "raw": "{{mockUrl}}/__mock/verteco-reseller/fs?dic={{dic}}&valid=0",
              "host": [
                "{{mockUrl}}"
              ],
              "path": [
                "__mock",
                "verteco-reseller",
                "fs"
              ],
              "query": [
                {
                  "key": "dic",
                  "value": "{{dic}}"
                },
                {
                  "key": "valid",
                  "value": "0"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
