optimize load balance for inventory list in pos - add new fields to stake holdes
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
from apps.authentication.models import Organization
|
||||
from apps.product.models import Broker
|
||||
from apps.product.models import Product
|
||||
from apps.product.models import Product, Broker, QuotaBrokerValue
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from apps.authorization.models import UserRelations
|
||||
from apps.authentication.models import Organization
|
||||
from apps.core.models import BaseModel
|
||||
from django.db import models
|
||||
import random
|
||||
import string
|
||||
|
||||
|
||||
class ProviderCompany(BaseModel):
|
||||
@@ -258,6 +256,18 @@ class StakeHolders(BaseModel):
|
||||
related_name='pos_stake_holders',
|
||||
null=True
|
||||
)
|
||||
broker = models.ForeignKey(
|
||||
Broker,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='pos_stake_holders',
|
||||
null=True
|
||||
)
|
||||
broker_amount = models.ForeignKey(
|
||||
QuotaBrokerValue,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='pos_stake_holders',
|
||||
null=True
|
||||
)
|
||||
share_percent = models.FloatField(default=0)
|
||||
default = models.BooleanField(default=False)
|
||||
|
||||
@@ -295,29 +305,3 @@ class POSFreeProducts(BaseModel):
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(POSFreeProducts, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class BrokerStakeHolderAssignment(BaseModel):
|
||||
device = models.ForeignKey(
|
||||
Device,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="stake_brok_assigment",
|
||||
null=True
|
||||
)
|
||||
stake_holder = models.ForeignKey(
|
||||
StakeHolders,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='stake_brok_assignment',
|
||||
null=True
|
||||
)
|
||||
broker = models.ForeignKey(
|
||||
Broker,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='stake_brok_assignment',
|
||||
null=True
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(BrokerStakeHolderAssignment, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user