The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Gets the total number of employees in the database. This includes employees of all privilege levels, including not only administrators and active employees, but inactives and passerbies as well. Keep this in mind when evaluating the number returned. EOH }, 'employee/count/:priv' => { target => { GET => '_get_count', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'admin', cli => 'employee count $PRIV', description => 'Display total count of employees with given privilege level', documentation => <<'EOH', =pod

Gets the number of employees with a given privilege level. Valid privlevels are:

  • passerby

  • inactive

  • active

  • admin

  • GET

    Displays the profile of the currently logged-in employee. The information is limited to just the employee object itself.

  • POST

    Provides a way for an employee to update certain fields of her own employee profile. Exactly which fields can be updated may differ from site to site (see the DOCHAZKA_PROFILE_EDITABLE_FIELDS site parameter).

Displays the "full profile" of the currently logged-in employee. The information includes the employee object in the 'current_emp' property and the employee's privlevel in the 'priv' property. EOH }, 'employee/eid' => { target => { POST => '_put_post_delete_employee_by_eid', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'admin', cli => 'employee eid $JSON', description => 'Update existing employee (JSON request body with EID required)', documentation => <<'EOH', =pod

This resource provides a way to update employee objects using the POST method, provided the employee's EID is provided in the content body. The properties to be modified should also be included, e.g.:

    { "eid" : 43, "fullname" : "Foo Bariful" }

This would change the 'fullname' property of the employee with EID 43 to "Foo Bariful" (provided such an employee exists). EOH }, 'employee/eid/:eid' => { target => { GET => '_get_eid', PUT => '_put_post_delete_employee_by_eid', DELETE => '_put_post_delete_employee_by_eid', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'admin', cli => 'employee eid $EID [$JSON]', description => 'GET: look up employee (exact match); PUT: update existing employee; DELETE: delete employee', documentation => <<'EOH', =over

  • GET

    Retrieves an employee object by its EID.

  • PUT

    Updates the "employee profile" (employee object) of the employee with the given EID. For example, if the request body was:

        { "fullname" : "Foo Bariful" }

    the reques would changesthe 'fullname' property of the employee with EID 43 to "Foo Bariful" (provided such an employee exists). Any 'eid' property provided in the content body will be ignored.

  • DELETE

    Deletes the employee with the given EID (will only work if the EID exists and nothing in the database refers to it).

Displays information on all employee resources available to the logged-in employee, according to her privlevel. EOH }, 'employee/nick' => { target => { POST => '_put_post_delete_employee_by_nick', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'admin', cli => 'employee nick $JSON', description => 'Insert new/update existing employee (JSON request body with nick required)', documentation => <<'EOH', =pod

This resource provides a way to insert/update employee objects using the POST method, provided the employee's nick is provided in the content body.

Consider, for example, the following request body:

    { "nick" : "foobar", "fullname" : "Foo Bariful" }

If an employee "foobar" exists, such a request would change the 'fullname' property of that employee to "Foo Bariful". On the other hand, if the employee doesn't exist this HTTP request would cause a new employee 'foobar' to be created. EOH }, 'employee/nick/:nick' => { target => { GET => '_get_nick', PUT => '_put_post_delete_employee_by_nick', DELETE => '_put_post_delete_employee_by_nick', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'admin', cli => 'employee nick $NICK [$JSON]', description => "Retrieves (GET), updates/inserts (PUT), and/or deletes (DELETE) the employee specified by the ':nick' parameter", documentation => <<'EOH', =over

  • GET

    Retrieves employee object(s) by exact match or % wildcard. For example:

        GET employee/nick/foobar

    would look for an employee whose nick is 'foobar'. Another example:

        GET employee/nick/foo%

    would return a list of employees whose nick starts with 'foo'.

  • PUT

    Inserts a new employee or updates an existing one (exact match only). If a 'nick' property is provided in the content body and its value is different from the nick provided in the URI, the employee's nick will be changed to the value provided in the content body.

  • DELETE

    Deletes an employee (exact match only). This will work only if the exact nick exists and nothing else in the database refers to the employee in question.

  • GET

    Displays the profile of the currently logged-in employee. The information is limited to just the employee object itself.

  • POST

    Provides a way for an employee to update certain fields of her own employee profile. Exactly which fields can be updated may differ from site to site (see the DOCHAZKA_PROFILE_EDITABLE_FIELDS site parameter).

Displays the "full profile" of the currently logged-in employee. The information includes the employee object in the 'current_emp' property and the employee's privlevel in the 'priv' property. EOH },

} );

1;

7 POD Errors

The following errors were encountered while parsing the POD:

Around line 92:

=back doesn't take any parameters, but you said =back EOH }, 'employee/current' => { target => { GET => '_get_current', POST => '_post_current', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => { 'GET' => 'passerby', 'POST' => 'inactive', }, cli => 'employee current', description => 'Retrieve (GET) and edit (POST) our own employee profile', documentation => <<'EOH', =pod

Around line 124:

=back doesn't take any parameters, but you said =back EOH }, 'employee/current/priv' => { target => { GET => '_get_current_priv', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'passerby', cli => 'employee current priv', description => 'Retrieve our own employee profile, privlevel, and schedule', documentation => <<'EOH', =pod

Around line 180:

'=item' outside of any '=over'

Around line 200:

=back doesn't take any parameters, but you said =back EOH }, 'employee/help' => { target => { GET => '_get_default', # _get_default is the name of a subroutine in the DISPATCH_EMPLOYEE_TARGET_MODULE module POST => '_post_default', PUT => '_put_default', DELETE => '_delete_default', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'passerby', cli => 'employee help', description => 'Display available employee resources for given HTTP method', documentation => <<'EOH', =pod

Around line 261:

'=item' outside of any '=over'

Around line 286:

=back doesn't take any parameters, but you said =back EOH }, 'employee/self' => { target => { GET => '_get_current', POST => '_post_current', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => { 'GET' => 'passerby', 'POST' => 'inactive', }, cli => 'employee current', description => 'Retrieve (GET) and edit (POST) our own employee profile', documentation => <<'EOH', =pod

Around line 318:

=back doesn't take any parameters, but you said =back EOH }, 'employee/self/priv' => { target => { GET => '_get_current_priv', }, target_module => 'App::Dochazka::REST::Dispatch::Employee', acl_profile => 'passerby', cli => 'employee current priv', description => 'Retrieve our own employee profile, privlevel, and schedule', documentation => <<'EOH', =pod