-
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
🌚 Contact creation endpoint #310
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
17e51c6
to
eaac133
Compare
eaac133
to
ece5169
Compare
@@ -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) { |
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.
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
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.
Nice, this looks good and nice job dealing with all the conflicts elegantly.
web/contact/contact.go
Outdated
oa, err = oa.Clone(s.CTX, s.DB) | ||
if err != nil { | ||
return nil, http.StatusInternalServerError, errors.Wrapf(err, "unable to clone orgs") | ||
} |
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.
assume this was just mistakenly copied from simulator endpoint - this endpoint shouldn't be modifying any assets
@@ -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) { |
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.
Nice, this looks good and nice job dealing with all the conflicts elegantly.
HX channel sends MO using ISO 8859-1 encoding
Update test database
No description provided.