Exemple #1
0
 def get(self, person_id, year):
     """
     Get aggregated time spents for given person and year.
     ---
     tags:
     - Persons
     parameters:
       - in: path
         name: person_id
         required: True
         schema:
             type: UUID
             example: a24a6ea4-ce75-4665-a070-57453082c25
       - in: path
         name: year
         required: True
         schema:
             type: integer
             example: 2022
     responses:
         200:
             description: Aggregated time spents for given person and year
         404:
             description: Wrong date format
     """
     project_id = self.get_project_id()
     user_service.check_person_access(person_id)
     try:
         return time_spents_service.get_year_time_spents(
             person_id, year, project_id=project_id
         )
     except WrongDateFormatException:
         abort(404)
Exemple #2
0
 def get(self, person_id, year):
     project_id = self.get_project_id()
     user_service.check_person_access(person_id)
     try:
         return time_spents_service.get_year_time_spents(
             person_id, year, project_id=project_id)
     except WrongDateFormatException:
         abort(404)
Exemple #3
0
 def get(self, person_id, year):
     permissions.check_admin_permissions()
     try:
         return time_spents_service.get_year_time_spents(person_id, year)
     except WrongDateFormatException:
         abort(404)