Transportation Fuels Reporting System
This software is being developed to streamline compliance reporting for transportation fuel suppliers
Documentation for system data is dynamical generated using Schema Spy: http://schema-spy-mem-tfrs-dev.pathfinder.gov.bc.ca/index.html
To learn more about the regulation governing the disclosure of data in this system please read Renewable and Low Carbon Fuel Requirements Regulation 11.11 (5)
- css and js libraries provided as part of the Gov 2.0 Bootstrap Skeleton
- Django/Python
This project is in development. To see the status of feature development please refer to the features page on the project wiki
If using Windows as your development environment, install the following:
- Python 3.5.1 - Select one of the installation options here that fits your workstation type: https://www.python.org/downloads/release/python-351/
- Postgresql http://www.enterprisedb.com/products/pgdownload.do#windows Be sure to edit the "PATH" environment variable to your in the advanced system settings on the control panel and add the postgresql bin folder. If you already have a PATH variable set to something you can add another separated by a semicolon. e.g. "C:\blah\npm; C:\Program Files\PostgreSQL\9.6\bin" (Without doing this you will have problems with psycopg2 not being able to find the postgrsql libraries)
- Visual Studio Community 2017 Preview https://www.visualstudio.com/vs/preview/ with the Python extensions (As of 2017-4-18 the Preview version is required in order to use the Python extensions, which can be selected at time of install)
This project has made use of the Swagger.io Code Generator. Here is the procedure for generation of code:
- First install an environment capable of running Java 7+ programs. As of 2017-5-2 the current JRE can be used.
- If building the code generator from source, follow the instructions at the code generator extension repository:
https://github.com/bcgov/Swagger-Codegen-Extension
An alternative to building from source is to obtain the jar files for the code generator and extension. - Make changes to the Excel file currently located at
tfrs\APISpec\in\TFRSSwagger.xlsm
- Export from Excel using the CTRL-SHIFT-V macro in the above excel file
- Run the file called
update.bat
located intfrs\APISpec
- In the Swagger-Codgen-Extension folder, run the Django generator batch file with the following parameters:
generate-all-django.bat <path to OpenAPI YAML file> <output folder name> <path to configuration file>
- The OpenAPI YAML file is located in this repository at
tfrs/ApiSpec/TFRSswagger.yaml
- The configuration file is located in this repository at
tfrs/ApiSpec/swagger-codegen-config.json
- The OpenAPI YAML file is located in this repository at
- Copy the following artifacts to the folder
server
in this repository.- admin.py
- serializers.py
- urls.py
- test_api_simple
- views.py
- fakedata.py
- models folder
- If the data model was changed, use the makemigrations feature of python django to make a migration (Visual Studio has a short cut to this - right click the project, select python, then Django Make Migrations...)
- Run the migration (There is an option to run migrations in the same python menu as above)
- Run automated tests and ensure they all pass
- The Visual Studio Test Explorer can be used to easily start the tests
- Run the following to ensure code coverage works:
coverage run --source='.' manage.py test
coverage xml
- Commit the code to your fork of the repository
- Do a test build in your OpenShift instance to ensure the build works
- If the build works, do a pull request.
To report bugs/issues/features requests, please file an issue.
If you would like to contribute, please see our contributing guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Copyright 2017 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This repository is maintained by Low Carbon Fuels Branch. Click here for a complete list of our repositories on GitHub.