Skip to content

Add verification before enabling donations on project - #514

Merged
joshsmith merged 1 commit into
developfrom
511-add-verification-status-to-connect-account
Dec 1, 2016
Merged

Add verification before enabling donations on project#514
joshsmith merged 1 commit into
developfrom
511-add-verification-status-to-connect-account

Conversation

@begedin

@begedin begedin commented Nov 30, 2016

Copy link
Copy Markdown
Contributor

What's in this PR?

Handles the API part of verifying that a project can enable donations. Done by adding a Validator module which ensures all project fields and relationships have the correct values. Similar in how it was implemented in #513

References

Progress on: #511

@sbatson5 sbatson5 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good to me 👍

defmodule CodeCorps.StripeService.StripeConnectPlanService do
alias CodeCorps.Organization
alias CodeCorps.Project
alias CodeCorps.{Project, StripeConnectPlan}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also alias Repo here?

@invalid {:error, :project_not_ready}

defp do_validate(%Project{
donation_goals: [_h | _t],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to specify head and tail here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbatson5 no, this just validates that it's non-empty.

@invalid {:error, :project_not_ready}

defp do_validate(%Project{
donation_goals: [_h | _t],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbatson5 no, this just validates that it's non-empty.

@joshsmith
joshsmith force-pushed the 511-add-verification-status-to-connect-account branch from db2b11a to 616cdf9 Compare December 1, 2016 05:53
@joshsmith
joshsmith merged commit 532d4f2 into develop Dec 1, 2016
@joshsmith
joshsmith deleted the 511-add-verification-status-to-connect-account branch December 1, 2016 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants