Open ekhoffman opened 5 months ago
@amyewang based on the implementation plan, is it possible for initial work to be done for this issue, but then to actually run the migration closer to when we are launching the new feature? ideally we want this migration to be able to be run close to the launch so it migrates as much recent data as possible.
@ClaireValdivia the second bullet point addresses this consistency issue - once the migration is run, we'll have the endpoint update the grant followers table as well; both of these changes should be deployed together. Once the feature is fully rolled out we can clean up all the team status stuff.
Full User Story
As an organization, we would like to foster more collaboration between our users to allow for the sharing of knowledge and resources to empower them to more efficiently and effectively apply for the grants discovered on our platform.
As a grantseeker, I want to be able to easily share grants I’ve discovered with my team.
As a grantseeker, I want to be able to easily find collaborators who may be able to help me when preparing and applying for grants.
As a grantseeker, I want to be able to quickly see what grants my team members are interested in.
As an admin, I want to be able to easily surface and resolve issues and blockers my team is running into.
Why is this issue important?
As we make the move from 'Status' to 'Mark as Interested', we want to ensure that we don't lose any of the work our users have put in to record status so far. Additionally, if we can kickstart usage of this feature with previously entered information, we may be able to boost adoption.
Action Plan
Acceptance Criteria
Currently a status is set for an entire team, moving forward 'Following' will apply to an individual user.
None of this data migration should trigger any notifications
Implementation Details
grant_followers
table for each row in thegrants_interested
table where thegrants_interested.interested_code_id
references a row in theinterested_codes
table whereinterested_codes.status_code = 'Interested'
.grant_id, user_id, created_at
values (i.e. as they would be inserted intogrant_followers
), while excluding records where thegrant_id
anduser_id
are already represented in thegrant_followers
table:INSERT INTO ... SELECT ...
syntax. See this post for more details and examples.PUT /:grantId/interested/:agencyId
request handler inpackages/server/src/routes/grants.js
so that thegrant_followers
table is kept up-to-date even after the Knex migration (detailed above) has been executed.db.markGrantAsInterested()
, this endpoint handler should implement the following new functionality as a side-effect of the endpoint:interestedCode
provided in the request body is an identifier for a row in theinterested_codes
table that has `status_code = 'Interested'.interestedCode
is associated withstatus_code = 'Interested'
, then call thefollowGrant()
function exported bypackages/server/src/lib/grantsCollaboration
so that the user is also a follower.interestedCode
is not associated withstatus_code = 'Interested'
, then call theunfollowGrant()
function exported bypackages/server/src/lib/grantsCollaboration
so that the user is no longer a follower.