Skip to content
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

[API] Application History: extend endpoint to record state change info #226

Closed
6 tasks
kcullion opened this issue Sep 30, 2021 · 4 comments
Closed
6 tasks

Comments

@kcullion
Copy link

kcullion commented Sep 30, 2021

Goal

Extend the GET application by ID endpoint: https://dac.qa.argo.cancercollaboratory.org/api/api-docs/#/Application/get_applications__id_to show the new values in the updates section with record the mini-history of the fields in mockup
image

Related UI tickets
icgc-argo/dac-ui#470
icgc-argo/dac-ui#471

Expected Outcomes

Need to record actions for each STATE CHANGE:

  • Record WHEN the action was done (Date of Status Change)

  • Record WHO did the action based on role + id (Action Performed By)

  • Calculate the days from last state change (to be used in the tsv report ticket:[API] Application History: endpoint to build tsv report #227 )
    New calculated field Application Type based on isRenewal value
    For application renewal we need a new migration on the CREATE endpoint

  • Set isRenewal = false (or "New")

  • Set ableToRenew = false

  • Migration for existing applications to support existing states. Note: about the migration for the updates section: we will only be able to add the current state as the first update event

From meeting with Bashar Oct 14

  • To simplify we will just sort by date of status/event change.
  • Let's do it the cheap way for now - not a new collection, but just a new response type that grabs all updates from the applications and then does the sort

For testing

  • This will only work for new applications going forward. Ignore the old apps
@kcullion kcullion changed the title [API] Application HIstory [API] Application History: extend endpoint to record state change info Sep 30, 2021
@akachru-github akachru-github modified the milestones: DACO Application - Sprint 5, DACO Sprint 6 Oct 21, 2021
@anncatton
Copy link
Contributor

Talked to @kcullion , will add a migration to clear existing apps' updates array, as there seems little value in trying to add the new update format with their current state. Testing will be done with all new applications. Will verify with @blabadi in case there is some issue to this approach!

@akachru-github akachru-github removed this from the DACO Sprint 6 - Kannbanne milestone Oct 25, 2021
@anncatton
Copy link
Contributor

anncatton commented Oct 25, 2021

Adds event tracking when app is:

  • created
  • submitted
  • revisions requested
  • approved
  • closed
  • rejected

Events for paused, attested and expired will be added when that functionality is implemented

@kcullion
Copy link
Author

kcullion commented Nov 4, 2021

@anncatton this works great! Well done! With a few new applications I tested:

DACO-252, I see the correct status changes in the modal:

  1. When I created an application
  2. When I submitted the application
  3. When admin request revisions
  4. When I fixed the application and resubmitted for review
  5. When admin approved the application
  6. When I close the application the next day, the modal data was correct

DACO-255 -
I submitted and requested revisions twice and then rejected - app history was correct. Did this across multiple days and the date was correct.

DACO-256
I tried closing before submitting - this reflects in modal correctly.

@kcullion
Copy link
Author

working as expected in staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants