-
Notifications
You must be signed in to change notification settings - Fork 36
Subscriber adjust credit - DO NOT MERGE #40
Subscriber adjust credit - DO NOT MERGE #40
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move computations out of PendingCreditUpdate
and add expiry field to Subscriber
model
@@ -978,6 +979,9 @@ class Network(models.Model): | |||
# Network environments let you specify things like "prod", "test", "dev", | |||
# etc so they can be filtered out of alerts. For internal use. | |||
environment = models.TextField(default="default") | |||
# Added for Network Balance Limit | |||
max_account_limit = models.BigIntegerField(default=10000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does these fields need to be in the PendingCreditUpdate
or can we query it from the associated Network
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is depended on PR #38 and part of parent PR
cloud/endagaweb/tasks.py
Outdated
# Get subscriber's 1st number from some admin number. | ||
num = Number.objects.filter( | ||
subscriber__imsi=update.subscriber.imsi)[0:1].get() | ||
if num.valid_through is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This field doesn't exist it seems in
Number
. Probably better to put it underSubscriber
sinceNumbers
can be recycled - None validation should be done by the model to ensure its never None
cloud/endagaweb/tasks.py
Outdated
bts.mark_active() | ||
bts.save() | ||
with transaction.atomic(): | ||
expiry_date = update.valid_through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This expiry date can be computed here using a denomination lookup and current subscriber balance expiry date rather than storing it in the PendingCreditUpdate
@shivkumarsah updated the pull request - view changes |
@shivkumarsah updated the pull request - view changes |
- if amount 10 in exist in 2 denomination, recharge with larger denomination
@shivkumarsah updated the pull request - view changes |
Check for denomination and network limit in adjust credit from web is not required now. |
Please review subscriber adjust credit enhancement which add the below validation: