-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1031295
commit c87cd2d
Showing
5 changed files
with
62 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import json | ||
|
||
from django.http import JsonResponse | ||
|
||
from payroll.views import EditPayrollBaseView | ||
|
||
from .services import payroll as payroll_service | ||
|
||
|
||
class EditPayrollApiView(EditPayrollBaseView): | ||
def post_data(self, data): | ||
raise NotImplementedError | ||
|
||
def get(self, request, *args, **kwargs): | ||
employees = list( | ||
payroll_service.get_payroll_data( | ||
self.cost_centre, | ||
self.financial_year, | ||
) | ||
) | ||
vacancies = list( | ||
payroll_service.get_vacancies_data( | ||
self.cost_centre, | ||
self.financial_year, | ||
) | ||
) | ||
pay_modifiers = list( | ||
payroll_service.get_pay_modifiers_data( | ||
self.cost_centre, | ||
self.financial_year, | ||
) | ||
) | ||
|
||
return JsonResponse( | ||
{ | ||
"employees": employees, | ||
"vacancies": vacancies, | ||
"pay_modifiers": pay_modifiers, | ||
} | ||
) | ||
|
||
def post(self, request, *args, **kwargs): | ||
data = json.loads(request.body) | ||
self.post_data( | ||
data, | ||
) | ||
return JsonResponse({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters