US-EPA-CAMD / easey-ui

Project Management repo for EPA Clean Air Markets Division (CAMD) Business Suite of applications
MIT License
0 stars 0 forks source link

Updates for already submitted QA Cert Events #6061

Open esaber76 opened 9 months ago

esaber76 commented 9 months ago

Users have the ability to remove already submitted QA Certification Events from their workspace. This could cause invalid evaluation results. Users are also able to modify all of the fields for already submitted events. This should not be allowed. Supplemental data that is used by the check engine exists based on QA Certification Events.

yonatan-dp commented 5 months ago

Hi @esaber76, how does one definitively identify a QA Certification Event as already being submitted? I see that the certification events table has a number of status codes (that we can potentially use)

Evaluation Status Codes

Submission Availability Codes (also referenced as Pending Status Code in the table)

Submission ID Column

esaber76 commented 5 months ago

@yonatan-dp - use the Submission Availability Code = Updated on Host. When an event exists with that status, users should not be able to delete the event. Also, the only fields that should be editable are Completion of Tests Date and Completion of Tests Hour.

yonatan-dp commented 5 months ago

@esaber76, for the third bullet point in your requirements, which of the codes I included above identify a new QA Cert Event that has been saved but not submitted. Will that be the 'Did Not Submit' code?

esaber76 commented 5 months ago

@yonatan-dp - are you using CAMDECMPSWKS.QA_CERT_EVENT.SUBMISSION_AVAILABILITY_CD? Let me actually check what 1.0 is doing. I almost think we may need to use submission_id in this.

esaber76 commented 5 months ago

For 1 and 2, can you use CAMDECMPSWKS.QA_CERT_EVENT.SUBMISSION_ID is not null? For 3, can you use CAMDECMPSWKS.QA_CERT_EVENT.SUBMISSION_ID is null? When a user adds a new event and saves, a row is added to CAMDECMPSWKS.QA_CERT_EVENT and there wouldn't obviously be a SUBMISSION_ID with it. The user should still be able to delete the event in this case though (null submission_id).

yonatan-dp commented 5 months ago

@esaber76 , for 1 and 2, based on your initial response to my first question, I am already using "Submission Availability Code = Updated on Host". Do you no longer that to be used for 1 and 2? For 3, I can implement based on a check if SUBMISSION_ID is null or not. However, it will be creating brittle logic. The meaning of submission_id being null is likely to change and will break this code. A status check will be a better solution.

esaber76 commented 5 months ago

@yonatan-dp - I'm going to discuss this with Dwayne this afternoon and will let you know. The issue with using UPDATED is that if a QA Cert Event is originally submitted without the test completion date as an example (which is common) and a user later adds this information to the record or corrects this information, the status will change to REQUIRE so I don't think always using UPDATED would work.

yonatan-dp commented 5 months ago

@esaber76 Okay. We can also use a combination of statuses.

djw4erg commented 5 months ago

QCE and TEE ECMPS 1.0 Update ECMPS Status Details

QA Cert Event (QAE)

djw4erg commented 5 months ago

Determining whether a QA Cert Event has already been submitted.

A submitted QA_CERT_EVENT should have the same QA_CERT_EVENT_ID in CAMDECMPS that it has in CAMDECMPSWKS. So to check whether a QA_CERT_EVENT in CAMDECMPSWKS has been submitted, check to see if its QA_CERT_EVENT_ID exists in the CAMDECMPS QA_CERT_EVENT table.

esaber76 commented 5 months ago

Acceptance Test 1:

Already submitted QA Cert Events can not be deleted from the workspace.

I.e. - The qa_cert_event_id exists in both the camdecmpswks.qa_cert_event and camdecmps.qa_cert_event tables.

Acceptance Test 2:

The only editable fields for already submitted QA Cert Events are Completion of Tests Date and Completion of Tests Hour.

I.e. - The qa_cert_event_id exists in both the camdecmpswks.qa_cert_event and camdecmps.qa_cert_event tables.

Acceptance Test 3:

A QA Cert Event that has been saved, but not submitted:

- The event can be deleted from the workspace.

- The only editable fields are Completion of Tests Date and Completion of Tests Hour.

I.e. - The qa_cert_event_id exists only in the camdecmpswks.qa_cert_event table. It is NOT in camdecmps.qa_cert_event.

lgiannini1 commented 4 months ago

Was able to verify that submitted QA Cert Events cannot be removed and the only editable fields for submitted QA Cert Events are Test Completion Date/ Hour, but I receive the attached error when clicking the "Add" button to add a new QA Cert Event.

Image

yonatan-dp commented 4 months ago

@lgiannini1 Please retest, fix deployed to Dev.

lgiannini1 commented 4 months ago

Verified on dev.

ntknguyen commented 4 months ago
  1. Verified that there is no "Remove" button for previously submitted QA Cert Events
  2. Verified that the only editable fields are the Test Completion Date and Hour fields.
  3. Verified that the newly created QA Cert Event can be removed from the workspace.
  4. Verified there is no "Remove" button for the event after submission