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

Refactor: Update Forms to Campaigns migration #7532

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

kjohnson
Copy link
Member

@kjohnson kjohnson commented Sep 4, 2024

Resolves GIVE-1178

Description

This PR updates the migrate_forms_to_campaign_forms migration to remove use of business logic specific code (that is prone to change/refactor) in favor of moving the data directly (or directly as possible) from one database table/column to another.

Specifically, this avoids use of the FormSettings DTO and the Campaign model and repository (prone to changes), while continuing to leverage DonationStatus and CampaignStatus Enums (unlikely to change).

Additionally, this PR updates the migration to add support for "upgraded" forms. This includes a secondary process in the migration that adds upgraded forms to existing campaigns alongside the form resulting from the upgrade process.

The Campaign model has been updated with a form() method to get the "default" form. This is in addition to the forms() relationship method which returns a prepared query for campaign related donation forms.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Self Review of code and UX completed

@kjohnson kjohnson changed the base branch from develop to epic/campaigns September 4, 2024 17:37
@kjohnson kjohnson marked this pull request as ready for review September 4, 2024 20:04
@kjohnson kjohnson changed the title Refactor: Update Forms to Camapigns migration to be closer to the data layer Refactor: Update Forms to Campaigns migration to be closer to the data layer Sep 4, 2024
@glaubersilva glaubersilva self-requested a review September 5, 2024 16:27
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

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

@kjohnson Looks good to me! I just left a comment related to a minor change, but I'll approve it to advance things.

@kjohnson kjohnson changed the title Refactor: Update Forms to Campaigns migration to be closer to the data layer Refactor: Update Forms to Campaigns migration Sep 10, 2024
Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

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

@kjohnson I left a comment about the trash status, but I am not sure if my point should be a concern. So let me know your thoughts on it.

Copy link
Contributor

@glaubersilva glaubersilva left a comment

Choose a reason for hiding this comment

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

@kjohnson Thanks for the feedback and update. Great work!

Copy link
Contributor

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

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

Great work! This is well done and future-proof. 💪

@kjohnson kjohnson merged commit aa54987 into epic/campaigns Sep 12, 2024
20 checks passed
@kjohnson kjohnson deleted the refactor/campaigns-migration-1178 branch September 12, 2024 14:52
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 this pull request may close these issues.

a11y: Donation form required fields
3 participants