ob-dj-store 0.0.20.7__py3-none-any.whl → 0.0.20.9__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.
@@ -239,6 +239,7 @@ class FavoriteFilter(filters.FilterSet):
239
239
  class PaymentMethodFilter(filters.FilterSet):
240
240
  store = filters.CharFilter(method="by_store")
241
241
  is_digital = filters.BooleanFilter(method="by_digital")
242
+ country = filters.CharFilter(method="by_country")
242
243
 
243
244
  class Meta:
244
245
  models = PaymentMethod
@@ -253,6 +254,12 @@ class PaymentMethodFilter(filters.FilterSet):
253
254
  )
254
255
  return queryset
255
256
 
257
+ def by_country(self, queryset, name, value):
258
+ currency = get_currency_by_country(value)
259
+ if value:
260
+ queryset = queryset.filter(currency=currency)
261
+ return queryset
262
+
256
263
 
257
264
  class WalletFilter(filters.FilterSet):
258
265
  currency = filters.CharFilter(
@@ -1,7 +1,8 @@
1
1
  import calendar
2
2
  import logging
3
3
  import typing
4
- from datetime import timedelta
4
+ from collections import OrderedDict
5
+ from datetime import datetime, timedelta
5
6
  from decimal import Decimal
6
7
 
7
8
  import pycountry
@@ -427,6 +428,7 @@ class OrderSerializer(serializers.ModelSerializer):
427
428
  )
428
429
  if (
429
430
  not op_hour.is_open_after_midnight
431
+ and not op_hour.always_open
430
432
  and not from_hour <= pickup_time_time <= to_hour
431
433
  ):
432
434
  raise serializers.ValidationError(
@@ -1645,6 +1647,27 @@ class WalletTransactionSerializer(serializers.ModelSerializer):
1645
1647
  ]
1646
1648
 
1647
1649
 
1650
+ class WalletTransactionListSerializer(serializers.Serializer):
1651
+ def to_representation(self, instance):
1652
+ result_dict = OrderedDict()
1653
+
1654
+ for wallettransaction in instance:
1655
+ year = wallettransaction.created_at.year
1656
+ month = wallettransaction.created_at.month
1657
+ title = f"{datetime(year, month, 1).strftime('%b')}, {year}"
1658
+
1659
+ if title not in result_dict:
1660
+ result_dict[title] = {"title": title, "data": []}
1661
+
1662
+ result_dict[title]["data"].append(
1663
+ WalletTransactionSerializer(
1664
+ wallettransaction, context=self.context
1665
+ ).data
1666
+ )
1667
+
1668
+ return {"Transactions": list(result_dict.values())}
1669
+
1670
+
1648
1671
  class ReorderSerializer(serializers.Serializer):
1649
1672
  force_cart = serializers.BooleanField(default=False)
1650
1673
 
@@ -60,7 +60,7 @@ from ob_dj_store.apis.stores.rest.serializers.serializers import (
60
60
  WalletMediaSerializer,
61
61
  WalletSerializer,
62
62
  WalletTopUpSerializer,
63
- WalletTransactionSerializer,
63
+ WalletTransactionListSerializer,
64
64
  )
65
65
  from ob_dj_store.core.stores.gateway.tap.utils import TapException
