workarea-orderbot 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/ci.yml +58 -0
- data/.gitignore +23 -0
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +58 -0
- data/Gemfile +17 -0
- data/LICENSE +52 -0
- data/README.md +100 -0
- data/Rakefile +59 -0
- data/app/assets/images/workarea/admin/orderbot/.keep +0 -0
- data/app/assets/images/workarea/storefront/orderbot/.keep +0 -0
- data/app/assets/javascripts/workarea/admin/orderbot/.keep +0 -0
- data/app/assets/javascripts/workarea/storefront/orderbot/.keep +0 -0
- data/app/assets/stylesheets/workarea/admin/orderbot/.keep +0 -0
- data/app/assets/stylesheets/workarea/storefront/orderbot/.keep +0 -0
- data/app/controllers/.keep +0 -0
- data/app/helpers/.keep +0 -0
- data/app/mailers/.keep +0 -0
- data/app/models/workarea/order.decorator +19 -0
- data/app/models/workarea/orderbot/import_log.rb +19 -0
- data/app/models/workarea/orderbot/pricing_import_data.rb +13 -0
- data/app/models/workarea/orderbot/product_import_data.rb +32 -0
- data/app/models/workarea/user.decorator +7 -0
- data/app/services/workarea/orderbot/child_product.rb +108 -0
- data/app/services/workarea/orderbot/filters.rb +33 -0
- data/app/services/workarea/orderbot/order.rb +146 -0
- data/app/services/workarea/orderbot/order/item.rb +69 -0
- data/app/services/workarea/orderbot/order/tender/credit_card.rb +43 -0
- data/app/services/workarea/orderbot/order/tender/general.rb +32 -0
- data/app/services/workarea/orderbot/order/tender/gift_card.rb +32 -0
- data/app/services/workarea/orderbot/order/tender/store_credit.rb +32 -0
- data/app/services/workarea/orderbot/parent_product.rb +87 -0
- data/app/views/.keep +0 -0
- data/app/workers/workarea/orderbot/fulfillment/import_fulfillments.rb +37 -0
- data/app/workers/workarea/orderbot/fulfillment_importer.rb +50 -0
- data/app/workers/workarea/orderbot/inventory/import_inventory.rb +50 -0
- data/app/workers/workarea/orderbot/inventory_importer.rb +57 -0
- data/app/workers/workarea/orderbot/pricing/import_pricing.rb +42 -0
- data/app/workers/workarea/orderbot/pricing_importer.rb +70 -0
- data/app/workers/workarea/orderbot/product/import_child_products.rb +24 -0
- data/app/workers/workarea/orderbot/product/import_parent_products.rb +32 -0
- data/app/workers/workarea/orderbot/product_importer.rb +72 -0
- data/app/workers/workarea/orderbot/save_order.rb +38 -0
- data/bin/rails +25 -0
- data/config/initializers/configurations.rb +60 -0
- data/config/initializers/scheduled_jobs.rb +28 -0
- data/config/initializers/workarea.rb +16 -0
- data/config/routes.rb +2 -0
- data/lib/workarea/orderbot.rb +43 -0
- data/lib/workarea/orderbot/authentication.rb +41 -0
- data/lib/workarea/orderbot/bogus_gateway.rb +629 -0
- data/lib/workarea/orderbot/engine.rb +10 -0
- data/lib/workarea/orderbot/gateway.rb +102 -0
- data/lib/workarea/orderbot/response.rb +29 -0
- data/lib/workarea/orderbot/version.rb +5 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +14 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +2 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +25 -0
- data/test/dummy/bin/update +25 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/config/application.rb +34 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +52 -0
- data/test/dummy/config/environments/production.rb +83 -0
- data/test/dummy/config/environments/test.rb +45 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +12 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +34 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/services/workarea/orderbot/order_test.rb +151 -0
- data/test/services/workarea/orderbot/product/child_product_test.rb +255 -0
- data/test/services/workarea/orderbot/product/parent_product_test.rb +106 -0
- data/test/teaspoon_env.rb +6 -0
- data/test/test_helper.rb +10 -0
- data/test/workers/workarea/orderbot/fulfillment/import_fulfillments_test.rb +41 -0
- data/test/workers/workarea/orderbot/fulfillment_importer_test.rb +29 -0
- data/test/workers/workarea/orderbot/inventory/import_inventory_test.rb +49 -0
- data/test/workers/workarea/orderbot/inventory_importer_test.rb +21 -0
- data/test/workers/workarea/orderbot/pricing/import_pricing_test.rb +61 -0
- data/test/workers/workarea/orderbot/pricing_importer_test.rb +29 -0
- data/test/workers/workarea/orderbot/product_importer_test.rb +23 -0
- data/test/workers/workarea/orderbot/save_order_test.rb +41 -0
- data/workarea-orderbot.gemspec +20 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2d058ea81f9b0b36aea5dcbc787ae4d2164b4bc70702d3882dac58c564b2ed9b
|
4
|
+
data.tar.gz: 02c6961f01d949fef422e5aaa414718c91db1eaf2bd2c389dcbc0b4ccbc6b776
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 367492706c59f24f458453127e7b8c1aad50d77d25b9ea3341fb958a209109f0e6dd9654f677d0adbe40a09a9b735d9cd4d6f5783a59a5536064a4c6bbf9f605
|
7
|
+
data.tar.gz: 3774fc70b7271cf5464fdbbbca5dedc757b5615fe8e69fe2e0c1760b5783f0dbabef0aa7bb155bca0d8b1b917fc62116f9d0bbe2543430dfb700538caa12830c
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve Workarea
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
⚠️**Before you create**⚠️
|
11
|
+
Please verify the issue you're experiencing is not part of your Workarea project customizations. The best way to do this is with a [vanilla Workarea installation](https://developer.workarea.com/articles/create-a-new-host-application.html). This will help us spend time on fixes/improvements for the whole community. Thank you!
|
12
|
+
|
13
|
+
**Describe the bug**
|
14
|
+
A clear and concise description of what the bug is.
|
15
|
+
|
16
|
+
**To Reproduce**
|
17
|
+
Steps to reproduce the behavior:
|
18
|
+
1. Go to '...'
|
19
|
+
2. Click on '....'
|
20
|
+
3. Scroll down to '....'
|
21
|
+
4. See error
|
22
|
+
|
23
|
+
**Expected behavior**
|
24
|
+
A clear and concise description of what you expected to happen.
|
25
|
+
|
26
|
+
**Workarea Setup (please complete the following information):**
|
27
|
+
- Workarea Version: [e.g. v3.4.6]
|
28
|
+
- Plugins [e.g. workarea-blog, workarea-sitemaps]
|
29
|
+
|
30
|
+
**Attachments**
|
31
|
+
If applicable, add any attachments to help explain your problem, things like:
|
32
|
+
- screenshots
|
33
|
+
- Gemfile.lock
|
34
|
+
- test cases
|
35
|
+
|
36
|
+
**Additional context**
|
37
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
name: Documentation request
|
3
|
+
about: Suggest documentation
|
4
|
+
title: ''
|
5
|
+
labels: documentation
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your documentation related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm confused by [...]
|
12
|
+
|
13
|
+
**Describe the article you'd like**
|
14
|
+
A clear and concise description of what would be in the documentation article.
|
15
|
+
|
16
|
+
**Additional context**
|
17
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for Workarea
|
4
|
+
title: ''
|
5
|
+
labels: enhancement
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: CI
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
paths-ignore:
|
5
|
+
- '.github/**'
|
6
|
+
- '**.md'
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
static_analysis:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
- uses: workarea-commerce/ci/bundler-audit@v1
|
14
|
+
- uses: workarea-commerce/ci/rubocop@v1
|
15
|
+
|
16
|
+
admin_tests:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v1
|
20
|
+
- uses: actions/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: 2.6.x
|
23
|
+
- uses: workarea-commerce/ci/test@v1
|
24
|
+
with:
|
25
|
+
command: bin/rails app:workarea:test:admin
|
26
|
+
|
27
|
+
core_tests:
|
28
|
+
runs-on: ubuntu-latest
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v1
|
31
|
+
- uses: actions/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: 2.6.x
|
34
|
+
- uses: workarea-commerce/ci/test@v1
|
35
|
+
with:
|
36
|
+
command: bin/rails app:workarea:test:core
|
37
|
+
|
38
|
+
storefront_tests:
|
39
|
+
runs-on: ubuntu-latest
|
40
|
+
steps:
|
41
|
+
- uses: actions/checkout@v1
|
42
|
+
- uses: actions/setup-ruby@v1
|
43
|
+
with:
|
44
|
+
ruby-version: 2.6.x
|
45
|
+
- uses: workarea-commerce/ci/test@v1
|
46
|
+
with:
|
47
|
+
command: bin/rails app:workarea:test:storefront
|
48
|
+
|
49
|
+
plugins_tests:
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
steps:
|
52
|
+
- uses: actions/checkout@v1
|
53
|
+
- uses: actions/setup-ruby@v1
|
54
|
+
with:
|
55
|
+
ruby-version: 2.6.x
|
56
|
+
- uses: workarea-commerce/ci/test@v1
|
57
|
+
with:
|
58
|
+
command: bin/rails app:workarea:test:plugins
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
.bundle/
|
2
|
+
log/*.log
|
3
|
+
pkg/
|
4
|
+
test/dummy/log/*.log
|
5
|
+
test/dummy/tmp/
|
6
|
+
.DS_Store
|
7
|
+
.byebug_history
|
8
|
+
.bundle/
|
9
|
+
.sass-cache/
|
10
|
+
Gemfile.lock
|
11
|
+
pkg/
|
12
|
+
test/dummy/tmp/
|
13
|
+
test/dummy/public/
|
14
|
+
log/*.log
|
15
|
+
test/dummy/log/*.log
|
16
|
+
test/dummy/db/*.sqlite3
|
17
|
+
test/dummy/db/*.sqlite3-journal
|
18
|
+
node_modules
|
19
|
+
yarn.lock
|
20
|
+
yarn-error.log
|
21
|
+
package-lock.json
|
22
|
+
.rubocop-https-*
|
23
|
+
.ruby-version
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
Workarea Orderbot 1.0.0 (2020-03-13)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Use correct date filter when polling for orderbot fulfillment records
|
5
|
+
|
6
|
+
ORDERBOT-15
|
7
|
+
Jeff Yucis
|
8
|
+
|
9
|
+
* Ensure product data is not duplicated in import products.
|
10
|
+
|
11
|
+
Commit also increases gateway timeout to avoid duplicate orders
|
12
|
+
|
13
|
+
ORDERBOT-14
|
14
|
+
Jeff Yucis
|
15
|
+
|
16
|
+
* Handle successfull responses that fail to save in orderbot
|
17
|
+
|
18
|
+
Commit handles case where the API response is a 200 but the order
|
19
|
+
fails to create the record in orderbot.
|
20
|
+
|
21
|
+
ORDERBOT-13
|
22
|
+
Jeff Yucis
|
23
|
+
|
24
|
+
* reset timeouts to defaults 10 seconds
|
25
|
+
|
26
|
+
Jeff Yucis
|
27
|
+
|
28
|
+
* Add taxes at the order level
|
29
|
+
|
30
|
+
ORDERBOT-12
|
31
|
+
Jeff Yucis
|
32
|
+
|
33
|
+
* Style fixes
|
34
|
+
|
35
|
+
Jeff Yucis
|
36
|
+
|
37
|
+
* Set backorder inventory policy based on backorderable custom field
|
38
|
+
|
39
|
+
ORDERBOT-9
|
40
|
+
Jeff Yucis
|
41
|
+
|
42
|
+
* Only pull active pricing when updated Workarea pricing
|
43
|
+
|
44
|
+
ORDERBOT-10
|
45
|
+
Jeff Yucis
|
46
|
+
|
47
|
+
* Add gift card and store credit payment types
|
48
|
+
|
49
|
+
ORDERBOT-6
|
50
|
+
Jeff Yucis
|
51
|
+
|
52
|
+
* Pull catalog data from orderbot APIs
|
53
|
+
|
54
|
+
ORDERBOT-1
|
55
|
+
Jeff Yucis
|
56
|
+
|
57
|
+
|
58
|
+
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
|
+
|
4
|
+
# Declare your gem's dependencies in orderbot.gemspec.
|
5
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
6
|
+
# development dependencies will be added by default to the :development group.
|
7
|
+
gemspec
|
8
|
+
|
9
|
+
# Declare any dependencies that are still in development here instead of in
|
10
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
11
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
12
|
+
# your gem to rubygems.org.
|
13
|
+
|
14
|
+
# To use a debugger
|
15
|
+
# gem 'byebug', group: [:development, :test]
|
16
|
+
|
17
|
+
gem 'workarea', github: 'workarea-commerce/workarea', branch: 'v3.5-stable'
|
data/LICENSE
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
WebLinc
|
2
|
+
Business Source License
|
3
|
+
|
4
|
+
Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
|
5
|
+
|
6
|
+
Licensed Work: Workarea Commerce Platform
|
7
|
+
The Licensed Work is (c) 2019 WebLinc Corporation
|
8
|
+
|
9
|
+
Additional Use Grant:
|
10
|
+
You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
|
11
|
+
|
12
|
+
A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
|
13
|
+
|
14
|
+
For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
|
15
|
+
|
16
|
+
Change Date: 2019-08-20
|
17
|
+
|
18
|
+
Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
|
19
|
+
|
20
|
+
Terms
|
21
|
+
|
22
|
+
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
|
23
|
+
|
24
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
|
25
|
+
|
26
|
+
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
|
27
|
+
|
28
|
+
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
|
29
|
+
|
30
|
+
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
|
31
|
+
|
32
|
+
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
33
|
+
|
34
|
+
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
|
35
|
+
|
36
|
+
Covenants of Licensor
|
37
|
+
In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
|
38
|
+
|
39
|
+
To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
|
40
|
+
|
41
|
+
To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
|
42
|
+
|
43
|
+
To specify a Change Date.
|
44
|
+
|
45
|
+
Not to modify this License in any other way.
|
46
|
+
|
47
|
+
Notice
|
48
|
+
The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
|
49
|
+
|
50
|
+
For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
|
51
|
+
|
52
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
Workarea Orderbot
|
2
|
+
================================================================================
|
3
|
+
|
4
|
+
Orderbot integration for the Workarea platform.
|
5
|
+
|
6
|
+
This integration pulls catalog information from the Orderbot REST API and pushes order and customer data back.
|
7
|
+
|
8
|
+
Overview
|
9
|
+
--------------------------------------------------------------------------------
|
10
|
+
|
11
|
+
The following catalog data is pulled from Orderbot:
|
12
|
+
|
13
|
+
* Products
|
14
|
+
* Pricing
|
15
|
+
* Inventory
|
16
|
+
* Fulfillments
|
17
|
+
|
18
|
+
The following is pushed to Orderbot:
|
19
|
+
|
20
|
+
* Orders
|
21
|
+
* Customer data (contained in order)
|
22
|
+
|
23
|
+
The synchronization of data relies on cron jobs defined in this plugin.
|
24
|
+
|
25
|
+
The defaults are:
|
26
|
+
|
27
|
+
* **Products**: Daily at 2:00am
|
28
|
+
* **Inventory**: Every hour on the hour
|
29
|
+
* **Pricing**: Every hour at the 30 minute mark
|
30
|
+
* **Fulfillments**: Every 20 minutes
|
31
|
+
|
32
|
+
Host apps can change these defaults by redefining them in their own initializer.
|
33
|
+
|
34
|
+
Each of these scheduled jobs are designed to only pull records from Orderbot that have changed since the last run of the job. You can pass an argument named "from_updated_on" with a datetime to the job via the the command line if you need to run an import on a longer time frame.
|
35
|
+
|
36
|
+
For example:
|
37
|
+
```ruby
|
38
|
+
Workarea::Orderbot::ProductImporter.new.perform(from_updated_on: 1.month.ago) # gets all products updated within the last month
|
39
|
+
```
|
40
|
+
|
41
|
+
Useful information is stored in ```Workarea::Orderbot::ImportLog``` with data about which import ran, when it started and finished.
|
42
|
+
|
43
|
+
Orders placed in Workarea are queued in Sidekiq and are not sent in a batch.
|
44
|
+
|
45
|
+
Product Import Notes
|
46
|
+
--------------------------------------------------------------------------------
|
47
|
+
|
48
|
+
The product import task saves import data into a collection defined at ```Workarea::Orderbot::ProductImportData```. This collection is then iterated over and creates products and their associated variants. Products not imported at the end of the process will remain in the collection. Relevant error data is stored in the ```error_message``` on the class. Check this field if a record is stuck in the import process.
|
49
|
+
|
50
|
+
The product import task will attempt to save the product details from Orderbot by making a call to the custom fields endpoint. These custom field names can not have the "." or "$" characters because of the way they are stored in the Workarea product details hash. If details from Orderbot are not importing a good place to start debugging is checking for those characters in the Orderbot custom fields admin.
|
51
|
+
|
52
|
+
The Orderbot fields "Group" and "Category" will be imported as product filters which can be used for category creation in the Workarea admin.
|
53
|
+
|
54
|
+
Order Export Notes
|
55
|
+
--------------------------------------------------------------------------------
|
56
|
+
|
57
|
+
Orders are put into a Sidekiq queue on order place. Orders that have been successfully sent to Orderbot will have the Orderbot order ID saved to the model as well as when a timestamp for the when it was exported.
|
58
|
+
|
59
|
+
A new Orderbot customer is created if the order's user does not have a customer ID associated to it already. The Orderbot customer ID will be attached to the user model if the order was a placed by a logged in user. Guest checkouts will be referenced by a users email in Orderbot.
|
60
|
+
|
61
|
+
Configuration
|
62
|
+
--------------------------------------------------------------------------------
|
63
|
+
|
64
|
+
This integration's configuration can be controlled via the admin configuration panel.
|
65
|
+
|
66
|
+
Notable configurations:
|
67
|
+
|
68
|
+
* **Orderbot API Email Address**: Email address used to login to your Orderbot admin. This user must have API access.
|
69
|
+
* **Orderbot API Password**: Password used to login to the Orderbot admin.
|
70
|
+
* **Order Guide ID**: The order guide ID used to get products and prices. Recommended to not leave this field blank.
|
71
|
+
* **Inventory Distribution Center ID**: The distribution center ID to pull inventory from. Leaving this field blank will pull inventory for all DCs and can lead to unexpected results.
|
72
|
+
|
73
|
+
See the "Orderbot" section under configuration for more options and details.
|
74
|
+
|
75
|
+
Getting Started
|
76
|
+
--------------------------------------------------------------------------------
|
77
|
+
|
78
|
+
This gem contains a Rails engine that must be mounted onto a host Rails application.
|
79
|
+
|
80
|
+
Add the gem to your application's Gemfile:
|
81
|
+
|
82
|
+
# ...
|
83
|
+
gem 'workarea-orderbot'
|
84
|
+
# ...
|
85
|
+
|
86
|
+
Update your application's bundle.
|
87
|
+
|
88
|
+
cd path/to/application
|
89
|
+
bundle
|
90
|
+
|
91
|
+
|
92
|
+
Workarea Platform Documentation
|
93
|
+
--------------------------------------------------------------------------------
|
94
|
+
|
95
|
+
See [https://developer.workarea.com](https://developer.workarea.com) for Workarea platform documentation.
|
96
|
+
|
97
|
+
License
|
98
|
+
--------------------------------------------------------------------------------
|
99
|
+
|
100
|
+
Workarea Orderbot is released under the [Business Software License](LICENSE)
|
data/Rakefile
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
9
|
+
rdoc.rdoc_dir = 'rdoc'
|
10
|
+
rdoc.title = 'Orderbot'
|
11
|
+
rdoc.options << '--line-numbers'
|
12
|
+
rdoc.rdoc_files.include('README.md')
|
13
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
14
|
+
end
|
15
|
+
|
16
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
17
|
+
load 'rails/tasks/engine.rake'
|
18
|
+
load 'rails/tasks/statistics.rake'
|
19
|
+
load 'workarea/changelog.rake'
|
20
|
+
|
21
|
+
require 'rake/testtask'
|
22
|
+
Rake::TestTask.new(:test) do |t|
|
23
|
+
t.libs << 'lib'
|
24
|
+
t.libs << 'test'
|
25
|
+
t.pattern = 'test/**/*_test.rb'
|
26
|
+
t.verbose = false
|
27
|
+
end
|
28
|
+
task default: :test
|
29
|
+
|
30
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
31
|
+
require 'workarea/orderbot/version'
|
32
|
+
|
33
|
+
desc "Release version #{Workarea::Orderbot::VERSION} of the gem"
|
34
|
+
task :release do
|
35
|
+
host = "https://#{ENV['BUNDLE_GEMS__WORKAREA__COM']}@gems.workarea.com"
|
36
|
+
|
37
|
+
Rake::Task['workarea:changelog'].execute
|
38
|
+
system 'git add CHANGELOG.md'
|
39
|
+
system 'git commit -m "Update CHANGELOG"'
|
40
|
+
|
41
|
+
system "git tag -a v#{Workarea::Orderbot::VERSION} -m 'Tagging #{Workarea::Orderbot::VERSION}'"
|
42
|
+
system 'git push origin HEAD --follow-tags'
|
43
|
+
|
44
|
+
system 'gem build workarea-orderbot.gemspec'
|
45
|
+
system "gem push workarea-orderbot-#{Workarea::Orderbot::VERSION}.gem"
|
46
|
+
system "gem push workarea-orderbot-#{Workarea::Orderbot::VERSION}.gem --host #{host}"
|
47
|
+
system "rm workarea-orderbot-#{Workarea::Orderbot::VERSION}.gem"
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'Run the JavaScript tests'
|
51
|
+
ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
|
52
|
+
task teaspoon: 'app:teaspoon'
|
53
|
+
|
54
|
+
desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
|
55
|
+
task :teaspoon_server do
|
56
|
+
Dir.chdir("test/dummy")
|
57
|
+
teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
|
58
|
+
system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
|
59
|
+
end
|