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

Reg\Transfers - Internal User can transfer a facility to another operation #2427

Open
8 of 27 tasks
andrea-williams opened this issue Oct 29, 2024 · 17 comments
Open
8 of 27 tasks

Comments

@andrea-williams
Copy link
Contributor

andrea-williams commented Oct 29, 2024

Dependencies

Description:

As an internal user, I need to be able to transfer a facility to another operation

Acceptance Criteria:

Given that I am on the BCIERS dashboard and click "Transfer an Operation or Facility"
OR Given that I am on the Transfer Grid, and I click "Make a transfer"
Then I am brought to the Transfer Entity form Figma

Given I haven't yet answered the question "What is being transferred?"
The only fields that appear on the page are "Current operator", "Select the new operator", and "What is being transferred?"
And the "Transfer Entity" button is disabled

Given that I have selected "Facility" as my answer to the "What is being transferred?" question,
Then only the facility-specific fields of the form are displayed ("Select the operation that this facility currently belongs to", "Facility" dropdown, "Select the new operation this facility will be allocated to", and "Effective date of transfer")

Given that I submitted the form,
Then I am brought to the transfer complete success page
Figma

Context: although the wireframe shows fields for transferring an operation and a facility, this ticket only captures the flow for transferring a facility. The work for transferring an operation is captured in separate ticket #1949

Context: this ticket only covers CREATING a new transfer record for facilities. Editing the transfer form will be covered in a separate ticket.

Additional Context: see associated ticket #2040

