fix: updated to include last name in call journaling
parent
9db7604b93
commit
cb840280fb
|
|
@ -89,7 +89,7 @@
|
||||||
"chats":[
|
"chats":[
|
||||||
{
|
{
|
||||||
"chatDone":{
|
"chatDone":{
|
||||||
"Text": "Conversation started via WhatsApp. Conversation link: chatLink"
|
"Text": "Conversación iniciada por WhatsApp. URL de la conversación de Ominhit: chatLink"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ const deleteCompany = async (req, res) => {
|
||||||
const callJournaling = async (req, res) => {
|
const callJournaling = async (req, res) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let { companyId, operation, crmPhone, crmAgent, crmCallDuration, crmFirstName, operationStatus } = req.body
|
let { companyId, operation, crmPhone, crmAgent, crmCallDuration, crmFirstName, crmLastName, operationStatus } = req.body
|
||||||
|
|
||||||
console.log(`[REQ.BODY - ${new Date()}] callJournaling: `, JSON.stringify(req.body, null, 6))
|
console.log(`[REQ.BODY - ${new Date()}] callJournaling: `, JSON.stringify(req.body, null, 6))
|
||||||
|
|
||||||
|
|
@ -229,10 +229,11 @@ const callJournaling = async (req, res) => {
|
||||||
crmCallDuration = "10"
|
crmCallDuration = "10"
|
||||||
|
|
||||||
|
|
||||||
|
console.log("=======================> crmLastName: ", crmLastName)
|
||||||
|
|
||||||
|
// crmLastName
|
||||||
if (operationStatus == "hangup")
|
if (operationStatus == "hangup")
|
||||||
await journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration, crmFirstName)
|
await journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration, crmFirstName, crmLastName)
|
||||||
|
|
||||||
|
|
||||||
else if (operationStatus == "update-answer") {
|
else if (operationStatus == "update-answer") {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const findProperty = require('./findProperty')
|
||||||
|
|
||||||
const journalingRequest = require('./journalingRequest')
|
const journalingRequest = require('./journalingRequest')
|
||||||
|
|
||||||
async function journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration = 0, crmFirstName ='Username') {
|
async function journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration = 0, crmFirstName ='Username', crmLastName = 'Last name') {
|
||||||
|
|
||||||
const crmFiles = await loadCRM(companyId)
|
const crmFiles = await loadCRM(companyId)
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ async function journaling(companyId, operation, crmPhone, crmAgent, crmCallDurat
|
||||||
let contact = await lookupContactByPhone(rest, authentication, crmPhone, companyId)
|
let contact = await lookupContactByPhone(rest, authentication, crmPhone, companyId)
|
||||||
|
|
||||||
if (!contact.exist) {
|
if (!contact.exist) {
|
||||||
contact = await createContact(companyId, rest, authentication, crmPhone, crmFirstName)
|
contact = await createContact(companyId, rest, authentication, crmPhone, crmFirstName, crmLastName)
|
||||||
}
|
}
|
||||||
|
|
||||||
let { request, calls, response } = findProperty(rest, 'callJournaling')
|
let { request, calls, response } = findProperty(rest, 'callJournaling')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue