-
Notifications
You must be signed in to change notification settings - Fork 21
Description
we should add a table to the project entity called associatedCauses. this table will keep track of all the causes a given project is associated with, allowing project owners and potential donors to discover Causes this project is related to
this should be an array of objects containing some information related to all of the Causes a given projects is associated with. we should make sure this is available under projectBySlug, projectsByUserId and projectById queries
the associatedCauses object should have 3 subfields available in the query with information related to each cause.
- id
- title
- slug
in addition we should then update the mutations we use when a cause owner creates or edits a cause so that this field in the project entity is adjusted
- when a cause owner creates a cause with some projects included we should add that cause to the
associatedCausesfield for those projects - when a cause owner edits a cause and adds some new projects included we should add that cause to the
associatedCausesfield for those projects - when a cause owner edits a cause and REMOVES some projects included we should remove that cause to the
associatedCausesfield for those given projects
LASTLY - we should prepare a migration script that will update those fields so the associatedCauses fields for all projects are up to date with the current cause<>project relationships
to summarize
- create table for
associatedCauses - attach to specified existing queries
- update cause edit/create mutations to handle modifying this project data
- create and run migration script to update project data for
associatedCauses
AC
- can query
projectBySlugwithassociatedCausesobject that hasid,slug,titleproperties - can query
projectsByUserIdwithassociatedCausesobject that hasid,slug,titleproperties - can query
projectByIdwithassociatedCausesobject that hasid,slug,titleproperties - data returned in
associatedCausesis correct, based on which causes a project is associated with - creating a new cause correctly updates projects'
associatedCausesfield for given projects included in cause, the newly created cause shows up in this field - editing a cause and adding some projects correctly updates projects'
associatedCausesfield for given projects included in cause, the edited cause shows up in this field - editing a cause and REMOVING some projects correctly updates projects'
associatedCausesfield for given projects included in cause, the edited cause DOES NOT show up in this field
Metadata
Metadata
Assignees
Labels
Type
Projects
Status