Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field description to the currency_exchange_retrieve API call #7147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/backend/InvenTree/InvenTree/api_version.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"""InvenTree API version information."""

# InvenTree API version
INVENTREE_API_VERSION = 193
INVENTREE_API_VERSION = 194
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""

INVENTREE_API_TEXT = """

v194 - 2024-05-01 : https://github.com/inventree/InvenTree/pull/7147
- Adds field description to the currency_exchange_retrieve API call

v193 - 2024-04-30 : https://github.com/inventree/InvenTree/pull/7144
- Adds "assigned_to" filter to PurchaseOrder / SalesOrder / ReturnOrder API endpoints

Expand Down
1 change: 1 addition & 0 deletions src/backend/InvenTree/common/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class CurrencyExchangeView(APIView):
permission_classes = [permissions.IsAuthenticated]
serializer_class = None

@extend_schema(responses={200: common.serializers.CurrencyExchangeSerializer})
def get(self, request, format=None):
"""Return information on available currency conversions."""
# Extract a list of all available rates
Expand Down
11 changes: 11 additions & 0 deletions src/backend/InvenTree/common/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ class Meta:
user = serializers.PrimaryKeyRelatedField(read_only=True)


class CurrencyExchangeSerializer(serializers.Serializer):
"""Serializer for a Currency Exchange request.

It's only purpose is describing the results correctly in the API schema right now.
"""

base_currency = serializers.CharField(read_only=True)
exchange_rates = serializers.DictField(child=serializers.FloatField())
updated = serializers.DateTimeField(read_only=True)


class GenericReferencedSettingSerializer(SettingsSerializer):
"""Serializer for a GenericReferencedSetting model.

Expand Down
Loading