bcgov / bcparks-ar-admin

BCParks Attendance and Revenue Admin
Apache License 2.0
4 stars 11 forks source link

[M]New Calculated Field to display total number of people at front country activities #256

Open kgorana opened 11 months ago

kgorana commented 11 months ago

Description

As a bc parks admin A&R uses, we want to easily see both the front country attendance total and the camping parties total.

This new calculation would apply to Front county camping only.

Front Country Activity form would show:

  1. The total number of camping party nights, (Standard + Senior + SSCFE + Longstay)
  2. Total Attendance (People), ((Standard + Senior + SSCFE +Longstay) * 3.2)

Acceptance Criteria:

Notes

request:

We would like to add an additional calculated field to the UI display (which will also result in an additional export column). Data that was entered directly into the A&R system shows the frontcountry attendance total as the total number of people (the system totals Standard + Senior + SSCFE + Longstay and multiplies this total by 3.2). This is definitely useful, but we have calculations that also use the camping party nights total, so the hope is to display both the total camping party nights and total number of people.

To keep what each total represents clear to the user, we would also like to display the unit (people) beside the total attendance title.

So the interface would display:

  1. The total number of camping party nights, (Standard + Senior + SSCFE + Longstay)
  2. Total Attendance (People), ((Standard + Senior + SSCFE +Longstay) * 3.2)

Image

Dianadec commented 7 months ago

Extra info from Sally: Total attendance (people) is (standard + senior + sscfe + longstay) * 3.2, so we want the total both without the multiplier (which is total camping nights) and with the multiplier (which is total people)

cameronpettit commented 7 months ago

@JLWade can you remember if we ever completed a ticket where legacy/historical fields were added to the report exporter? If so, do you know the ticket #?

Dianadec commented 7 months ago

@cameronpettit this one? https://github.com/bcgov/bcparks-ar-admin/issues/270 cc @JLWade

cameronpettit commented 7 months ago

That looks right. Led me to https://bcparksdigital.atlassian.net/browse/BRS-973 (Jira), for the same task. Looks like a past developer on the team didn't get a chance to finish it before they left, so #270 was attempted but never completed.

From said developer on the Jira ticket

Notes on this ticket: Inclusion/order of the 5 new columns: none needed as per consulted with Exporter displays the correct field value depending on whether the record is legacy or not: Should display field once data question resolved For this first iteration, legacy records should never calculate values if they are not provided. Values should not be assumed. If the legacy data is not on the legacy record, leave the column blank: No values calculated or assumed, will display blank. Legacy Data activity fields are added to the exporter: Done, columns show up in report Additional legacy fields are added to the exporter if they do not line up with existing fields: some additional fields added. I will be submitting a draft PR to the repository so all the code for this ticket will be accessible for later use. Current Issue: Tallying up fields for regular data require a config object with certain attributes/information. However, some legacy data activity entries do not have this config data object. There needs to be some decision on how to handle the lack of the config information.

It doesn't look like there are any provisions to export legacy data from a codebase perspective, so #270 blocks the portion of this ticket that deals with exporting the legacy frontcountry camping fields.

@Dianadec @JLWade I'd recommend removing the legacy portion of this ticket's AC and adding it to #270, so we can pass this ticket and do all the legacy stuff together in the correct ticket.

Dianadec commented 7 months ago

That makes sense @cameronpettit - is it the third bullet that needs to be transferred to 270, as well as the description with the second screenshot? cc @JLWade

  • historical: new field name “camping party nights” to replace Total Attendance, add Total Attendance (people) field with this calculation ((Standard + Senior + SSCFE +Longstay) * 3.2)

For the historical data, the display would be the same, but will need to be implemented a little differently. This is because the historical data’s display is showing a Total Attendance field that is really Total Camping Party Nights, as no 3.2 multiplier is being applied. So for the historical data the current Total Attendance would be mapped to/ re-labelled as Total Camping Party Nights, and then the Total Attendance would be that number multiplied by 3.2.

cameronpettit commented 7 months ago

@Dianadec correct

Dianadec commented 7 months ago

ok, info has now been transferred to #270 accordingly. @cameronpettit @JLWade - please review and let me know if anything needs adjusting.

manuji commented 6 months ago

Tested on TEST: Pending

Issues:

  1. The calculated total does not show up on the View Front Country Activity form on the Enter Data page for the data added before introducing this field. Eg: If I view a record from last year, the field is displayed and the value is not displayed.

Image

  1. This new field "Total Camping Party Nights" has not been added to the Edit Front Country Activity form, but it's not given in the AC as well. Just FYI @JLWade .
cameronpettit commented 6 months ago

This issue happens whenever any of the camping party night fields are null. Fixed in https://github.com/bcgov/bcparks-ar-admin/pull/320

manuji commented 6 months ago

Tested on TEST: Passed

@JLWade please note that the new field and the "(People)" suffix have not been added to the edit view.

JLWade commented 6 months ago

Thanks for the flag - i think most important is part of the report and view but if that changes I will add another ticket - moving to done