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

Define Schema for Plans #119

Open
bofstein opened this issue Oct 9, 2024 · 3 comments · Fixed by #162
Open

Define Schema for Plans #119

bofstein opened this issue Oct 9, 2024 · 3 comments · Fixed by #162
Assignees

Comments

@bofstein
Copy link
Collaborator

bofstein commented Oct 9, 2024

Define structure - what data we need to gather, what queries we need to have for resolvers

@briri briri self-assigned this Dec 10, 2024
@briri
Copy link
Collaborator

briri commented Dec 16, 2024

Table schema

All tables below also have a createdOn, createdBy, modifiedOn, and modifiedBy fields.

ResearchDomains

  • id - Integer
  • uri - String/URI
  • name - String
  • description - String/Text

OutputTypes

  • id - Integer
  • uri - String/URI
  • name - String
  • description - String/Text

Projects

  • id - Integer
  • isTestProject - Boolean
  • title - String
  • abstractText - String/Text
  • researchDomainId - String/URL
  • startDate - String (YYYY-MM-DD format)
  • endDate - String (YYYY-MM-DD format)

ProjectContributor

  • id - Integer
  • projectId - Integer
  • givenName - String
  • surName - String
  • orcid - String
  • email - String/Email
  • affiliationId - String/URL

ProjectContributorRoles

  • id - Integer
  • projectContributorId - Integer
  • contributorRoleId - Integer

ProjectFunders

  • id - Integer
  • projectId - Integer
  • funderId - String/URI (Fkey to affiliations table)
  • status - String (PLANNED, DENIED, GRANTED)
  • opportunityId - String
  • grantId - String
  • funderProjectNumber - String

ProjectOutputs

  • id - Integer
  • outputTypeId - Integer
  • otherOutputTypeName - String (only used if 'OTHER' was selected)
  • title - String
  • description - String/Text
  • metadataStandards - JSON array of URIs
  • repositories - JSON array of URIs
  • licenseId - String/URI
  • accessType - String (RESTRICTED, UNRESTRICTED, OTHER)
  • anticipatedReleaseDate - String (YYYY-MM-DD format)
  • mayContainSensitiveData - Boolean
  • mayContainPII - Boolean

Plans

  • id - Integer
  • visibility - String (PUBLIC, PRIVATE, ORGANIZATIONAL)
  • dmpId - String/DOI
  • lastUpdatedOn - String (YYYY-MM-DD HH:MM:SS format) last time anything about the Plan was changed
  • lastUpdatedBy - Integer
  • status - (DRAFT, COMPLETE, PUBLISHED) controlled by app logic
  • uploadedNarrativeDoc - String/URI
  • publishedOn - String (YYYY-MM-DD HH:MM:SS format)
  • publishedBy - Integer
  • isComplete - Boolean
  • completedOn - String (YYYY-MM-DD HH:MM:SS format)
  • completedBy - Integer

PlanContributors

  • id - Integer
  • projectContributorId - Integer
  • contributorRoleId - Integer

PlanCollaborators

  • id - Integer
  • planId - Integer
  • email - String/Email
  • userId - Integer
  • accessLevel - (COMMENTER, EDITOR, ADMIN)
  • invitedBy - Integer
  • invitedOn - String (YYYY-MM-DD HH:MM:SS format)

Creation of this record should send notification/invitations

PlanFunders

  • id - Integer
  • projectFunderId - Integer

PlanFeedback

  • id - Integer
  • planId - Integer
  • requestedOn - String (YYYY-MM-DD HH:MM:SS format)
  • requestedBy - Integer
  • summary - String/Text
  • completedOn - String (YYYY-MM-DD HH:MM:SS format)
  • completedBy - Integer

Creation of this record should trigger notifications to admins. Completion should send notification to requestor

PlanAnswers

  • id - Integer
  • planId - Integer
  • sectionId - Integer
  • questionId - Integer
  • answerText - String/Text

PlanAnswerComments

  • id - Integer
  • answerId - Integer
  • commentText - String/Text

