Skip to content

Commit

Permalink
Add id to Vacancies class
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitBarnard committed Nov 19, 2024
1 parent aad7d67 commit 7ef774c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions front_end/src/Apps/Payroll.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { useEffect, useReducer, useState, useMemo } from "react";

import EditPayroll from "../Components/EditPayroll";
import * as api from "../Components/EditPayroll/api";
import { payrollHeaders, vacancyHeaders } from "../Components/EditPayroll/constants";
import {
payrollHeaders,
vacancyHeaders,
} from "../Components/EditPayroll/constants";

const initialPayrollState = [];

Expand Down Expand Up @@ -79,7 +82,7 @@ export default function Payroll() {
/>
<h2 className="govuk-heading-m">Vacancies</h2>
<EditPayroll
payroll={nonPayroll}
payroll={[]}
headers={vacancyHeaders}
onTogglePayPeriods={handleTogglePayPeriods}
/>
Expand Down
6 changes: 3 additions & 3 deletions payroll/services/payroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def update_payroll_data(


class Vacancies(TypedDict):
id: str
grade: str
programme_code: str
recruitment_type: str
Expand Down Expand Up @@ -194,7 +195,6 @@ def update_vacancies_data(
ValueError: If any of the pay_periods are not of type bool.
"""

# Need to add id to Vacancies and pay periods to Vacancy model
for vacancy in vacancies_data:
if not vacancy["id"]:
raise ValueError("id is empty")
Expand All @@ -206,8 +206,8 @@ def update_vacancies_data(
raise ValueError("pay_periods items should be of type bool")

pay_periods = EmployeePayPeriods.objects.get(
employee__employee_no=vacancy["employee_no"],
employee__cost_centre=cost_centre,
vacancy__id=vacancy["id"],
vacancy__cost_centre=cost_centre,
year=financial_year,
)
pay_periods.periods = vacancy["pay_periods"]
Expand Down

0 comments on commit 7ef774c

Please sign in to comment.