{
  "_type": "export",
  "__export_format": 4,
  "__export_date": "2026-09-26T00:00:00.000Z",
  "__export_source": "backend-moderno-cap02",
  "resources": [
    {
      "_id": "wrk_cap02_mensageria",
      "_type": "workspace",
      "name": "Cap 02 · Pedidos e Pagamentos",
      "description": "Roteiro manual: criar, copiar id para ambiente, consultar, solicitar e conferir. Pagamentos é simulado.",
      "scope": "collection"
    },
    {
      "_id": "env_cap02_base",
      "_type": "environment",
      "parentId": "wrk_cap02_mensageria",
      "name": "Base Environment",
      "data": {
        "base_url": "http://localhost:8080",
        "pedido_id": "COLE_O_ID_RETORNADO_AQUI",
        "pedido_recusa_id": "COLE_O_ID_DO_SEGUNDO_PEDIDO",
        "solicitacao_aprovacao": "11111111-1111-4111-8111-111111111111",
        "solicitacao_recusa": "22222222-2222-4222-8222-222222222222"
      },
      "dataPropertyOrder": null,
      "color": null,
      "isPrivate": false
    },
    {
      "_id": "req_cap02_00",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "01 · Criar pedido",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos",
      "description": "Esperado 201, status ABERTO, total 37.80. Copie id para pedido_id no ambiente. Para recusa crie outro e copie para pedido_recusa_id.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"clienteId\": \"cliente-aula\",\n  \"itens\": [\n    {\n      \"sku\": \"CAFE\",\n      \"quantidade\": 2,\n      \"precoUnitario\": 18.9\n    }\n  ]\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 0,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_01",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "02 · Consultar pedido",
      "method": "GET",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}",
      "description": "Esperado 200. Antes da solicitação: ABERTO; pendente: EM_PAGAMENTO; depois da aprovação: PAGO.",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {},
      "metaSortKey": 1,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_02",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "03 · Solicitar aprovação",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}/pagamentos",
      "description": "Pagamentos parado: 202, registro PENDENTE, Ready aumenta. Após ligar consumidor, consulte pedido: PAGO.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"{{ _.solicitacao_aprovacao }}\",\n  \"cenario\": \"APROVAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 2,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_03",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "04 · Repetir a mesma solicitação",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}/pagamentos",
      "description": "Mesma chave e conteúdo. Pendente: 202 e pode republicar. Concluída: 200 com estado APROVADO, sem publicar. Não é uma nova tentativa.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"{{ _.solicitacao_aprovacao }}\",\n  \"cenario\": \"APROVAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 3,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_04",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "05 · Solicitar recusa em outro pedido",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_recusa_id }}/pagamentos",
      "description": "Primeiro crie outro pedido e ajuste pedido_recusa_id. Esperado 202; depois do resultado pedido volta a ABERTO.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"{{ _.solicitacao_recusa }}\",\n  \"cenario\": \"RECUSAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 4,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_05",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "05b · Consultar pedido da recusa",
      "method": "GET",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_recusa_id }}",
      "description": "Após processar a recusa: 200, ABERTO, total 37.80. Uma nova tentativa de aprovação usa outra solicitacaoId.",
      "body": {},
      "parameters": [],
      "headers": [],
      "authentication": {},
      "metaSortKey": 5,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_06",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "06 · Conflito de conteúdo na mesma chave",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}/pagamentos",
      "description": "Após a solicitação original APROVAR, esperado 409. Não muda o registro original.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"{{ _.solicitacao_aprovacao }}\",\n  \"cenario\": \"RECUSAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 6,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_07",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "07 · Pedido inexistente",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/00000000-0000-4000-8000-000000000000/pagamentos",
      "description": "Esperado 404. Nenhuma publicação.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"33333333-3333-4333-8333-333333333333\",\n  \"cenario\": \"APROVAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 7,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_08",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "08 · Formato inválido",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}/pagamentos",
      "description": "Esperado 400. Nenhuma publicação.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"solicitacaoId\": \"nao-e-uuid\",\n  \"cenario\": \"APROVAR\"\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 8,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    },
    {
      "_id": "req_cap02_09",
      "_type": "request",
      "parentId": "wrk_cap02_mensageria",
      "name": "09 · Tentar mudar itens após solicitar",
      "method": "POST",
      "url": "{{ _.base_url }}/pedidos/{{ _.pedido_id }}/itens",
      "description": "Com pedido EM_PAGAMENTO ou PAGO: esperado 409, total permanece 37.80.",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"sku\": \"CHA\",\n  \"quantidade\": 1,\n  \"precoUnitario\": 10.0\n}"
      },
      "parameters": [],
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "authentication": {},
      "metaSortKey": 9,
      "isPrivate": false,
      "settingStoreCookies": true,
      "settingSendCookies": true,
      "settingDisableRenderRequestBody": false,
      "settingEncodeUrl": true,
      "settingRebuildPath": true,
      "settingFollowRedirects": "global"
    }
  ]
}