-
Notifications
You must be signed in to change notification settings - Fork 16
Modified Adoption Opportunity endpoint for renewal form #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1290 +/- ##
==========================================
+ Coverage 86.62% 86.87% +0.25%
==========================================
Files 495 497 +2
Lines 7819 7817 -2
==========================================
+ Hits 6773 6791 +18
+ Misses 1046 1026 -20 |
|
||
# then we will get any new records | ||
command = "SELECT Id, Accounts_UUID__c, Book_Text__c, Contact_Email__c, School_Name__c, Yearly_Students__c, Students__c, Type, Base_Year__c, IsWon from Opportunity WHERE OS_Accounts_ID__c != null AND Type = 'Renewal' AND Base_Year__c = {} AND IsWon = True".format(year) | ||
command = "SELECT Id, Accounts_UUID__c, Book_Text__c, Contact_Email__c, School_Name__c, Yearly_Students__c, Students__c, Type, Base_Year__c, IsWon, Fall_Students__c, Spring_Students__c, Summer_Students__c from Opportunity WHERE Accounts_UUID__c != null AND Type = 'Renewal' AND Base_Year__c = {} AND IsWon = True".format(year) |
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.
You might want to verify with @denvergreene on if we should still check Type=Renewal
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.
Checked with Denver and removed reference to type
opportunity_id=record['Id'], | ||
defaults = {'account_uuid': record['Accounts_UUID__c'], | ||
'book_name': record['Book_Text__c'], | ||
'email': record['Contact_Email__c'], |
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.
Do we need the email?
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.
I left most of the code and commented out code for our discussion on Monday. I have a list of questions which includes do we need all this data?
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.
Removed all unused fields
salesforce/models.py
Outdated
confirmed_yearly_students = models.IntegerField(null=True, blank=True,) | ||
created = models.DateTimeField(auto_now_add=True) | ||
last_update = models.DateTimeField(auto_now=True) | ||
verified = models.BooleanField(default=False) |
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.
Probably don't need this anymore?
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.
Removed last_updated and verified
salesforce/views.py
Outdated
@action(methods=['get'], detail=True) | ||
def list(self, request, account_id): | ||
def list(self, request): | ||
print(str(request.data)) |
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.
remove debug
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.
Removed
salesforce/views.py
Outdated
|
||
return JsonResponse(data) | ||
|
||
# @action(methods=['post'], detail=True) |
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.
I'd remove commented code. We can always look at history if we need to reference it
salesforce/views.py
Outdated
return JsonResponse(data) | ||
else: | ||
return JsonResponse({'error': 'Must include adoption ID to update'}) | ||
queryset = AdoptionOpportunityRecord.objects.filter(account_uuid=account_uuid, verified=False) |
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.
I don't see setting verified anywhere, so probably remove unless I'm missing it.
class AdoptionOpportunityRecord(models.Model): | ||
opportunity_id = models.CharField(max_length=255, unique=True) | ||
account_id = models.CharField(max_length=255, null=True, blank=True) # TODO: for deletion after switching to UUID | ||
account_uuid = models.UUIDField(null=True) |
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.
wondering if it might help data consistency to have the contact id here too - since we do have that in the /api/user endpoint
No description provided.