ob-dj-store 0.0.11.10__py3-none-any.whl → 0.0.11.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,6 +40,7 @@ from ob_dj_store.core.stores.models import (
40
40
  Store,
41
41
  Tax,
42
42
  Wallet,
43
+ WalletTransaction,
43
44
  )
44
45
  from ob_dj_store.core.stores.models._inventory import Inventory
45
46
  from ob_dj_store.core.stores.utils import distance
@@ -52,6 +53,7 @@ class AttributeChoiceSerializer(serializers.ModelSerializer):
52
53
  "id",
53
54
  "name",
54
55
  "price",
56
+ "label",
55
57
  "is_default",
56
58
  )
57
59
 
@@ -403,6 +405,7 @@ class ProductAttributeSerializer(serializers.ModelSerializer):
403
405
  "is_mandatory",
404
406
  "attribute_choices",
405
407
  "type",
408
+ "label",
406
409
  "min",
407
410
  "max",
408
411
  )
@@ -1090,3 +1093,15 @@ class WalletTopUpSerializer(serializers.Serializer):
1090
1093
  amount = self.validated_data["amount"]
1091
1094
  payment_method = self.validated_data["payment_method"]
1092
1095
  return wallet.top_up_wallet(amount=amount, payment_method=payment_method)
1096
+
1097
+
1098
+ class WalletTransactionSerializer(serializers.ModelSerializer):
1099
+ class Meta:
1100
+ model = WalletTransaction
1101
+ fields = [
1102
+ "id",
1103
+ "type",
1104
+ "amount",
1105
+ "created_at",
1106
+ "wallet",
1107
+ ]
@@ -50,6 +50,7 @@ from ob_dj_store.apis.stores.rest.serializers.serializers import (
50
50
  TaxSerializer,
51
51
  WalletSerializer,
52
52
  WalletTopUpSerializer,
53
+ WalletTransactionSerializer,
53
54
  )
54
55
  from ob_dj_store.core.stores.models import (
55
56
  Cart,
@@ -1010,3 +1011,32 @@ class WalletViewSet(
1010
1011
  instance = self.get_object()
1011
1012
  payment_url = serializer.top_up_wallet(instance)
1012
1013
  return Response({"payment_url": payment_url}, status=status.HTTP_200_OK)
1014
+
1015
+ @swagger_auto_schema(
1016
+ operation_summary="List Wallet's transactions",
1017
+ operation_description="""
1018
+ list user's wallet transactions(debit,credit)
1019
+ """,
1020
+ tags=[
1021
+ "Wallet",
1022
+ ],
1023
+ )
1024
+ @action(
1025
+ methods=[
1026
+ "GET",
1027
+ ],
1028
+ detail=True,
1029
+ url_path="transactions",
1030
+ serializer_class=WalletTransactionSerializer,
1031
+ )
1032
+ def transactions(
1033
+ self, request: Request, *args: typing.Any, **kwargs: typing.Any
1034
+ ) -> Response:
1035
+ queryset = self.get_object().transactions.all()
1036
+ page = self.paginate_queryset(queryset)
1037
+ if page is not None:
1038
+ serializer = self.get_serializer(page, many=True)
1039
+ return self.get_paginated_response(serializer.data)
1040
+
1041
+ serializer = self.get_serializer(queryset, many=True)
1042
+ return Response(serializer.data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ob-dj-store
3
- Version: 0.0.11.10
3
+ Version: 0.0.11.11
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -2,8 +2,8 @@ ob_dj_store/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
2
2
  ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  ob_dj_store/apis/stores/filters.py,sha256=s4US_TysnIgdT8pue_1jlG3V33WhYmCymXK3DuC0rqY,5746
4
4
  ob_dj_store/apis/stores/urls.py,sha256=cPForgFpOgOGCUVAk6DZcZ7qOooMf1zpDIr1BA0L_8A,1593
5
- ob_dj_store/apis/stores/views.py,sha256=zoEgQg3qKVlhhHPj96_UoNE-B8Pf8NK4AuUEmTwOhgg,29833
6
- ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=43c_0NyKVZDfmI32f2DR3m6i0G2y3G_yxZEuJBvdAL4,36402
5
+ ob_dj_store/apis/stores/views.py,sha256=1rmtT1tHYwvo3U43gSWfjV-E4_qs6P3hqxMnPlYd-xA,30767
6
+ ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=RyGNV8w1xFtD8WCqfhVzFr56d-pbyXiJpyUaEWp2SeQ,36720
7
7
  ob_dj_store/apis/tap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  ob_dj_store/apis/tap/serializers.py,sha256=KPrBK4h2-fWvEVf6vOj2ww5-USV9WqpyYicIqoHIiXI,1065
9
9
  ob_dj_store/apis/tap/urls.py,sha256=bnOTv6an11kxpo_FdqlhsizlGPLVpNxBjCyKcf3_C9M,367
@@ -110,7 +110,7 @@ ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
110
110
  ob_dj_store/utils/helpers.py,sha256=02igVH2DSDTZYa6kFSTmBnJeXfTdgjRCRSXQ7mvmCGo,1224
111
111
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
112
112
  ob_dj_store/utils/utils.py,sha256=euWeNI39P48jGNwKoBCC5AmwQUmgDeb92t0fQtPm-5g,1282
113
- ob_dj_store-0.0.11.10.dist-info/METADATA,sha256=pjF7LcR9ltkOqvsxXXp5ZGjaJRR47kGrO_SyxVtGrZ4,2828
114
- ob_dj_store-0.0.11.10.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
115
- ob_dj_store-0.0.11.10.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
116
- ob_dj_store-0.0.11.10.dist-info/RECORD,,
113
+ ob_dj_store-0.0.11.11.dist-info/METADATA,sha256=uObApo60WAdwyIg3mZ4_onVE7gwMSaofdhj5MIT6Cfo,2828
114
+ ob_dj_store-0.0.11.11.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
115
+ ob_dj_store-0.0.11.11.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
116
+ ob_dj_store-0.0.11.11.dist-info/RECORD,,