mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add field description to the currency_exchange_retrieve API call (#7147)
* Add field description to the currency_exchange_retrieve API call * Bump API version * Do not call constuctor for the serializer exposed for extend schema in the CurrencyExchangeView
This commit is contained in:
parent
66c208c328
commit
60ddbe980e
@ -1,11 +1,14 @@
|
|||||||
"""InvenTree API version information."""
|
"""InvenTree API version information."""
|
||||||
|
|
||||||
# InvenTree API version
|
# 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."""
|
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||||
|
|
||||||
INVENTREE_API_TEXT = """
|
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
|
v193 - 2024-04-30 : https://github.com/inventree/InvenTree/pull/7144
|
||||||
- Adds "assigned_to" filter to PurchaseOrder / SalesOrder / ReturnOrder API endpoints
|
- Adds "assigned_to" filter to PurchaseOrder / SalesOrder / ReturnOrder API endpoints
|
||||||
|
|
||||||
|
@ -127,6 +127,7 @@ class CurrencyExchangeView(APIView):
|
|||||||
permission_classes = [permissions.IsAuthenticated]
|
permission_classes = [permissions.IsAuthenticated]
|
||||||
serializer_class = None
|
serializer_class = None
|
||||||
|
|
||||||
|
@extend_schema(responses={200: common.serializers.CurrencyExchangeSerializer})
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
"""Return information on available currency conversions."""
|
"""Return information on available currency conversions."""
|
||||||
# Extract a list of all available rates
|
# Extract a list of all available rates
|
||||||
|
@ -125,6 +125,17 @@ class UserSettingsSerializer(SettingsSerializer):
|
|||||||
user = serializers.PrimaryKeyRelatedField(read_only=True)
|
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):
|
class GenericReferencedSettingSerializer(SettingsSerializer):
|
||||||
"""Serializer for a GenericReferencedSetting model.
|
"""Serializer for a GenericReferencedSetting model.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user