Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement billing API #71

Open
chregu opened this issue Jan 30, 2018 · 0 comments
Open

Implement billing API #71

chregu opened this issue Jan 30, 2018 · 0 comments

Comments

@chregu
Copy link
Contributor

chregu commented Jan 30, 2018

The backend has now info about past and future costs -> https://api.rokka.io/billing/$org

Would be nice, if we could display in the dashboard in a nice format, for the current and the last few months maybe (the ?from and ?to parameters exist like in the /stats call, but default to the current month and the returned data is always for the full month)

It has the format

{
  "$master_organiation": {
    "$year-$month": {
      "organizations": {
        "$org1": {
          "traffic": {
            "$tier1": {
              "amount_in_gb": 0.05,
              "price_per_gb": 0.5,
              "price_in_chf": 0.03
            },
            "total": {
              "amount_in_gb": 0.05,
              "price_in_chf": 0.03
            }
          },
          "storage": {
            "$tier1": {
              "amount_in_gb": 20.66,
              "price_per_gb": 0.4,
              "price_in_chf": 24.26
            },
            "total": {
              "amount_in_gb": 154.66,
              "price_in_chf": 24.26
            }
          },
          "total": {
            "price_in_chf": 24.29
          }
        },
        "$org2": {
          "traffic": {
            ...
          }
      },
      "combined": {
        "traffic": {
          "$tier1": {
            "amount_in_gb": 5.0,
            "price_per_gb": 0.5,
            "price_in_chf": 2.5
          },
          "total": {
            "amount_in_gb": 5.0,
            "price_in_chf": 2.5
          }
        },
        "storage": {
          "$tier": {
            "amount_in_gb": 40,
            "price_per_gb": 0.4,
            "price_in_chf": 16
          },
          "total": {
            "amount_in_gb": 40,
            "price_in_chf": 16.0
          }
        },
        "total": {
          "price_in_chf": 30.29
        }
      },
      "combined_forecast": {
        "traffic": {
          "$tier1": {
            "amount_in_gb": 20.25,
            "price_per_gb": 0.5,
            "price_in_chf": 10.13
          },
          "total": {
            "amount_in_gb": 20.25,
            "price_in_chf": 10.13
          }
        },
        "storage": {
          "$tier2": {
            "amount_in_gb": 200.99,
            "price_per_gb": 0.4,
            "price_in_chf": 80.6
          },
          "total": {
            "amount_in_gb": 50,
            "price_in_chf": 25.6
          }
        },
        "total": {
          "price_in_chf": 143.73
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant