Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ladekarl
Copy link
Contributor

#30

@Ladekarl Ladekarl requested a review from magesoe April 16, 2018 13:03
Copy link
Member

@TomMalow TomMalow left a 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;
Copy link
Member

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.

}

[TestMethod]
public void TestQualifyLeadRequestCreateAccountSuccess()
Copy link
Member

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

}

[TestMethod]
public void TestQualifyLeadRequestOpportunityCustomerIdSuccess()
Copy link
Member

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

}

[TestMethod]
public void TestQualifyLeadRequestCreateContactSuccess()
Copy link
Member

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()
Copy link
Member

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

}

[TestMethod]
public void TestQualifyLeadRequestCreateAllSuccess()
Copy link
Member

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"]));
Copy link
Member

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"]));
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

@magesoe magesoe added the review label Aug 2, 2018
@ghost ghost assigned Ladekarl Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants