-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CPDNPQ-2317] change validation and do not destroy declarations #2131
Conversation
Review app deployed to https://npq-registration-review-2131-web.test.teacherservices.cloud/ |
185782b
to
fbf930c
Compare
%i[submitted voided ineligible].each do |declaration_state| | ||
context "with #{declaration_state} state" do | ||
context "when application already has declarations" do | ||
%i[voided ineligible awaiting_clawback clawed_back].each do |declaration_state| |
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.
Could we use Applications::RevertToPending::REVERTABLE_DECLARATION_STATES
here?
end | ||
end | ||
end | ||
|
||
%i[eligible payable paid awaiting_clawback clawed_back].each do |declaration_state| | ||
context "with #{declaration_state} state" do | ||
Declaration.states.keys.excluding(%w[voided ineligible awaiting_clawback clawed_back]).each do |declaration_state| |
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.
Could we use Applications::RevertToPending::REVERTABLE_DECLARATION_STATES
here too?
config/locales/en.yml
Outdated
@@ -264,7 +264,7 @@ en: | |||
lead_provider_approval_status: | |||
inclusion: Current lead provider approval status is not Accepted | |||
base: | |||
pending_unremoveable_declarations: There are already declarations for this participant on this course, please ask provider to void and/or clawback any declarations they have made before attempting to reset the application. | |||
pending_unremoveable_declarations: There are already declarations for this participant on this course, please ask the provider to void and/or clawback any declarations they have made before attempting to reset the application. |
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.
pending_unremoveable_declarations: There are already declarations for this participant on this course, please ask the provider to void and/or clawback any declarations they have made before attempting to reset the application. | |
pending_unremoveable_declarations: There are already declarations for this participant on this course, please ask the provider to void any declarations they have made before attempting to revert the application. |
From a provider's perspective, they can only void a declaration. Whether it goes to void
or through the clawback states is determined by Declarations::Void#void
checking whether money has changed hands, but the provider has no control over that.
Also tiny change for consistent verb revert
(could also change i18n key)
ade5ffe
to
31b5126
Compare
|
Context
Ticket: https://dfedigital.atlassian.net/browse/CPDNPQ-2317
When there are voided statement items and a voided declaration, it is currently not possible to revert an application to pending.
It raises an error in the admin console:
Changes proposed in this pull request
voided
,ineligible
,awaiting_clawback
,clawed_back
) can be reverted to pendingsubmitted
,eligible
,payable
orpaid
- an error will be shown.submitted
were allowed - but this has been removed - the provider will have to void those declarations first if they want the application reverted to pending.The error you get if the state of the declarations are not revertable is:
![Screenshot 2025-01-22 at 13 16 32](https://private-user-images.githubusercontent.com/55911/405634241-2985b314-6b42-4b32-93f7-20512d2ca932.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNzcwNzUsIm5iZiI6MTczOTM3Njc3NSwicGF0aCI6Ii81NTkxMS80MDU2MzQyNDEtMjk4NWIzMTQtNmI0Mi00YjMyLTkzZjctMjA1MTJkMmNhOTMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE2MTI1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0Y2JjNGY5YWY3MmUxNjE4YWI5NGMzMDg1NDdkY2UzZTNhNTU4ZDIyYWU0ZjUxZjk1YWQwZDkzYWIxNWUyNWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.E0uAeSwOTHYO5QjcH__wpuvWDfVuf2RqXfmxgyTSros)