serenity-health / roadmap

Public roadmap for development of Serenity's apps reported by our community of users
0 stars 1 forks source link

[SER-266] View corp spend insights dashboard #133

Closed chris-dare closed 11 months ago

chris-dare commented 1 year ago

Issue description

HR administrators should be able to view a summary of their corporate spend with insights into utilization

Loom video: N/A

Integration Code @lewis

// you will need to install via 'npm install jsonwebtoken' or in your package.json

var jwt = require("jsonwebtoken");

var METABASE_SITE_URL = "https://serenity.metabaseapp.com";

var METABASE_SECRET_KEY = "ea34aba3f1c92e1e203cedf362e8d3b86f236124cc27fa1854d4d0e24a29946f";

var payload = {

resource: { dashboard: 36 },

params: {

"company_name_": null

},

exp: Math.round(Date.now() / 1000) + (10 * 60) // 10 minute expiration

};

var token = jwt.sign(payload, METABASE_SECRET_KEY);

var iframeUrl = METABASE_SITE_URL + "/embed/dashboard/" + token + "#bordered=true&titled=true";

In Frontend:

<iframe

src={iframeUrl}

frameBorder={0}

width={800}

height={600}

allowTransparency

/>

Acceptance criteria / Steps to verify 

  1. Premium to Utilisation ratio calculated and displayed on dashboard

How to resolve (Proposition)

Given a sample company, we calculate the total amount spent by its employees so far against the what is allocated as premium.

Formula to calculate premium:

Product (AVG number of visits by employees, Max spend per visit, total number of registered employees)

Utilisation Formula

Sum(total amount spent on all employee visits)

External / 3rd Party dependencies identified

This may depend on metabase being available

From SyncLinear.com | SER-266

chris-dare commented 1 year ago

Great thanks.

Why do we need to fetch the list of clients from a google sheet? Why not directly from the database?

@Rejoice Hormeku

chris-dare commented 1 year ago

@lewis here's the link to the list of corporate clients. Please use the values under the Name column.

https://drive.google.com/file/d/1rpoQzxxDu9iJdZcPzj2O4noYQxEhmXDh/view?usp=drivesdk

chris-dare commented 1 year ago

Done, please have a review

chris-dare commented 1 year ago

@Rejoice Hormeku please update this issue with a description of what we want to achieve