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

feat(salesforce): Added customers webhooks #2783

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

brunomiguelpinto
Copy link
Contributor

@brunomiguelpinto brunomiguelpinto commented Nov 6, 2024

Context

This PR adds to the Customers::CreateService and Customers::UpdateService the SendWebhookJob with appropriate events ('customer.created' and 'customer.updated'). This ensures that both customer creation and updates send the needed webhooks

Description

Customers::CreateService
Added SendWebhookJob.perform_later('customer.created', customer) to the end of the create_from_api and create methods, so a webhook is sent each time a new customer is created.

Customers::UpdateService
Added SendWebhookJob.perform_later('customer.updated', customer) to the end of the call method, ensuring that updates to customer send a webhook event.

@brunomiguelpinto brunomiguelpinto self-assigned this Nov 6, 2024
@brunomiguelpinto brunomiguelpinto added 🔔 Webhook Related to Webhooks Customer Customer management labels Nov 6, 2024
@brunomiguelpinto brunomiguelpinto marked this pull request as ready for review November 6, 2024 13:53
@brunomiguelpinto brunomiguelpinto changed the title feat: added customers webhooks feat(salesforce): Added customers webhooks Nov 6, 2024
app/services/customers/create_service.rb Outdated Show resolved Hide resolved
app/services/customers/create_service.rb Outdated Show resolved Hide resolved
@brunomiguelpinto brunomiguelpinto merged commit e284ebc into main Nov 6, 2024
6 checks passed
@brunomiguelpinto brunomiguelpinto deleted the feat-customer-webhooks branch November 6, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔔 Webhook Related to Webhooks Customer Customer management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants