Added Config variable docs.

This commit is contained in:
2024-12-12 15:17:49 +01:00
parent 80b8926a0e
commit 3f1cf11cd7
+182 -36
View File
@@ -1,54 +1,200 @@
<!-- omit in toc -->
# SomniaRooms - App Configuration Variables. # SomniaRooms - App Configuration Variables.
- [Config Sections](#config-sections)
- [Config implementation status](#config-implementation-status)
- [Company Information](#company-information)
- [Front-end Config](#front-end-config)
- [Var `NightAmountForContactDialog`](#var-nightamountforcontactdialog)
- [Var `GuestNumberForContactDialog`](#var-guestnumberforcontactdialog)
- [Var `ContactDialogShowBehaviour`](#var-contactdialogshowbehaviour)
- [Var `ShowNonAvailableRooms`](#var-shownonavailablerooms)
- [Var `SomniaAttributionNotice`](#var-somniaattributionnotice)
- [Var `PhotoAspectRatio`](#var-photoaspectratio)
- [Price Management](#price-management)
- [Var `TotalPriceMethod`.](#var-totalpricemethod)
- [Var `FareSelectionMethod`](#var-fareselectionmethod)
- [API Config.](#api-config)
- [Var `MaxAllowedNightAmount`](#var-maxallowednightamount)
- [Var `MaxAllowedGuestNumber`](#var-maxallowedguestnumber)
---
This document contains a list of all config variables of SomniaRooms. Variables are stored in DB (table _`config_variable`_) and can be configured from admin panel. This document contains a list of all config variables of SomniaRooms. Variables are stored in DB (table _`config_variable`_) and can be configured from admin panel.
Variables are divided in sections. Some sections are ony accesible from SomniaRoom, but others can be retrieved by anyone using config endpoint (_`/config`_). Variables are divided in sections. Some sections are ony accesible from SomniaRoom, but others can be retrieved by anyone using config endpoint (_`/config`_).
## List of sections: ## Config Sections
WIP | Section | SectionName | Description | Availability |
| :------------------------------------------ | :-------------- | :--------------------------------------------- | :----------: |
| [Company Information](#company-information) | COMPANY | Configure company information | Public |
| [Front-end config](#front-end-config) | FRONTEND_CONFIG | Configure front-end behaviour | Public |
| [Price API Management](#price-management) | API_PRICES | Configure how prices are calculated for a stay | Private |
| [API Config](#api-config) | API_CONFIG | Configure API | Private |
TODO -> Add default table with basic information to all sections.
### **Company** ### Config implementation status
Variables in this section contains information about the Hotel.
- SectionName -> company Not all variables are fully implemented, some are experimental or have options that are.
- Availability -> public Current status for a variable and it's options:
- Nº variables -> X - New!: :sparkles:
- Fully available: :heavy_check_mark:
- Partially available: :construction:
- Experimental: :bulb:
- Not yet: :x:
**Variable list:**
- Name - Name of hotel. ## Company Information
Variables in this section contains information about the Company. Those are used to identify the business and to customize frontend.
| Variable | Type | Description | Constraints | Default Value | Status |
| :------------- | :----- | :-------------------- | :----------------------------------------------------------- | :------------ | :------------: |
| CompanyName | string | Company name | - | SomniaRooms | :construction: |
| CompanyWebsite | string | Company website URL | Valid URL to company website. | somnia.dev | :construction: |
| CompanyLogo | string | Company Logo URL | Valid URL to company logo. Somnia Backend system can be used | "" | :construction: |
| CompanyAddress | string | Company Address | - | "" | :construction: |
| CompanyEmail | string | Company email address | - | "" | :construction: |
| CompanyPhone | string | Company phone number | - | "" | :construction: |
## Front-end Config
This variable set the behaviour of front-end app.
| Variable | Type | Description | Constraints | Default Value | Status |
| :-------------------------- | :------ | :------------------------------------------------- | :---------------------------------------------- | :------------ | :------------: |
| NightAmountForContactDialog | int | Set the amount of nights to show a contact dialog. | See [details](#var-nightamountforcontactdialog) | 10 | :construction: |
| GuestNumberForContactDialog | int | Set the guest number to show a contact dialog. | See [details](#var-guestnumberforcontactdialog) | 6 | :construction: |
| ContactDialogShowBehaviour | options | Set how the contact dialog is shown | See [details](#var-contactdialogshowbehaviour) | show | :construction: |
| ShowNonAvailableRooms | bool | Show rooms without availability on search | See [details](#var-shownonavailablerooms) | true | :construction: |
| SomniaAttributionNotice | options | How SomniaRooms notice is shown. | See [details](#var-somniaattributionnotice) | full | :construction: |
| PhotoAspectRatio | string | Set the aspect ratio for photos | See [details](#var-photoaspectratio) | 4:3 | :construction: |
### Var `NightAmountForContactDialog`
Set the amount of nights to show a contact dialog. This dialog contains company contact information and may be used to get a custom price for long stays.
The contact dialog will be shown when night amount is equal or greater than configured amount.
**Options:**
| Option | Value | Usage | Status |
| :------------ | :---- | :-------------------------------------------------------- | :----: |
| Disabled | -1 | Disable this funcionality. Contact dialog won't be shown. | :x: |
| Always | 0 | Contact dialog is always shown. | :x: |
| Custom Amount | - | Set the minimun number of nights to show the dialog. | :x: |
### Var `GuestNumberForContactDialog`
Set the guest number to show a contact dialog. This dialog contains company contact information and may be used to get a custom price for groups.
The contact dialog will be shown when guest number is equal or greater than configured amount.
**Options:**
| Option | Value | Usage | Status |
| :------------ | :---- | :-------------------------------------------------------- | :----: |
| Disabled | -1 | Disable this funcionality. Contact dialog won't be shown. | :x: |
| Always | 0 | Contact dialog is always shown. | :x: |
| Custom Amount | - | Set the minimun guest number to show the dialog. | :x: |
### Var `ContactDialogShowBehaviour`
How the contact dialog is shown to the user (when conditions are meet).
**Options:**
| Option | Value | Usage | Status |
| :----- | :---- | :------------------------------- | :----: |
| Show | SHOW | Show dialog on screen | :x: |
| Alert | ALERT | Show an alert to open the dialog | :x: |
### Var `ShowNonAvailableRooms`
Show rooms without availability on search.
Non-available rooms will be shown at the end of the list.
**Options:**
| Option | Value | Usage | Status |
| :----- | :---- | :-------------------------------------------------------- | :----: |
| Show | true | All rooms will appear on search. Even non-available ones. | :x: |
| Hide | false | Only show available rooms. | :x: |
### Var `SomniaAttributionNotice`
Configure how SomniaRooms attribution note is display.
**Options:**
| Option | Value | Usage | Status |
| :----- | :---- | :------------------------------------ | :----: |
| Full | FULL | Show the full message. Thanks :heart: | :x: |
| Small | SMALL | Show a small notice :+1: | :x: |
| Hide | HIDE | SomniaRooms notice won't be shown. | :x: |
### Var `PhotoAspectRatio`
Aspect ratio for front-end photos.
This setting is currently used for room photos. You may set any valid aspect-ratio you want.
It's recommended that all photos have the same aspect-ratio to avoid scaling.
## Price Management
How SomniaRooms API services calculates prices for bookings.
| Variable | Type | Description | Constraints | Default Value | Status |
| :------------------ | :----- | :---------------------------------------------------- | :-------------------------------------- | :------------ | :----: |
| TotalPriceMethod | option | How total price is calculated for a stay | See [details](#var-totalpricemethod) | SUM | :x: |
| FareSelectionMethod | option | What fare to select when multiple fares are available | See [details](#var-fareselectionmethod) | HIGHER | :x: |
### Var `TotalPriceMethod`.
Establish the method used to calculate the total price for a stay.
The total price for a stay will be calculated from the price of the days that make the stay. A operation must be selected to get total price from daily prices.
**Options:**
| Option | Value | Usage | Status |
| :------------ | :------ | :----------------------------------------------------------------- | :----: |
| Lower Price | LOWER | The lower price will be apply for each day. | :x: |
| High Price | HIGHER | The highest price will be apply for each day. | :x: |
| Total Sum | SUM | Total price will be the sum of the price for each day. | :x: |
| Average Price | AVERAGE | The average for all days will be calculated and apply to each day. | :x: |
### Var `FareSelectionMethod`
How to select the fare for a room when there are multiple fares applicable.
A faretable may contain multiple fares for a room and guest number given some conditions. If multiple conditions match for a date and therefore there are more than 1 applicable fare, one must be used. This method sets what to do in those cases.
Note: RoomPrices have more priority than fares. So if a RoomPrice is available, it will always be the prefered option.
**Options:**
| Option | Value | Usage | Status |
| :------------ | :------ | :---------------------------------------------------------------- | :----: |
| Lower Price | LOWER | Lower price available will be used. | :x: |
| High Price | HIGHER | Higher available price will be used. | :x: |
| Average price | AVERAGE | Selected price will be the aritmetic average of available prices. | :x: |
## API Config.
Configuration for some API endpoints.
| Variable | Type | Description | Constraints | Default Value | Status |
| :-------------------- | :--- | :----------------------------------- | :---------------------------------------- | :------------ | :------------: |
| MaxAllowedNightAmount | int | Max night amount that can be booked. | See [details](#var-maxallowednightamount) | 20 | :construction: |
| MaxAllowedGuestNumber | int | Max guest number that can be booked. | See [details](#var-maxallowedguestnumber) | 20 | :construction: |
### **Price Management** ### Var `MaxAllowedNightAmount`
Configure how backend services calculates prices for bookings. Max number of nights that can be booked using the app. For longer stays the company should be contacted.
- SectionName -> price_mng **Options:**
- Availability -> internal | Option | Value | Usage | Status |
- Nº variables -> X | :------------ | :---- | :---------------------------------------------------------- | :----: |
| Disabled | 0 | Disable this funcionality. No limit on booking will be set. | :x: |
**Variable list:** | Custom Amount | - | Set the max number of nights allowed to book. | :x: |
WIP
#### FinalPriceCalculation.
Establece cómo se deben tratar los precios de cada día para generar el precio final de la estancia.
Algunos algoritmos para estos serán:
- Precio más alto.
- Precio más bajo.
- Suma de precios. --> Por defecto.
- Media de precios.
#### MultipleRoomFareValid
Estrategia de selección de tarifa en caso de que haya varias válidas (mientras no exista un sistema de prioridad de tarifas...)
Posibles algoritmos:
- Precio más alto.
- Precio más bajo.
- Media.
### Var `MaxAllowedGuestNumber`
Max guest number that can be booked using the app. For bigger groups the company should be contacted.
**Options:**
| Option | Value | Usage | Status |
| :------------ | :---- | :---------------------------------------------------------- | :----: |
| Disabled | 0 | Disable this funcionality. No limit on booking will be set. | :x: |
| Custom Amount | - | Set the max guest number allowed to book. | :x: |