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

[SCL-81] Square API Backend Metrics: Total Donations #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sandaiiyahh
Copy link
Contributor

  • Added new GCP function: cookbook to call Square Orders API for getting total donations

@sandaiiyahh sandaiiyahh requested a review from a team as a code owner July 7, 2023 23:11
@linear
Copy link

linear bot commented Jul 7, 2023

SCL-85 Back-End

SCL-81 Square Metrics

Page information

Judy has already done some research on how to query the Square API to get the information that we need. Let's convert that into actual code that is hosted on Heroku, as a Firebase function, or otherwise. If the former, the implementer can make a new repo, if the latter, we can either do a new repo or piggy-back on the APAHM project.

We need to create a micro-service that has our Square API keys (talk to jacob for access) that can return a set of metrics (namely two as listed below). This should have a 1-hr caching layer to not approach Square's API usage thresholds. Then, a front-end embeddable element should be designed to consume and render those metrics.

The two metrics that need to be retrieved are:

  • Total number of cookbook items sold (factoring in quantity in orders)
  • Total donations to SCL via Square (may change later)
    • The SCL Donation item can be used
    • This is less important and not required for MVP

This is a large amount of work and may take 2 sprints to complete. 2 engineers may also take it and split the work into front-end / back-end.

An example micro-service backend that implemented caching and was deployed on Heroku can be found here.

For the front-end component, the background should be transparent as we will color it from within the Weebly section. It should be done in the Weebly repo in the custom-elements folder. Code should be vanilla HTML / CSS / JS for embedding on the Weebly site. You can use the HTML Preview extension for quick local development.

Font: https://fonts.google.com/specimen/Plus+Jakarta+Sans

Acceptance Criteria

  • Create and stand up a micro-service to retrieve metrics from square.
  • The micro-service caches square data on a 1-hr basis
  • The embeddable front-end can consume our micro-service and displays information accordingly

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

Successfully merging this pull request may close these issues.

1 participant