feat: sla business hours

This commit is contained in:
Muhsin
2025-12-16 13:01:10 +05:30
parent bb8bafe3dc
commit 473dc978e0
6 changed files with 804 additions and 3 deletions
@@ -1,6 +1,7 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
import { evaluateSLAStatus } from '@chatwoot/utils';
import { getBusinessHoursConfig } from 'dashboard/helper/slaHelper';
const props = defineProps({
conversation: {
@@ -40,9 +41,17 @@ const slaStatusText = computed(() => {
});
const updateSlaStatus = () => {
const businessHoursConfig = getBusinessHoursConfig(
appliedSLA.value?.slaPolicy,
props.conversation?.inbox
);
slaStatus.value = evaluateSLAStatus({
appliedSla: convertObjectCamelCaseToSnakeCase(appliedSLA.value || {}),
chat: props.conversation,
options: businessHoursConfig
? { businessHours: businessHoursConfig }
: undefined,
});
};