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

Design architecture for tracking and notifying award winners #840

Open
8 tasks
lmkw opened this issue Jul 8, 2021 · 1 comment
Open
8 tasks

Design architecture for tracking and notifying award winners #840

lmkw opened this issue Jul 8, 2021 · 1 comment

Comments

@lmkw
Copy link
Contributor

lmkw commented Jul 8, 2021

Based on requirements gathered in #824

  • Consult with Yulia about StudyBudget comparisons
  • Add column to submissions for award amount (optional, might be salary percentage, or hours of work awarded)
  • Add column to grants for maximum awarded amount. (Should this be required?)
  • Error handling for calculations between the two columns if not required.
  • Awardable validations (must be reviewed and submitted before awarded)
  • Add a new column on the submission index page. The heading has the maximum amount awarded and the rows have amount awarded. Potentially have all this handled on a new tab for awards.
  • Link to open a modal to add amount awarded to a submission.
  • Pipe in title of submission, funding mechanism/"EDW Pilot Program", PI name (personalized)

Notifications will be handled separately.

@mattbaumann1
Copy link
Collaborator

MODELS
outcomes
grant_submission_outcomes
submission_id
grant_id
amount
ENUM [funded, not_funded]
notified_at

  updated_at
  created_at
  created_by

Add paper trail for outcomes

Relationships
outcome belongs to grant
outcome belongs to submission

grant has many outcomes
grant has many submission_outcomes
through outcomes foreign key is submission id

submission has one outcome

dependent destroy with both grant and submission

Update soft delete method for grant to account for all this.

Permissions
permission for create and edit are on grant editor through grant on outcome

Requirements
optional true on submission
every submission does not need an outcome

Add these attributes to grant on overview tab
optional (all)
maximum total amount for grant
maximum outcome per submission (1)
maximum number of funded submissions per grant
outcome period start
outcome period end

Validations on outcome
validate amount on outcome if max or total amount are set on grant
validate that it is not greater than grant.remaining_amount

validate the grant is published
validate the submission is submitted
validate the submission is reviewed

validate created by grant_editor permission
validate grant_viewer for show

Validations on Grant
max outcome per submission shouldn't be greater than total amount

create remaining_amount method?

New Outcomes Tab
where an admin assigns outcome amounts to submissions

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

2 participants