solidus_tiny 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +53 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +1 -0
  5. data/.github_changelog_generator +2 -0
  6. data/.gitignore +21 -0
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +5 -0
  9. data/CHANGELOG.md +3 -0
  10. data/Gemfile +48 -0
  11. data/LICENSE +26 -0
  12. data/README.md +73 -0
  13. data/Rakefile +7 -0
  14. data/app/controllers/spree/admin/orders/solidus_tiny/sellers_controller.rb +38 -0
  15. data/app/controllers/spree/admin/solidus_tiny/accounts_controller.rb +82 -0
  16. data/app/controllers/spree/admin/solidus_tiny/orders_controller.rb +20 -0
  17. data/app/jobs/solidus_tiny/application_job.rb +9 -0
  18. data/app/jobs/solidus_tiny/order_job.rb +10 -0
  19. data/app/jobs/solidus_tiny/upsert_sellers_job.rb +9 -0
  20. data/app/models/solidus_tiny/account.rb +8 -0
  21. data/app/models/solidus_tiny/event.rb +4 -0
  22. data/app/models/solidus_tiny/order.rb +129 -0
  23. data/app/models/solidus_tiny/payment_method.rb +4 -0
  24. data/app/models/solidus_tiny/seller.rb +44 -0
  25. data/app/models/solidus_tiny/shipping_method.rb +10 -0
  26. data/app/models/spree/permission_sets/tiny_seller_update.rb +9 -0
  27. data/app/subscribers/solidus_tiny/subscriber.rb +12 -0
  28. data/app/views/spree/admin/orders/solidus_tiny/sellers/edit.html.erb +19 -0
  29. data/app/views/spree/admin/shared/_order_submenu.html.erb +67 -0
  30. data/app/views/spree/admin/shared/_order_summary.html.erb +75 -0
  31. data/app/views/spree/admin/solidus_tiny/accounts/_form.html.erb +110 -0
  32. data/app/views/spree/admin/solidus_tiny/accounts/edit.html.erb +3 -0
  33. data/app/views/spree/admin/solidus_tiny/accounts/index.html.erb +54 -0
  34. data/app/views/spree/admin/solidus_tiny/accounts/new.html.erb +3 -0
  35. data/bin/console +17 -0
  36. data/bin/rails +7 -0
  37. data/bin/rails-engine +13 -0
  38. data/bin/rails-sandbox +16 -0
  39. data/bin/rake +7 -0
  40. data/bin/sandbox +76 -0
  41. data/bin/setup +8 -0
  42. data/config/locales/en.yml +5 -0
  43. data/config/locales/pt-BR.yml +5 -0
  44. data/config/routes.rb +17 -0
  45. data/db/migrate/20240506185512_create_solidus_tiny_accounts.rb +11 -0
  46. data/db/migrate/20240507111938_create_solidus_tiny_sellers.rb +15 -0
  47. data/db/migrate/20240507112822_add_solidus_tiny_seller_id_to_orders.rb +5 -0
  48. data/db/migrate/20240507114823_create_solidus_tiny_shipping_methods.rb +15 -0
  49. data/db/migrate/20240507121424_create_solidus_tiny_payment_methods.rb +13 -0
  50. data/db/migrate/20240507181649_add_tiny_order_id_to_spree_orders.rb +5 -0
  51. data/db/migrate/20240507190528_create_solidus_tiny_events.rb +13 -0
  52. data/lib/generators/solidus_tiny/install/install_generator.rb +31 -0
  53. data/lib/generators/solidus_tiny/install/templates/initializer.rb +4 -0
  54. data/lib/solidus_tiny/configuration.rb +18 -0
  55. data/lib/solidus_tiny/engine.rb +38 -0
  56. data/lib/solidus_tiny/testing_support/factories.rb +4 -0
  57. data/lib/solidus_tiny/version.rb +5 -0
  58. data/lib/solidus_tiny.rb +7 -0
  59. data/solidus_tiny.gemspec +36 -0
  60. metadata +182 -0
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusTiny
4
+ class Configuration
5
+ end
6
+
7
+ class << self
8
+ def configuration
9
+ @configuration ||= Configuration.new
10
+ end
11
+
12
+ alias_method :config, :configuration
13
+
14
+ def configure
15
+ yield configuration
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'solidus_core'
4
+ require 'solidus_support'
5
+
6
+ module SolidusTiny
7
+ class Engine < Rails::Engine
8
+ include SolidusSupport::EngineExtensions
9
+
10
+ isolate_namespace ::SolidusTiny
11
+
12
+ engine_name 'solidus_tiny'
13
+
14
+ initializer "solidus_tiny.configure_backend" do
15
+ next unless ::Spree::Backend::Config.respond_to?(:menu_items)
16
+
17
+ ::Spree::Backend::Config.configure do |config|
18
+ config.menu_items << config.class::MenuItem.new(
19
+ label: "tiny_account",
20
+ icon: "link",
21
+ url: "/admin/solidus_tiny/accounts",
22
+ condition: -> { can?(:manage, ::Spree::Store) }
23
+ )
24
+ end
25
+ end
26
+
27
+ initializer "solidus_tiny.pub_sub", after: "spree.core.pub_sub" do |app|
28
+ app.reloader.to_prepare do
29
+ SolidusTiny::Subscriber.new.subscribe_to(::Spree::Bus)
30
+ end
31
+ end
32
+
33
+ # use rspec for tests
34
+ config.generators do |g|
35
+ g.test_framework :rspec
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ FactoryBot.define do
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusTiny
4
+ VERSION = '1.0.0'
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tiny_erp_api"
4
+ require "solidus_brazilian_adaptations"
5
+ require 'solidus_tiny/configuration'
6
+ require 'solidus_tiny/version'
7
+ require 'solidus_tiny/engine'
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/solidus_tiny/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'solidus_tiny'
7
+ spec.version = SolidusTiny::VERSION
8
+ spec.authors = ['ulysses']
9
+ spec.email = 'ulyssesh.20@gmail.com'
10
+
11
+ spec.summary = ''
12
+ spec.homepage = 'https://github.com/ulysses-bull/solidus_tiny#readme'
13
+ spec.license = 'BSD-3-Clause'
14
+
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = 'https://github.com/ulysses-bull/solidus_tiny'
17
+ spec.metadata['changelog_uri'] = 'https://github.com/ulysses-bull/solidus_tiny/blob/main/CHANGELOG.md'
18
+
19
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 4')
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") }
24
+
25
+ spec.files = files.grep_v(%r{^(test|spec|features)/})
26
+ spec.bindir = "exe"
27
+ spec.executables = files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 5']
31
+ spec.add_dependency 'solidus_support', '~> 0.5'
32
+ spec.add_dependency "solidus_brazilian_adaptations"
33
+ spec.add_dependency "tiny_erp_api"
34
+
35
+ spec.add_development_dependency 'solidus_dev_support', '~> 2.9'
36
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solidus_tiny
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - ulysses
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: solidus_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
33
+ - !ruby/object:Gem::Dependency
34
+ name: solidus_support
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.5'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.5'
47
+ - !ruby/object:Gem::Dependency
48
+ name: solidus_brazilian_adaptations
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: tiny_erp_api
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: solidus_dev_support
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.9'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '2.9'
89
+ description:
90
+ email: ulyssesh.20@gmail.com
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - ".circleci/config.yml"
96
+ - ".gem_release.yml"
97
+ - ".github/stale.yml"
98
+ - ".github_changelog_generator"
99
+ - ".gitignore"
100
+ - ".rspec"
101
+ - ".rubocop.yml"
102
+ - CHANGELOG.md
103
+ - Gemfile
104
+ - LICENSE
105
+ - README.md
106
+ - Rakefile
107
+ - app/controllers/spree/admin/orders/solidus_tiny/sellers_controller.rb
108
+ - app/controllers/spree/admin/solidus_tiny/accounts_controller.rb
109
+ - app/controllers/spree/admin/solidus_tiny/orders_controller.rb
110
+ - app/jobs/solidus_tiny/application_job.rb
111
+ - app/jobs/solidus_tiny/order_job.rb
112
+ - app/jobs/solidus_tiny/upsert_sellers_job.rb
113
+ - app/models/solidus_tiny/account.rb
114
+ - app/models/solidus_tiny/event.rb
115
+ - app/models/solidus_tiny/order.rb
116
+ - app/models/solidus_tiny/payment_method.rb
117
+ - app/models/solidus_tiny/seller.rb
118
+ - app/models/solidus_tiny/shipping_method.rb
119
+ - app/models/spree/permission_sets/tiny_seller_update.rb
120
+ - app/subscribers/solidus_tiny/subscriber.rb
121
+ - app/views/spree/admin/orders/solidus_tiny/sellers/edit.html.erb
122
+ - app/views/spree/admin/shared/_order_submenu.html.erb
123
+ - app/views/spree/admin/shared/_order_summary.html.erb
124
+ - app/views/spree/admin/solidus_tiny/accounts/_form.html.erb
125
+ - app/views/spree/admin/solidus_tiny/accounts/edit.html.erb
126
+ - app/views/spree/admin/solidus_tiny/accounts/index.html.erb
127
+ - app/views/spree/admin/solidus_tiny/accounts/new.html.erb
128
+ - bin/console
129
+ - bin/rails
130
+ - bin/rails-engine
131
+ - bin/rails-sandbox
132
+ - bin/rake
133
+ - bin/sandbox
134
+ - bin/setup
135
+ - config/locales/en.yml
136
+ - config/locales/pt-BR.yml
137
+ - config/routes.rb
138
+ - db/migrate/20240506185512_create_solidus_tiny_accounts.rb
139
+ - db/migrate/20240507111938_create_solidus_tiny_sellers.rb
140
+ - db/migrate/20240507112822_add_solidus_tiny_seller_id_to_orders.rb
141
+ - db/migrate/20240507114823_create_solidus_tiny_shipping_methods.rb
142
+ - db/migrate/20240507121424_create_solidus_tiny_payment_methods.rb
143
+ - db/migrate/20240507181649_add_tiny_order_id_to_spree_orders.rb
144
+ - db/migrate/20240507190528_create_solidus_tiny_events.rb
145
+ - lib/generators/solidus_tiny/install/install_generator.rb
146
+ - lib/generators/solidus_tiny/install/templates/initializer.rb
147
+ - lib/solidus_tiny.rb
148
+ - lib/solidus_tiny/configuration.rb
149
+ - lib/solidus_tiny/engine.rb
150
+ - lib/solidus_tiny/testing_support/factories.rb
151
+ - lib/solidus_tiny/version.rb
152
+ - solidus_tiny.gemspec
153
+ homepage: https://github.com/ulysses-bull/solidus_tiny#readme
154
+ licenses:
155
+ - BSD-3-Clause
156
+ metadata:
157
+ homepage_uri: https://github.com/ulysses-bull/solidus_tiny#readme
158
+ source_code_uri: https://github.com/ulysses-bull/solidus_tiny
159
+ changelog_uri: https://github.com/ulysses-bull/solidus_tiny/blob/main/CHANGELOG.md
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '2.5'
169
+ - - "<"
170
+ - !ruby/object:Gem::Version
171
+ version: '4'
172
+ required_rubygems_version: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ requirements: []
178
+ rubygems_version: 3.5.10
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: ''
182
+ test_files: []