feat: add initial application structure with configuration, UI components, and state management
This commit is contained in:
parent
fadf94002c
commit
0af6b17792
56 changed files with 6137 additions and 129 deletions
25
composables/useCoverage.ts
Normal file
25
composables/useCoverage.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Computes coverage: funded paid hours ÷ target hours
|
||||
*/
|
||||
export const useCoverage = () => {
|
||||
const calculateCoverage = (fundedPaidHours: number, targetHours: number): number => {
|
||||
if (targetHours <= 0) return 0
|
||||
return (fundedPaidHours / targetHours) * 100
|
||||
}
|
||||
|
||||
const getCoverageStatus = (coveragePct: number): 'green' | 'yellow' | 'red' => {
|
||||
if (coveragePct >= 80) return 'green'
|
||||
if (coveragePct >= 60) return 'yellow'
|
||||
return 'red'
|
||||
}
|
||||
|
||||
const formatCoverage = (coveragePct: number): string => {
|
||||
return `${Math.round(coveragePct)}%`
|
||||
}
|
||||
|
||||
return {
|
||||
calculateCoverage,
|
||||
getCoverageStatus,
|
||||
formatCoverage
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue