{
  "info": {
    "name": "Exchange Accounting v4.3",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:3000"
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "adminEmail",
      "value": "admin@example.com"
    },
    {
      "key": "adminPassword",
      "value": ""
    },
    {
      "key": "customerId",
      "value": "1"
    },
    {
      "key": "userId",
      "value": "1"
    },
    {
      "key": "documentId",
      "value": ""
    },
    {
      "key": "presetId",
      "value": ""
    },
    {
      "key": "importId",
      "value": ""
    },
    {
      "key": "textImportKey",
      "value": ""
    },
    {
      "key": "draftId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Liveness (no database dependency)",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/health",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "health"
          ]
        }
      }
    },
    {
      "name": "Database readiness",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{baseUrl}}/ready",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "ready"
          ]
        }
      }
    },
    {
      "name": "Login",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/auth/login",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "auth",
            "login"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"email\": \"{{adminEmail}}\",\n  \"password\": \"{{adminPassword}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if (pm.response.code === 200) pm.collectionVariables.set('token', pm.response.json().data.token);"
            ]
          }
        }
      ]
    },
    {
      "name": "Current user",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/auth/me",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "auth",
            "me"
          ]
        }
      }
    },
    {
      "name": "Revoke current session",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/auth/logout",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "auth",
            "logout"
          ]
        }
      }
    },
    {
      "name": "Revoke all my sessions",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/auth/logout-all",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "auth",
            "logout-all"
          ]
        }
      }
    },
    {
      "name": "Change password and revoke all sessions",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/auth/change-password",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "auth",
            "change-password"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"currentPassword\": \"{{adminPassword}}\",\n  \"newPassword\": \"{{adminPassword}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "List users",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "users"
          ]
        }
      }
    },
    {
      "name": "Create user",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/users",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "users"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example Name\",\n  \"email\": \"{{adminEmail}}\",\n  \"password\": \"{{adminPassword}}\",\n  \"role\": \"CASHIER\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Edit user; self role/deactivation forbidden",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/users/{{userId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "users",
            "{{userId}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example Name\",\n  \"role\": \"CASHIER\",\n  \"active\": true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Admin password reset; revoke sessions",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/users/{{userId}}/reset-password",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "users",
            "{{userId}}",
            "reset-password"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"newPassword\": \"{{adminPassword}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Search customers",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers"
          ]
        }
      }
    },
    {
      "name": "Create customer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"code\": \"C001\",\n  \"name\": \"Ahmad\",\n  \"phone\": \"+93700000000\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Customer detail",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}"
          ]
        }
      }
    },
    {
      "name": "Edit or deactivate customer",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"code\": \"C001\",\n  \"name\": \"Example Name\",\n  \"phone\": \"example\",\n  \"notes\": \"example\",\n  \"active\": true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Current customer debt/credit by currency",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}/balances",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}",
            "balances"
          ]
        }
      }
    },
    {
      "name": "Customer ledger with opening and running balances",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}/statement",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}",
            "statement"
          ]
        }
      }
    },
    {
      "name": "Profit attributable to customer",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}/profit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}",
            "profit"
          ]
        }
      }
    },
    {
      "name": "Set optional initial customer debt/credit once per currency",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/customers/{{customerId}}/opening-balances",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "customers",
            "{{customerId}}",
            "opening-balances"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"currencyCode\": \"USD\",\n  \"amount\": \"100\",\n  \"eurRate\": \"0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "List currencies and reporting rates",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/currencies",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "currencies"
          ]
        }
      }
    },
    {
      "name": "Create currency",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/currencies",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "currencies"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"code\": \"USD\",\n  \"name\": \"Example Name\",\n  \"decimals\": 2,\n  \"eurRate\": \"0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Edit currency name/active flag",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/currencies/USD",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "currencies",
            "USD"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example Name\",\n  \"active\": true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Set reporting rate: EUR per 1 unit of currency",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/currencies/USD/rate",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "currencies",
            "USD",
            "rate"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"eurRate\": \"0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Read settings",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/settings",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings"
          ]
        }
      }
    },
    {
      "name": "Update fee default and optional cash reporting",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/settings",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "settings"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"defaultFeePercent\": \"0.5\",\n  \"cashEnabled\": true,\n  \"staleRateHours\": \"0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "List trades",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades"
          ]
        }
      }
    },
    {
      "name": "Get trade with ledger entries",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades/{{documentId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades",
            "{{documentId}}"
          ]
        }
      }
    },
    {
      "name": "Create trade",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customerId\": 1,\n  \"receivedCurrency\": \"USD\",\n  \"paidCurrency\": \"EUR\",\n  \"receivedAmount\": \"1000\",\n  \"agreedRate\": \"0.91\",\n  \"receivedEurRate\": \"0.92\",\n  \"feePercent\": \"0.5\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Void trade with reversal entries",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades/{{documentId}}/void",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades",
            "{{documentId}}",
            "void"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reason\": \"Correction of incorrect entry\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "List payments",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments"
          ]
        }
      }
    },
    {
      "name": "Get payment with ledger entries",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments/{{documentId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments",
            "{{documentId}}"
          ]
        }
      }
    },
    {
      "name": "Create payment",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customerId\": 1,\n  \"currencyCode\": \"USD\",\n  \"direction\": \"RECEIVE\",\n  \"amount\": \"1005\",\n  \"eurRate\": \"0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Void payment with reversal entries",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments/{{documentId}}/void",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments",
            "{{documentId}}",
            "void"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"reason\": \"Correction of incorrect entry\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Aggregate accrued profit report",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/profit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "profit"
          ]
        }
      }
    },
    {
      "name": "Paged customer profit breakdown",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/customer-profit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "customer-profit"
          ]
        }
      }
    },
    {
      "name": "Paged current customer balances",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/balances",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "balances"
          ]
        }
      }
    },
    {
      "name": "Dashboard counts, profit and optional cash",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/dashboard",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "dashboard"
          ]
        }
      }
    },
    {
      "name": "Optional cash balances and completeness",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/cash",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "cash"
          ]
        }
      }
    },
    {
      "name": "Record cash balance at system start (optional)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/cash/openings",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "cash",
            "openings"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"currencyCode\": \"USD\",\n  \"amount\": \"100\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Read immutable audit history",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/audit-logs",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "audit-logs"
          ]
        }
      }
    },
    {
      "name": "فهرست گزارش‌های پویا",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/catalog",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "catalog"
          ]
        }
      }
    },
    {
      "name": "فیلدها و فیلترهای مجاز: معاملات",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/trades/options",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "trades",
            "options"
          ]
        }
      }
    },
    {
      "name": "معاملات با فیلتر و صفحه‌بندی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/trades",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "trades"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"search\": \"\",\n  \"filters\": {\n    \"from\": \"2026-09-01T00:00:00Z\",\n    \"to\": \"2026-10-01T00:00:00Z\"\n  },\n  \"fields\": [\n    \"id\",\n    \"documentNumber\",\n    \"customerName\",\n    \"receivedAmount\",\n    \"receivedCurrency\",\n    \"paidAmount\",\n    \"paidCurrency\",\n    \"feeEur\",\n    \"exchangeProfitEur\",\n    \"profitStatus\",\n    \"status\",\n    \"createdAt\"\n  ],\n  \"sort\": {\n    \"field\": \"createdAt\",\n    \"direction\": \"desc\"\n  },\n  \"page\": 1,\n  \"limit\": 25\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "فیلدها و فیلترهای مجاز: دریافت و پرداخت",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/payments/options",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "payments",
            "options"
          ]
        }
      }
    },
    {
      "name": "دریافت و پرداخت با فیلتر و صفحه‌بندی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/payments",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "payments"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"search\": \"\",\n  \"filters\": {\n    \"from\": \"2026-09-01T00:00:00Z\",\n    \"to\": \"2026-10-01T00:00:00Z\"\n  },\n  \"fields\": [\n    \"id\",\n    \"documentNumber\",\n    \"customerName\",\n    \"currencyCode\",\n    \"direction\",\n    \"amount\",\n    \"unallocatedAmount\",\n    \"eurRate\",\n    \"status\",\n    \"createdAt\"\n  ],\n  \"sort\": {\n    \"field\": \"createdAt\",\n    \"direction\": \"desc\"\n  },\n  \"page\": 1,\n  \"limit\": 25\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "فیلدها و فیلترهای مجاز: گردش حساب",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/statement/options",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "statement",
            "options"
          ]
        }
      }
    },
    {
      "name": "گردش حساب با فیلتر و صفحه‌بندی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/statement",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "statement"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"search\": \"\",\n  \"filters\": {\n    \"customerId\": 1,\n    \"from\": \"2026-09-01T00:00:00Z\",\n    \"to\": \"2026-10-01T00:00:00Z\"\n  },\n  \"fields\": [\n    \"id\",\n    \"customerName\",\n    \"currencyCode\",\n    \"amount\",\n    \"runningBalance\",\n    \"source\",\n    \"createdAt\"\n  ],\n  \"sort\": {\n    \"field\": \"createdAt\",\n    \"direction\": \"asc\"\n  },\n  \"page\": 1,\n  \"limit\": 25\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "فیلدها و فیلترهای مجاز: مانده بدهی و طلب",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/balances/options",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "balances",
            "options"
          ]
        }
      }
    },
    {
      "name": "مانده بدهی و طلب با فیلتر و صفحه‌بندی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/balances",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "balances"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"search\": \"\",\n  \"filters\": {},\n  \"fields\": [\n    \"customerId\",\n    \"customerName\",\n    \"currencyCode\",\n    \"amount\",\n    \"side\",\n    \"eurEquivalent\",\n    \"rateStatus\",\n    \"rateUpdatedAt\"\n  ],\n  \"sort\": {\n    \"field\": \"customerId\",\n    \"direction\": \"asc\"\n  },\n  \"page\": 1,\n  \"limit\": 25\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "فیلدها و فیلترهای مجاز: سود مشتریان",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/customer-profit/options",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "customer-profit",
            "options"
          ]
        }
      }
    },
    {
      "name": "سود مشتریان با فیلتر و صفحه‌بندی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/customer-profit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "customer-profit"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"search\": \"\",\n  \"filters\": {\n    \"from\": \"2026-09-01T00:00:00Z\",\n    \"to\": \"2026-10-01T00:00:00Z\"\n  },\n  \"fields\": [\n    \"customerId\",\n    \"customerName\",\n    \"tradeCount\",\n    \"feeRevenueEur\",\n    \"knownExchangeProfitEur\",\n    \"unknownProfitTrades\",\n    \"totalProfitEur\"\n  ],\n  \"sort\": {\n    \"field\": \"feeRevenueEur\",\n    \"direction\": \"desc\"\n  },\n  \"page\": 1,\n  \"limit\": 25\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "پیش‌نمایش اختیاری معامله",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades/preview",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades",
            "preview"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"customerId\": 1,\n  \"receivedCurrency\": \"USD\",\n  \"paidCurrency\": \"EUR\",\n  \"receivedAmount\": \"1000\",\n  \"agreedRate\": \"0.91\",\n  \"receivedEurRate\": \"0.92\",\n  \"feePercent\": \"0.5\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "وضعیت تسویه دو سمت معامله",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades/{{documentId}}/settlement",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades",
            "{{documentId}}",
            "settlement"
          ]
        }
      }
    },
    {
      "name": "تخصیص‌ها و مانده تخصیص‌نیافته پرداخت",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments/{{documentId}}/allocations",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments",
            "{{documentId}}",
            "allocations"
          ]
        }
      }
    },
    {
      "name": "اصلاح تخصیص بدون تغییر گردش مالی",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments/{{documentId}}/allocations",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments",
            "{{documentId}}",
            "allocations"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1,\n  \"mode\": \"AUTO\",\n  \"allocations\": []\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "رسید trade",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trades/{{documentId}}/receipt",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trades",
            "{{documentId}}",
            "receipt"
          ]
        }
      }
    },
    {
      "name": "رسید payment",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/payments/{{documentId}}/receipt",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "payments",
            "{{documentId}}",
            "receipt"
          ]
        }
      }
    },
    {
      "name": "خروجی CSV trades",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/trades/export",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "trades",
            "export"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"filters\": {},\n  \"maxRows\": 5000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "خروجی CSV payments",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/payments/export",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "payments",
            "export"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"filters\": {},\n  \"maxRows\": 5000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "خروجی CSV statement",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/statement/export",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "statement",
            "export"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"filters\": {\n    \"customerId\": 1\n  },\n  \"maxRows\": 5000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "خروجی CSV balances",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/balances/export",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "balances",
            "export"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"filters\": {},\n  \"maxRows\": 5000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "خروجی CSV customer-profit",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/reports/customer-profit/export",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "reports",
            "customer-profit",
            "export"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"filters\": {},\n  \"maxRows\": 5000\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "تنظیمات گزارش شخصی",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets"
          ]
        }
      }
    },
    {
      "name": "ذخیره تنظیم گزارش",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"معاملات دلار\",\n  \"report\": \"trades\",\n  \"config\": {\n    \"filters\": {\n      \"currency\": \"USD\"\n    },\n    \"limit\": 25\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "جزئیات تنظیم شخصی",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets/{{presetId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets",
            "{{presetId}}"
          ]
        }
      }
    },
    {
      "name": "ویرایش تنظیم شخصی با کنترل نسخه",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets/{{presetId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets",
            "{{presetId}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1,\n  \"name\": \"گزارش معاملات روزانه\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "حذف تنظیم شخصی",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets/{{presetId}}?expectedVersion=1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets",
            "{{presetId}}?expectedVersion=1"
          ]
        }
      }
    },
    {
      "name": "اجرای تنظیم ذخیره‌شده",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/report-presets/{{presetId}}/run",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "report-presets",
            "{{presetId}}",
            "run"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "قالب ثبت متنی معامله",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trade-text/template",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trade-text",
            "template"
          ]
        }
      }
    },
    {
      "name": "بررسی و پیش‌نمایش متن معامله",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trade-text/preview",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trade-text",
            "preview"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\\nهزینه یورویی: 910\\nتوضیحات: معامله نمونه\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "ثبت معامله از متن قالب‌دار",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/trade-text",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "trade-text"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\\nهزینه یورویی: 910\\nتوضیحات: معامله نمونه\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "قالب‌های کامل عملیات متنی",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports/templates",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports",
            "templates"
          ]
        }
      }
    },
    {
      "name": "تجزیه متن بدون مراجعه به دیتابیس کسب‌وکار",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports/parse",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports",
            "parse"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "اعتبارسنجی همه رکوردها و محاسبه اثر مالی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports/validate",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports",
            "validate"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\\n---\\nنوع: دریافت\\nمشتری: C001\\nمبلغ: 100 USD\\nنرخ یورویی: 0.92\\nتخصیص: AUTO\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "پیش‌نمایش قابل تأیید با اعتبار پنج دقیقه",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports/preview",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports",
            "preview"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"نوع: معامله\\nمشتری: C001\\nدریافتی: ۱٬۰۰۰ USD\\nپرداختی: ۹۱۰ EUR\\nکارمزد: ۰٫۵\\nنرخ یورویی دریافتی: ۰٫۹۲\\nتسویه: کامل\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "ثبت اتمیک متن تکی یا گروهی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{textImportKey}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if(!pm.collectionVariables.get('textImportKey'))pm.collectionVariables.set('textImportKey',pm.variables.replaceIn('{{$guid}}'));"
            ]
          }
        }
      ]
    },
    {
      "name": "تاریخچه ثبت‌های متنی خود کاربر",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports"
          ]
        }
      }
    },
    {
      "name": "متن اصلی و نتیجه ثبت همراه وضعیت جاری اسناد",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-imports/{{importId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-imports",
            "{{importId}}"
          ]
        }
      }
    },
    {
      "name": "ذخیره پیش‌نویس متنی بدون ثبت مالی",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"title\": \"معاملات امروز\",\n  \"text\": \"مشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nکارمزد: 0.5\\nنرخ یورویی دریافتی: 0.92\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "فهرست پیش‌نویس‌های شخصی",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts"
          ]
        }
      }
    },
    {
      "name": "خواندن متن و نسخه پیش‌نویس",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts/{{draftId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts",
            "{{draftId}}"
          ]
        }
      }
    },
    {
      "name": "ویرایش پیش‌نویس با کنترل نسخه",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts/{{draftId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts",
            "{{draftId}}"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1,\n  \"text\": \"نوع: معامله\\nمشتری: C001\\nدریافتی: 1000 USD\\nپرداختی: 910 EUR\\nنرخ یورویی دریافتی: 0.92\\nتسویه: جزئی\\nدریافت واقعی: 500 USD\\nپرداخت واقعی: 200 EUR\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "حذف پیش‌نویس ثبت‌نشده",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts/{{draftId}}?expectedVersion=1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts",
            "{{draftId}}?expectedVersion=1"
          ]
        }
      }
    },
    {
      "name": "بررسی پیش‌نویس و ساخت پیش‌نمایش",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts/{{draftId}}/preview",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts",
            "{{draftId}}",
            "preview"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "تأیید نهایی پیش‌نویس",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Authorization",
            "value": "Bearer {{token}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{draftCommitKey}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/text-drafts/{{draftId}}/commit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "text-drafts",
            "{{draftId}}",
            "commit"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"expectedVersion\": 1,\n  \"previewId\": \"00000000-0000-4000-8000-000000000001\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              "if(!pm.collectionVariables.get('draftCommitKey'))pm.collectionVariables.set('draftCommitKey',pm.variables.replaceIn('{{$guid}}'));"
            ]
          }
        }
      ]
    }
  ]
}