# Offer Management

## The `onOfferManagement` callback

When the Assistant detects that the user is trying to enquire about offers,  it invokes the callback associated with the Offer Management user journey. The callback looks like this:

{% tabs %}
{% tab title="Android Native" %}

```
public OfferAppState onOfferManagement(OfferInfo offerInfo, OfferManagementUserJourney offerManagementUserJourney) {
```

{% endtab %}

{% tab title="React Native" %}

```
TBD
```

{% endtab %}

{% tab title="Web" %}

```
TBD
```

{% endtab %}
{% endtabs %}

1. Open the offers page
2. Return the ViewOffer as the state and SUCCESS as the condition

{% tabs %}
{% tab title="Android Native" %}

```
public OfferAppState onOfferManagement(OfferInfo offerInfo, OfferManagementUserJourney offerManagementUserJourney) {
    // Navigate to the offers page
    return new ViewOfferAppState(ViewOfferAppState.SUCCESS);
}
```

{% endtab %}

{% tab title="React Native" %}

```
TBD
```

{% endtab %}

{% tab title="Web" %}

```
TBD
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Note that currently, the OfferInfo object does not contain any additional data that would be useful to further understand the kind of offer the user is looking for. That could get added in the future
{% endhint %}

## Sample Utterances that could trigger Offers

The following are some examples of commands that could trigger this journey

* *"where is my offer"*
* *"any offers"*
* *"show me offers"*

### Supported `AppState`s

The following `AppState`s are supported.

* **VIEW\_OFFER (`ViewOfferAppState`):** To be returned when the app handles the navigation request
* **UNSUPPORTED (`UnsupportedAppState`):** To be returned when the app is not ready to handle navigation yet. The Assistant will speak out an appropriate prompt to the user.&#x20;

{% hint style="info" %}
The Slang Retail Assistant provides a special `AppState` **`'WAITING' (WaitingAppState)`** that is common across all `UserJourney` types for completing asynchronous operations within the callback. Refer to the [Asynchronous Action Handling](https://docs.conva.ai/slang/getting-started/integrating-slang-retail-assistant/code-integration-basic-steps/code-integration-basic-steps-1/supported-user-journeys/broken-reference) section for details of how to deal with asynchronous operations.
{% endhint %}

### Supported `Condition`s

The following `Condition`s are supported for each of the `AppState`s supported by the Assistant

| **App State**                    | **App State Condition**                                             | Description                                                                                                       |
| -------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `VIEW_OFFER (ViewOfferAppState)` | <ul><li><code>SUCCESS</code></li><li><code>FAILURE</code></li></ul> | <ul><li>The offer page was successfully opened</li><li>There was a failure while opening the offer page</li></ul> |

### Assistant Prompts

Based on the App State and the Condition that was set, the Assistant will speak out an appropriate message to the user. You can examine the default set of prompts configured for the Assistant through the Console and also customize it to your needs. Refer to the [Customizing the Assistant](https://docs.conva.ai/slang/getting-started/integrating-slang-retail-assistant/code-integration-basic-steps/code-integration-basic-steps-1/supported-user-journeys/broken-reference) section for details.
