---
# System prepended metadata

title: Untitled

---

## DB

### Packages

* Table: `academy_packages`
    * Add 6 packages with periods `monthly`
    * `duration_days` = `0`
    * `meta_data.min_duration_days` = `120`
    * `meta_data.max_duration_days` = `330`

### Period

* Table: `system_meta`
* Meta key: `trio_settings_meta.package_periods`
* Hide 5 months period:
```json
{
  "title": "5 months",
  "type": "5months",
  "days": 150,
  "visible": false
},
```

* Set 12 months period as most popular

```json
{
  "title": "2 weeks",
  "type": "2weeks",
  "days": 14,
  "visible": true,
  "most_popular": true
}
```

* New period: 

```json
{
  "title": "Monthly",
  "type": "monthly",
  "days": 0,
  "visible": true,
  "most_popular": false
}
```




## Academy lib

### Convert days to months

`$package->getMonths($days);`


## Backend


### Checkout

POST /plan/checkout?package_id=123

* Add a new body parameter:

`num_of_months: 4`
