@@ -16,7 +16,7 @@ import {
1616 QuickbooksFindCustomersInput ,
1717 SalesforceClosedWonResource ,
1818} from "@/utils/types" ;
19- import { isProduction } from "@/utils/utils" ;
19+ import { isProduction , sanitizeDisplayName } from "@/utils/utils" ;
2020import { Job } from "bull" ;
2121
2222const logger = createLogger ( "Intuit Processor" ) ;
@@ -154,7 +154,7 @@ const processCustomerHierarchy = async (
154154 const parentProducerId = isProduction ? parent ?. AVSFQB__Quickbooks_Id__c : parent . QBO_Account_ID_Staging__c ;
155155
156156 const parentCustomer = await processCustomer ( service , parentProducerId , parent . Id , {
157- DisplayName : parent . Name ,
157+ DisplayName : sanitizeDisplayName ( parent . Name ) ,
158158 CompanyName : parent . Name ,
159159 BillAddr : {
160160 City : parent . BillingCity ,
@@ -178,7 +178,7 @@ const processCustomerHierarchy = async (
178178 job . log ( `Successfully created parent customer: ${ parentCustomer . DisplayName } ` ) ;
179179
180180 await processCustomer ( service , accountProducerId , account . Id , {
181- DisplayName : account . Name ,
181+ DisplayName : sanitizeDisplayName ( account . Name ) ,
182182 CompanyName : account . Name ,
183183 PrimaryEmailAddr : {
184184 Address : contact . Email ,
@@ -202,7 +202,7 @@ const processCustomerHierarchy = async (
202202 logger . info ( `Account Info: ${ JSON . stringify ( account , null , 2 ) } ` ) ;
203203
204204 const customer = await processCustomer ( service , accountProducerId , account . Id , {
205- DisplayName : account . Name ,
205+ DisplayName : sanitizeDisplayName ( account . Name ) ,
206206 CompanyName : account . Name ,
207207 PrimaryEmailAddr : {
208208 Address : contact . Email ,
0 commit comments