sla calculation modified
This commit is contained in:
parent
077fe78e8a
commit
f89514eb2b
@ -1,2 +1,2 @@
|
||||
import{a as s}from"./index-Be7X0Sj8.js";import"./radix-vendor-DIkYAdWy.js";import"./charts-vendor-Bme4E5cb.js";import"./utils-vendor-DHm03ykU.js";import"./ui-vendor-CdaLA-IN.js";import"./socket-vendor-TjCxX7sJ.js";import"./redux-vendor-tbZCm13o.js";import"./router-vendor-AvM4PHvP.js";async function m(n){return(await s.post(`/conclusions/${n}/generate`)).data.data}async function f(n,t){return(await s.post(`/conclusions/${n}/finalize`,{finalRemark:t})).data.data}async function d(n){var t;try{return(await s.get(`/conclusions/${n}`)).data.data}catch(o){if(((t=o.response)==null?void 0:t.status)===404)return null;throw o}}export{f as finalizeConclusion,m as generateConclusion,d as getConclusion};
|
||||
//# sourceMappingURL=conclusionApi-92p3rlzy.js.map
|
||||
import{a as s}from"./index-r7_wqQ4e.js";import"./radix-vendor-DIkYAdWy.js";import"./charts-vendor-Bme4E5cb.js";import"./utils-vendor-DNMmNUQL.js";import"./ui-vendor-KevyU1nl.js";import"./socket-vendor-TjCxX7sJ.js";import"./redux-vendor-tbZCm13o.js";import"./router-vendor-AvM4PHvP.js";async function m(n){return(await s.post(`/conclusions/${n}/generate`)).data.data}async function f(n,t){return(await s.post(`/conclusions/${n}/finalize`,{finalRemark:t})).data.data}async function d(n){var t;try{return(await s.get(`/conclusions/${n}`)).data.data}catch(o){if(((t=o.response)==null?void 0:t.status)===404)return null;throw o}}export{f as finalizeConclusion,m as generateConclusion,d as getConclusion};
|
||||
//# sourceMappingURL=conclusionApi-DG9VB6DM.js.map
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"conclusionApi-92p3rlzy.js","sources":["../../src/services/conclusionApi.ts"],"sourcesContent":["import apiClient from './authApi';\r\n\r\nexport interface ConclusionRemark {\r\n conclusionId: string;\r\n requestId: string;\r\n aiGeneratedRemark: string | null;\r\n aiModelUsed: string | null;\r\n aiConfidenceScore: number | null;\r\n finalRemark: string | null;\r\n editedBy: string | null;\r\n isEdited: boolean;\r\n editCount: number;\r\n approvalSummary: any;\r\n documentSummary: any;\r\n keyDiscussionPoints: string[];\r\n generatedAt: string | null;\r\n finalizedAt: string | null;\r\n createdAt: string;\r\n updatedAt: string;\r\n}\r\n\r\n/**\r\n * Generate AI-powered conclusion remark\r\n */\r\nexport async function generateConclusion(requestId: string): Promise<{\r\n conclusionId: string;\r\n aiGeneratedRemark: string;\r\n keyDiscussionPoints: string[];\r\n confidence: number;\r\n generatedAt: string;\r\n}> {\r\n const response = await apiClient.post(`/conclusions/${requestId}/generate`);\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Update conclusion remark (edit by initiator)\r\n */\r\nexport async function updateConclusion(requestId: string, finalRemark: string): Promise<ConclusionRemark> {\r\n const response = await apiClient.put(`/conclusions/${requestId}`, { finalRemark });\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Finalize conclusion and close request\r\n */\r\nexport async function finalizeConclusion(requestId: string, finalRemark: string): Promise<{\r\n conclusionId: string;\r\n requestNumber: string;\r\n status: string;\r\n finalRemark: string;\r\n finalizedAt: string;\r\n}> {\r\n const response = await apiClient.post(`/conclusions/${requestId}/finalize`, { finalRemark });\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Get conclusion for a request\r\n * Returns null if conclusion doesn't exist (404) instead of throwing error\r\n */\r\nexport async function getConclusion(requestId: string): Promise<ConclusionRemark | null> {\r\n try {\r\n const response = await apiClient.get(`/conclusions/${requestId}`);\r\n return response.data.data;\r\n } catch (error: any) {\r\n // Handle 404 gracefully - conclusion doesn't exist yet, which is normal\r\n if (error.response?.status === 404) {\r\n return null;\r\n }\r\n // Re-throw other errors\r\n throw error;\r\n }\r\n}\r\n\r\n"],"names":["generateConclusion","requestId","apiClient","finalizeConclusion","finalRemark","getConclusion","error","_a"],"mappings":"6RAwBA,eAAsBA,EAAmBC,EAMtC,CAED,OADiB,MAAMC,EAAU,KAAK,gBAAgBD,CAAS,WAAW,GAC1D,KAAK,IACvB,CAaA,eAAsBE,EAAmBF,EAAmBG,EAMzD,CAED,OADiB,MAAMF,EAAU,KAAK,gBAAgBD,CAAS,YAAa,CAAE,YAAAG,EAAa,GAC3E,KAAK,IACvB,CAMA,eAAsBC,EAAcJ,EAAqD,OACvF,GAAI,CAEF,OADiB,MAAMC,EAAU,IAAI,gBAAgBD,CAAS,EAAE,GAChD,KAAK,IACvB,OAASK,EAAY,CAEnB,KAAIC,EAAAD,EAAM,WAAN,YAAAC,EAAgB,UAAW,IAC7B,OAAO,KAGT,MAAMD,CACR,CACF"}
|
||||
{"version":3,"file":"conclusionApi-DG9VB6DM.js","sources":["../../src/services/conclusionApi.ts"],"sourcesContent":["import apiClient from './authApi';\r\n\r\nexport interface ConclusionRemark {\r\n conclusionId: string;\r\n requestId: string;\r\n aiGeneratedRemark: string | null;\r\n aiModelUsed: string | null;\r\n aiConfidenceScore: number | null;\r\n finalRemark: string | null;\r\n editedBy: string | null;\r\n isEdited: boolean;\r\n editCount: number;\r\n approvalSummary: any;\r\n documentSummary: any;\r\n keyDiscussionPoints: string[];\r\n generatedAt: string | null;\r\n finalizedAt: string | null;\r\n createdAt: string;\r\n updatedAt: string;\r\n}\r\n\r\n/**\r\n * Generate AI-powered conclusion remark\r\n */\r\nexport async function generateConclusion(requestId: string): Promise<{\r\n conclusionId: string;\r\n aiGeneratedRemark: string;\r\n keyDiscussionPoints: string[];\r\n confidence: number;\r\n generatedAt: string;\r\n}> {\r\n const response = await apiClient.post(`/conclusions/${requestId}/generate`);\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Update conclusion remark (edit by initiator)\r\n */\r\nexport async function updateConclusion(requestId: string, finalRemark: string): Promise<ConclusionRemark> {\r\n const response = await apiClient.put(`/conclusions/${requestId}`, { finalRemark });\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Finalize conclusion and close request\r\n */\r\nexport async function finalizeConclusion(requestId: string, finalRemark: string): Promise<{\r\n conclusionId: string;\r\n requestNumber: string;\r\n status: string;\r\n finalRemark: string;\r\n finalizedAt: string;\r\n}> {\r\n const response = await apiClient.post(`/conclusions/${requestId}/finalize`, { finalRemark });\r\n return response.data.data;\r\n}\r\n\r\n/**\r\n * Get conclusion for a request\r\n * Returns null if conclusion doesn't exist (404) instead of throwing error\r\n */\r\nexport async function getConclusion(requestId: string): Promise<ConclusionRemark | null> {\r\n try {\r\n const response = await apiClient.get(`/conclusions/${requestId}`);\r\n return response.data.data;\r\n } catch (error: any) {\r\n // Handle 404 gracefully - conclusion doesn't exist yet, which is normal\r\n if (error.response?.status === 404) {\r\n return null;\r\n }\r\n // Re-throw other errors\r\n throw error;\r\n }\r\n}\r\n\r\n"],"names":["generateConclusion","requestId","apiClient","finalizeConclusion","finalRemark","getConclusion","error","_a"],"mappings":"6RAwBA,eAAsBA,EAAmBC,EAMtC,CAED,OADiB,MAAMC,EAAU,KAAK,gBAAgBD,CAAS,WAAW,GAC1D,KAAK,IACvB,CAaA,eAAsBE,EAAmBF,EAAmBG,EAMzD,CAED,OADiB,MAAMF,EAAU,KAAK,gBAAgBD,CAAS,YAAa,CAAE,YAAAG,EAAa,GAC3E,KAAK,IACvB,CAMA,eAAsBC,EAAcJ,EAAqD,OACvF,GAAI,CAEF,OADiB,MAAMC,EAAU,IAAI,gBAAgBD,CAAS,EAAE,GAChD,KAAK,IACvB,OAASK,EAAY,CAEnB,KAAIC,EAAAD,EAAM,WAAN,YAAAC,EAAgB,UAAW,IAC7B,OAAO,KAGT,MAAMD,CACR,CACF"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
build/assets/index-DMIvOF3n.css
Normal file
1
build/assets/index-DMIvOF3n.css
Normal file
File diff suppressed because one or more lines are too long
75
build/assets/index-r7_wqQ4e.js
Normal file
75
build/assets/index-r7_wqQ4e.js
Normal file
File diff suppressed because one or more lines are too long
1
build/assets/index-r7_wqQ4e.js.map
Normal file
1
build/assets/index-r7_wqQ4e.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
build/assets/utils-vendor-DNMmNUQL.js
Normal file
7
build/assets/utils-vendor-DNMmNUQL.js
Normal file
File diff suppressed because one or more lines are too long
1
build/assets/utils-vendor-DNMmNUQL.js.map
Normal file
1
build/assets/utils-vendor-DNMmNUQL.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -52,15 +52,15 @@
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/index-Be7X0Sj8.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-r7_wqQ4e.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/charts-vendor-Bme4E5cb.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/radix-vendor-DIkYAdWy.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/utils-vendor-DHm03ykU.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/ui-vendor-CdaLA-IN.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/utils-vendor-DNMmNUQL.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/ui-vendor-KevyU1nl.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/socket-vendor-TjCxX7sJ.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/redux-vendor-tbZCm13o.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/router-vendor-AvM4PHvP.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CB8CcL1-.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DMIvOF3n.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@ -654,12 +654,15 @@ export class DashboardService {
|
||||
const totalCompleted = recalculatedBreachedCount + recalculatedCompliantCount;
|
||||
const compliantCount = recalculatedCompliantCount;
|
||||
|
||||
// Compliance percentage = (compliant / total completed) * 100
|
||||
// This shows what percentage of CLOSED requests were completed within TAT
|
||||
const compliancePercent = totalCompleted > 0 ? Math.round((compliantCount / totalCompleted) * 100) : 0;
|
||||
// Compliance percentage = (compliant / (total completed + pending breached)) * 100
|
||||
// This shows health of the system: successful completions vs (failed completions + currently failing)
|
||||
// We include pending breached requests because they are already failures regarding SLA
|
||||
const totalFailuresAndSuccesses = totalCompleted + pendingBreachedCount;
|
||||
const compliancePercent = totalFailuresAndSuccesses > 0 ? Math.round((compliantCount / totalFailuresAndSuccesses) * 100) : 0;
|
||||
|
||||
// Average cycle time is already calculated above from priority averages
|
||||
logger.info(`[Dashboard] Compliance calculation: ${totalCompleted} total completed (CLOSED), ${finalBreachedCount} breached, ${compliantCount} compliant`);
|
||||
logger.info(`[Dashboard] Compliance calculation: ${totalCompleted} total completed (CLOSED), ${finalBreachedCount} completed breached, ${pendingBreachedCount} pending breached`);
|
||||
logger.info(`[Dashboard] Total Evaluated: ${totalFailuresAndSuccesses}, Compliant: ${compliantCount}, Score: ${compliancePercent}%`);
|
||||
logger.info(`[Dashboard] Breached requests (using Requests screen logic): ${finalBreachedCount} completed breached + ${pendingBreachedCount} pending/in-progress breached = ${totalDelayedWorkflows} total delayed`);
|
||||
|
||||
return {
|
||||
@ -2280,30 +2283,30 @@ export class DashboardService {
|
||||
const batch = allRequests.slice(i, i + BATCH_SIZE);
|
||||
const batchResults = await Promise.all(
|
||||
batch.map(async (req: any) => {
|
||||
const priority = ((req as any).priority || 'STANDARD').toLowerCase();
|
||||
const businessDays = await calculateBusinessDays(
|
||||
(req as any).submission_date,
|
||||
null, // current date
|
||||
priority
|
||||
);
|
||||
const priority = ((req as any).priority || 'STANDARD').toLowerCase();
|
||||
const businessDays = await calculateBusinessDays(
|
||||
(req as any).submission_date,
|
||||
null, // current date
|
||||
priority
|
||||
);
|
||||
|
||||
if (businessDays > threshold) {
|
||||
if (businessDays > threshold) {
|
||||
return {
|
||||
requestId: (req as any).request_id,
|
||||
requestNumber: (req as any).request_number,
|
||||
title: (req as any).title,
|
||||
priority: priority,
|
||||
status: ((req as any).status || 'PENDING').toLowerCase(),
|
||||
initiatorName: (req as any).initiator_name || (req as any).initiator_email || 'Unknown',
|
||||
initiatorEmail: (req as any).initiator_email,
|
||||
submissionDate: (req as any).submission_date,
|
||||
daysOpen: businessDays,
|
||||
currentLevel: (req as any).current_level,
|
||||
totalLevels: (req as any).total_levels,
|
||||
currentStageName: (req as any).current_stage_name || `Level ${(req as any).current_level}`,
|
||||
currentApproverName: (req as any).current_approver_name
|
||||
requestId: (req as any).request_id,
|
||||
requestNumber: (req as any).request_number,
|
||||
title: (req as any).title,
|
||||
priority: priority,
|
||||
status: ((req as any).status || 'PENDING').toLowerCase(),
|
||||
initiatorName: (req as any).initiator_name || (req as any).initiator_email || 'Unknown',
|
||||
initiatorEmail: (req as any).initiator_email,
|
||||
submissionDate: (req as any).submission_date,
|
||||
daysOpen: businessDays,
|
||||
currentLevel: (req as any).current_level,
|
||||
totalLevels: (req as any).total_levels,
|
||||
currentStageName: (req as any).current_stage_name || `Level ${(req as any).current_level}`,
|
||||
currentApproverName: (req as any).current_approver_name
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user