Skip to content

[Consent] Validate DateWithdrawn later than DateGiven #6102

@zaliqarosli

Description

@zaliqarosli

Describe the bug
This is not necessarily a bug, but a request to strengthen the validation of the candidate_consent_rel data. Currently, a user is able to withdraw consent with a date that is earlier than the date of given consent. Theoretically, the date of withdrawal should always be later than the date of given consent.

To Reproduce

  1. Go to candidate_parameters module
  2. Click on Consent tab
  3. Update a consent to 'Yes', provide today's date, and Save. Then, withdraw the consent by changing the response to 'No', and provide yesterday's date as the Date of Withdrawal. Save changes.
  4. You will see that no error is thrown.

What did you expect to happen?
The front-end AND back-end should validate that if consent is being withdrawn, then the Date of Withdrawal being submitted is later than the Date of Consent currently in the database.

Lack of validation first reported here #6044

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: BugPR or issue that aims to report or fix a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions