-
Notifications
You must be signed in to change notification settings - Fork 24
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-7618 : Re-add project/product to Disposition Files (Create, Update and View File Summary) #3777
Conversation
eddherrera
commented
Feb 7, 2024
✅ No secrets were detected in the code. |
✅ No secrets were detected in the code. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #3777 +/- ##
==========================================
- Coverage 77.54% 75.65% -1.90%
==========================================
Files 493 1448 +955
Lines 17099 37910 +20811
Branches 1122 7133 +6011
==========================================
+ Hits 13260 28682 +15422
- Misses 3560 8945 +5385
- Partials 279 283 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
public long? ProjectId { get; set; } | ||
|
||
/// <summary> | ||
/// get/set - The acquisition project. |
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.
acquisition -> disposition
@@ -1,5 +1,6 @@ | |||
using System; | |||
using System.Security.Claims; | |||
using Microsoft.EntityFrameworkCore.Storage; |
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 looks unused to me (remove)
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.
removed
{ | ||
Context.Remove(existingSale.DspPurchAgent); | ||
dispositionSale.DspPurchAgentId = null; | ||
} |
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.
Test coverage on these conditionals is a bit spotty, can you add some tests for this?
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.
updated
@@ -108,7 +112,7 @@ describe('Disposition List View', () => { | |||
it('searches by pid', async () => { | |||
let results = mockPagedResults([ | |||
{ | |||
...mockDispositionFileResponse(), | |||
...(mockDispositionFileResponse() as unknown as Api_DispositionFile), |
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'm having trouble understanding the need for this, if the entire point of this mock is to create a disposition file, why are you needing to cast this to an Api_DispositionFile via an unknown?
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 am casting from the new generated models ApiGen_Concepts_XXX I am limiting the use of the new models scoped to what I am currently working and not trying to spill over everywhere. The story to do the removal of old models would just need to remove the casting.
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.
ah ok. I see. That is fine for now then.
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.
Actually, can you log a follow-up task for is74 that would cover correcting this once we merge 5.1
That way we don't forget.
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.
Task created.
if (param[0].id) { | ||
const result = await retrieveProjectProducts(param[0].id); | ||
if (result) { | ||
setProjectProducts(result as unknown as ApiGen_Concepts_Product[]); |
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 don't understand why all this casting is necessary. Is this not the type returned by the API?
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.
same as previous comment. Related to the use of the new generated models but limiting to the scope of what I am working on.
); | ||
|
||
useEffect(() => { | ||
console.log(initialValues.project); |
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.
console.log
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.
removed
onChange={(vals: IAutocompletePrediction[]) => { | ||
onMinistryProjectSelected(vals); | ||
if (vals.length === 0) { | ||
formikProps.setFieldValue('project', 0); |
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.
Is this correct? Or should this be product?
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.
it should be product. updated.
✅ No secrets were detected in the code. |
); | ||
|
||
useEffect(() => { | ||
console.log(initialValues.project); |
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.
console.log
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.
removed
✅ No secrets were detected in the code. |
@eddherrera removing a purchaser solicitor or purchaser agent causes the db to throw a foreign key violation exception. Are you missing unit tests for that case? |
SqlException: *** [PIMS_DSPPUR_I_S_U_TR], Line 14. Errno 547: The UPDATE statement conflicted with the FOREIGN KEY constraint "PIM_DSPSAL_PIM_DSPPUR_FK". The conflict occurred in database "pims", table "dbo.PIMS_DISPOSITION_SALE", column 'DISPOSITION_SALE_ID'. |
Similarly, I received the following with this test:
SqlException: *** [PIMS_DSPPUR_I_S_U_TR], Line 14. Errno 547: The UPDATE statement conflicted with the FOREIGN KEY constraint "PIM_DSPSAL_PIM_DSPPUR_FK". The conflict occurred in database "pims", table "dbo.PIMS_DISPOSITION_SALE", column 'DISPOSITION_SALE_ID'. |
Also, the "product" field does not seem to be cleared appropriately when the parent project is removed:
|
✅ No secrets were detected in the code. |
✅ No secrets were detected in the code. |
✅ No secrets were detected in the code. |
@devinleighsmith updated issue with project-product and fixed issue with FK. |
✅ No secrets were detected in the code. |
✅ No secrets were detected in the code. |