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

psp-7346 correct bracket usage, ensure logic limited to file close only. #3622

Merged
merged 3 commits into from
Dec 2, 2023

Conversation

devinleighsmith
Copy link
Collaborator

No description provided.

@devinleighsmith devinleighsmith added the bug Something isn't working label Nov 29, 2023
@devinleighsmith devinleighsmith self-assigned this Nov 29, 2023
Copy link
Contributor

✅ No secrets were detected in the code.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Merging #3622 (49b1d24) into dev (6bc01fb) will decrease coverage by 6.09%.
The diff coverage is 80.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3622      +/-   ##
==========================================
- Coverage   69.51%   63.43%   -6.09%     
==========================================
  Files        1375      474     -901     
  Lines       34403    15416   -18987     
  Branches     6496     1059    -5437     
==========================================
- Hits        23916     9779   -14137     
+ Misses      10227     5376    -4851     
- Partials      260      261       +1     
Flag Coverage Δ
unittests 63.43% <80.00%> (-6.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rce/backend/api/Services/AcquisitionFileService.cs 71.06% <80.00%> (-0.57%) ⬇️

... and 901 files with indirect coverage changes

@@ -242,7 +242,7 @@ public PimsAcquisitionFile Update(PimsAcquisitionFile acquisitionFile, IEnumerab

_user.ThrowInvalidAccessToAcquisitionFile(_userRepository, _acqFileRepository, acquisitionFile.Internal_Id);
ValidateVersion(acquisitionFile.Internal_Id, acquisitionFile.ConcurrencyControlNumber);
ValidateDrafts(acquisitionFile.Internal_Id);
ValidateDrafts(acquisitionFile);
Copy link
Collaborator

Choose a reason for hiding this comment

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

kinda of a nit: The current acq file is being retrieved multiple times for each validation function, ideally we would retrieve it once and pass it to the validation logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, I only see one request for the acquisition file in any validate functions within Update:
ValidatePayeeDependency
the only other call is at the end of the update function, but that is after the transaction is committed so I think that makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

for example teh GetCurrentAcquisitionStatus will retrieve the latest acq file for the given id

@@ -948,7 +949,7 @@ private void ValidateInterestHoldersDependency(long acquisitionFileId, List<Pims
var currentAcquisitionFile = _acqFileRepository.GetById(acquisitionFileId);
AcquisitionStatusTypes currentAcquisitionStatus;

if (Enum.TryParse(currentAcquisitionFile.AcquisitionFileStatusTypeCode, out currentAcquisitionStatus))
if (Enum.TryParse(currentAcquisitionFile?.AcquisitionFileStatusTypeCode, out currentAcquisitionStatus))
Copy link
Collaborator

Choose a reason for hiding this comment

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

the acq file should never be null here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

imo, having the code throw here if null is a good idea

Copy link
Contributor

github-actions bot commented Dec 1, 2023

✅ No secrets were detected in the code.

2 similar comments
Copy link
Contributor

github-actions bot commented Dec 1, 2023

✅ No secrets were detected in the code.

Copy link
Contributor

github-actions bot commented Dec 1, 2023

✅ No secrets were detected in the code.

Copy link
Contributor

github-actions bot commented Dec 2, 2023

✅ No secrets were detected in the code.

@devinleighsmith devinleighsmith merged commit c03a205 into bcgov:dev Dec 2, 2023
8 of 9 checks passed
FuriousLlama added a commit that referenced this pull request Dec 7, 2023
* Added check status logic when updating acq and related entities | psp-7006 (#3602)

* Added status checking to details, take, compensation and other acq file pages

* Updated backend and updated tests

* Fixed lint

* Refactored solver to be simpler

* Added tests

* Pr comments

* Added the sys-admin to edit acquisition fields

* CI: Bump version to v4.0.0-67.24

* Updated placeholder display (#3620)

* CI: Bump version to v4.0.0-67.25

* dialog correction. (#3629)

Co-authored-by: Smith <[email protected]>

* CI: Bump version to v4.0.0-67.26

* Keycloak Refactor (#3624)

* Refactored keycloak sync to use the keycloak repository used by the API. ALso removed tools.Core and removed redundant models

* pr fixes

* CI: Bump version to v4.0.0-67.27

* System error modal | psp-7304 (#3628)

* Updated Generic modal to use a variant

* Improved System error modal

* Lit fixes

* Info fixes

* CI: Bump version to v4.0.0-67.28

* psp-7346 correct bracket usage, ensure logic limited to file close only. (#3622)

* psp-7346 correct bracket usage, ensure logic limited to file close only.

* comment from code review.

* test correction.

---------

Co-authored-by: Smith <[email protected]>

* CI: Bump version to v4.0.0-67.29

* requested source marked as nullable for validation. (#3630)

Co-authored-by: Smith <[email protected]>

* CI: Bump version to v4.0.0-67.30

* allow showing the edit screen for management activity while the popout is open. (#3632)

Co-authored-by: Smith <[email protected]>

* CI: Bump version to v4.0.0-67.31

* Pims api to Frontend ts generator and generated files (#3618)

* Refactored concept models. Created a new library and cleaned dependencies between projects. Cleaned names of reused concepts and standarized concept namespace. Cleaned extension and help files

* Fixed lints

* Initial generator work

* Cleaned up files and improved translation

* Updated namespaces and path for the api models

* Updated generator and cleaned up code

* Added make command to generate ts api files and lint them.

* First generation of the pims api.

* Cleaned up generator and handled generic types. Improved header docks.

* Fixed solution

* Updated models for keycloak sync and fixed lint warnings

* Fixed registering mappers

* CI: Bump version to v4.0.0-67.32

* Bump DEV version - IS68 (#3636)

* CI: Bump version to v4.0.0-68.1

* Manual merges and re-generated snaps

* moved disposition models to the new api-models project

* re-generated api models

* Changed disposition property to property model type

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: devinleighsmith <[email protected]>
Co-authored-by: Smith <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants