Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Add total price indicator to labels and locations #638

Closed
wants to merge 1 commit into from

Conversation

JackBailey
Copy link

@JackBailey JackBailey commented Nov 24, 2023

What type of PR is this?

  • feature

What this PR does / why we need it:

It adds an indicator to the /label and /location pages to show the overall purchase price.

For locations it includes child locations.

Location

image

Label

image

Changed files:

  • frontend/lib/api/types/data-contracts.ts
    • add optional totalPrice field to LabelOut and LocationOut types
  • frontend/pages/label/[id].vue
    • Add total price for label to header
  • frontend/pages/location/[id].vue
    • Add total price for location and child locations
    • Additional request: Request of location tree

Special notes for your reviewer:

I haven't used typescript before, there's no errors and it works but it might not be done to the best way.

Testing

Labels

  • Tested with lots, some and no items

Locations

  • Location with/without items
  • With/without child locations
  • With child locations, and without own items

Release Notes

Added a chip-style indicator to show the total price for labels and locations.

@JackBailey
Copy link
Author

This might benefit from also showing the prices on the individual items and also working out if the items have been sold or not, but this should be a good starting point.

@JackBailey
Copy link
Author

@hay-kot any thoughts on this or other features you'd like me to add in this PR?

Copy link
Owner

@hay-kot hay-kot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I think this kind of thing should be handled on the backend and returned to the frontend from the API, not computed on the frontend.

If you're interested in making a PR for that I think it would be a great addition!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is auto-generated you shouldn't manually update it

@JackBailey
Copy link
Author

I can certainly give it a go, not very proficient in golang but I'm sure I can get it to a usable state and then my code could be improved if needed. Will look at it soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants