Skip to content

Commit

Permalink
Merge pull request #204 from Bostads-AB-Mimer/feature/mim-188-dolj-hu…
Browse files Browse the repository at this point in the history
…sdjur-och-huvudnyckel-i-tvattstugearenden

MIM-188: update description and access caption if location is a common space
  • Loading branch information
lalmqvist authored Nov 4, 2024
2 parents 6dccfc1 + 69dfa6c commit 7631a10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/services/ticketing-service/adapters/odoo-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ const transformTicket = (ticket: OdooGetTicket) => {
const equipmentCode = transformEquipmentCode(ticket.equipment_code)
const description = removePTags(ticket.description)

const descriptionWithMoreInfo = `${description}\r\nHusdjur: ${ticket.pet ? 'Ja' : 'Nej'}${ticket.call_between ? `\r\n Kund nås enklast mellan ${ticket.call_between} \r\n på telefonnummer: ${ticket.phone_number}.` : ''}`
const isCommonSpace = Object.keys(spaceCodes).includes(ticket.space_code)

const descriptionWithMoreInfo = `${description}${isCommonSpace ? '' : `\r\n Husdjur: ${ticket.pet ? 'Ja' : 'Nej'}`}
${ticket.call_between ? `\r\n Kund nås enklast mellan ${ticket.call_between} \r\n på telefonnummer: ${ticket.phone_number}.` : ''}`

return {
AccessCaption: 'Huvudnyckel',
AccessCaption: isCommonSpace ? 'Gemensamt utrymme' : 'Huvudnyckel',
Caption:
spaceCode && equipmentCode
? `WEBB: ${spaceCode}, ${equipmentCode}`
Expand Down

0 comments on commit 7631a10

Please sign in to comment.