Skip to content

Commit

Permalink
Merge pull request #236 from bcgov/release-v0.1.0
Browse files Browse the repository at this point in the history
Release v0.1.1
  • Loading branch information
kuanfandevops authored Apr 25, 2018
2 parents 51d4b9b + 84eca7d commit 3b058c1
Show file tree
Hide file tree
Showing 17 changed files with 4,992 additions and 8,074 deletions.
13 changes: 13 additions & 0 deletions Release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release Notes

## [0.1.0]
### Added
- Historical Data Entry

### Changed
- How the asset files are being served so refreshing won't break certain pages
- Credit Transactions
- Some alignment changes in table
- Some label changes and formatting in table
- Now showing 'N/A' for from and to when appropriate in table
- Now showing '-' for the value per credit when applicable
4 changes: 3 additions & 1 deletion backend/api/models/CreditTrade.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
Expand Down
34 changes: 32 additions & 2 deletions backend/api/models/Organization.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,6 +22,9 @@
"""

from django.db import models
from .OrganizationActionsType import OrganizationActionsType
from .OrganizationBalance import OrganizationBalance
from .OrganizationStatus import OrganizationStatus

from auditable.models import Auditable

Expand All @@ -43,5 +48,30 @@ class Organization(Auditable):
def __str__(self):
return self.name

@property
def actions_type_display(self):
return self.actions_type.the_type

@property
def organization_balance(self):
data = {
'credit_trade_id': None,
'validated_credits': 0
}

organization_balance = OrganizationBalance.objects.filter(
organization_id=self.id,
expiration_date=None).first()

if organization_balance:
data['credit_trade_id'] = organization_balance.credit_trade_id
data['validated_credits'] = organization_balance.validated_credits

return data

@property
def status_display(self):
return self.status.status

class Meta:
db_table = 'organization'
5 changes: 3 additions & 2 deletions backend/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ class OrganizationSerializer(serializers.ModelSerializer):
class Meta:
model = Organization
fields = (
'id', 'name', 'status', 'actions_type',
'create_timestamp', 'type')
'id', 'name', 'status', 'status_display', 'actions_type',
'actions_type_display', 'create_timestamp', 'type',
'organization_balance')


class OrganizationActionsTypeSerializer(serializers.ModelSerializer):
Expand Down
Loading

0 comments on commit 3b058c1

Please sign in to comment.