role type key
This commit is contained in:
@@ -7,7 +7,7 @@ ENV_NAME=DEV
|
||||
# Database secrets
|
||||
DB_HOST=31.7.78.133
|
||||
DB_PORT=14352
|
||||
DB_NAME=Development
|
||||
DB_NAME=Production
|
||||
DB_USERNAME=postgres
|
||||
DB_PASSWORD=pfLIVXupbDetvFMt2gUvxLXUL9b4HIOHaPcKXsBEZ1i8zl0iLUjmhUfXlGfJKcTV
|
||||
|
||||
|
||||
@@ -147,7 +147,11 @@ class UserRelationSerializer(serializers.ModelSerializer):
|
||||
if instance.organization:
|
||||
representation['organization'] = {"id": instance.organization.id, "name": instance.organization.name}
|
||||
if instance.role:
|
||||
representation['role'] = {"id": instance.role.id, "role_name": instance.role.role_name}
|
||||
representation['role'] = {
|
||||
"id": instance.role.id, "role_name": instance.role.role_name, 'type': {
|
||||
'key': instance.role.type.key
|
||||
}
|
||||
}
|
||||
if instance.permissions: # noqa
|
||||
# set permissions by a default structure like:
|
||||
# 'page permission':[element permissions]
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0 on 2025-11-10 07:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0084_broker_fix_broker_price_state'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='broker',
|
||||
name='suggested_broker_price',
|
||||
field=models.PositiveBigIntegerField(default=0),
|
||||
),
|
||||
]
|
||||
@@ -1,16 +1,17 @@
|
||||
from apps.product.pos.api.v1.serializers import product_serializers as product_serializers
|
||||
from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin
|
||||
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
||||
from apps.core.mixins.soft_delete_mixin import SoftDeleteMixin
|
||||
from django.db import transaction
|
||||
from rest_framework import status
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.exceptions import APIException
|
||||
from apps.product import models as product_models
|
||||
from apps.pos_device import models as pos_models
|
||||
from rest_framework.permissions import AllowAny
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework import viewsets
|
||||
from rest_framework import status
|
||||
from django.db import transaction
|
||||
|
||||
from apps.core.mixins.search_mixin import DynamicSearchMixin
|
||||
from apps.core.mixins.soft_delete_mixin import SoftDeleteMixin
|
||||
from apps.pos_device import models as pos_models
|
||||
from apps.pos_device.mixins.pos_device_mixin import POSDeviceMixin
|
||||
from apps.product import models as product_models
|
||||
from apps.product.pos.api.v1.serializers import product_serializers as product_serializers
|
||||
|
||||
|
||||
def trash(queryset, pk): # noqa
|
||||
@@ -105,6 +106,7 @@ class POSFreeProductsViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSear
|
||||
request.data.update({
|
||||
'organization': organization.id,
|
||||
'device': device.id,
|
||||
'company_fee': product_models.Broker.objects.get(organization=organization).company_fee,
|
||||
})
|
||||
|
||||
serializer = product_serializers.POSFreeProductSerializer(data=request.data, context={'device': device})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "🚀 Make migrations..."
|
||||
python manage.py migrate --noinput
|
||||
python manage.py makemigrations --noinput
|
||||
|
||||
echo "🚀 Applying database migrations..."
|
||||
python manage.py migrate --noinput
|
||||
|
||||
Reference in New Issue
Block a user