bcgov / bcgov/cas-reporting

Bug: Error in reporting when changing operation type

Open
#707 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

#### Describe the Bug:

Changing the operation type results to issues in reporting. Listed below are the areas:

1. When there are multiple facilities, then I change from Linear Facilities Operation to Single Facility Operation - `get() returned more than one FacilityReport` [error](https://github.com/bcgov/cas-reporting/issues/697#issuecomment-2802938657)
2. When changing from Single Facility Operation to Linear Facility Operation - Facility type is blank (see [comment](https://github.com/bcgov/cas-reporting/issues/697#issuecomment-2798036066))

#### Probability:

(How likely the bug is to happen, scored from 1-5. For example, probability of 5 is something like "it happens to all users every time they log in." whereas probability of 1 "only happens to certain users when a really specific and unlikely path is followed.")

#### Impact:

(How bad the bug is when it does happen, scored from 1-5. For example, effect of 5 is "the entire app crashes and makes it unusable for all users" or "the bug causes the wrong data to be saved, with critical information (e.g. payment) being affected." whereas effect of 1 is "It makes some styling look a little bit weird.")

Bug Matrix

#### Steps to reproduce the behaviour:

First issue (LFO to SFO):
1. Register a Regulated Operation as an LFO, create 2 facilities
2. Start a report and fill out at least 1 facility report, but don't complete the annual report
3. Go back to Admin and change the Operation from an LFO to SFO
4. Go back into Reporting and on the Operation Information Page click "Sync data" button
5. Operation updates to SFO
6. Click Save & Continue and get this error message:

Second issue (SFO to LFO):
1. Register as Regulated Operation with operation type = SFO
2. Start report
3. Go back to Admin and change the operation type to LFO
4. Go back to Reporting, click sync button
5. Click Save & Continue until you reach the Review Facility Information page

#### Screenshots:

First issue:

![Image](https://github.com/user-attachments/assets/7b4da18c-ed19-405e-83b7-4740d66bc875)

Second issue:

![Image](https://github.com/user-attachments/assets/b9f68def-966f-414b-aee4-7c2a49fb8117)

#### Additional information:

OS: [e.g. iOS]
Browser: [e.g. chrome, safari]
Version: [e.g. 22]

#### Additional Context

-

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing both operation-type transitions through Admin and Reporting, including Sync data and Save & Continue. Trace the reporting flow after each transition and compare the facility records used for the report. Done means LFO-to-SFO no longer raises the multiple-FacilityReport error and SFO-to-LFO displays the facility type.

Written by the indexing model from the issue text.

Assessment

Domain
full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.