app_manager 2.4.11 → 2.5.0

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: d059334cfd6240a77f00920ff84d496f0360f99a3af5a363e822969fd682e1c7
4
- data.tar.gz: 3f613e46ff5db1cb6afc5f8e3954f6a371c5426bba15c1ca28161811c010f8f7
3
+ metadata.gz: 9661cef74e8d94fb367e3a6886459bfde70c41d37d5c520892cbb4c7c39f86d5
4
+ data.tar.gz: 3b3dce409ba57c93e93373eded966f1b576e29918dd25bf3f74117e14debf156
5
5
  SHA512:
6
- metadata.gz: 24708a6b21a077f54c68192b963edbc1057e93fefd45a60dc21bf54de20e1ac5e2402d99282e0df377c133045dd0971e7f6a1caea55bd6f79b5afd168a79faf5
7
- data.tar.gz: 948de12ae256d9bf53bb06951f3c362b924a01ab20609b0df4da214016e4aac5b4d620d842de039951e68185896ace49a43307acbd34eb9ca930b6123da52139
6
+ metadata.gz: 5c4169d529a20d888ea6c308a380dd9a9d91e8f654145338f5ca76ad42d3ac26ec2e4ce486dab845f2ee854129b282fa6fcdce471ca3e8e2e30ebfc6e07c9096
7
+ data.tar.gz: a2cd325a7d10096a812644a47a0fdeed0bd51117ed13e35ee0cdd7b5950aa83553db2ed10a939a8ec388a4a5a33172ee8b43ec64bf946c9dd9c43f0547911ccd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (2.4.11)
4
+ app_manager (2.5.0)
5
5
  activerecord-import (~> 1.4)
6
6
  httparty
7
7
  kaminari (>= 0.16.3)
@@ -10,7 +10,7 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- action_text-trix (2.1.18)
13
+ action_text-trix (2.1.19)
14
14
  railties
15
15
  actioncable (8.1.3)
16
16
  actionpack (= 8.1.3)
@@ -120,7 +120,7 @@ GEM
120
120
  prism (>= 1.3.0)
121
121
  rdoc (>= 4.0.0)
122
122
  reline (>= 0.4.2)
123
- json (2.19.5)
123
+ json (2.19.7)
124
124
  kaminari (1.2.2)
125
125
  activesupport (>= 4.1.0)
126
126
  kaminari-actionview (= 1.2.2)
@@ -143,9 +143,10 @@ GEM
143
143
  net-imap
144
144
  net-pop
145
145
  net-smtp
146
- marcel (1.1.0)
146
+ marcel (1.2.1)
147
147
  method_source (1.1.0)
148
148
  mini_mime (1.1.5)
149
+ mini_portile2 (2.8.9)
149
150
  minitest (6.0.6)
150
151
  drb (~> 2.0)
151
152
  prism (~> 1.5)
@@ -161,6 +162,9 @@ GEM
161
162
  net-smtp (0.5.1)
162
163
  net-protocol
163
164
  nio4r (2.7.5)
165
+ nokogiri (1.19.3)
166
+ mini_portile2 (~> 2.8.2)
167
+ racc (~> 1.4)
164
168
  nokogiri (1.19.3-x86_64-linux-gnu)
165
169
  racc (~> 1.4)
166
170
  pp (0.6.3)
@@ -254,7 +258,7 @@ GEM
254
258
  base64
255
259
  websocket-extensions (>= 0.1.0)
256
260
  websocket-extensions (0.1.5)
257
- zeitwerk (2.7.5)
261
+ zeitwerk (2.8.2)
258
262
 
259
263
  PLATFORMS
260
264
  ruby
@@ -95,6 +95,9 @@ module AppManager
95
95
  bundle_obj = AppManager::Client.new
96
96
  app_bundle_data = bundle_obj.get_app_bundle_data
97
97
 