Development Checklist:

  • apply RBAC to API endpoint(s) for making a transfer so that it's only accessible to "cas_admin" and "cas_analyst" users
  • in "Create" mode of a new Transfer, the breadcrumb [Name of entity being transferred] (in wireframe) does NOT need to populated - developer's choice to leave it entity or add generic title like "Transfer Entity"/"New Transfer"
  • the dropdown options in "Select the new operator" dropdown should exclude the operator selected as "Current operator"
  • the options in "Select the operation that this facility currently belongs to" dropdown should only be the operations associated with the Current Operator (selected in a previous dropdown)
  • the options in the "Facility" dropdown should only be the facilities that are associated with the selected operation (from the previous dropdown)
  • the options in the "Select the new operation this facility will be allocated to" dropdown should only be the operations associated with the "Select the new operator" dropdown answer
  • for each facility listed in the Transfer Entity form, a new record should be created in the transfer_event table => Sep: This is not valid, we are saving facilities as a M2M field
  • for each facility listed in the Transfer Entity form, a new record should be created in facility_designated_operation_timeline table with the form fields. The "effective date of transfer" in the form should be inserted into the start_date column for the new FacilityDesignatedOperationTimeline record, and it should also be inserted into the end_date column for the FacilityDesignatedOperationTimeline record of the previous designated operation. The status of the new record should be set to To be transferred. Transferring a facility should not change any data in the facility table => Sep: After processing the transfer, we create an entry in the FacilityDesignatedOperationTimeline table. (we don't do it if transfer is in the future)
  • create several mock fixtures for transfers of facilities, with effective dates both in the distant future and in the past
  • recommended: add explanation in docs/backend folder to explain how transfers work - it's complicated and confusing
  • Meets the DOD

Definition of Ready (Note: If any of these points are not applicable, mark N/A)

  • User story is included
  • User role and type are identified
  • Acceptance criteria are included
  • Wireframes are included (if required)
  • Design / Solution is accepted by Product Owner
  • Dependencies are identified (technical, business, regulatory/policy)
  • Story has been estimated (under 13 pts)

·Definition of Done (Note: If any of these points are not applicable, mark N/A)

  • Acceptance criteria are tested by the CI pipeline
  • UI meets accessibility requirements
  • Configuration changes are documented, documentation and designs are updated
  • Passes code peer-review
  • Passes QA of Acceptance Criteria with verification in Dev and Test
  • Ticket is ready to be merged to main branch
  • Can be demoed in Sprint Review
  • Bugs or future work cards are identified and created
  • Reviewed and approved by Product Owner

Notes:

@Sepehr-Sobhani
Copy link
Contributor

Questions and Comments:

  • What is the function of the “Add Another Facility” button?
  • Should we only display operator-related drop-downs if the user intends to transfer an operation?
  • Why do we need to ask the user to select the operation that this facility belongs to? We already have that information. 🤔
  • I recommend addressing the issue of changing the status of the second data center from “PENDING” to “To Be Transferred” in the transfer data grid ticket.
  • We have a note indicating that the facility drop-down is multi-select. Does this mean that all selected facilities will be transferred to a single operation?

@andrea-williams
Copy link
Contributor Author

  • "Add Another Facility" button is for when multiple facilities from the same operation need to be transferred at the same time to the same recipient operation
  • I'm not sure I understand your question, but facilities could be transferred to a different operator too, so I think we'll need to ask about the operator regardless
  • We would be asking them to select the operation that the facility currently belongs to just so that the facility dropdown then only shows the facilities for the selected operation.
  • I'm on board for that
  • yes, all selected facilities would be transferred to the one recipient operation selected

@andrea-williams
Copy link
Contributor Author

@zoeyli-46 design question (all credit goes to @Sepehr-Sobhani for this idea): rather than having the "Add another facility" button and one dropdown per facility, could we instead make the "Facility" dropdown a multi-select, and then include the geographic coordinates in the dropdown options. (So for example, each option in the facility dropdown would look like "[Operation name] - [lat, long]"). We think this way would be easier to implement development-wise, and it would also save space on the page.

@zoeyli-46
Copy link

Yes! Thats a great design too. I'll reflect it in the wireframe.

@patrickisaac patrickisaac removed the Estimation Tickets that need to be estimated label Nov 7, 2024
@patriciarussellCAS patriciarussellCAS added this to the Event reporting milestone Nov 7, 2024
@Sepehr-Sobhani
Copy link
Contributor

We should change the wording of 'transfer completion success page' because transfers have an effective date, and we might not transfer entities immediately.
cc: @andrea-williams / @zoeyli-46 / @patriciarussellCAS

@zoeyli-46
Copy link

@Sepehr-Sobhani good point, I made a wireframe for a success page for transfers that have not occurred yet (i.e., the effective date has not happened) https://www.figma.com/design/LsDmLDCdnJqI8UahyqvOD8/BCIERS-Designs?node-id=26272-7674&t=QZVf9IjjfsLafkGY-4

@Sepehr-Sobhani
Copy link
Contributor

Hi @patriciarussellCAS / @andrea-williams!

For transferring facilities, does the user want to transfer a facility from Operation 1 to Operation 2 under the same operator, or should facilities be transferable from Operation 1 under Operator 1 to Operation 2 under Operator 2, or both?

@andrea-williams
Copy link
Contributor Author

Hi @patriciarussellCAS / @andrea-williams!

For transferring facilities, does the user want to transfer a facility from Operation 1 to Operation 2 under the same operator, or should facilities be transferable from Operation 1 under Operator 1 to Operation 2 under Operator 2, or both?

I believe both

@Sepehr-Sobhani Sepehr-Sobhani pinned this issue Nov 28, 2024
@Sepehr-Sobhani Sepehr-Sobhani unpinned this issue Nov 28, 2024
@Sepehr-Sobhani
Copy link
Contributor

Hi @patriciarussellCAS / @andrea-williams!
For transferring facilities, does the user want to transfer a facility from Operation 1 to Operation 2 under the same operator, or should facilities be transferable from Operation 1 under Operator 1 to Operation 2 under Operator 2, or both?

I believe both

In this case, we should allow the user to select the same operator for both the current and new operator. We should remove below AC:

the dropdown options in "Select the new operator" dropdown should exclude the operator selected as "Current operator"

@andrea-williams
Copy link
Contributor Author

Hi @patriciarussellCAS / @andrea-williams!
For transferring facilities, does the user want to transfer a facility from Operation 1 to Operation 2 under the same operator, or should facilities be transferable from Operation 1 under Operator 1 to Operation 2 under Operator 2, or both?

I believe both

In this case, we should allow the user to select the same operator for both the current and new operator. We should remove below AC:

the dropdown options in "Select the new operator" dropdown should exclude the operator selected as "Current operator"

I agree. I've removed that AC :)

@patriciarussellCAS
Copy link

Thanks guys! Yes, it could be both.

@patriciarussellCAS
Copy link

Review notes:
Transfer an Operation:
First time I tried I got the following error message

Image

The second time I tried, there are no operations available to select in the dropdown. This happens when I select transfer facility as well.

Image

cc: @Sepehr-Sobhani @BCerki @andrea-williams

@BCerki
Copy link
Contributor

BCerki commented Dec 18, 2024

Review notes: Transfer an Operation: First time I tried I got the following error message

Mock data again. In the Operation model, Operation 17 belongs to Existing Operator 2 Legal Name, but in the OperationDesignatedOperatorTimeline, it belongs to and is active with Operator 1 Legal Name. _process_operation_transfer should set the end_date for the timeline table (if current_timeline: OperationDesignatedOperatorTimelineService.set_timeline_status_and_end_date(...) but we don't find a current_timeline because the operator is wrong. So then there's no end date and we hit the constraint about not having an operation owned by two operators at the same time

The second time I tried, there are no operations available to select in the dropdown. This happens when I select transfer facility as well.

The dropdowns only show operations that belong to the selected operator, and facilities that belong to the selected operation. New Operator 11 doesn't have any operations, so that's why you're getting nothing in the dropdown. Existing Operator 2 has lots of operations and facilities if you'd like to play around with it, but I'm also going to update the mock data and then everything should work better

cc: @Sepehr-Sobhani @BCerki @andrea-williams

@zoeyli-46
Copy link

Image

Is this the format for displaying "time" across the app? I wonder if it would be easier to read if it just said "Jul 5, 2024 4:25PM". is the time zone and second necessary information? @patriciarussellCAS

@patriciarussellCAS
Copy link

@zoeyli-46 I think we should ask Tiegan. I don't actually think we need the time at all, just the date.

@zoeyli-46
Copy link

zoeyli-46 commented Dec 24, 2024

@patriciarussellCAS Tiegan and Kirk said they do not need the timestamp for transfers reports. However, @vesselak flagged to keep the date/time display consistent across the pages and timestamps ARE needed for annual reports. The suggestion here is to remove just the "seconds" from the time stamp, for better readability.

July 4, 2024 4:25 p.m. PDT Thread for context

@zoeyli-46
Copy link

Created ticket #2640 regarding the date/time display @patriciarussellCAS cc @vesselak

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

No branches or pull requests

6 participants