spree_elta_courier 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.md +11 -6
- data/README.md +35 -19
- data/app/assets/config/spree_elta_courier_manifest.js +0 -2
- data/config/initializers/spree.rb +2 -5
- data/config/locales/el.yml +2 -2
- data/config/locales/en.yml +2 -2
- data/lib/spree_elta_courier/engine.rb +0 -11
- data/lib/spree_elta_courier/factories.rb +10 -2
- data/lib/spree_elta_courier/version.rb +1 -1
- data/lib/spree_elta_courier.rb +1 -4
- metadata +10 -15
- data/app/javascript/spree_elta_courier/application.js +0 -12
- data/app/views/spree_elta_courier/_head.html.erb +0 -1
- data/config/importmap.rb +0 -6
- data/lib/generators/spree_elta_courier/install/install_generator.rb +0 -20
- data/lib/spree_elta_courier/testing_support/factories/elta_courier_integration.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 395baab6c36f279e270abbaaa80ef0e6eecb2520d8d33dcdae61346d73c24008
|
|
4
|
+
data.tar.gz: e313ed63cabf500eeafbf874c974c6c8fd6c9ba589091045196a0f1261968b06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9fdac845b505ed658c36e8f5d1011c06c5a3dfb956cbadbdbbe69c27f7c2fb80974a4520294fe7e2f0a34c2860147f9dc1d52870f092801c10480f48b657238
|
|
7
|
+
data.tar.gz: e3d04145b3c5cd4ca3847d464ff08ed9f8e8cd4240437ed873abebb49dd6ebea44b3ed7f0d95cd49cf3edae8557e961f14832b861b3ac4e6a52c47ceeea218b9
|
data/LICENSE.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LICENSE
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025 OlympusOne
|
|
3
|
+
Copyright (c) 2025 OlympusOne. All rights reserved.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
+
GNU Affero General Public License as published by the Free Software Foundation, either
|
|
7
|
+
version 3 of the License, or any later version.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
|
data/README.md
CHANGED
|
@@ -1,45 +1,59 @@
|
|
|
1
1
|
# Spree Elta Courier
|
|
2
2
|
|
|
3
|
-
This is
|
|
3
|
+
This is an Elta Courier extension for [Spree Commerce](https://spreecommerce.org), an open‑source e-commerce platform built with Ruby on Rails. It adds the ability to manage Elta Courier vouchers.
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/rb/spree_elta_courier)
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
1. Add this extension to your Gemfile
|
|
9
|
+
1. Add this extension to your Gemfile:
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
12
|
bundle add spree_elta_courier
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
2.
|
|
15
|
+
2. Restart your server.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
## Usage (Creating & Printing Vouchers)
|
|
18
|
+
|
|
19
|
+
Prerequisites for an order:
|
|
20
|
+
|
|
21
|
+
- Shipping and billing addresses present
|
|
22
|
+
- Payment completed
|
|
23
|
+
- Order state: ready (so shipments exist and are ready to ship)
|
|
24
|
+
|
|
25
|
+
Workflow:
|
|
26
|
+
|
|
27
|
+
1. Open the order in Spree Admin.
|
|
28
|
+
2. If the order meets the prerequisites, the “Create Voucher” option appears in the top‑right dropdown.
|
|
29
|
+
3. Click “Create Voucher” (creates one voucher per shipment or split shipment).
|
|
30
|
+
4. After successful creation, the “Print Voucher” option becomes available.
|
|
31
|
+
5. Click “Print Voucher”: a merged (or single) PDF opens in a new tab for download/printing.
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
Notes:
|
|
22
34
|
|
|
23
|
-
|
|
35
|
+
- Multiple shipment vouchers are merged into one PDF.
|
|
36
|
+
- If no voucher can be created (e.g. order not ready), the button does not appear.
|
|
37
|
+
- Errors will return and log details server‑side.
|
|
24
38
|
|
|
25
39
|
## Developing
|
|
26
40
|
|
|
27
|
-
1. Create a dummy app
|
|
41
|
+
1. Create a dummy app:
|
|
28
42
|
|
|
29
43
|
```bash
|
|
30
44
|
bundle update
|
|
31
45
|
bundle exec rake test_app
|
|
32
46
|
```
|
|
33
47
|
|
|
34
|
-
2. Add
|
|
35
|
-
|
|
48
|
+
2. Add code.
|
|
49
|
+
|
|
50
|
+
3. Run tests:
|
|
36
51
|
|
|
37
52
|
```bash
|
|
38
53
|
bundle exec rspec
|
|
39
54
|
```
|
|
40
55
|
|
|
41
|
-
When testing your
|
|
42
|
-
Simply add this require statement to your spec_helper:
|
|
56
|
+
When testing your application's integration you may use its factories:
|
|
43
57
|
|
|
44
58
|
```ruby
|
|
45
59
|
require 'spree_elta_courier/factories'
|
|
@@ -47,19 +61,21 @@ require 'spree_elta_courier/factories'
|
|
|
47
61
|
|
|
48
62
|
## Testing
|
|
49
63
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
We can do this with the following command from the root directory of our extension:
|
|
64
|
+
Generate the test app:
|
|
53
65
|
|
|
54
66
|
```bash
|
|
55
67
|
bundle exec rake test_app
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
Then run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
bundle exec rspec
|
|
74
|
+
```
|
|
59
75
|
|
|
60
76
|
## Releasing a new version
|
|
61
77
|
|
|
62
|
-
```
|
|
78
|
+
```bash
|
|
63
79
|
bundle exec gem bump -p -t
|
|
64
80
|
bundle exec gem release
|
|
65
81
|
```
|
|
@@ -72,4 +88,4 @@ If you'd like to contribute, please take a look at the
|
|
|
72
88
|
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
|
|
73
89
|
pull request.
|
|
74
90
|
|
|
75
|
-
Copyright (c) 2025 OlympusOne, released under the
|
|
91
|
+
Copyright (c) 2025 OlympusOne, released under the AGPL-3.0 or later.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
Rails.application.config.after_initialize do
|
|
2
2
|
Rails.application.config.spree.integrations << Spree::Integrations::EltaCourier
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Rails.application.config.spree_admin.order_page_dropdown_partials << 'spree_elta_courier/order_dropdown_options'
|
|
8
|
-
end
|
|
4
|
+
# Admin partials
|
|
5
|
+
Rails.application.config.spree_admin.order_page_dropdown_partials << 'spree_elta_courier/order_dropdown_options'
|
|
9
6
|
end
|
data/config/locales/el.yml
CHANGED
|
@@ -11,8 +11,8 @@ el:
|
|
|
11
11
|
preferred_user_code: User Code
|
|
12
12
|
preferred_password: Password
|
|
13
13
|
preferred_paper_size: Μέγεθος Χαρτιού
|
|
14
|
-
create_voucher: Δημιουργία Voucher
|
|
15
|
-
print_voucher: Εκτύπωση Voucher
|
|
14
|
+
create_voucher: Δημιουργία Voucher (Elta Courier)
|
|
15
|
+
print_voucher: Εκτύπωση Voucher (Elta Courier)
|
|
16
16
|
voucher_successfully_created: Voucher δημιουργήθηκε επιτυχώς
|
|
17
17
|
voucher_creation_failed: Αποτυχία δημιουργίας Voucher
|
|
18
18
|
voucher_print_failed: Αποτυχία εκτύπωσης Voucher
|
data/config/locales/en.yml
CHANGED
|
@@ -11,8 +11,8 @@ en:
|
|
|
11
11
|
preferred_user_code: User Code
|
|
12
12
|
preferred_password: Password
|
|
13
13
|
preferred_paper_size: Paper Size
|
|
14
|
-
create_voucher: Create Voucher
|
|
15
|
-
print_voucher: Print Voucher
|
|
14
|
+
create_voucher: Create Voucher (Elta Courier)
|
|
15
|
+
print_voucher: Print Voucher (Elta Courier)
|
|
16
16
|
voucher_successfully_created: Voucher successfully created
|
|
17
17
|
voucher_creation_failed: Voucher creation failed
|
|
18
18
|
voucher_print: Voucher printing failed
|
|
@@ -14,20 +14,9 @@ module SpreeEltaCourier
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
initializer 'spree_elta_courier.assets' do |app|
|
|
17
|
-
app.config.assets.paths << root.join('app/javascript')
|
|
18
17
|
app.config.assets.precompile += %w[spree_elta_courier_manifest]
|
|
19
18
|
end
|
|
20
19
|
|
|
21
|
-
initializer 'spree_elta_courier.importmap', after: 'spree.admin.importmap' do |app|
|
|
22
|
-
app.config.spree_admin.importmap.draw(root.join('config/importmap.rb'))
|
|
23
|
-
|
|
24
|
-
app.config.spree_admin.cache_sweepers << root.join('app/javascript')
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
initializer 'spree_elta_courier.cache_sweeper', before: 'spree.admin.importmap.cache_sweeper' do |app|
|
|
28
|
-
app.config.spree_admin.cache_sweepers << root.join('app/javascript')
|
|
29
|
-
end
|
|
30
|
-
|
|
31
20
|
def self.activate
|
|
32
21
|
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
|
33
22
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
FactoryBot.define do
|
|
2
|
+
factory :elta_courier_integration, class: Spree::Integrations::EltaCourier do
|
|
3
|
+
active { true }
|
|
4
|
+
preferred_wsdl_url { ENV['ELTA_COURIER_WSDL_URL'] }
|
|
5
|
+
preferred_customer_code { ENV['ELTA_COURIER_CUSTOMER_CODE'] }
|
|
6
|
+
preferred_user_code { ENV['ELTA_COURIER_USER_CODE'] }
|
|
7
|
+
preferred_password { ENV['ELTA_COURIER_PASSWORD'] }
|
|
8
|
+
preferred_paper_size { "1" }
|
|
9
|
+
store { Spree::Store.default }
|
|
10
|
+
end
|
|
3
11
|
end
|
data/lib/spree_elta_courier.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_elta_courier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OlympusOne
|
|
@@ -15,42 +15,42 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 5.1.
|
|
18
|
+
version: 5.1.8
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 5.1.
|
|
25
|
+
version: 5.1.8
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: spree_storefront
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 5.1.
|
|
32
|
+
version: 5.1.8
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 5.1.
|
|
39
|
+
version: 5.1.8
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: spree_admin
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 5.1.
|
|
46
|
+
version: 5.1.8
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 5.1.
|
|
53
|
+
version: 5.1.8
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: spree_extension
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -133,7 +133,6 @@ files:
|
|
|
133
133
|
- app/assets/config/spree_elta_courier_manifest.js
|
|
134
134
|
- app/assets/images/integration_icons/elta-courier-logo.png
|
|
135
135
|
- app/controllers/spree/admin/elta_courier_controller.rb
|
|
136
|
-
- app/javascript/spree_elta_courier/application.js
|
|
137
136
|
- app/lib/elta_courier/soap_client.rb
|
|
138
137
|
- app/models/spree/integrations/elta_courier.rb
|
|
139
138
|
- app/models/spree/order_decorator.rb
|
|
@@ -141,19 +140,15 @@ files:
|
|
|
141
140
|
- app/services/spree_elta_courier/create_voucher.rb
|
|
142
141
|
- app/services/spree_elta_courier/print_vouchers.rb
|
|
143
142
|
- app/views/spree/admin/integrations/forms/_elta_courier.html.erb
|
|
144
|
-
- app/views/spree_elta_courier/_head.html.erb
|
|
145
143
|
- app/views/spree_elta_courier/_order_dropdown_options.html.erb
|
|
146
|
-
- config/importmap.rb
|
|
147
144
|
- config/initializers/spree.rb
|
|
148
145
|
- config/locales/el.yml
|
|
149
146
|
- config/locales/en.yml
|
|
150
147
|
- config/routes.rb
|
|
151
|
-
- lib/generators/spree_elta_courier/install/install_generator.rb
|
|
152
148
|
- lib/spree_elta_courier.rb
|
|
153
149
|
- lib/spree_elta_courier/configuration.rb
|
|
154
150
|
- lib/spree_elta_courier/engine.rb
|
|
155
151
|
- lib/spree_elta_courier/factories.rb
|
|
156
|
-
- lib/spree_elta_courier/testing_support/factories/elta_courier_integration.rb
|
|
157
152
|
- lib/spree_elta_courier/version.rb
|
|
158
153
|
- lib/spree_elta_courier/wsdl/CREATEAWB02.wsdl
|
|
159
154
|
- lib/spree_elta_courier/wsdl/ELTACOURIERPOSTSIDETA.wsdl
|
|
@@ -162,13 +157,13 @@ files:
|
|
|
162
157
|
- lib/spree_elta_courier/wsdl/PELTT03.wsdl
|
|
163
158
|
homepage: https://github.com/olympusone/spree_elta_courier
|
|
164
159
|
licenses:
|
|
165
|
-
-
|
|
160
|
+
- AGPL-3.0-or-later
|
|
166
161
|
metadata:
|
|
167
162
|
bug_tracker_uri: https://github.com/olympusone/spree_elta_courier/issues
|
|
168
|
-
changelog_uri: https://github.com/olympusone/spree_elta_courier/releases/tag/v1.0.
|
|
163
|
+
changelog_uri: https://github.com/olympusone/spree_elta_courier/releases/tag/v1.0.1
|
|
169
164
|
documentation_uri: https://github.com/olympusone/spree_elta_courier
|
|
170
165
|
homepage_uri: https://github.com/olympusone/spree_elta_courier
|
|
171
|
-
source_code_uri: https://github.com/olympusone/spree_elta_courier/tree/v1.0.
|
|
166
|
+
source_code_uri: https://github.com/olympusone/spree_elta_courier/tree/v1.0.1
|
|
172
167
|
rdoc_options: []
|
|
173
168
|
require_paths:
|
|
174
169
|
- lib
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import '@hotwired/turbo-rails'
|
|
2
|
-
import { Application } from '@hotwired/stimulus'
|
|
3
|
-
|
|
4
|
-
let application
|
|
5
|
-
|
|
6
|
-
if (typeof window.Stimulus === "undefined") {
|
|
7
|
-
application = Application.start()
|
|
8
|
-
application.debug = false
|
|
9
|
-
window.Stimulus = application
|
|
10
|
-
} else {
|
|
11
|
-
application = window.Stimulus
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%= javascript_import_module_tag 'application-spree-elta-courier' %>
|
data/config/importmap.rb
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
pin 'application-spree-elta-courier', to: 'spree_elta_courier/application.js', preload: false
|
|
2
|
-
|
|
3
|
-
pin_all_from SpreeEltaCourier::Engine.root.join('app/javascript/spree_elta_courier/controllers'),
|
|
4
|
-
under: 'spree_elta_courier/controllers',
|
|
5
|
-
to: 'spree_elta_courier/controllers',
|
|
6
|
-
preload: 'application-spree-elta-courier'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module SpreeEltaCourier
|
|
2
|
-
module Generators
|
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
|
4
|
-
class_option :migrate, type: :boolean, default: true
|
|
5
|
-
|
|
6
|
-
def add_migrations
|
|
7
|
-
run 'bundle exec rake railties:install:migrations FROM=spree_elta_courier'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def run_migrations
|
|
11
|
-
run_migrations = options[:migrate] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
|
|
12
|
-
if run_migrations
|
|
13
|
-
run 'bin/rails db:migrate'
|
|
14
|
-
else
|
|
15
|
-
puts 'Skipping rails db:migrate, don\'t forget to run it!'
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
FactoryBot.define do
|
|
2
|
-
factory :elta_courier_integration, class: Spree::Integrations::EltaCourier do
|
|
3
|
-
active { true }
|
|
4
|
-
preferred_wsdl_url { ENV['ELTA_COURIER_WSDL_URL'] }
|
|
5
|
-
preferred_customer_code { ENV['ELTA_COURIER_CUSTOMER_CODE'] }
|
|
6
|
-
preferred_username { ENV['ELTA_COURIER_USERNAME'] }
|
|
7
|
-
preferred_password { ENV['ELTA_COURIER_PASSWORD'] }
|
|
8
|
-
store { Spree::Store.default }
|
|
9
|
-
end
|
|
10
|
-
end
|