98
+ app_faqs_obj = AppManager::Client.new
99
+ app_faqs = app_faqs_obj.get_app_faqs || []
100
+
98
101
  response = {
99
102
  'plans' => plans,
100
103
  'promotional_discount' => promotional_discount,
@@ -106,7 +109,8 @@ module AppManager
106
109
  'most_popular_plan_ids' => most_popular_plan_ids,
107
110
  'choose_later' => choose_later,
108
111
  'has_active_charge' => (((active_charge && active_charge.any? && !active_charge['active_charge'].nil?) or !trial_activated_at) ? true : false),
109
- 'global_plan_charge' => plan.present? && plan['is_global'] && active_charge.present? && active_charge.any? && !active_charge['active_charge'].nil? && !active_charge['bundle_charge'].nil?
112
+ 'global_plan_charge' => plan.present? && plan['is_global'] && active_charge.present? && active_charge.any? && !active_charge['active_charge'].nil? && !active_charge['bundle_charge'].nil?,
113
+ 'app_faqs' => app_faqs
110
114
  }
111
115
  render json: response
112
116
  end
@@ -0,0 +1,5 @@
1
+ module AppManager
2
+ class AppFaq < AppManagerRecord
3
+ self.table_name = "app_faqs"
4
+ end
5
+ end
@@ -133,6 +133,8 @@ module AppManager
133
133
  return @fs.store_discount_used(params,options)
134
134
  when 'get-related-discounted-plans'
135
135
  return @fs.get_local_related_discounted_plans(params,options)
136
+ when 'app-faqs'
137
+ return @fs.get_local_app_faqs
136
138
  when 'app-bundle-data'
137
139
  return []
138
140
  when 'activate-global-plan'
@@ -76,6 +76,10 @@ module AppManager
76
76
  get("/get-related-discounted-plans?discount_id=#{discount_id}")
77
77
  end
78
78
 
79
+ def get_app_faqs
80
+ get("/app-faqs")
81
+ end
82
+
79
83
  end
80
84
  end
81
85
  end
@@ -87,6 +87,12 @@ module AppManager
87
87
  Rollbar.error("[Promotional discounts usage log] APP MANAGER >>>> #{e.inspect}")
88
88
  end
89
89
 
90
+ begin
91
+ save_api_app_faqs(params["app_faqs"])
92
+ rescue Exception => e
93
+ Rollbar.error("[app_faqs] APP MANAGER >>>> #{e.inspect}")
94
+ end
95
+
90
96
  end
91
97
 
92
98
  def save_api_plans(plans)
@@ -130,6 +136,9 @@ module AppManager
130
136
  plan_columns = AppManager::Plan.column_names
131
137
  plan_attrs[:details] = details if plan_columns.include?('details')
132
138
  plan_attrs[:note] = note if plan_columns.include?('note')
139
+ plan_attrs[:trial_days_text] = plan["trial_days_text"] if plan_columns.include?('trial_days_text')
140
+ plan_attrs[:most_popular] = plan["most_popular"] if plan_columns.include?('most_popular')
141
+ plan_attrs[:plan_badge] = plan["plan_badge"] if plan_columns.include?('plan_badge')
133
142
  plan_data << AppManager::Plan.new(plan_attrs)
134
143
  end
135
144
  end
@@ -336,6 +345,29 @@ module AppManager
336
345
  end
337
346
  end
338
347
 
348
+ def save_api_app_faqs(app_faqs)
349
+ begin
350
+ AppManager::AppFaq.connection.truncate(AppManager::AppFaq.table_name)
351
+ rescue
352
+ AppManager::AppFaq.delete_all
353
+ end
354
+ return unless app_faqs&.any?
355
+ app_faqs_data = app_faqs.map do |faq|
356
+ AppManager::AppFaq.new(
357
+ question: faq['question'],
358
+ answer: faq['answer'],
359
+ sort_order: faq['sort_order'] || 0,
360
+ created_at: faq['created_at'],
361
+ updated_at: faq['updated_at']
362
+ )
363
+ end
364
+ AppManager::AppFaq.bulk_import app_faqs_data
365
+ end
366
+
367
+ def get_local_app_faqs
368
+ AppManager::AppFaq.order(:sort_order, :id).map(&:attributes)
369
+ end
370
+
339
371
  def get_local_app_structures
340
372
  app_structure = AppManager::AppStructure.first
341
373
  app_structure_computed = {}
@@ -1030,6 +1062,18 @@ module AppManager
1030
1062
  )
