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

Geo reference #36

Merged
merged 12 commits into from
Mar 1, 2024
Merged

Geo reference #36

merged 12 commits into from
Mar 1, 2024

Conversation

spencerSmarty
Copy link
Contributor

Added the following files and directories to make the code more modular and readable for the user.
-examples
-us-enrichment-api
--geo-reference (implements the geo-reference functionality as an example for the user along with getting rid of the licensing functionality so the user does not need to specify a license)
--property-financial (separated this from the original directory that initially just had the different options for sending data as commented out code along with getting rid of the licensing functionality so the user does not need to specify a license)
--property-principal(Like the previous example we made this portion modular so that the user could successfully navigate between the propertyfinancial and propertyprincipal lookups along with getting rid of the licensing functionality so the user does not need to specify a license)

-us-enrichment-api
--response.go(included the attributes and structs to be able to use geo-reference)
--client.go(implemented the lookup functions to be able to utilize geo-reference)
--lookup.go(Implemented functions for the geo-reference functionality)


client := wireup.BuildUSEnrichmentAPIClient(
//wireup.WebsiteKeyCredential(os.Getenv("SMARTY_AUTH_WEB"), os.Getenv("SMARTY_AUTH_REFERER")),
wireup.SecretKeyCredential(os.Getenv("SMARTY_AUTH_ID"), os.Getenv("SMARTY_AUTH_TOKEN")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the wireup on other examples there is some explanation to the user of the different things that could go in here. I would take a look at those and copy that into here!

log.SetFlags(log.Ltime | log.Llongfile)

client := wireup.BuildUSEnrichmentAPIClient(
//wireup.WebsiteKeyCredential(os.Getenv("SMARTY_AUTH_WEB"), os.Getenv("SMARTY_AUTH_REFERER")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comment. Follow the other examples and put some comments here

@@ -36,6 +36,12 @@ func (c *Client) SendPropertyPrincipal(lookup *Lookup) (error, []*PrincipalRespo
return err, propertyLookup.Response
}

func (c *Client) SendPropertyGeoReference(lookup *Lookup) (error, []*GeoReferenceResponse) {
geoReferenceLookup := &geoReferenceLookup{Lookup: lookup}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable name geoReferenceLookup is overriding the struct with that same name. Functionality will be preserved but I recommend changing the variable name just for the sake of cleaner code and to prevent bugs in the future.

principalDataSubset = "principal"
propertyDataSet = "property"
geoReferenceDataSet = "geo-reference"
geoReferenceDataSubset = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking we write geoReferenceDataSubset instead as emptyDataSubset so we can reuse that in the future. This is more of a design choice, I will leave that up to you but I think that would make more sense

Copy link
Contributor

@LandonSmarty LandonSmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor changes to make! Overall, the code looks great! The only thing that was missing was some tests to make sure some of those more complex lookup methods work correctly. Nice work!

@smartybryan smartybryan merged commit f9743de into master Mar 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants