Custom Ink ERP Tools

A collection of tools for working with Custom Ink's ERP (NetSuite) via AWS EventBridge and Boomi

Installation

Ruby & Dependencies

  • Ruby >= 2.3

Bundling the gem

Add this line to your application's Gemfile:

gem 'erp_tools', git: '[email protected]:customink/erp_tools-ruby'

Or, using a :github source:

gem 'erp_tools', github: 'customink/erp_tools-ruby'

Then execute:

$ bundle install

Usage

The ErpTools namespace exposes several functional areas:

Event

The Event namespace includes helpers for interacting with AWS EventBridge. You can:

Get the event source for MMS item events:

ErpTools::Event::V0::Item.source
#=> "mms.Item"

See the list of detail-types allowed in an event namespace:

ErpTools::Event::V0::SalesOrder.detail_types
#=> [:create, :update, :notification, :delete_payment, :upsert_payment, :upsert_job_order, :upsert_drop_ship, :upsert_work_order, :upsert_purchase_order_for_work_order]

Get the detail-type for creating or updating a sales order:

ErpTools::Event::V0::SalesOrder.detail_type :create
#=> "createSalesOrder"

ErpTools::Event::V0::SalesOrder.detail_type :update
#=> "updateSalesOrder"

Get the appropriate payload version to send for an event

ErpTools::Event::V0::Item.payload_version
#=> "0"

Customink

The Customink namespace exposes constants related to business lines, subsidiaries and other non-domain-specific mapping of corporate properties within NetSuite.

Id

The Id namespace includes helpers for converting app-specific local identifiers to NetSuite-friendly external IDs. Some examples:

Get the external ID for a sales order:

ErpTools::Id.sales_order 1234
#=> "CI-SO-1234"

ErpTools::Id.sales_order 'S-5928345
#=> "CI-SO-S-5928345"

Get the external ID for a decorated MMS sku:

ErpTools::Id.decorated_mms_sku "12345678"
#=> "INVITM-MMS-12345678-F"

Get the external ID for a blanks PO:

ErpTools::Id.purchase_order 'BLANKS-9987'
#=> "CI-PO-BLANKS-9987"

Get the external ID for a work order relating to CI order '66209' and decorated sku '142874':

ErpTools::Id.work_order '66209-MMS-142874-F'
#=> "CI-WO-66209-MMS-142874-F"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Roadmap

  • [x] Initial release of Id and Event namespaces
  • [ ] Subtypes of PO, WO, SO specific to common use cases
  • [x] CI/CD & Test binstub
  • [ ] Extraction of EventBridge Service classes and shared config
  • ~~[ ] Appraisal gem~~ Skipped in favor of circleci build matrix
  • [ ] Under Consideration: Event paylod builders, validators & full-fledged client

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/customink/erp_tools. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code of Conduct

Everyone interacting in the ErpTools project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.