fix: add missing custom requirement data on customer data communication with machine

fix: create function to reset the override flag in custom requirement data
This commit is contained in:
Sérgio Salgado 2022-02-10 20:28:20 +00:00
parent 45173e7c0e
commit 81d74eb40b
3 changed files with 18 additions and 3 deletions

View file

@ -520,7 +520,11 @@ function getCustomersList (phone = null, name = null, address = null, id = null)
AND ($7 IS NULL OR id_card_data::json->>'documentNumber' = $7)
limit $3`
return db.any(sql, [ passableErrorCodes, anonymous.uuid, NUM_RESULTS, phone, name, address, id ])
.then(customers => Promise.all(_.map(camelizeDeep, customers)))
.then(customers => Promise.all(_.map(customer =>
getCustomInfoRequestsData(customer)
.then(camelizeDeep), customers)
)
)
}
/**
@ -569,6 +573,7 @@ function getCustomerById (id) {
) AS cl WHERE rn = 1`
return db.oneOrNone(sql, [passableErrorCodes, id])
.then(assignCustomerData)
.then(getCustomInfoRequestsData)
.then(camelizeDeep)
}