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

[WIP] Attach primary contact #304

Closed

Conversation

bernardeli
Copy link
Contributor

Hi @iloveitaly,

I'm currently opening this pull request as a WIP to get your opinion on the design of #299 (disclaimer: I work with @jamesottaway)

Based on http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_2/schema/other/attachcontactreference.html?mode=package, I assume AttachContactReference is a record where the attributes include contact and contact role.

The customer is the object to be attached to the tuple contact + role.

Given the above, I came up with the following idea:

customer = NetSuite::Records::Customer.new(internal_id: 1)
NetSuite::Records::AttachContactReference.new(contact: { internal_id: 1 }, contact_role: { internal_id: -10 }).attach(customer)

Sorry for the lack of tests at this point. I spat out the ideas to get my head around and would appreciate an initial feedback before I clean it up and put some tests.

Thanks
Ricardo

@bernardeli bernardeli closed this Dec 19, 2018
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.

1 participant