Fix Additional Service modal: department enum mapping and timing value
- Map display labels to DepartmentType enum values (CLAIMS, PERSONAL_LINES, etc.) - Fix timing from invalid 'ONGOING' to 'PRE_RENEWAL' (only valid values) - Remove unused TIMINGS constant
This commit is contained in:
parent
5934ff7c4f
commit
27247f77f0
1 changed files with 11 additions and 6 deletions
|
|
@ -68,8 +68,13 @@ interface AdditionalServiceModalProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PRIORITIES = ['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']
|
const PRIORITIES = ['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']
|
||||||
const DEPARTMENTS = ['Claims', 'Personal Lines', 'Commercial Lines', 'Benefits', 'Life', 'Other']
|
const DEPARTMENTS: { label: string; value: string }[] = [
|
||||||
const TIMINGS = ['BEFORE_RENEWAL', 'AT_RENEWAL', 'AFTER_RENEWAL', 'ONGOING']
|
{ label: 'Claims', value: 'CLAIMS' },
|
||||||
|
{ label: 'Personal Lines', value: 'PERSONAL_LINES' },
|
||||||
|
{ label: 'Commercial Lines', value: 'COMMERCIAL_LINES' },
|
||||||
|
{ label: 'Benefits', value: 'BENEFITS' },
|
||||||
|
{ label: 'Other', value: 'OTHER' },
|
||||||
|
]
|
||||||
|
|
||||||
export function AdditionalServiceModal({
|
export function AdditionalServiceModal({
|
||||||
open,
|
open,
|
||||||
|
|
@ -82,7 +87,7 @@ export function AdditionalServiceModal({
|
||||||
const [title, setTitle] = useState('')
|
const [title, setTitle] = useState('')
|
||||||
const [description, setDescription] = useState('')
|
const [description, setDescription] = useState('')
|
||||||
const [priority, setPriority] = useState('MEDIUM')
|
const [priority, setPriority] = useState('MEDIUM')
|
||||||
const [department, setDepartment] = useState(DEPARTMENTS[0])
|
const [department, setDepartment] = useState(DEPARTMENTS[0].value)
|
||||||
const [dueDate, setDueDate] = useState('')
|
const [dueDate, setDueDate] = useState('')
|
||||||
const [assignTo, setAssignTo] = useState(currentUserId)
|
const [assignTo, setAssignTo] = useState(currentUserId)
|
||||||
const [saving, setSaving] = useState(false)
|
const [saving, setSaving] = useState(false)
|
||||||
|
|
@ -106,7 +111,7 @@ export function AdditionalServiceModal({
|
||||||
setTitle('')
|
setTitle('')
|
||||||
setDescription('')
|
setDescription('')
|
||||||
setPriority('MEDIUM')
|
setPriority('MEDIUM')
|
||||||
setDepartment(DEPARTMENTS[0])
|
setDepartment(DEPARTMENTS[0].value)
|
||||||
setDueDate('')
|
setDueDate('')
|
||||||
setAssignTo(currentUserId)
|
setAssignTo(currentUserId)
|
||||||
setLevel(context?.policyId ? 'policy' : context?.policyGroupId ? 'group' : 'client')
|
setLevel(context?.policyId ? 'policy' : context?.policyGroupId ? 'group' : 'client')
|
||||||
|
|
@ -160,7 +165,7 @@ export function AdditionalServiceModal({
|
||||||
priority,
|
priority,
|
||||||
department,
|
department,
|
||||||
dueDate: new Date(dueDate).toISOString(),
|
dueDate: new Date(dueDate).toISOString(),
|
||||||
timing: 'ONGOING',
|
timing: 'PRE_RENEWAL',
|
||||||
daysOffset: 0,
|
daysOffset: 0,
|
||||||
status: 'NOT_STARTED',
|
status: 'NOT_STARTED',
|
||||||
isAdHoc: true,
|
isAdHoc: true,
|
||||||
|
|
@ -336,7 +341,7 @@ export function AdditionalServiceModal({
|
||||||
<Select value={department} onValueChange={setDepartment}>
|
<Select value={department} onValueChange={setDepartment}>
|
||||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{DEPARTMENTS.map((d) => <SelectItem key={d} value={d}>{d}</SelectItem>)}
|
{DEPARTMENTS.map((d) => <SelectItem key={d.value} value={d.value}>{d.label}</SelectItem>)}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue