Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Add status attribute to statistics for review v. published #76

Open
kjacobsen16 opened this issue Oct 2, 2020 · 6 comments
Open

Add status attribute to statistics for review v. published #76

kjacobsen16 opened this issue Oct 2, 2020 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@kjacobsen16
Copy link
Contributor

Think about: do we just want simple ready v. not ready for production? Or use the statuses we already have for the regression regions?

If just ready v. not ready for production, would checking for citation be enough?

@kjacobsen16
Copy link
Contributor Author

@USGSPMM3 are we only expecting to need review v. published for gage statistics and characteristics (I'm thinking essentially a true/false)? Or will we need more, like in NSS, where there's Review, Disabled, NSS Approved, SS Approved, etc.?

I think I'll also work in a step that checks for a citation and marks it as in review if there is none.

@USGSPMM3
Copy link
Collaborator

@kjacobsen16
I think we want 3:
Review, Published, Superseded

I am going to send an email to Ryan and cc you.

@kjacobsen16
Copy link
Contributor Author

This should be on each statistic and will use the Status table used for the NSS regression regions. We should also add the "DateStatusModified" table and associated trigger to keep that updated.

@kjacobsen16
Copy link
Contributor Author

@USGSPMM3 something we didn't clarify on the call - is this wanted for statistics and characteristics? Or just statistics? Once we have the process nailed down for statistics, adding it to the characteristics should be trivial.

@kjacobsen16
Copy link
Contributor Author

kjacobsen16 commented Apr 20, 2021

Can we query (internally) by citation, status, and variable type so we can get all stats for a reference that are for peak flow and are set to InTest and then change the status? That would be the workflow we would have to use (I think)

☝️ from Pete, also added it to USGS-WiM/NSS#452, might be more of a client-side task?

@kjacobsen16
Copy link
Contributor Author

kjacobsen16 commented Jul 27, 2021

@amedenblik this is a good second issue for you! This requires DB work so will need a migration, which I will send more info on later. So the tasks at hand:

  • Add the "StatusID" attribute to the characteristics and statistics table, which is hooked up to the Status table used in the NSS regression regions. We can set everything to statusID = 4 right away (SS approved) and let Ryan change things as he needs to
    • We may need to move the Status table to the shared DB, which would need some NSS Service work
  • Send the status through when statistics or characteristics are queried or included in another call (e.g. the get station endpoint)
  • Make sure the edit endpoint also allows for updating this property
  • Update docs file for stats and chars
  • Duplicate GetApplicableStatus() function from NSSServices
    • In the NSSServices, this is used to determine which regression regions are sent in the response (e.g. review regions only get sent from the services on the test/staging services or when a user is logged in).
    • we will need to make sure that the applicable status are used as filters where the statistics or characteristics are queried as well

Edit: (KJ noticed before leaving) I also noted above that Pete was hoping to mark things automatically as review if there isn't a citation attached, and we should add a trigger for "date status modified", just like the regression regions have

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants