-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/reports stay after transfer/3584 #3829
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
base: develop
Are you sure you want to change the base?
Conversation
834bc9d
to
f40780b
Compare
a05a54b
to
d23e6a5
Compare
report_version__report__reporting_year=reporting_year, | ||
).values("operation_name")[:1] | ||
|
||
current_operations = OperationDataAccessService.get_all_current_operations_for_user(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b this is more complicated than needed?
user = baker.make(User, app_role=AppRole.objects.get(role_name="industry_user")) | ||
operator = operator_baker() | ||
user_operator = user_operator_baker( | ||
{ | ||
"user": user, | ||
"operator": operator, | ||
"status": UserOperator.Statuses.APPROVED, | ||
"role": UserOperator.Roles.ADMIN, | ||
} | ||
) | ||
mock_get_by_guid.return_value = user_operator.user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with recipes
operation_baker(_quantity=20) | ||
|
||
# create report for operation, filed by original_operator | ||
report_r1v1_id = ReportService.create_report(operation.id, reporting_year_2024.reporting_year) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use bakers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think it's better to use bakers, but I'm going to leave as-is because it does work and setting up the bakers manually requires a good understanding of reporting
timeline1.end_date = "2025-07-01T00:00:00Z" | ||
timeline1.save() | ||
OperationDesignatedOperatorTimeline.objects.create( | ||
operation=operation, operator=new_user_operator.operator, start_date="2025-07-01T00:00:00Z", end_date=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use dates at end of year
.only("id", "name", "submission_date", "status", "operator__legal_name", "bc_obps_regulated_operation__id") | ||
) | ||
|
||
@classmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have get_previously_owned_operations_by_operator
, overlap?
if (response?.error) | ||
setResponseError( | ||
`We couldn't create a report for operation ID '${operationId}' and reporting year '${reportingYear}': ${response?.error}.`, | ||
if (response?.error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was an unrelated bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asked PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments are notes to self
c204948
to
4b0cafa
Compare
… ReportDataAccessService
…revious owner-operator can now view their reports but new owner-operator can see previous owners' reports too - they shouldnt be able to
…rect operator, but new operator still sees duplicated operations and can't create a new report
…ate report for operation that already has one from old operator
…s_for_operator. Need to investigate failing tests
… Years Reports PR
… more still failing due to changed code; new pytests still needed
…eorganized one API file
…eval_after_transfer to fail
4b0cafa
to
de75d53
Compare
Ticket #3584
Recommended Testing Steps
appears there too, but that you don't have the option to view the report submitted for it by Bravo. Click the "Start" button to try to create a new report for Bangles SFO - you should see a modal popup with an error message saying that a report already exists for that operation and reporting year.does not appear.Brianna updates:
OperationDesignatedOperatorTimelineDataAccessService.get_operation_timeline_for_user
to facilitate ^