# Resources and Assignments
URL: https://pro.rv-grid.com/guides/gantt/resources/resources-and-assignments/
Source: src/content/docs/guides/gantt/resources/resources-and-assignments.mdx
Description: Define resource capacity, assignments, and how they interact with task work.
Resources define the people, equipment, or facilities that perform work on your tasks. Assignments connect these resources to specific tasks with defined allocation units and work hours.

## Data Model

Resources and assignments are managed through two distinct collections:

```typescript
grid.ganttResources = [{
  id: 'alex',
  name: 'Alex',
  role: 'Engineer',
  calendarId: 'cal-standard',
  allocationCapacity: 100, // 100% capacity
  hourlyCost: 120,
}];

grid.ganttAssignments = [{
  id: 'assign-1',
  taskId: 'task-1',
  resourceId: 'alex',
  allocationUnits: 100, // 100% assignment
  workHours: 40,
  responsibility: 'Owner',
}];
```

### Capacity and Units
`allocationCapacity` and `allocationUnits` accept either a percent scale (`100`) or a decimal scale (`1.0`) for full capacity. The scheduling engine uses these values to calculate resource load and identify over-allocations.

## Resource Over-Allocation

When the `resourceLeveling` policy is set to `'warn'`, the scheduler calculates allocation by resource and working date. If assigned units exceed the resource's capacity on any given day, it reports a `resource-overallocation` conflict.

```typescript
grid.gantt = {
  scheduling: { resourceLeveling: 'warn' },
};
```

### Example: Over-Allocation Warning

If one resource is assigned to multiple overlapping tasks at 100% each, a warning will be triggered:

```typescript
grid.ganttResources = [{
  id: 'alex',
  name: 'Alex',
  allocationCapacity: 100,
}];

grid.ganttAssignments = [
  { taskId: 'build', resourceId: 'alex', allocationUnits: 100 },
  { taskId: 'docs', resourceId: 'alex', allocationUnits: 100 },
];
```

**Expected result**: On days where `build` and `docs` overlap, Alex is allocated at 200%. Each affected task receives a `resource-overallocation` warning in the grid and on the timeline.

---

## Next Steps
- **[Resource Planning View](../resource-planning-view)**: Visualize resource load on a dedicated timeline.
- **[Resource Leveling](../scheduling/leveling)**: Automatically resolve over-allocations by delaying tasks.
- **[Effort Modes](../scheduling/effort-modes)**: Control how assignments affect task duration.
