---
title: Who does what
summary: A service is given to a resource only if that resource is marked as doing it. Places and devices are marked at once for every service that needs them; masters are marked service by service.
tools: [talemo_list_services, talemo_add_service_fit, talemo_remove_service_fit, talemo_list_resources]
related: [resources, services-and-prices, finding-times]
search: [which master does which service, staff skills]
---

# Who does what

A service needs a master, a place or a device (see [Services, prices and currency](services-and-prices.md)),
and each is filled by a particular resource. Who does what is the mark that a
particular resource does a particular service. Booking offers a resource for a
service only when the mark is there.

## Two rules

- **Places and devices** are marked at once. A new place or device does every
  service that needs it, and a new service is done by every place and device it
  needs. The mark can be taken off: for example, a service is done only in
  one room.
- **Masters** are marked by hand, service by service. A new master does nothing
  until marked, so a trainee does not get someone else's work.

Changing who a resource is — a master, a place or a device — first takes away its
old marks (see [Resources](resources.md)), and then the rules for what it became
apply.

## Where

Marks are set from two sides, and both work on the open branch.

- **From a resource.** On the card of a master, place or device (the section
  **Masters, places and devices**) the item **Services** of the “…” menu
  opens a window with the services of the price list that need such a master, place
  or device, by service group; next to it is how many are marked out of the total, and **Turn all on** and
  **Turn all off** mark the whole list at once.
- **From a service.** In **Services and prices** the item **Who does it** of the “…” menu
  of a row opens a window with the resources that can do the service; the column
  **Who does it** of the row shows them as circles. The item **Nobody does it** in the
  panel of the section gathers the services that can’t be booked: for one of the things
  they need — a master, a place or a device — there is no working resource.

The service list in `talemo_list_services` also names who does each service.

## Marking

Marking a service in the window, or `talemo_add_service_fit`, says that the resource does the
service; removing the mark, or `talemo_remove_service_fit`, says it does not.
Repeating either gives the same result. A mark is refused when:

- the resource is in another branch;
- the resource is deactivated, or the service is deactivated (taking a mark off is
  still allowed);
- the service doesn’t need it: for example, it needs a master and a place is being marked.

## What it changes in booking

When a visit has several services, a master is offered only if marked for all of
them that need a master. If no master does all the services together, the finder
says so and does not search for free time (see [Finding times](finding-times.md)).
The fix is to remove a service from the visit or to mark a master.

## Who can do it

Marking uses the same right as changing a service, the Administrator's.

## Tools and refusals

- `talemo_list_services` names who does each service in `fits`, with the name of each resource; `talemo_list_resources` lists the masters, places and devices.
- `talemo_add_service_fit` marks that a resource does a service, `talemo_remove_service_fit` marks that it does not; both take `service_id` and `resource_id`. Repeating either returns the service as it is.
- A mark is refused with status 422, code `service.resource_unfit` and `params.role` when the service does not need such a resource: for example, it needs a master and a place is being marked. A resource of another branch gives status 422 and code `record.reference_missing` with `params.field` = `resource_id`. A deactivated resource gives status 409 and code `resource.deactivated`, a deactivated service `service.deactivated`: turn them on first; taking a mark off works even then.
- A master does a service only once marked, so a new master does nothing until the person says who does what. Ask them; never mark every service on your own. Places and devices are marked at once for every service that needs them.
- A visit with several services gets a master only if one master is marked for all the services that need a master. When none is, `talemo_find_times` answers `none_together` with `roles` telling who fits as a master, a place and a device: take a service out of the visit or mark a master, and ask the person which. A place and a device are not counted this way: each service gets its own, so a manicure on a table and a pedicure on a couch are one visit of one master. A place or a device gives `none_together` only when one of the services has no fitting one at all.
