git_brcal/src/server
Daniel Schick a5b16154c6 Fixed saving of shipcall by correctly interpreting enums now
The trick was to use a helper-field and a (decorated) @post_load method in the model that allows to fill the helper
fields with the values (ints) instead of strings for enums.
Trouble is: We are parsing strings from API/JSON and want to serialize as int (value in IntEnum). The helper
fields also must be skipped when setting up the query. Pretty convoluted, but gets the jon done (finally).

Also extended the database by new field 'interval_end' which is a preparation to allow not only timestamps but also
intervals when specifying times for participants.
2024-03-27 19:20:54 +01:00
..
BreCal Fixed saving of shipcall by correctly interpreting enums now 2024-03-27 19:20:54 +01:00
tests bugfix of 0004A and B, where the tide window may have deviated by few seconds, so the wrong state would be concluded. 2023-12-19 09:51:29 +01:00
flaskapp.wsgi moved schedule import after venv sitepackage path set 2023-11-22 10:48:27 +01:00
README.md updated environment 2023-03-12 11:56:24 +01:00
requirements.txt Adding validation rules (traffic light status) to the system. Post & Put calls of shipcalls and times now execute the traffic light evaluation and store the result in the connected MySQL database instance. The 'brecal_utils' library is merged with 'BreCal', including the stub objects and test functions. Requirements were adapted, and installation of a virtual environment works from scratch (on a linux system). 2023-10-17 09:09:35 +02:00
setup.py Version bump to 1.1.1 2023-12-26 17:13:10 +01:00

BreCal

OpenAPI 3.0 Generated Flask project

The code was originally created by exporting the API from Postman. Selecting the API on the left (root element) the code generation icon becomes visible on the right.

image

If the API gets updated I think it makes most sense to export again into a API helper branch and then merge this branch back into the project. Please do not forget to update the index.yaml file. The branch is named yaml_export.

All the routes are defined in 'project/api' folder. Each route parses the request and calls the corresponding function in the 'project/impl' directory passing all the parameters and request body as function arguments.

To run this project:

pip install -r requirements.txt
export FLASK_APP='BreCal'
export FLASK_ENV=development
flask run