diff --git a/.env.local b/.env.local index 67aaaa8..2028adf 100644 --- a/.env.local +++ b/.env.local @@ -11,14 +11,14 @@ DB_NAME=Development DB_USERNAME=postgres DB_PASSWORD=pfLIVXupbDetvFMt2gUvxLXUL9b4HIOHaPcKXsBEZ1i8zl0iLUjmhUfXlGfJKcTV -ENV RUNNING_IN_DOCKER= +RUNNING_IN_DOCKER=0 CORS_ALLOWED_ORIGINS=http://localhost:8080,http://127.0.0.1:8080,http://127.0.0.1:3000,http://localhost:3000,http://192.168.88.130:3000,https://rasadyar.net,https://rasaddam-front.liara.run,https://dam.rasadyar.net,https://api.dam.rasadyar.com -REDIS_URL=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 +REDIS_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 -CELERY_BROKER_URL=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 -CELERY_RESULT_BACKEND=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 +CELERY_BROKER_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 +CELERY_RESULT_BACKEND=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 CELERY_CACHE_BACKEND=default # Super user information diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml new file mode 100644 index 0000000..4ea72a9 --- /dev/null +++ b/.idea/copilot.data.migration.agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml new file mode 100644 index 0000000..7ef04e2 --- /dev/null +++ b/.idea/copilot.data.migration.ask.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml new file mode 100644 index 0000000..1f2ea11 --- /dev/null +++ b/.idea/copilot.data.migration.ask2agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml new file mode 100644 index 0000000..8648f94 --- /dev/null +++ b/.idea/copilot.data.migration.edit.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..ada8dab --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 296aa57..f1b70db 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/apps/product/web/api/v1/serializers/quota_serializers.py b/apps/product/web/api/v1/serializers/quota_serializers.py index 590214a..bc4cfb4 100644 --- a/apps/product/web/api/v1/serializers/quota_serializers.py +++ b/apps/product/web/api/v1/serializers/quota_serializers.py @@ -1,9 +1,8 @@ -from apps.authentication.api.v1.serializers.serializer import OrganizationSerializer -from apps.authorization.api.v1 import serializers as authorize_serializers -from apps.product.web.api.v1.serializers import product_serializers +from rest_framework import serializers + from apps.livestock.web.api.v1.serializers import LiveStockTypeSerializer from apps.product import models as product_models -from rest_framework import serializers +from apps.product.web.api.v1.serializers import product_serializers class QuotaSerializer(serializers.ModelSerializer): @@ -65,6 +64,19 @@ class QuotaSerializer(serializers.ModelSerializer): {"name": limit.name, "id": limit.id} for limit in instance.limit_by_organizations.all() ] + # Build a simplified list of pricing items for API output: + # map `pricing_type_id` to `pricing_type` and keep `name` and `value` + items = [ + { + "pricing_type": it["pricing_type_id"], + "name": it["name"], + "value": it["value"], + } + for it in instance.pricing_items.values("pricing_type_id", "name", "value") + ] + + representation["price_calculation_items"] = items + return representation def update(self, instance, validated_data):