API endpoint for Timesheet entries (#332)

This commit is contained in:
Kevin Papst
2018-11-18 19:43:58 +01:00
committed by GitHub
parent 8cb52e22b1
commit b1c06eed7b
35 changed files with 1073 additions and 118 deletions

View File

@@ -1,5 +1,5 @@
fos_rest:
# disable_csrf_role: ROLE_API
# disable_csrf_role: IS_AUTHENTICATED_ANONYMOUSLY
# access_denied_listener:
# enabled: false
# service: null
@@ -18,8 +18,8 @@ fos_rest:
default_format: json
include_format: true
# prefix_methods: true
# body_converter:
# enabled: false
body_converter:
enabled: true
# validate: false
# validation_errors_argument: validationErrors
# service:
@@ -46,8 +46,8 @@ fos_rest:
# name: ~
# templating_formats:
# name: ~
# view_response_listener:
# enabled: true
view_response_listener:
enabled: true
# force: true
# service: null
failed_validation: 400
@@ -67,16 +67,16 @@ fos_rest:
messages:
'Symfony\Component\Routing\Exception\ResourceNotFoundException': true
'Symfony\Component\HttpKernel\Exception\NotFoundHttpException': true
# body_listener:
# enabled: true
body_listener:
enabled: true
# service: null
# default_format: null
# throw_exception_on_unsupported_content_type: false
# decoders:
# name: ~
# array_normalizer:
# service: null
# forms: false
array_normalizer:
service: null
forms: true
format_listener:
enabled: true
# service: null

View File

@@ -1,4 +1,7 @@
jms_serializer:
handlers:
datetime:
default_format: "Y-m-d H:i"
visitors:
xml:
format_output: '%kernel.debug%'

View File

@@ -1,16 +1,35 @@
nelmio_api_doc:
models:
use_jms: true
names:
- { alias: CustomerEntity, type: App\Entity\Customer, groups: [Default, Entity, Customer] }
- { alias: CustomerCollection, type: App\Entity\Customer, groups: [Default, Collection, Customer] }
- { alias: ProjectEntity, type: App\Entity\Project, groups: [Default, Entity, Project] }
- { alias: ProjectCollection, type: App\Entity\Project, groups: [Default, Collection, Project] }
- { alias: ActivityEntity, type: App\Entity\Activity, groups: [Default, Entity, Activity] }
- { alias: ActivityCollection, type: App\Entity\Activity, groups: [Default, Collection, Activity] }
- { alias: TimesheetFormEntity, type: App\Form\TimesheetEditForm, groups: [Default, Entity, Timesheet] }
- { alias: TimesheetEntity, type: App\Entity\Timesheet, groups: [Default, Entity, Timesheet] }
- { alias: TimesheetCollection, type: App\Entity\Timesheet, groups: [Default, Collection, Timesheet] }
- { alias: UserEntity, type: App\Entity\User, groups: [Default, Entity, User] }
- { alias: UserCollection, type: App\Entity\User, groups: [Default, Collection, User] }
areas:
path_patterns:
- ^/api(?!/doc)
documentation:
#host: '{{hostname}}'
# host: '{{hostname}}'
schemes: [http, https]
info:
title: Kimai 2 - API Docs
description: REST API description for the Kimai 2 time-tracking software
version: 0.1
description: REST API description for the Kimai 2 time-tracking software. Do not rely on the example values/models, they are currently generated wrong. Please fetch the request and response structure from the API itself.
version: 0.2
# parameters:
# hostname:
# name: hostname
# in: url
# description: the hostname where your api runs
# required: true
# type: string
securityDefinitions:
X-AUTH-USER:
type: apiKey

View File

@@ -1,18 +1,32 @@
App\Entity\Activity:
exclusion_policy: All
custom_accessor_order: [id, name, comment, visible, project_id]
custom_accessor_order: [id, name, comment, visible, project, fixedRate, hourlyRate]
properties:
id:
include: true
groups: [Default]
name:
include: true
groups: [Default]
comment:
include: true
groups: [Entity]
visible:
include: true
groups: [Default]
fixedRate:
include: true
groups: [Default]
hourlyRate:
include: true
groups: [Default]
project:
include: false
exclude: true
groups: [Default]
virtual_properties:
getProjectId:
name: project_id
serialized_name: project_id
getProject:
serialized_name: project
exp: "object.getProject() === null ? null : object.getProject().getId()"
type: integer
groups: [Default]

View File

@@ -1,35 +1,58 @@
App\Entity\Customer:
exclusion_policy: All
custom_accessor_order: [id, name, number, comment, visible, company, contact, address, country, currency, phone, fax, mobile, mail, homepage, timezone, fixedRate, hourlyRate]
properties:
id:
include: true
groups: [Default]
name:
include: true
groups: [Default]
number:
include: true
groups: [Entity]
comment:
include: true
groups: [Entity]
visible:
include: true
groups: [Default]
company:
include: true
groups: [Entity]
contact:
include: true
groups: [Entity]
address:
include: true
groups: [Entity]
country:
include: true
groups: [Entity]
currency:
include: true
groups: [Entity]
phone:
include: true
groups: [Entity]
fax:
include: true
groups: [Entity]
mobile:
include: true
groups: [Entity]
mail:
include: true
groups: [Entity]
homepage:
include: true
groups: [Entity]
timezone:
include: true
groups: [Entity]
fixedRate:
include: true
groups: [Default]
hourlyRate:
include: true
groups: [Default]

View File

@@ -1,22 +1,38 @@
App\Entity\Project:
exclusion_policy: All
custom_accessor_order: [id, name, comment, visible, budget, orderNumber, customer_id]
custom_accessor_order: [id, name, comment, visible, budget, orderNumber, customer, fixedRate, hourlyRate]
properties:
id:
include: true
groups: [Default]
name:
include: true
groups: [Default]
comment:
include: true
groups: [Entity]
visible:
include: true
groups: [Default]
budget:
include: true
groups: [Entity]
orderNumber:
include: true
groups: [Entity]
fixedRate:
include: true
groups: [Entity]
hourlyRate:
include: true
groups: [Entity]
customer:
include: false
exclude: true
groups: [Default]
virtual_properties:
getCustomerId:
name: customer_id
serialized_name: customer_id
getCustomer:
serialized_name: customer
exp: "object.getCustomer() === null ? null : object.getCustomer().getId()"
type: integer
groups: [Default]

View File

@@ -0,0 +1,56 @@
App\Entity\Timesheet:
exclusion_policy: All
custom_accessor_order: [id, begin, end, duration, rate, activity, project, user, description, fixedRate, hourlyRate]
properties:
id:
include: true
groups: [Default]
begin:
include: true
groups: [Default]
end:
include: true
groups: [Default]
duration:
include: true
groups: [Default]
description:
include: true
groups: [Entity]
rate:
include: true
groups: [Default]
fixedRate:
include: true
groups: [Entity]
hourlyRate:
include: true
groups: [Entity]
activity:
include: false
exclude: true
groups: [Default]
project:
include: false
exclude: true
groups: [Default]
user:
include: false
exclude: true
groups: [Default]
virtual_properties:
getActivity:
serialized_name: activity
exp: "object.getActivity() === null ? null : object.getActivity().getId()"
type: integer
groups: [Default]
getProject:
serialized_name: project
exp: "object.getProject() === null ? null : object.getProject().getId()"
type: integer
groups: [Default]
getUser:
serialized_name: user
exp: "object.getUser().getId()"
type: integer
groups: [Default]

View File

@@ -3,9 +3,13 @@ App\Entity\User:
properties:
id:
include: true
groups: [Default]
alias:
include: true
groups: [Default]
title:
include: true
groups: [Entity]
avatar:
include: true
groups: [Entity]

View File

@@ -1,6 +1,15 @@
FOS\UserBundle\Model\User:
exclusion_policy: NONE
properties:
enabled:
include: true
groups: [Default]
groups:
include: true
groups: [Entity]
roles:
include: true
groups: [Entity]
email:
exclude: true
emailCanonical: