feat: enhance tickets portal and admin flows
This commit is contained in:
parent
9cdd8763b4
commit
c15f0a5b09
67 changed files with 1101 additions and 338 deletions
|
|
@ -53,6 +53,23 @@ function slugify(value) {
|
|||
.toLowerCase()
|
||||
}
|
||||
|
||||
const STATUS_MAP = {
|
||||
NEW: "PENDING",
|
||||
PENDING: "PENDING",
|
||||
OPEN: "AWAITING_ATTENDANCE",
|
||||
AWAITING_ATTENDANCE: "AWAITING_ATTENDANCE",
|
||||
ON_HOLD: "PAUSED",
|
||||
PAUSED: "PAUSED",
|
||||
RESOLVED: "RESOLVED",
|
||||
CLOSED: "CLOSED",
|
||||
}
|
||||
|
||||
function normalizeStatus(status) {
|
||||
if (!status) return "PENDING"
|
||||
const key = String(status).toUpperCase()
|
||||
return STATUS_MAP[key] ?? "PENDING"
|
||||
}
|
||||
|
||||
async function upsertCompanies(snapshotCompanies) {
|
||||
const map = new Map()
|
||||
|
||||
|
|
@ -250,7 +267,7 @@ async function upsertTickets(snapshotTickets, userMap, queueMap, companyMap) {
|
|||
const data = {
|
||||
subject: ticket.subject,
|
||||
summary: ticket.summary ?? null,
|
||||
status: (ticket.status ?? "NEW").toUpperCase(),
|
||||
status: normalizeStatus(ticket.status),
|
||||
priority: (ticket.priority ?? "MEDIUM").toUpperCase(),
|
||||
channel: (ticket.channel ?? "MANUAL").toUpperCase(),
|
||||
queueId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue