# Work area and travel limits

> Record where each site is and how far each person will travel, so schedules, offers and pickups never send someone outside their area or across the country between shifts.

A work area is the set of sites a person can be sent to. Staffedly works it out from three things you record: where each site is, where the person travels from, and how far they will go. You can also name the sites a person only works at, or never works at. Once these are filled in, the schedule generator, shift offers, pickups, swaps and trades all keep to them.

Work areas are part of every plan.

![The Work area panel on a person's page: home ZIP code, travel limit, and each site with its distance and whether the person can be scheduled there](https://staffedly.com/docs/img/people/work-area.webp)

## Who can set it

Admins and schedulers. A teammate with custom access needs the **People and places** access area at the Full level. The organization's default limit is in Settings, which only admins can open. Staff can see their own work area in the portal but cannot change it.

## Say where a site is

1. Open **Clients**, then **Facilities**.
2. Click **Edit** on the site.
3. Type the **ZIP code**. The street address is optional and is only shown to you.
4. Click **Save**.

The site's card then shows the ZIP code and its town. When you add a new site, there is a **ZIP** box in the bar at the top.

Distance is measured between ZIP codes, not street addresses. For Canadian sites, type the postal code; the first three characters are used.

## Set a person's work area

1. Open **People**, then **Providers**, and click the person's name.
2. Scroll to **Work area**.
3. Type their **Home ZIP code**. Only the ZIP is kept, not a street address.
4. Type how far they **Will travel up to**, in miles. Leave it empty to use your organization's default.
5. Optional: in the table, choose a rule for a site:
   - **by distance**: the usual rule. The site is allowed if it is inside the limit.
   - **works here (only listed sites)**: once any site is marked this way, the person works only at the marked sites.
   - **never here**: the person is never placed at this site.
6. Click **Save work area**.

The table shows each site's distance from the person's home and, under **As it stands**, either **can be scheduled** or the reason they cannot.

If the person already holds upcoming shifts outside the new area, the note after saving tells you how many. Those shifts are not moved or cancelled; change them yourself if you want to.

## Set a default limit for everyone

1. Open **Admin**, then **Settings**, then **Provider roles**.
2. Under **Travel limit**, type a number of miles and click **Save**.

The default applies to people who have a home ZIP code and no limit of their own. A person's own limit always wins. Leave the default empty and only people with their own limit are held to one.

## What the rules do

- **Site list.** A person marked **never here** is not placed at that site. A person with **only listed sites** is placed at those and nowhere else.
- **Work area.** A person is not placed at a site further from their home ZIP than their limit.
- **Travel between shifts.** When someone has two shifts at different sites, the gap between them must cover the trip. The trip is taken as the straight-line distance at 35 miles an hour, plus 15 minutes. Two sites 10 miles apart need about half an hour; two sites on opposite coasts cannot be worked on the same day or the next. On-call is not counted, because call is usually taken from home.

A site with no ZIP code, or a person with no home ZIP code, is not measured. The distance rules do not apply to them, and scheduling works as it did before. The site list still applies.

## Where the rules apply

| Where | What happens |
| --- | --- |
| [Generate a schedule](https://staffedly.com/docs/plan/generate-a-schedule) | Nobody is placed outside their work area or with a trip that does not fit. A slot left empty for this reason is listed as "outside their work area" or "too far from their other shift". Among people who qualify, a nearer site is slightly preferred once fairness is settled. |
| [Open shifts](https://staffedly.com/docs/fill/open-shifts) and [offers](https://staffedly.com/docs/fill/offers-and-outreach) | The candidate list shows the person with a ✗ and the reason, for example "Eastside Depot is 42 miles from home; the limit is 25". No offer is sent to them. |
| [The provider portal](https://staffedly.com/docs/portals/provider-portal) | An open shift outside the person's area reads **can't take**, with "Outside your work area". |
| [Swap board](https://staffedly.com/docs/fill/swap-board) | A claim or a trade that would break a rule is refused. |
| [The schedule calendar](https://staffedly.com/docs/plan/schedule-calendar) | Assigning or moving a shift by hand is checked. See below. |

## Place someone outside their area by hand

Automatic scheduling and offers never break these rules. You can.

1. On the calendar, assign or move the shift as usual.
2. If distance is the only problem, the red note lists it and shows a box: **You can place them anyway. Say why**.
3. Type the reason, then press the assign or move button again.

The reason is kept in the [Audit log](https://staffedly.com/docs/run/audit-log). If something else is also wrong, such as an overlap or a missing credential, that still has to be fixed first.

## Import home ZIP codes and limits

The people import accepts two more columns, `home_zip` and `max_miles`. The locations import accepts `zip`. The templates include them. A row with a ZIP code that does not exist is skipped and named in the result. See [Import people](https://staffedly.com/docs/getting-started/import-people).

## From the API

People carry `homePostalCode`, `maxTravelMiles`, `onlyFacilityIds` and `neverFacilityIds`, and sites carry `postalCode` and `address`. You can set the person fields when you add or update a person; see [Add a person](https://staffedly.com/docs/api/providers) in the API reference. A scheduling call that would break a rule answers `422 constraint_violation` and names `work_area` or `travel_time`. The API cannot set a rule aside; that is done by hand in the app.

## Questions

### Is the distance the driving distance?

No. It is the straight line between the two ZIP codes, so it reads a little shorter than the drive. Set limits with that in mind. No address is sent to a mapping service.

### Can staff set their own limit?

No. They see it on **My page** in the portal, with the sites they only or never work at, and are told to message the office to change it.

### What happens to shifts already on the schedule when I set a limit?

Nothing. They stay where they are, and the note after saving tells you how many fall outside the new area.

### Does this change anything if I do not enter ZIP codes?

No. With no ZIP codes there is nothing to measure, and no distance rule applies.

### Can I use kilometres?

Not yet. Limits are in miles.
