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

Sorting Tables + Edit /invoices/total #85

Closed
6 tasks done
jessieh9 opened this issue Feb 22, 2025 · 0 comments · Fixed by #94
Closed
6 tasks done

Sorting Tables + Edit /invoices/total #85

jessieh9 opened this issue Feb 22, 2025 · 0 comments · Fixed by #94
Assignees

Comments

@jessieh9
Copy link
Collaborator

jessieh9 commented Feb 22, 2025

This task will focus on adding sorting to some tables in pages that are already made including the Programs page, Single Program Page, and Archived Programs page matching the Figma. You will also be editing the /invoices/total endpoint to account for total adjustment with a booking_id.

Sorting for Tables

  • It might be helpful to create components for the sorting modals and then apply to each table/page. For example, the Programs page and Archived Programs page both use similar sorting modals.
  • Create the modals for each page listed on the Figma and match any design/icons necessary. Make the corresponding filtering fucntionality with the displayed table information.

Create the modals for the sort in /lpa/client/src/components/filters/ProgramFilter.jsx, /lpa/client/src/components/filters/DateFilter.jsx, etc...

Editing /invoices/total Endpoint

Currently, the endpoint calculates the current total of the entire invoice, taking into consideration multiple adjustments and comments.

Previously, for the adjustment_types, we implemented:

  • total
    • Applied to the entire invoice
    • Increases or decreases the total cost of the entire invoice
    • Use: adding $20 off or charging $5 for cleaning fees
  • rate_flat
    • Applied to EITHER a booking, OR the invoice itself
    • If applied to a booking, it is still tied to the invoice, but only applied to the booking
    • Increases or decreases the flat rate of the room associated with EITHER the booking or all bookings of the invoice
    • Use: giving the payee $10 off the room rate for the month or giving them $5 off for one booking because the room was dirty
  • rate_percent
    • Same as rate_flat, but applies a percent value to the original room rate
  • paid ( not used here )
    • Increases or decreases how much was paid by the payee for this invoice

Now, we want to add a slight change to total:

  • If the adjustment is total AND there is a booking_id associated with it, we want to apply the adjustment_value to the booking itself (previously total didn't account for booking_id)
  • Increases or decreases the total cost of the booking itself
  • Use: adding $10 or deducting $5 for that one session
  • Add this edit to the endpoint

You can reference this Issue if you'd like to understand more and learn about the invoices/total endpoint in detail.

Acceptance Criteria

  • Sorting Modals and Functionality for all pages
    • Programs page /home
    • Single Program page /programs/:id
    • Archived Programs page /programs/archived
  • Updated invoices/total endpoint to reflect the adjustment with total and booking_id associated with it
    • Tested the endpoint after changes
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 a pull request may close this issue.

3 participants