1031
1063
  record.update!(filtered)
1032
1064
 
1065
+ when "app-faqs"
1066
+ begin
1067
+ AppManager::AppFaq.connection.truncate(AppManager::AppFaq.table_name)
1068
+ rescue
1069
+ AppManager::AppFaq.delete_all
1070
+ end
1071
+ Array(payload).each do |faq|
1072
+ faq = faq.is_a?(Hash) ? faq : {}
1073
+ filtered = serialize_row_for_failsafe(faq, date_fields, %w[pivot app_id])
1074
+ AppManager::AppFaq.create!(filtered) if filtered.present?
1075
+ end
1076
+
1033
1077
  when "promotional-discounts-app-removed"
1034
1078
 
1035
1079
  discount_id = payload["id"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "2.4.11"
4
+ VERSION = "2.5.0"
5
5
  end
@@ -66,6 +66,22 @@ module AppManager
66
66
  end
67
67
  end
68
68
 
69
+ def create_trial_days_text_most_popular_plan_badge_to_plans_migration
70
+ if self.class.migration_exists?("db/app_manager", "add_trial_days_text_most_popular_plan_badge_to_plans")
71
+ say_status("skipped", "Migration add_trial_days_text_most_popular_plan_badge_to_plans.rb already exists")
72
+ else
73
+ migration_template("add_trial_days_text_most_popular_plan_badge_to_plans.erb", "db/app_manager/add_trial_days_text_most_popular_plan_badge_to_plans.rb")
74
+ end
75
+ end
76
+
77
+ def create_app_faqs_table_migration
78
+ if self.class.migration_exists?("db/app_manager", "create_app_faqs_table")
79
+ say_status("skipped", "Migration create_app_faqs_table.rb already exists")
80
+ else
81
+ migration_template("create_app_faqs_table.erb", "db/app_manager/create_app_faqs_table.rb")
82
+ end
83
+ end
84
+
69
85
 
70
86
  private
71
87
 
@@ -0,0 +1,7 @@
1
+ class AddTrialDaysTextMostPopularPlanBadgeToPlans < ActiveRecord::Migration[<%= rails_migration_version %>]
2
+ def change
3
+ add_column :plans, :trial_days_text, :text unless column_exists?(:plans, :trial_days_text)
4
+ add_column :plans, :most_popular, :boolean, default: false unless column_exists?(:plans, :most_popular)
5
+ add_column :plans, :plan_badge, :text unless column_exists?(:plans, :plan_badge)
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ class CreateAppFaqsTable < ActiveRecord::Migration[<%= rails_migration_version %>]
2
+ def change
3
+ create_table :app_faqs do |t|
4
+ t.text :question, null: false
5
+ t.text :answer, null: false
6
+ t.integer :sort_order, default: 0
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def down
12
+ drop_table :app_faqs
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.11
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Tiwari @ Hulkapps
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-14 00:00:00.000000000 Z
11
+ date: 2026-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -86,6 +86,7 @@ files:
86
86
  - app/controllers/app_manager/plans_controller.rb
87
87
  - app/controllers/concerns/app_manager/authenticate.rb
88
88
  - app/model/app_manager/app.rb
89
+ - app/model/app_manager/app_faq.rb
89
90
  - app/model/app_manager/app_manager_record.rb
90
91
  - app/model/app_manager/app_structure.rb
91
92
  - app/model/app_manager/charge.rb
@@ -129,7 +130,9 @@ files:
129
130
  - lib/generators/app_manager/install/templates/add_is_global_to_plans.erb
130
131
  - lib/generators/app_manager/install/templates/add_note_and_details_to_plans.erb
131
132
  - lib/generators/app_manager/install/templates/add_plan_trial_grandfathered_to_shops.erb
133
+ - lib/generators/app_manager/install/templates/add_trial_days_text_most_popular_plan_badge_to_plans.erb
132
134
  - lib/generators/app_manager/install/templates/app_manager.rb.tt
135
+ - lib/generators/app_manager/install/templates/create_app_faqs_table.erb
133
136
  - lib/generators/app_manager/install/templates/failsafe_tables.erb
134
137
  homepage: https://www.hulkapps.com
135
138
  licenses: []