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

Poll User Workspaces Invoices. #1680

Closed
4 tasks
elraphty opened this issue Jun 3, 2024 · 0 comments · Fixed by #1682
Closed
4 tasks

Poll User Workspaces Invoices. #1680

elraphty opened this issue Jun 3, 2024 · 0 comments · Fixed by #1682
Assignees
Labels

Comments

@elraphty
Copy link
Contributor

elraphty commented Jun 3, 2024

Context

Currently, we poll Workspace budget invoices using the /poll/invoices/{uuid} route, to achieve this a user has to click the Manage button on a single Workspace on the sphinx-tribes frontend app before the Workspace budget can be updated.

Design

We want to create a new endpoint /poll/{user_pubkey}/workspaces/invoices, that will add the functionality of updating the Workspaces budget on the Workspace list on the front end. The user will not have to click on a single Workspace to get the revised budget.

To Achieve This:

  • We will get the user public key from the route params
  • Search for all the workspaces the user is an admin or has the Role to view workspace budget
  • Then will loop through all the pending invoices that are not expired, if the invoice is paid we will add the invoice amount to the workspace budget.
  • If the invoice is not paid and expired we will prune the invoice from the invoice_lists table
  • if the invoice has not been paid, and hasn't expired, we will keep the invoice on the invoice_lists table.

This Issue is blocked by Issue #1679.

Acceptance Criteria

  • I've tested on Chrome
  • I've created a test that...
  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 2 days of taking the bounty

Here is an example backend test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant