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

FFS-2466: Infer supported jobs from within Pinwheel subclass #474

Open
wants to merge 2 commits into
base: wmg/2466-sti
Choose a base branch
from

Conversation

allthesignals
Copy link
Contributor

@allthesignals allthesignals commented Feb 27, 2025

Ticket

Addresses FFS-2466.

Changes

This makes the model infer the pinwheel accounts supported jobs through the provided pinwheel_account_id.

Context for reviewers

We need to do this to make it easier to support multi-provider. The reason for this is that we want to create a payrol_acount earlier in the process, not when the webhook is received. In order to do that, we needed a tidier way to create payroll account objects.

Before, we would look up the support jobs in the events controller and provide that to the model.

Now, we do that in an after_create hook. This means we can create payroll acounts anywhere without also needing to supply the supported jobs.

Acceptance testing

  • No acceptance testing needed
    • This change will not affect the user experience (bugfix, dependency updates, etc.)
  • Acceptance testing prior to merge
    • This change can be verified visually via screenshots attached below or by sending a link to a local development environment to the acceptance tester
    • Acceptance testing should be done by design for visual changes, product for behavior/logic changes, or both for changes that impact both.
  • Acceptance testing after merge
    • This change is hard to test locally, so we'll test it in the demo environment (deployed automatically after merge.)
    • Make sure to notify the team once this PR is merged so we don't inadvertently deploy the unaccepted change to production. (e.g. :alert: Deploy block! @ffs-eng I just merged PR [#123] and will be doing acceptance testing in demo - please don't deploy until I'm finished!)

@allthesignals allthesignals changed the base branch from main to wmg/2466-sti February 27, 2025 19:07
@allthesignals allthesignals marked this pull request as ready for review February 27, 2025 19:30

def lookup_supported_jobs
platform_id = pinwheel.fetch_account(account_id: pinwheel_account_id)["data"]["platform_id"]
supported_jobs = pinwheel.fetch_platform(platform_id: platform_id)["data"]["supported_jobs"]
Copy link
Contributor

Choose a reason for hiding this comment

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

(Hmm thinks to self. Maybe we should save platform_id in the table itself.)

@@ -54,4 +56,19 @@ def event_columns_for(job)

[ error_column, sync_column ]
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to make these methods private

@tdooner
Copy link
Contributor

tdooner commented Feb 27, 2025

FWIW, I don't love making API calls to 3rd party services on model creation. Probably not the best practice because it might make testing harder. But it seems ok for now, and we can refactor it later if it becomes annoying.

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.

2 participants