README.md
SolidusWms
==========
[![Build Status](https://travis-ci.org/madetech/solidus_wms.svg?branch=master)](https://travis-ci.org/madetech/solidus_wms) [![Code Climate](https://codeclimate.com/github/madetech/solidus_wms/badges/gpa.svg)](https://codeclimate.com/github/madetech/solidus_wms) [![Test Coverage](https://codeclimate.com/github/madetech/solidus_wms/badges/coverage.svg)](https://codeclimate.com/github/madetech/solidus-adyen-cse/coverage)
Adds additional API endpoints, and state machine events to the `Spree::Shipment` to provide an integration with your WMS of choice.
Installation
------------
Add solidus_wms to your Gemfile:
```ruby
gem 'solidus_wms'
```
Bundle your dependencies and run the installation generator:
```shell
bundle
bundle exec rails g solidus_wms:install
```
Testing
-------
First bundle your dependencies, then run `rake`. `rake` will default to building the dummy app if it does not exist, then it will run specs, and [Rubocop](https://github.com/bbatsov/rubocop) static code analysis. The dummy app can be regenerated by using `rake test_app`.
```shell
bundle
bundle exec rake
```
When testing your applications integration with this extension you may use it's factories.
Simply add this require statement to your spec_helper:
```ruby
require 'solidus_wms/factories'
```
Endpoints
---------
`/api/shipments/:id/receive` Moves a Shipment from `ready` to `recieved`
`/api/shipments/:id/pick` Moves a Shipment from `received` to `picked`
`/api/orders/:id/export` Marks an order as exported, by touching the `exported_at`
`/api/order/to_export` Lists all orders ready to export before a provided timestamp
`/xlsx-export/orders` Basic auth protected endpoint to export orders to .xlsx
Excel Order export
-------------------
In your host application, create the following configuration:
`Spree::WmsConfig.order_xls_export_class = Exporter::Xlsx::Order`
This class needs to provide the custom application specific data to the Axlsx exporter
An example of this data structure is:
```
[
{
name: 'Worksheet 1',
headers: [
'Create Date',
'Status',
],
orders: [
[order_1.created_at, 'complete'],
[order_2.created_at, 'complete'],
]
}
]
```
There is an #on_success callback that can be used for custom functionality in the host application.
In our case we use it to exclude already exported orders.
Copyright (c) 2016 Seb Ashton and [Made Tech](https://www.madetech.com) released under the New BSD License