support custom fields for timesheets, customers, projects and activities (#871)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
App\Entity\Activity:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [id, name, comment, visible, project, fixedRate, hourlyRate, color, budget, timeBudget]
|
||||
custom_accessor_order: [id, name, comment, visible, project, fixedRate, hourlyRate, color, budget, timeBudget, metaFields]
|
||||
properties:
|
||||
id:
|
||||
include: true
|
||||
@@ -32,9 +32,16 @@ App\Entity\Activity:
|
||||
groups: [Default]
|
||||
color:
|
||||
include: true
|
||||
metaFields:
|
||||
exclude: true
|
||||
virtual_properties:
|
||||
getProject:
|
||||
serialized_name: project
|
||||
exp: "object.getProject() === null ? null : object.getProject().getId()"
|
||||
type: integer
|
||||
groups: [Default]
|
||||
getMetaFields:
|
||||
serialized_name: metaFields
|
||||
exp: "object.getVisibleMetaFields()"
|
||||
type: array<App\Entity\ActivityMeta>
|
||||
groups: [Default]
|
||||
|
||||
15
config/serializer/App/Entity.ActivityMeta.yml
Normal file
15
config/serializer/App/Entity.ActivityMeta.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
App\Entity\ActivityMeta:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [name, value]
|
||||
properties:
|
||||
name:
|
||||
include: false
|
||||
value:
|
||||
include: false
|
||||
virtual_properties:
|
||||
getName:
|
||||
serialized_name: name
|
||||
exp: "object.isVisible() ? object.getName() : null"
|
||||
getValue:
|
||||
serialized_name: value
|
||||
exp: "object.isVisible() ? object.getValue() : null"
|
||||
@@ -1,6 +1,6 @@
|
||||
App\Entity\Customer:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [id, name, number, comment, visible, company, contact, address, country, currency, phone, fax, mobile, email, homepage, timezone, fixedRate, hourlyRate, color, budget, timeBudget]
|
||||
custom_accessor_order: [id, name, number, comment, visible, company, contact, address, country, currency, phone, fax, mobile, email, homepage, timezone, fixedRate, hourlyRate, color, budget, timeBudget, metaFields]
|
||||
properties:
|
||||
id:
|
||||
include: true
|
||||
@@ -61,3 +61,11 @@ App\Entity\Customer:
|
||||
groups: [Customer]
|
||||
color:
|
||||
include: true
|
||||
metaFields:
|
||||
exclude: true
|
||||
virtual_properties:
|
||||
getMetaFields:
|
||||
serialized_name: metaFields
|
||||
exp: "object.getVisibleMetaFields()"
|
||||
type: array<App\Entity\CustomerMeta>
|
||||
groups: [Default]
|
||||
|
||||
15
config/serializer/App/Entity.CustomerMeta.yml
Normal file
15
config/serializer/App/Entity.CustomerMeta.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
App\Entity\CustomerMeta:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [name, value]
|
||||
properties:
|
||||
name:
|
||||
include: false
|
||||
value:
|
||||
include: false
|
||||
virtual_properties:
|
||||
getName:
|
||||
serialized_name: name
|
||||
exp: "object.isVisible() ? object.getName() : null"
|
||||
getValue:
|
||||
serialized_name: value
|
||||
exp: "object.isVisible() ? object.getValue() : null"
|
||||
@@ -1,6 +1,6 @@
|
||||
App\Entity\Project:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [id, name, comment, visible, orderNumber, customer, fixedRate, hourlyRate, color, budget, timeBudget]
|
||||
custom_accessor_order: [id, name, comment, visible, orderNumber, customer, fixedRate, hourlyRate, color, budget, timeBudget, metaFields]
|
||||
properties:
|
||||
id:
|
||||
include: true
|
||||
@@ -30,9 +30,16 @@ App\Entity\Project:
|
||||
groups: [Subresource]
|
||||
color:
|
||||
include: true
|
||||
metaFields:
|
||||
exclude: true
|
||||
virtual_properties:
|
||||
getCustomer:
|
||||
serialized_name: customer
|
||||
exp: "object.getCustomer() === null ? null : object.getCustomer().getId()"
|
||||
type: integer
|
||||
groups: [Entity, Collection]
|
||||
getMetaFields:
|
||||
serialized_name: metaFields
|
||||
exp: "object.getVisibleMetaFields()"
|
||||
type: array<App\Entity\ProjectMeta>
|
||||
groups: [Default]
|
||||
|
||||
15
config/serializer/App/Entity.ProjectMeta.yml
Normal file
15
config/serializer/App/Entity.ProjectMeta.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
App\Entity\ProjectMeta:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [name, value]
|
||||
properties:
|
||||
name:
|
||||
include: false
|
||||
value:
|
||||
include: false
|
||||
virtual_properties:
|
||||
getName:
|
||||
serialized_name: name
|
||||
exp: "object.isVisible() ? object.getName() : null"
|
||||
getValue:
|
||||
serialized_name: value
|
||||
exp: "object.isVisible() ? object.getValue() : null"
|
||||
@@ -1,6 +1,6 @@
|
||||
App\Entity\Timesheet:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [id, begin, end, duration, rate, activity, project, user, description, fixedRate, hourlyRate, tags, exported]
|
||||
custom_accessor_order: [id, begin, end, duration, rate, activity, project, user, description, fixedRate, hourlyRate, tags, exported, metaFields]
|
||||
properties:
|
||||
id:
|
||||
include: true
|
||||
@@ -29,6 +29,8 @@ App\Entity\Timesheet:
|
||||
groups: [Subresource]
|
||||
user:
|
||||
exclude: true
|
||||
metaFields:
|
||||
exclude: true
|
||||
virtual_properties:
|
||||
getBegin:
|
||||
serialized_name: begin
|
||||
@@ -53,6 +55,11 @@ App\Entity\Timesheet:
|
||||
exp: "object.getUser().getId()"
|
||||
type: integer
|
||||
getTags:
|
||||
serialized_name: tags
|
||||
exp: "object.getTagsAsArray()"
|
||||
type: array<string>
|
||||
serialized_name: tags
|
||||
exp: "object.getTagsAsArray()"
|
||||
type: array<string>
|
||||
getMetaFields:
|
||||
serialized_name: metaFields
|
||||
exp: "object.getVisibleMetaFields()"
|
||||
type: array<App\Entity\TimesheetMeta>
|
||||
groups: [Default]
|
||||
|
||||
15
config/serializer/App/Entity.TimesheetMeta.yml
Normal file
15
config/serializer/App/Entity.TimesheetMeta.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
App\Entity\TimesheetMeta:
|
||||
exclusion_policy: All
|
||||
custom_accessor_order: [name, value]
|
||||
properties:
|
||||
name:
|
||||
include: false
|
||||
value:
|
||||
include: false
|
||||
virtual_properties:
|
||||
getName:
|
||||
serialized_name: name
|
||||
exp: "object.isVisible() ? object.getName() : null"
|
||||
getValue:
|
||||
serialized_name: value
|
||||
exp: "object.isVisible() ? object.getValue() : null"
|
||||
Reference in New Issue
Block a user