Skip to content

Commit 839dd39

Browse files
authored
Merge pull request #33 from icefoganalytics/main
Fix enrollment chart colors so they actually show up.
2 parents 48dfa96 + 1252a9f commit 839dd39

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

api/src/db/seeds/development/2025.11.21T12.21.14.fill-employee-benefits-table.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { isNil } from "lodash"
33
import { Centre, EmployeeBenefit, FiscalPeriod } from "@/models"
44

55
export async function up() {
6-
const fiscalPeriods = await FiscalPeriod.findAll()
7-
8-
await Centre.findEach(async (centre) => {
9-
for (const fiscalPeriod of fiscalPeriods) {
6+
await FiscalPeriod.findEach(async (fiscalPeriod) => {
7+
await Centre.findEach(async (centre) => {
108
const employeeBenefit = await EmployeeBenefit.findOne({
119
where: {
1210
centreId: centre.id,
@@ -27,7 +25,7 @@ export async function up() {
2725
employerCostEstimated: "0",
2826
})
2927
}
30-
}
28+
})
3129
})
3230
}
3331

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Centre, EmployeeBenefit, FiscalPeriod } from "@/models"
2+
import { isNil } from "lodash"
3+
4+
export async function up() {
5+
await FiscalPeriod.findEach(async (fiscalPeriod) => {
6+
await Centre.findEach(async (centre) => {
7+
const employeeBenefit = await EmployeeBenefit.findOne({
8+
where: {
9+
centreId: centre.id,
10+
fiscalPeriodId: fiscalPeriod.id,
11+
},
12+
})
13+
14+
if (isNil(employeeBenefit)) {
15+
await EmployeeBenefit.create({
16+
centreId: centre.id,
17+
fiscalPeriodId: fiscalPeriod.id,
18+
grossPayrollMonthlyActual: "0",
19+
grossPayrollMonthlyEstimated: "0",
20+
costCapPercentage: EmployeeBenefit.DEFAULT_COST_CAP_PERCENTAGE,
21+
employeeCostActual: "0",
22+
employeeCostEstimated: "0",
23+
employerCostActual: "0",
24+
employerCostEstimated: "0",
25+
})
26+
}
27+
})
28+
})
29+
}
30+
31+
export async function down() {
32+
// this method needs to exist, but does not need to be implemented.
33+
// Seeds should be idempotent.
34+
}

web/src/components/funding-line-values/FundingLineValuesEnrollmentChart.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const options = computed(() => ({
6363
stroke: {
6464
show: false,
6565
},
66-
colors: ["#0094A9", "#002EB7", "#FFAE00", "#FF7A00", "#04DDFB", "#A65000", "#1851FC"],
66+
colors: ["#D81B60", "#002EB7", "#FFAE00", "#FF7A00", "#00A0C6", "#A65000", "#1851FC"],
6767
labels: lineNames.value,
6868
tooltip: {
6969
theme: "light",
@@ -72,7 +72,9 @@ const options = computed(() => ({
7272
}))
7373
7474
const actualChildOccupancyRates = computed(() => {
75-
return latestFundingLineValuesForSection.value.map((line) => line.actualChildOccupancyRate)
75+
return latestFundingLineValuesForSection.value.map((line) =>
76+
Number(line.actualChildOccupancyRate)
77+
)
7678
})
7779
7880
const hasActualChildOccupancyRates = computed(() =>

0 commit comments

Comments
 (0)