SHAR Production
← Все рецепты

Executable workflow

Нормализация предложений подрядчиков

Нормализует валюты и сравнивает полноту scope.

Результат успешного запуска

{
  "input": {
    "synthetic": true,
    "rates": {
      "RUB": 1,
      "USD": 90
    },
    "bids": [
      {
        "vendor_ref": "vendor-a",
        "currency": "RUB",
        "total": 100000,
        "scope_score": 80
      },
      {
        "vendor_ref": "vendor-b",
        "currency": "USD",
        "total": 1200,
        "scope_score": 90
      }
    ]
  },
  "result": {
    "pass": true,
    "issues": [],
    "metrics": {
      "normalized": [
        {
          "vendor_ref": "vendor-a",
          "total_rub": 100000
        },
        {
          "vendor_ref": "vendor-b",
          "total_rub": 108000
        }
      ]
    }
  }
}

Результат отклонения

{
  "input": {
    "synthetic": true,
    "rates": {
      "RUB": 1
    },
    "bids": [
      {
        "vendor_ref": "vendor-a",
        "currency": "XXX",
        "total": -1,
        "scope_score": 120
      }
    ]
  },
  "result": {
    "pass": false,
    "issues": [
      "vendor-a:negative_total",
      "vendor-a:unknown_currency",
      "vendor-a:bad_scope_score"
    ],
    "metrics": {
      "normalized": []
    }
  }
}

SHAR Production · sharprod.com