Technical¶
The limepkg-workorder
package installs the following dependencies:
- limepkg-document-widget
- limepkg-form (full documentation here)
- limepkg-fullcalendar
- limepkg-scheduled-limeobject (full documentation here)
- limepkg-server-commands
- limepkg-workorder-list
Table and Field Definitions Lime CRM¶
Any data structure that is expected to exist or is added?
Work Order Status and List¶
limetype | property | option key | type | configurable |
---|---|---|---|---|
workorder | limetype | No | ||
workorder | state | option | No | |
workorder | state | NotStarted | option key | No |
workorder | state | Started | option key | No |
workorder | state | Finished | option key | No |
workorder | started | time | No | |
workorder | finished | time | No | |
workorder | helpdesk | belongsto (helpdesk) | No | |
history | limetype | No | ||
history | type | option | No | |
history | type | comment | option key | No |
history | date | time | No | |
history | note | text | No | |
history | workorder | belongsto (workorder) | No | |
history | coworker | belongsto (coworker) | No | |
history | helpdesk | belongsto (helpdesk) | No | |
coworker | limetype | No | ||
helpdesk | limetype | No |
Document Widget¶
limetype | property | type | configurable |
---|---|---|---|
document | limetype | No | |
document | type | option | No |
document | workorder | belongsto (workorder) | No |
Form Protocol¶
This is documented in the readthedocs for limepkg-form already.
- The protocol is the the protocol instance that is added to the parent. It contains answers.
- The answers are the protocol items (including answer type).
- The parent can be anything that a protocol could be attached to. Here is it the workorder.
The table for protocols is not configurable.
limetype | property | option key | type | configurable |
---|---|---|---|---|
limepkg_form_protocol | No | |||
limepkg_form_protocol | key | text | No | |
limepkg_form_protocol | title | text | No | |
limepkg_form_protocol | description | text | No | |
limepkg_form_protocol | limepkg_form_anwer | hasmany (limepkg_form_answer) | No | |
limepkg_form_protocol | workorder | belongsto (workorder | Yes |
The table for answers is not configurable.
limetype | property | option key | type | configurable |
---|---|---|---|---|
limepkg_form_answer | No | |||
limepkg_form_answer | title | text | No | |
limepkg_form_answer | description | text | No | |
limepkg_form_answer | answer | text | No | |
limepkg_form_answer | comment | text | No | |
limepkg_form_answer | mandatory | yesno | No | |
limepkg_form_answer | type | text | No | |
limepkg_form_answer | options | text | No | |
limepkg_form_answer | multiselect | yesno | No | |
limepkg_form_answer | limepkg_form_protocol | belongsto (limepkg_form_protocol) | No |
The table for the parent could be anything. It just needs a relation to the protocols.
limetype | property | option key | type | configurable |
---|---|---|---|---|
workorder | Yes | |||
workorder | limepkg_form_protocol | hasmany (limepkg_form_protocol) | Yes |
Scheduled Work Orders¶
- The scheduled work order is the schedule. It says what should be created and when.
- The scheduled work order parameter set contains relations to the affected lime objects.
- The work order is what is created for every parameter set for each execution of the schedule.
The schedule has several hard coded properties that must exist.
limetype | property | option key | type | configurable |
---|---|---|---|---|
scheduledworkorder | limetype | Yes | ||
scheduledworkorder | startdate | date | No | |
scheduledworkorder | starttime | time | No | |
scheduledworkorder | endtime | time | No | |
scheduledworkorder | numberofdays | integer | No | |
scheduledworkorder | until | datetime | No | |
scheduledworkorder | createdaysbefore | integer | No | |
scheduledworkorder | lastcreated | datetime | No | |
scheduledworkorder | active | yesno | No | |
scheduledworkorder | rrulejson | text (length>=256) | No | |
scheduledworkorder | rruledescription | text (length>=256) | No | |
scheduledworkorder | protocol_keys | text (length>=1024) | Yes | |
scheduledworkorder | scheduledworkorderparameterset | hasmany (scheduledtodoparameterset) | Yes | |
scheduledworkorder | workorder | hasmany (workorder) | Yes | |
scheduledworkorder | history | hasmany (history) | Yes |
The parameter set can have any number of fields, the only required field is a relation back to the schedule.
limetype | property | option key | type | configurable |
---|---|---|---|---|
scheduledworkorderparameterset | scheduledworkorder | belongsto (scheduledworkorder) | Yes |
And finally the work orders that are created must have a relation back to the schedule as well as a field to store an identifier used for duplicate prevention.
limetype | property | option key | type | configurable |
---|---|---|---|---|
workorder | limetype | Yes | ||
workorder | scheduledworkorder | belongsto (scheduledworkorder) | Yes | |
workorder | scheduledid | string (length>=128) | Yes |
To be able to create a history note when the schedule is run the history limetype must have a relation back to the schedule, a field to store the message, an option field for type and a type key.
limetype | property | option key | type | configurable |
---|---|---|---|---|
history | limetype | Yes | ||
history | type | option | Yes | |
history | type | comment | option key | Yes |
history | note | text | Yes | |
history | scheduledworkorder | belongsto (scheduledworkorder) | Yes |
Work Order Location¶
limetype | type | configurable |
---|---|---|
workorder | limetype | No |
Hierarchy¶
limetype | property | type | configurable |
---|---|---|---|
hierarchy_limetype | limetype | Yes | |
hierarchy_limetype | workorder | hasmany (workorder) | No |
hierarchy_limetype | address | string | No |
hierarchy_limetype | zipcode | string | No |
hierarchy_limetype | city | string | No |
Time and Material Reporting¶
- The articles are the products in the product catalogue. They typically have an articlenumber and price per unit.
- The article rows are the billable value of the work order. This includes time spent and materials used. They belong to the workorder.
limetype | property | option key | type | configurable |
---|---|---|---|---|
article | yes | |||
article | name | string, len>=256 | yes | |
article | articlenumber | string(64) | yes | |
article | articletype | option | yes | |
article | price | decimal | yes | |
article | cost | decimal | yes | |
article | unit | string(32) | yes | |
article | inactive | yesno | yes | |
article | quantityincrement | decimal | yes | |
article | articlerow | hasmany (articlerow) | yes |
limetype | property | option key | type | configurable |
---|---|---|---|---|
articlerow | yes | |||
articlerow | article | belongsto (article) | yes | |
articlerow | articlename | string, len>=256 | yes | |
articlerow | articlerowstatus | notapproved |
option | yes |
articlerow | coworker | belongsto (coworker) | yes | |
articlerow | registrationdate | datetime | yes | |
articlerow | quantity | decimal | yes | |
articlerow | totalcost | decimal | yes | |
articlerow | totalprice | decimal | yes | |
articlerow | comment | text, len>=1024 | yes | |
articlerow | articlenumber | string, len>=64 | yes | |
articlerow | articletype | option | yes | |
articlerow | price | decimal | yes | |
articlerow | cost | decimal | yes | |
articlerow | unit | string, len>=32 | yes | |
articlerow | article | belongsto (article) | yes | |
articlerow | workorder | belongsto (workorder) | yes |
The article row status notapproved
is used for object access only.
Absence¶
- absence are the timeslots when a resource (coworker) aren't available for booking. For example "vacation". These are visualized in the resource planner.
limetype | property | option key | type | configurable |
---|---|---|---|---|
absence | yes | |||
absence | description | string, len>=256 | yes | |
absence | start | time | yes | |
absence | end | time | yes | |
absence | coworker | belongsto (coworker) | yes |
Work Order Default Resource¶
limetype | property | type | configurable |
---|---|---|---|
coworker | limetype | No | |
coworker | name | string | No |
absence | limetype | No | |
absence | coworker | belongsto (coworker) | No |
absence | start | time | No |
absence | end | time | No |
absence | replacement | belongsto (coworker) | No |
trait_object_coworker | limetype | No | |
trait_object_coworker | coworker | belongsto (coworker) | No |
trait_object_coworker | trait | belongsto (trait) | No |
trait | limetype | No |
Commands¶
Command default behavior can be overridden subscribing to the command.received
event. See platform docs for details.
Show Resource Planner Dialog¶
The limepkg_workorder.show-resource-planner-dialog
command is used to open the
Resource planner dialog.
property | type | description |
---|---|---|
context | LimeWebComponentContext | |
unassignedFilter | string | Optional. The id of the filter to pre-select for the list of unassigned work orders |
import {
LimeWebComponentContext,
Command,
} from '@limetech/lime-web-components';
@Command({
id: 'limepkg_workorder.show-resource-planner-dialog',
})
export class ShowResourcePlannerDialogCommand {
public context: LimeWebComponentContext;
public unassignedFilter: string;
public constructor(
context: LimeWebComponentContext,
unassignedFilter?: string
) {
this.context = context;
this.unassignedFilter = unassignedFilter;
}
}
export const ClosedResourcePlannerDialogEvent =
'limepkg_workorder.resourceplanner.closed';
Show Add Article Row Dialog¶
The limepkg-workorder.show-add-articlerow-dialog
command is used to open the add Artice Row dialog.
Finish Work Order¶
The limepkg_workorder.finish-workorder
command is used to set a work order status to finished.
Start Work Order¶
The limepkg_workorder.start-workorder
command is used to set the status of a work order to started
Reset Work Order¶
The limepkg_workorder.reset-workorder
command is used to set the status of a work order to not started.
Resume Work Order¶
The limepkg_workorder.resume-workorder
command is used to set the status of a finished work order to started.
Web Components¶
Location¶
The lwc-limepkg-workorder-location
web component renders a link that opens the work order's address on google maps. It is designed to be put on the workorder object card.
Protocol Dialog¶
The lwc-limepkg-workorder-protocol-dialog
web component is used by the handle status to show mandatory protocol items that must be completed before the work order can be finished.
Unassigned Work Orders¶
The lwc-limpkg-workorder-unassigned-workorders
web component is used in the
Start Page designer to add a button or info tile that launches the Resource
planner.
Old web components¶
These web components work but have been replaced by commands and actions. Thus, they should not be configured for new solutions.
Add Article¶
The lwc-limepkg-workorder-add-articlerow
web component is a button that can be put on the workorder object card. It opens the add article form in a new dialog.
Add Article Form¶
The lwc-limepkg-workorder-add-articlerow-form
web component is a dialog that is opened by the add article button.
Descriptive Link¶
The lwc-limepkg-workorder-descriptive-link
web component renders a clickable lime-link to most specifc object in the "hierarchy". It is designed to be put on the workorder object card.
Handle Status¶
The lwc-limepkg-workorder-handle-status
web component is a button that can be put on the workorder object card. It is used to update the state of the workorder: Not Started ⮕ Started ⮕ Finished
Events¶
Application events can be subscribed to using the event dispatcher service in the platform. See platform docs for details.
Resource Planner Closed¶
The limepkg_workorder.resourceplanner.closed
event is raised when the
Resource planner is closed.
preventDefault¶
Not applicable to this event.
Internal Endpoints¶
The package uses several endpoints. None are to be used by external systems.
Commands¶
No documentation available.
/limepkg-workorder/commands/
Get resource for WO¶
Gets the best resource for a workorder based on related objects. Will only return a coworker object if one and only one match is found.
/limepkg-workorder/resource/<limetype>/<objectid>/<traitid>/
Location¶
Returns the address and the lowest related objects configured location information.
/limepkg-workorder/workorder/location/