66
66
  from ob_dj_store.core.stores.models import (
@@ -1103,7 +1103,7 @@ class WalletViewSet(
1103
1103
  methods=["GET",],
1104
1104
  detail=True,
1105
1105
  url_path="transactions",
1106
- serializer_class=WalletTransactionSerializer,
1106
+ serializer_class=WalletTransactionListSerializer,
1107
1107
  )
1108
1108
  def transactions(
1109
1109
  self, request: Request, *args: typing.Any, **kwargs: typing.Any
@@ -1111,10 +1111,10 @@ class WalletViewSet(
1111
1111
  queryset = self.get_object().transactions.all().order_by("-created_at")
1112
1112
  page = self.paginate_queryset(queryset)
1113
1113
  if page is not None:
1114
- serializer = self.get_serializer(page, many=True)
1114
+ serializer = self.get_serializer(page)
1115
1115
  return self.get_paginated_response(serializer.data)
1116
1116
 
1117
- serializer = self.get_serializer(queryset, many=True)
1117
+ serializer = self.get_serializer(queryset)
1118
1118
  return Response(serializer.data)
1119
1119
 
1120
1120
  @swagger_auto_schema(
@@ -0,0 +1,25 @@
1
+ # Generated by Django 3.2.8 on 2025-07-10 11:25
2
+
3
+ import django.db.models.deletion
4
+ from django.conf import settings
5
+ from django.db import migrations, models
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12
+ ("tap", "0007_alter_tappayment_source"),
13
+ ]
14
+
15
+ operations = [
16
+ migrations.AlterField(
17
+ model_name="tappayment",
18
+ name="user",
19
+ field=models.ForeignKey(
20
+ help_text="Captured the User ID for both registered users and Guests (Every guest user has a user_id assigned by device_id)",
21
+ on_delete=django.db.models.deletion.CASCADE,
22
+ to=settings.AUTH_USER_MODEL,
23
+ ),
24
+ ),
25
+ ]
@@ -37,7 +37,7 @@ class TapPayment(models.Model):
37
37
  source = models.CharField(max_length=100, choices=Sources.choices)
38
38
  user = models.ForeignKey(
39
39
  settings.AUTH_USER_MODEL,
40
- on_delete=models.DO_NOTHING,
40
+ on_delete=models.CASCADE,
41
41
  help_text=_(
42
42
  "Captured the User ID for both registered "
43
43
  "users and Guests (Every guest user has a user_id assigned by device_id)"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ob-dj-store
3
- Version: 0.0.20.7
3
+ Version: 0.0.20.9
4
4
  Summary: OBytes django application for managing ecommerce stores.
5
5
  Home-page: https://www.obytes.com/
6
6
  Author: OBytes
@@ -1,9 +1,9 @@
1
1
  ob_dj_store/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  ob_dj_store/apis/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- ob_dj_store/apis/stores/filters.py,sha256=kbKtrg9ba9R5ptN9xOOEo-ZZ2IZbQfGH6BJCGUzF1bc,9510
3
+ ob_dj_store/apis/stores/filters.py,sha256=lDb-wS7dEsSS0XL2qN4XqoRKYSEDgxhVZLBPGL0pPM4,9764
4
4
  ob_dj_store/apis/stores/urls.py,sha256=7vwogfIGcKS0hHYK3iBXKQwi1kCA_vuHY1eZt8rAspg,2021
5
- ob_dj_store/apis/stores/views.py,sha256=P8hkpMxC080QlPGFXaQXV2wKoo-B0aUg-hToHtMG24s,41612
6
- ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=5P8C_mki1qVsTBFppEu9Ys0uE71pdWuYhxUSTPKiV94,65969
5
+ ob_dj_store/apis/stores/views.py,sha256=3uhbSZ9IJ0-t73NgYqepd0X3RlddtF24b9h9Q-GseFQ,41598
6
+ ob_dj_store/apis/stores/rest/serializers/serializers.py,sha256=zsrEyB86eHbMEK2_3xMLOZkoYTdAoqjberqY-NM4p8c,66787
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
@@ -22,7 +22,7 @@ ob_dj_store/core/stores/gateway/tap/__init__.py,sha256=5Z6azpb6tmr1nRvKwQWzlYw9r
22
22
  ob_dj_store/core/stores/gateway/tap/admin.py,sha256=tGtLg6ttkZXb7JtFPD-5r46pCmb1BsbQpv182KlY3-o,1153
23
23
  ob_dj_store/core/stores/gateway/tap/apps.py,sha256=kWwPjuAJeEmEasVDzUbvRsGaQWL-aYe4JDHNLvCVXPs,212
24
24
  ob_dj_store/core/stores/gateway/tap/managers.py,sha256=FmnJVWwShbNJPU_USZA2hC8g2W3D_S4J3sxN8JROlRo,817
25
- ob_dj_store/core/stores/gateway/tap/models.py,sha256=ZbMdglR2a8MhHO-qfOFP7tjxiA8XmZb8IKP5L7TXrZY,4786
25
+ ob_dj_store/core/stores/gateway/tap/models.py,sha256=KfM8s_tFlGIVpaol9CVFjSaCx6zn7wu3l90oWBviV7I,4783
26
26
  ob_dj_store/core/stores/gateway/tap/utils.py,sha256=bajB6TH83AVPzm9npshgIZy-PUd0dt4vS4msLs2h998,5206
27
27
  ob_dj_store/core/stores/gateway/tap/migrations/0001_initial.py,sha256=U8Cv1zLEb4SB4uX5Jjt6QJi7RkZ46-3TF18NcupHb-8,4778
28
28
  ob_dj_store/core/stores/gateway/tap/migrations/0002_auto_20220815_1610.py,sha256=gRsekTbqUH4h5yg5d1zWuai7Wiv6-rfsmjnXundgin8,674
@@ -31,6 +31,7 @@ ob_dj_store/core/stores/gateway/tap/migrations/0004_tapcustomer.py,sha256=tazV01
31
31
  ob_dj_store/core/stores/gateway/tap/migrations/0005_alter_tappayment_payment_url.py,sha256=M66KGz3b1R-xkv3GPQKkrKDUrO-2L0mmbcnmDDP_xII,512
32
32
  ob_dj_store/core/stores/gateway/tap/migrations/0006_alter_tappayment_source.py,sha256=K-aktQ87sbvSedumIo-dxrJ32CjCwbEWqLyGGzexqhU,655
33
33
  ob_dj_store/core/stores/gateway/tap/migrations/0007_alter_tappayment_source.py,sha256=OXK2Esw908DBYlf5rkvqc645gKSOfkUL0RFOmcTrVFM,700
34
+ ob_dj_store/core/stores/gateway/tap/migrations/0008_alter_tappayment_user.py,sha256=oSjhhPOMM37VLWdr25YcR9rm0Zkq6wQQzV64fClYCBI,771
34
35
  ob_dj_store/core/stores/gateway/tap/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
36
  ob_dj_store/core/stores/migrations/0001_initial.py,sha256=Ny58kubU6qNVr2TYD1p61Sb8jQGgdLjVN5HwywugN8k,2108
36
37
  ob_dj_store/core/stores/migrations/0002_auto_20220422_0205.py,sha256=hnfr60m50hyIL2QkPfD8rKWLtfVjW58L9vNkYo72ZII,382
@@ -158,7 +159,7 @@ ob_dj_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
158
159
  ob_dj_store/utils/helpers.py,sha256=o7wgypM7mI2vZqZKkhxnTcnHJC8GMQDOuYMnRwXr6tY,2058
159
160
  ob_dj_store/utils/model.py,sha256=DV7hOhTaZL3gh9sptts2jTUFlTArKG3i7oPioq9HLFE,303
160
161
  ob_dj_store/utils/utils.py,sha256=8UVAFB56qUSjJJ5f9vnermtw638gdFy4CFRCuMbns_M,1342
161
- ob_dj_store-0.0.20.7.dist-info/METADATA,sha256=5VjZm9Hv7Zl1RSBi2yw3-P3dNobmZJ0wYNdxV9F9nUU,2850
162
- ob_dj_store-0.0.20.7.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
163
- ob_dj_store-0.0.20.7.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
164
- ob_dj_store-0.0.20.7.dist-info/RECORD,,
162
+ ob_dj_store-0.0.20.9.dist-info/METADATA,sha256=gbT3fMY8JgAOJxAbCb2o9Ub-T8bDU-esMeaXCvKwqvU,2850
163
+ ob_dj_store-0.0.20.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
164
+ ob_dj_store-0.0.20.9.dist-info/top_level.txt,sha256=CZG3G0ptTkzGnc0dFYN-ZD7YKdJBmm47bsmGwofD_lk,12
165
+ ob_dj_store-0.0.20.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5