Creation of this record should trigger notification to owner.

PlanFeedbackComment

  • id - Integer
  • plandFeedbackId - Integer
  • answerId - Integer
  • commentText - String/Text

MetadataStandards, Repositories and Licenses will be stored in a DynamoDB table and references via their URIs

@briri
Copy link
Collaborator

briri commented Dec 16, 2024

Queries
Lookup tables

  • getContributorRoles
  • getProjectOutputTypes
  • getResearchDomains

Displaying section/question/guidance

  • getTemplateSections(templateId: number)
  • getSection(sectionId: number)
  • getQuestionsForSection(sectionId: number)

Projects

  • getProject(projectId: number)
  • searchForPerson(term: string)
  • getProjectContributors(projectId: number)
  • getProjectContributor(projectContributorId: number)
  • getProjectFunders(projectId: number)
  • getProjectFunder(projectFunderId: number)
  • getProjectOutputs(projectId: number)
  • getProjectOutput(projectOutputId: number)

Plans

  • findPlan(projectId: number, term: string)
  • getPlansForProject(projectId: number)
  • getPlan(planId: number)
  • getPlanContributors(planId: number)
  • getPlanCollaborators(planId: number)
  • getPlanFunders(planId: number)
  • getAnswerForQuestion(questionId: number, planId: number)
  • getCommentsForAnswer(answerId: number)
  • getFeedbackForAnswer(answerId: number)

Mutations
Projects

  • createProject(title: string, versionedTemplateId: number, funderId: string, isTestProject: boolean)
  • funderAwardSearch(projectId: number, funderId: string, projectId: string, projectName: string, principalInvestigator: string, awardYear: string)
  • selectFunderAward(projectId: number, funderId: string, projectName: string, projectAbstract: string, projectStartDate: string, projectEndDate: string, grantId: string, opportunityNumber: string, projectContributors: array)
  • editProject(projectId: number, title: string, abstractText: string, projectId: string, projectStartDate: string, projectEndDate: string, researchDomainId: string, isTestProject: boolean)
  • removeProject(projectId: number)
  • addProjectFunder(projectId: number, funderId: string, funderOtherName: string, projectNumber: string opportunityNumber: string, status: string, grantId: string)
  • editProjectFunder(projectFunderId: number, projectNumber: string opportunityNumber: string, status: string, grantId: string)
  • removeProjectFunder(projectFunderId: number)
  • addProjectContributor(projectId: number, givenName: string, surName: string, email: string, orcid: string, roles: [string])
  • editProjectContributor(projecContributorId: number, givenName: string, surName: string, email: string, orcid: string, roles: [string])
  • removeProjectContributor(projecContributorId: number)

Plans

  • uploadPlan(projectId: number, fileName: string, file: ???)
  • createPlan(projectId: number, copyFromPlanId: number)
  • addPlanContributor(planId: number, projectContributorId: number, role: string)
  • removePlanContributor(planId: number, planContributorId: number)
  • addPlanCollaborator(planId: number, email: string, accessType: string)
  • removePlanCollaborator(planId: number, PlanCollaboratorId: number)
  • addPlanFunder(planId: number, projectFunderId: id)
  • addPlanOutput(planId: number, projectOutput: id)
  • removePlanOutput(planId: number, planOutput: id)
  • answerPlanQuestion(planId: number, questionId: number: answer: string)
  • commentOnPlanAnswer(answerId: number, comment: string)
  • setPlanCompletion(planId: number, complete: boolean)
  • setPlanVisibility(planId: number, visibility: string)
  • publishPlan(planId: number)
  • requestPlanFeedback(planId: number)
  • addPlanFeedbackComment(planFeedbackId: number, answerId: number, comment: string)
  • submitPlanFeedback(planFeedbackId: number, summary: string)
  • downloadPlan(planId: number, format: string) format types: (HTML, TEXT, JSON, DOCX, PDF)

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

Successfully merging a pull request may close this issue.

2 participants