percentage done
This commit is contained in:
parent
53adac2d26
commit
b29e7207a9
1 changed files with 4 additions and 5 deletions
|
|
@ -38,9 +38,6 @@ class BasePromotionHandler:
|
||||||
|
|
||||||
|
|
||||||
class WalletPercentageHandler(BasePromotionHandler):
|
class WalletPercentageHandler(BasePromotionHandler):
|
||||||
payee_type = 2
|
|
||||||
payee_uuid = ''
|
|
||||||
|
|
||||||
def calculate(self, **kwargs):
|
def calculate(self, **kwargs):
|
||||||
base_amount = kwargs.get('base_amount', 0)
|
base_amount = kwargs.get('base_amount', 0)
|
||||||
|
|
||||||
|
|
@ -52,13 +49,15 @@ class WalletPercentageHandler(BasePromotionHandler):
|
||||||
return promotion_amount
|
return promotion_amount
|
||||||
|
|
||||||
def promote(self, promotion, **kwargs):
|
def promote(self, promotion, **kwargs):
|
||||||
|
payee_type = self.policy.get('payee_type')
|
||||||
|
payee_uuid = self.policy.get('payee_uuid')
|
||||||
|
|
||||||
# promotion_amount = self.calculate(**kwargs)
|
# promotion_amount = self.calculate(**kwargs)
|
||||||
try:
|
try:
|
||||||
data = {
|
data = {
|
||||||
"uuid": str(promotion.uuid),
|
"uuid": str(promotion.uuid),
|
||||||
"payee_id": str(self.payee_uuid),
|
"payee_id": str(payee_uuid),
|
||||||
"payee_type": self.payee_type,
|
"payee_type": payee_type,
|
||||||
"amount": promotion.promotion_amount,
|
"amount": promotion.promotion_amount,
|
||||||
"details": {
|
"details": {
|
||||||
'description': "for promotion",
|
'description': "for promotion",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue