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

🌚 Contact creation endpoint #310

Merged
merged 20 commits into from
Aug 31, 2020
Merged

🌚 Contact creation endpoint #310

merged 20 commits into from
Aug 31, 2020

Conversation

rowanseymour
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #310 into master will increase coverage by 0.17%.
The diff coverage is 67.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #310      +/-   ##
==========================================
+ Coverage   54.51%   54.68%   +0.17%     
==========================================
  Files         106      107       +1     
  Lines        8853     8942      +89     
==========================================
+ Hits         4826     4890      +64     
- Misses       3335     3352      +17     
- Partials      692      700       +8     
Impacted Files Coverage Δ
web/surveyor/surveyor.go 56.94% <40.00%> (+0.36%) ⬆️
models/contacts.go 55.57% <53.73%> (-0.38%) ⬇️
web/contact/contact.go 75.00% <70.00%> (-1.79%) ⬇️
models/utils.go 65.00% <75.00%> (+0.52%) ⬆️
web/ivr/ivr.go 50.79% <80.00%> (+0.20%) ⬆️
web/contact/utils.go 90.24% <90.24%> (ø)
tasks/starts/worker.go 57.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df920c0...f32d581. Read the comment docs.

@rowanseymour rowanseymour force-pushed the contact_create branch 2 times, most recently from 17e51c6 to eaac133 Compare July 2, 2020 21:45
@@ -611,8 +612,82 @@ func ContactIDsFromURNs(ctx context.Context, db *sqlx.DB, org *OrgAssets, us []u
}

// CreateContact creates a new contact for the passed in org with the passed in URNs
func CreateContact(ctx context.Context, db *sqlx.DB, org *OrgAssets, urn urns.URN) (ContactID, error) {
// we have a URN, first try to look up the URN
func CreateContact(ctx context.Context, db *sqlx.DB, org *OrgAssets, userID UserID, name string, language envs.Language, urnz []urns.URN) (*Contact, *flows.Contact, error) {
Copy link
Contributor Author

@rowanseymour rowanseymour Jul 2, 2020

Choose a reason for hiding this comment

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

there's a bit of repetition but feels worth it to keep the create vs get_or_create pathways separate since there are many little ways in which they end up different

Copy link
Member

Choose a reason for hiding this comment

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

Nice, this looks good and nice job dealing with all the conflicts elegantly.

oa, err = oa.Clone(s.CTX, s.DB)
if err != nil {
return nil, http.StatusInternalServerError, errors.Wrapf(err, "unable to clone orgs")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

assume this was just mistakenly copied from simulator endpoint - this endpoint shouldn't be modifying any assets

@rowanseymour rowanseymour marked this pull request as ready for review July 24, 2020 18:27
@rowanseymour rowanseymour requested a review from nicpottier July 24, 2020 18:27
@@ -611,8 +612,82 @@ func ContactIDsFromURNs(ctx context.Context, db *sqlx.DB, org *OrgAssets, us []u
}

// CreateContact creates a new contact for the passed in org with the passed in URNs
func CreateContact(ctx context.Context, db *sqlx.DB, org *OrgAssets, urn urns.URN) (ContactID, error) {
// we have a URN, first try to look up the URN
func CreateContact(ctx context.Context, db *sqlx.DB, org *OrgAssets, userID UserID, name string, language envs.Language, urnz []urns.URN) (*Contact, *flows.Contact, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this looks good and nice job dealing with all the conflicts elegantly.

@rowanseymour rowanseymour merged commit d73b244 into master Aug 31, 2020
@rowanseymour rowanseymour deleted the contact_create branch August 31, 2020 16:46
rasoro pushed a commit to Ilhasoft/mailroom that referenced this pull request Mar 10, 2023
HX channel sends MO using ISO 8859-1 encoding
rasoro pushed a commit to Ilhasoft/mailroom that referenced this pull request Jan 21, 2025
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.

2 participants