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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0138c167e19a827d9eda2caef4333702930eb2d1f436b6a7f9755bb83b9a79d6'
4
- data.tar.gz: 6aaf7177fb8045fb654cb47282a148baab634bb6d541a8731561bd52dcbf252d
3
+ metadata.gz: 395baab6c36f279e270abbaaa80ef0e6eecb2520d8d33dcdae61346d73c24008
4
+ data.tar.gz: e313ed63cabf500eeafbf874c974c6c8fd6c9ba589091045196a0f1261968b06
5
5
  SHA512:
6
- metadata.gz: eaa5dfcba4320663fd8f21880aaa667e754fc5e56ebcbb242a430a77eafda2df4a75afc83dfa0a5ce83085ddfb23dddc32a57cc189c1cde146c02d51c7cca29d
7
- data.tar.gz: 8bef0689177ce154d5c51aeda6f245349707632258e09596572cf019d468d70df14f99db56d41788ce4c2ba4eac414ab9734c5c33b7a6b049dee8a4dca643806
6
+ metadata.gz: b9fdac845b505ed658c36e8f5d1011c06c5a3dfb956cbadbdbbe69c27f7c2fb80974a4520294fe7e2f0a34c2860147f9dc1d52870f092801c10480f48b657238
7
+ data.tar.gz: e3d04145b3c5cd4ca3847d464ff08ed9f8e8cd4240437ed873abebb49dd6ebea44b3ed7f0d95cd49cf3edae8557e961f14832b861b3ac4e6a52c47ceeea218b9
data/LICENSE.md CHANGED
@@ -1,10 +1,15 @@
1
- # MIT License
1
+ # LICENSE
2
2
 
3
- Copyright (c) 2025 OlympusOne
3
+ Copyright (c) 2025 OlympusOne. All rights reserved.
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
10
- SOFTWARE.
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 a Elta Courier extension for [Spree Commerce](https://spreecommerce.org), an open source e-commerce platform built with Ruby on Rails. Adds the ability to manage Elta Courier vouchers to Spree stores.
3
+ This is an Elta Courier extension for [Spree Commerce](https://spreecommerce.org), an opensource e-commerce platform built with Ruby on Rails. It adds the ability to manage Elta Courier vouchers.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/spree_elta_courier.svg)](https://badge.fury.io/rb/spree_elta_courier)
6
6
 
7
7
  ## Installation
8
8
 
9
- 1. Add this extension to your Gemfile with this line:
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. Run the install generator
15
+ 2. Restart your server.
16
16
 
17
- ```ruby
18
- bundle exec rails g spree_elta_courier:install
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
- 3. Restart your server
33
+ Notes:
22
34
 
23
- If your server was running, restart it so that it can find the assets properly.
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 your new code
35
- 3. Run tests
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 applications integration with this extension you may use it's factories.
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
- By running the Spree test_app rake task, we can generate a barebones Spree application within our spec directory to run our tests against.
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
- After this command completes, you should be able to run `rspec`.
70
+ Then run:
71
+
72
+ ```bash
73
+ bundle exec rspec
74
+ ```
59
75
 
60
76
  ## Releasing a new version
61
77
 
62
- ```shell
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 MIT
91
+ Copyright (c) 2025 OlympusOne, released under the AGPL-3.0 or later.
@@ -1,3 +1 @@
1
1
  //= link_tree ../images
2
- //= link spree_elta_courier/application.js
3
- //= link_tree ../../javascript/spree_elta_courier/controllers .js
@@ -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
- if Rails.application.config.respond_to?(:spree_admin)
5
- Rails.application.config.spree_admin.head_partials << 'spree_elta_courier/head'
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
@@ -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
@@ -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
- Dir["#{File.dirname(__FILE__)}/testing_support/factories/**"].each do |f|
2
- load File.expand_path(f)
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
@@ -1,5 +1,5 @@
1
1
  module SpreeEltaCourier
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
 
4
4
  def gem_version
5
5
  Gem::Version.new(VERSION)
@@ -5,7 +5,4 @@ require 'spree_elta_courier/version'
5
5
  require 'spree_elta_courier/configuration'
6
6
 
7
7
  module SpreeEltaCourier
8
- def self.queue
9
- 'default'
10
- end
11
- end
8
+ end
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.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.0
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.0
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.0
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.0
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.0
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.0
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
- - MIT
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.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.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