Giveth / impact-graph

MIT License
49 stars 18 forks source link

conditional checks on diff parameters in adminJS for deverification #1848

Open divine-comedian opened 1 month ago

divine-comedian commented 1 month ago

need to do some conditional checking and error handling in adminJS

make sure in the admin that when you change a status that is dependent on the other

I made a table here that hopefully can carefully explain the impact of each action in the admin and what the expected outcome should be on the projects status for a variety of conditions

there are 4 columns:

  1. the current status of the 3 relevant values: givbacks form, verified, isGIVbacksEligible
  2. the action being applied
  3. the expected status of the 3 values
  4. notes (error conditions etc..)

you can also view the sheet in google where it might look a bit easier to follow https://docs.google.com/spreadsheets/d/1RTvg0YaMjEyZOgUpW1i0YQPnnlEPgHZM7ZDXq5e39ro/edit?usp=sharing

current status action expected status notes
givbacks form verified isGIVbacksEligible givbacks form verified isGIVbacksEligible
not started FALSE FALSE verify (vouch) not started TRUE FALSE
incomplete FALSE FALSE verify (vouch) incomplete TRUE FALSE
submitted FALSE FALSE verify (vouch) submitted TRUE FALSE
approved TRUE TRUE verify (vouch) approved TRUE TRUE (no status change)
declined FALSE FALSE verify (vouch) declined TRUE FALSE
not started TRUE FALSE reject (vouch) not started FALSE FALSE
incomplete TRUE FALSE reject (vouch) incomplete FALSE FALSE
submitted TRUE FALSE reject (vouch) submitted FALSE FALSE
approved TRUE TRUE reject (vouch) throws error -- -- (cannot revoke Vouched badge of GIVbacks eligible project)
declined TRUE FALSE reject (vouch) declined FALSE FALSE
not started TRUE FALSE approve application form (givbacks eligible) throws error TRUE -- (cannot approve unsubmitted or incomplete application)
not started FALSE FALSE approve application form (givbacks eligible) throws error FALSE -- (cannot approve unsubmitted or incomplete application)
incomplete TRUE FALSE approve application form (givbacks eligible) throws error TRUE -- (cannot approve unsubmitted or incomplete application)
incomplete FALSE FALSE approve application form (givbacks eligible) throws error FALSE -- (cannot approve unsubmitted or incomplete application)
submitted TRUE FALSE approve application form (givbacks eligible) approved TRUE TRUE
submitted FALSE FALSE approve application form (givbacks eligible) approved TRUE TRUE
approved TRUE TRUE approve application form (givbacks eligible) approved TRUE TRUE (no status change)
approved FALSE TRUE approve application form (givbacks eligible) approved TRUE TRUE (should be impossible for verified = false while GIVbacks eligible = true
declined TRUE FALSE approve application form (givbacks eligible) approved TRUE TRUE
declined FALSE FALSE approve application form (givbacks eligible) approved TRUE TRUE
not started TRUE FALSE reject application form (givbacks eligible) throws error TRUE -- (cannot reject unsubmitted or incomplete application)
not started FALSE FALSE reject application form (givbacks eligible) throws error FALSE -- (cannot reject unsubmitted or incomplete application)
incomplete TRUE FALSE reject application form (givbacks eligible) throws error TRUE -- (cannot reject unsubmitted or incomplete application)
incomplete FALSE FALSE reject application form (givbacks eligible) throws error FALSE -- (cannot reject unsubmitted or incomplete application)
submitted TRUE FALSE reject application form (givbacks eligible) declined TRUE FALSE
submitted FALSE FALSE reject application form (givbacks eligible) declined FALSE FALSE
approved TRUE TRUE reject application form (givbacks eligible) declined TRUE FALSE
approved FALSE TRUE reject application form (givbacks eligible) declined FALSE FALSE
declined TRUE FALSE reject application form (givbacks eligible) declined TRUE FALSE (no status change)
declined FALSE FALSE reject application form (givbacks eligible) declined FALSE FALSE (no status change)
not started TRUE FALSE revoke badge (givbacks eligible) not started TRUE FALSE
incomplete TRUE FALSE revoke badge (givbacks eligible) incomplete TRUE FALSE
submitted TRUE FALSE revoke badge (givbacks eligible) submitted FALSE FALSE
approved TRUE TRUE revoke badge (givbacks eligible) throws error TRUE FALSE
declined TRUE FALSE revoke badge (givbacks eligible) declined FALSE FALSE (no status change)

divine-comedian commented 2 weeks ago

@MohammadPCh what is the update on this? Is it being worked on through #1866 ?