Allow AP phone number as alternative to AP email (#17)#100
Draft
gutobenn wants to merge 3 commits into
Draft
Conversation
Adds phone-number support to accounts-payable contacts across prospects, distributor customers, and active Fulfil customers. AP contact rows can satisfy the "AP contact required" rule with an email, a phone (E.164), or both. When an active customer has no AP email and AR automation fires, the customer-facing template is swapped for a new internal "call this customer" template routed to accountsreceivable@.
- Restore loose email detection in FulfilService::parseContactMechanism so legacy contact_mechanism rows with empty/missing `type` still parse (phone routing stays strict). - Log AR template reroutes to the internal phone-followup template so ops can audit why a customer-facing send was swapped. - Add unit tests for FulfilService AP/phone parsing, ArEmailService reroute behavior + logging, CompanyFields after-validation and E.164 normalization, and PhoneHelper.
# Conflicts: # app/Http/Controllers/ProspectController.php # resources/js/Pages/Prospects/Show.tsx # tests/Unit/Services/FulfilServiceTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this close?
Closes #17
Write a short description of code change.
Adds phone-number support to accounts-payable contacts across prospects, distributor customers, and active Fulfil customers. AP rows now satisfy the "AP contact required" rule with an email, a phone (stored as E.164 via
propaganistas/laravel-phone), or both — the legacy{name, value}shape (email or AP Portal URL) continues to work.FulfilServicereads and writes phone-typedparty.contact_mechanismrows alongside email, deduping by contact name on read. When AR automation fires for a customer that has no AP email but does have a phone, it swaps the customer-facing template for a new internalap_phone_followup_requiredtemplate routed toaccountsreceivable@universalyums.comso the AR team can call instead.How should these changes be tested?
{name, value: email}) still render and save unchanged.Steps taken before assigning the PR.