# Develop with saaster

To know which plan or which modules the customer has booked, you can query a struct. This gives you all the relevant information you need to develop your software.

There are two session structs in saaster with which you can get this data:

* session.currentPlan
* session.currentModules

### The session variable "currentPlan"

With the session variable *session.currentPlan* you get all the data for a booked plan. \
This is how it looks like:

<div align="left"><figure><img src="/files/aPykBTBnfkrxlszT6VPO" alt=""><figcaption></figcaption></figure></div>

#### Explanation of the variables:

| **bookingID**       | The primary id from table *bookings*                              |
| ------------------- | ----------------------------------------------------------------- |
| **endDate**         | The end of the current subscription (*date*)                      |
| **invoiceID**       | The primary id from table *invoices,* which is joined to the plan |
| **maxUsers**        | The maximum number of users within this subscription              |
| **modulesIncluded** | An array with all modules included within this plan               |
| **nextPlan**        | A struct containing the data of the next plan if it’s another one |
| **planID**          | The primary id from table *plans*                                 |
| **planName**        | The name of the current plan                                      |
| **priceMonthly**    | The price paid monthly                                            |
| **recurring**       | <p>The current cycle of the plan; <br>ecurring and status</p>     |
| **startDate**       | The start of the current subscription (*date*)                    |
| **status**          | The status of the current subscription; Recurring and status      |

### The session variable "currentModules"

With the session variable *session.currentModules* you get all the data you need. \
This is how it looks like:

<div align="left"><figure><img src="/files/YFZItA0JXYL9CNT1xb4K" alt=""><figcaption></figcaption></figure></div>

#### Explanation of the variables:

| **includedInCurrentPlan**                                 | Whether the module is included within the current plan              |
| --------------------------------------------------------- | ------------------------------------------------------------------- |
| **invoiceID**                                             | The primary id from table *invoices,* which is joined to the module |
| **moduleData**                                            | All data of the corresponding module as a struct                    |
| **moduleID**                                              | The primary id from table *modules*                                 |
|                                                           |                                                                     |
| <mark style="color:blue;">**Struct moduleStatus:**</mark> |                                                                     |
|                                                           |                                                                     |
| **bookingID**                                             | The primary id from table *bookings*                                |
| **endDate**                                               | The end of the current subscription (*date*)                        |
| **fontColor**                                             | The font color is used to display a text in that color              |
| **recurring**                                             | The current cycle of the plan; Recurring and status                 |
| **startDate**                                             | The start of the current subscription (*date*)                      |
| **status**                                                | The status of the current subscription; Recurring and status        |
| **statusText**                                            | The status description to display to the customer                   |
| **statusTitle**                                           | The status title to display to the customer                         |

### Recurring and status

We work in saaster with the term "recurring" to save the cycle of the plan or module. These values are used:

| **test**    | The plan is in test mode and will not be automatically renewed |
| ----------- | -------------------------------------------------------------- |
| **monthly** | The plan is in a monthly cycle                                 |
| **yearly**  | The plan is in a yearly cycle                                  |

Furthermore, many different statuses exist to define plans and modules. These values are used as statuses:

| **test**     | The plan is in test mode                   |
| ------------ | ------------------------------------------ |
| **free**     | There is a free plan running               |
| **active**   | There is a paid plan running               |
| **payment**  | Waiting for payment from the customer      |
| **waiting**  | Waiting to start the plan (next plan)      |
| **canceled** | The plan has been canceled by the customer |
| **expired**  | The plan has expired                       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saaster.io/development/develop-with-saaster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
