-
Notifications
You must be signed in to change notification settings - Fork 29
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
Implemented QualifyLeadRequestHandler #51
base: master
Are you sure you want to change the base?
Conversation
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.
The test are missing asserts that verifies that data have been created in the mockup database.
The Qualify lead process does not currently create any Opportunities and are missing some checks such as it should not be possible to add an existing account to the qualifying process with out requiring creation of a new Opportunity.
Qualify lead does not handle any kind of duplicate detection when creating new account or contacts.
} | ||
|
||
var resp = new QualifyLeadResponse(); | ||
resp.Results["CreatedEntities"] = createdEntities; |
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 also need to create the entities in the mockup database. Currently you just respond with almost the same data as the user has requested. Additionally, you also need to update the state of the Lead to Qualified.
tests/SharedTests/TestLeads.cs
Outdated
} | ||
|
||
[TestMethod] | ||
public void TestQualifyLeadRequestCreateAccountSuccess() |
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.
Missing assert that lead has been qualified and that a new account has been created
tests/SharedTests/TestLeads.cs
Outdated
} | ||
|
||
[TestMethod] | ||
public void TestQualifyLeadRequestOpportunityCustomerIdSuccess() |
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.
Missing assert that lead has been qualified. This test should also fails as you need to also set CreateOpportunity if you want to set OpportunityCustomerId as it defines an existing account that the opportunity should point to
tests/SharedTests/TestLeads.cs
Outdated
} | ||
|
||
[TestMethod] | ||
public void TestQualifyLeadRequestCreateContactSuccess() |
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.
Missing assert that lead has been qualified and check if a new contact have been created
} | ||
|
||
[TestMethod] | ||
public void TestQualifyLeadRequestSuccess() |
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.
Missing assert if the lead has been qualified
tests/SharedTests/TestLeads.cs
Outdated
} | ||
|
||
[TestMethod] | ||
public void TestQualifyLeadRequestCreateAllSuccess() |
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.
Missing assert that lead has been qualified and that a new Opportunity and Account have been created and that the opportunity points the the new account and existing contact
|
||
if (request.CreateContact) | ||
{ | ||
var contactAlreadyExists = db["contact"].Any(row => row["fullname"] != null && row["fullname"].Equals(lead["fullname"])); |
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 think Qualified Lead handles any kind of duplicate detection in CRM.
|
||
if (request.CreateAccount) | ||
{ | ||
var accountAlreadyExists = db["account"].Any(row => row["name"] != null && row["name"].Equals(lead["fullname"])); |
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 think Qualified Lead handles any kind of duplicate detection in CRM.
throw new FaultException("A record was not created or updated because a duplicate of the current record already exists."); | ||
} | ||
|
||
var account = new Entity |
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.
Qualify lead uses some of the fields on the lead when creating the account. Such as the Company text field
throw new FaultException("A record was not created or updated because a duplicate of the current record already exists."); | ||
} | ||
|
||
var contact = new Entity |
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.
Qualify Lead uses fields on the lead when creating the contact such as Contact Name and Job title.
#30