# Statuses

Each ticket provider class has some default properties which have to be defined.

## getStatuses()

This defines all possible statuses from the external integration. This is important, because the ID of the status will get saved to the hostware database and will get mapped to display the displayName and color.

### Parameters

None.

### Response

Collection of TicketStatusResponse() classes. Each class contains the following attributes:

* id (The technical ID of the status. Usually, each ticket system has something like "active", "closed", "answered" etc. or numeric IDs which are static.
* displayName (The name which gets displayed in the storefront)
* color (The color which gets displayed for the status)

### Example Code

```php
public function getStatuses(): Collection {
	return collect([
		new TicketStatusResponse("active", "Aktiv", "var(--bs-success)"),
		new TicketStatusResponse("pending", "In Bearbeitung", "var(--bs-warning)"),
		new TicketStatusResponse("closed", "Geschlossen", "var(--bs-danger)"),
		new TicketStatusResponse("spam", "Spam", "var(--bs-secondary)"),
	]);
}
```

## Other properties

At the top of the file, the following parameters have to be defined. They should contain the ID (of the above defined array) for each ticket state. This is required so hostware can interprete which ticket status e.g. is the closed state to calculate the number of open tickets.

```php
// Tickets, which where opened by the customer and need admin-response
public mixed $openStatusId = "active";

// Tickets, which where responded by the customer and need admin-response
public mixed $answeredStatusId = "active";

// Tickets, which where closed
public mixed $closedStatusId = "closed";
```
