Skip to content

Commit 6ce6f2c

Browse files
committed
include department on new struct
1 parent 05b60a4 commit 6ce6f2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/api/payroll.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type EmployeePayroll struct {
2828
TotalDeductions float64 `json:"total_deductions"`
2929
NSSFEmployee float64 `json:"nssf_employee"`
3030
NHIFEmployee float64 `json:"nhif_employee"`
31+
Department string `json:"department"`
3132
}
3233

3334
type EmployeePayrollDetails struct {
@@ -153,7 +154,7 @@ func (app *application) getAllPayroll(c echo.Context) error {
153154

154155
nssfEmployee := bs * 0.10
155156

156-
nhifEmployee := max(bs * 0.03, 20000)
157+
nhifEmployee := max(bs*0.03, 20000)
157158

158159
taxableIncome := bs - nssfEmployee
159160

@@ -180,6 +181,7 @@ func (app *application) getAllPayroll(c echo.Context) error {
180181
TotalDeductions: totalDeductions,
181182
NSSFEmployee: nssfEmployee,
182183
NHIFEmployee: nhifEmployee,
184+
Department: p.Department,
183185
}
184186

185187
e_payrolls = append(e_payrolls, e)

0 commit comments

Comments
 (0)