stake holders sharing & quota distribution to CMP - list of stake holder sharings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from apps.product.models import Product, Broker, QuotaBrokerValue
|
||||
from apps.product.models import Product, Broker, QuotaBrokerValue, QuotaDistribution
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from apps.authorization.models import UserRelations
|
||||
from apps.authentication.models import Organization
|
||||
@@ -271,14 +271,6 @@ class StakeHolders(BaseModel):
|
||||
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)
|
||||
|
||||
def __str__(self):
|
||||
return f'Device: {self.assignment.device.serial}-organization: {self.organization.name}'
|
||||
@@ -287,6 +279,31 @@ class StakeHolders(BaseModel):
|
||||
return super(StakeHolders, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class StakeHolderShareAmount(BaseModel):
|
||||
quota_distribution = models.ForeignKey(
|
||||
QuotaDistribution,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='holders_share_amount',
|
||||
null=True
|
||||
)
|
||||
stakeholders = models.ForeignKey(
|
||||
StakeHolders,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='holders_share_amount',
|
||||
null=True
|
||||
)
|
||||
share_amount = models.PositiveBigIntegerField(default=0)
|
||||
registering_organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='holders_share_amount',
|
||||
null=True
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(StakeHolderShareAmount, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
class POSFreeProducts(BaseModel):
|
||||
product = models.ForeignKey(
|
||||
Product,
|
||||
|
||||
Reference in New Issue
Block a user