> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/marcosfabricio3/simple-manager-mobile/llms.txt
> Use this file to discover all available pages before exploring further.

# Service

> Service entity represents services offered in Simple Manager Mobile

## Overview

The `Service` entity represents services or offerings available in Simple Manager Mobile. Services can be activated or deactivated, have pricing information, and include color coding for visual organization.

## Interface Definition

```typescript theme={null}
export interface Service {
    id: string;
    name: string;
    defaultPrice: number;
    color: string;
    isActive: boolean;
    createdAt: string;
    updatedAt: string;
}
```

## Properties

<ParamField path="id" type="string" required>
  Unique identifier for the service
</ParamField>

<ParamField path="name" type="string" required>
  Name or title of the service
</ParamField>

<ParamField path="defaultPrice" type="number" required>
  Default price for the service in the application's base currency
</ParamField>

<ParamField path="color" type="string" required>
  Color code (typically hex format) used for visual identification of the service in the UI
</ParamField>

<ParamField path="isActive" type="boolean" required>
  Flag indicating whether the service is currently active and available for use. Inactive services are typically hidden from selection
</ParamField>

<ParamField path="createdAt" type="string" required>
  ISO 8601 timestamp indicating when the service was created
</ParamField>

<ParamField path="updatedAt" type="string" required>
  ISO 8601 timestamp indicating when the service was last updated
</ParamField>

## Usage Example

```typescript theme={null}
import { Service } from '@/domain/entities/Service';

const service: Service = {
  id: 'svc_123456',
  name: 'General Consultation',
  defaultPrice: 150.00,
  color: '#4A90E2',
  isActive: true,
  createdAt: '2024-03-12T10:30:00Z',
  updatedAt: '2024-03-12T10:30:00Z'
};
```

## Common Operations

### Creating a New Service

```typescript theme={null}
const newService: Omit<Service, 'id' | 'createdAt' | 'updatedAt'> = {
  name: 'Physical Therapy Session',
  defaultPrice: 100.00,
  color: '#2ECC71',
  isActive: true
};
```

### Deactivating a Service

```typescript theme={null}
const deactivatedService: Service = {
  ...existingService,
  isActive: false,
  updatedAt: new Date().toISOString()
};
```

### Updating Service Price

```typescript theme={null}
const updatedService: Service = {
  ...existingService,
  defaultPrice: 175.00,
  updatedAt: new Date().toISOString()
};
```

## Color Guidelines

The `color` field should follow these recommendations:

* Use hex color codes (e.g., `#4A90E2`, `#FF5733`)
* Choose distinct colors for different services to improve visual differentiation
* Consider accessibility and contrast when selecting colors

```typescript theme={null}
// Example color palette for services
const serviceColors = {
  consultation: '#4A90E2',
  therapy: '#2ECC71',
  diagnostic: '#F39C12',
  surgery: '#E74C3C',
  followUp: '#9B59B6'
};
```

## Filtering Active Services

```typescript theme={null}
// Get only active services
const activeServices = services.filter(service => service.isActive);

// Get services by price range
const affordableServices = services.filter(
  service => service.isActive && service.defaultPrice <= 100
);
```

## Related Entities

* [Record](/api/entities/record)
* [Appointment](/api/entities/appointment)
