balanced / balanced-api

Balanced API specification.
221 stars 72 forks source link

Add logs to elastic search #685

Closed kyungmin closed 10 years ago

kyungmin commented 10 years ago

As described in https://github.com/balanced/balanced-dashboard/issues/1425,

https://api.balancedpayments.com/marketplaces/:marketplace_id/search should return logs results for the given OHM.

Expected response example:

{
-->  "logs": [
    {
      "id": "OHMxxxxxx",
      "endpoint": "debits",
      "uri": "/logs/OHMxxxxxx",
      "url": ".../bank_accounts/BAxxxxxx/verifications",
      "created_at": "2014-08-21T18:22:41.398783+00:00Z",
      "status_rollup": "2XX",
      "method": "POST",
      "href": "/logs/OHMxxxxxx",
      "message": {
        "response": {
          "status": "201 CREATED",
        }
      }
    }
  ],
  "meta": {
    "last": "/marketplaces/MPxxxxxx/search?...",
    "next": null,
    "href": "/marketplaces/MPxxxxxx/search?...",
    "limit": 10,
    "offset": 0,
    "previous": null,
    "counts": {
-->      "log": 1,
      "refund": 0,
      "customer": 0,
      "card_hold": 0,
      "credit": 0,
      "card": 0,
      "reversal": 0,
      "debit": 0,
      "order": 0,
      "bank_account": 0
    },
    "total": 1,
    "first": "/marketplaces/MPxxxxxx/search?..."
  },
  "links": {
    "cards.card_holds": "/cards/{cards.id}/card_holds",
    "cards.customer": "/customers/{cards.customer}",
    "cards.credits": "/cards/{cards.id}/credits",
    "cards.disputes": "/cards/{cards.id}/disputes",
    "cards.debits": "/cards/{cards.id}/debits"
  }
}
mjallday commented 10 years ago

logs are already exposed at https://api.balancedpayments.com/logs and https://api.balancedpayments.com/logs/OHM23123123