app_manager 2.4.0 → 2.4.2

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: 8ef9a51f2af61a37129f4654a1b2d60c4542cbfd3e229d34754f748180a1e75e
4
- data.tar.gz: 6ca85b33ff77d3043f0cc683ab93f033df7964e6844edbf5b706fe2f2adff17f
3
+ metadata.gz: 4ad4341fa685d8ead7b67ced72169de1a681bab991d6b4cd31be5593744cce24
4
+ data.tar.gz: b702e63ee20af249fb949d4cd980b486f465cb6933fb310fb4df1e772a2e0af2
5
5
  SHA512:
6
- metadata.gz: 2dbc7e0beb36d44be94178415ec4ea098bd5baf2ff799963987fa9df4d8bdb9044644a94a799568303ff8b089e8a878675ba318749cfc24adb0c705e3f51707c
7
- data.tar.gz: e4dac67910df25ee2746af43fc70c394367da06ded486065140aa453c84d5873ded867ce3c94a6182fdbe265d4e271734cf0322eee3e1a01cece4a1de65e17c9
6
+ metadata.gz: f728df28393203f69e4cc77616502479256ba6f1c868c456e23c596952b58911d667e5c6fec9932483ac07f95ead43edb5967e85e3c858966a6697b3a5b2f18f
7
+ data.tar.gz: a2cbe8d14ef379903483f84ca425d4df234408e775fb84452cfd757bac116b84bc11c9fe70b7b08bfc50274785c73b89da0a1ae6b5a757cf25adb9bf4958a762
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (2.4.0)
4
+ app_manager (2.4.2)
5
5
  activerecord-import (~> 1.4)
6
6
  httparty
7
7
  kaminari (>= 0.16.3)
@@ -103,7 +103,7 @@ GEM
103
103
  diff-lcs (1.6.2)
104
104
  dotenv (2.1.2)
105
105
  drb (2.2.3)
106
- erb (6.0.1)
106
+ erb (6.0.2)
107
107
  erubi (1.13.1)
108
108
  globalid (1.3.0)
109
109
  activesupport (>= 6.1)
@@ -147,7 +147,8 @@ GEM
147
147
  method_source (1.1.0)
148
148
  mini_mime (1.1.5)
149
149
  mini_portile2 (2.8.9)
150
- minitest (6.0.1)
150
+ minitest (6.0.2)
151
+ drb (~> 2.0)
151
152
  prism (~> 1.5)
152
153
  multi_xml (0.8.1)
153
154
  bigdecimal (>= 3.1, < 5)
@@ -205,8 +206,8 @@ GEM
205
206
  activesupport (>= 5.0.0)
206
207
  minitest
207
208
  nokogiri (>= 1.6)
208
- rails-html-sanitizer (1.6.2)
209
- loofah (~> 2.21)
209
+ rails-html-sanitizer (1.7.0)
210
+ loofah (~> 2.25)
210
211
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
211
212
  railties (8.1.2)
212
213
  actionpack (= 8.1.2)
@@ -140,7 +140,7 @@ module AppManager
140
140
 
141
141
  begin
142
142
  plan_obj = AppManager::Client.new
143
- if params[:discount].present? && !params[:discount].nil? && params[:discount] != '0' && !plan_data['is_global']
143
+ if params[:discount].present? && !params[:discount].nil? && params[:discount] != '0' && plan_data['is_global'] == 0
144
144
  discounted_plans = plan_obj.get_related_discounted_plans(params[:discount])
145
145
  if discounted_plans.empty? || discounted_plans.include?(params[:plan].to_i)
146
146
  plan_obj.discount_used(@shop[shopify_domain], params[:discount])
@@ -211,7 +211,7 @@ module AppManager
211
211
  if plan_users.any?
212
212
  extend_plan_users = []
213
213
  plan_users.each do |plan_user|
214
- extend_plan_users << AppManager::PlanUser.new(plan_user_id: plan_user['id'],shop_domain: plan_user['shop_domain'], plan_id: plan_user['plan_id'], created_by: plan_user['created_by'], created_at: plan_user['created_at'], updated_at: plan_user['updated_at'])
214
+ extend_plan_users << AppManager::PlanUser.new(plan_user_id: plan_user['id'],shop_domain: plan_user['shop_domain'], plan_id: plan_user['plan_id'], app_id: plan_user['app_id'],created_by: plan_user['created_by'], created_at: plan_user['created_at'], updated_at: plan_user['updated_at'])
215
215
  # extend_plan_users << AppManager::PlanUser.new(id: plan_user['id'], shop_domain: plan_user['shop_domain'], plan_id: plan_user['plan_id'], created_by: plan_user['created_by'], created_at: plan_user['created_at'], updated_at: plan_user['updated_at'])
216
216
  end
217
217
  AppManager::PlanUser.bulk_import extend_plan_users
@@ -948,9 +948,6 @@ module AppManager
948
948
 
949
949
  rows = Array(payload["usage_relation"]).map do |row|
950
950
  row = row.deep_stringify_keys
951
- puts "================"
952
- puts row.inspect
953
- puts "============="
954
951
  {
955
952
  "discount_id" => main_data["discount_id"],
956
953
  "domain" => row["domain"],
@@ -974,6 +971,8 @@ module AppManager
974
971
  )
975
972
 
976
973
  when "plan-discount"
974
+ payload["discount_plan_id"] = payload.delete("id")
975
+
977
976
  filtered = filter_data(payload, date_fields)
978
977
 
979
978
  record = AppManager::DiscountPlan.find_or_initialize_by(
@@ -982,6 +981,7 @@ module AppManager
982
981
  record.update!(filtered)
983
982
 
984
983
  when "plan-user"
984
+ payload["plan_user_id"] = payload.delete("id")
985
985
  filtered = filter_data(payload, date_fields)
986
986
 
987
987
  record = AppManager::PlanUser.find_or_initialize_by(
@@ -990,6 +990,8 @@ module AppManager
990
990
  record.update!(filtered)
991
991
 
992
992
  when "extend-trial"
993
+ payload["extend_trial_id"] = payload.delete("id")
994
+
993
995
  filtered = filter_data(payload, date_fields)
994
996
 
995
997
  record = AppManager::ExtendTrial.find_or_initialize_by(
@@ -997,8 +999,23 @@ module AppManager
997
999
  )
998
1000
  record.update!(filtered)
999
1001
 
1002
+ when "promotional-discounts-app-removed"
1003
+
1004
+ discount_id = payload["id"]
1005
+
1006
+ AppManager::Discount
1007
+ .where(discount_id: discount_id)
1008
+ .delete_all
1009
+
1010
+ AppManager::DiscountShop
1011
+ .where(discount_id: discount_id)
1012
+ .delete_all
1013
+
1014
+ AppManager::DiscountUsageLog
1015
+ .where(discount_id: discount_id)
1016
+ .delete_all
1000
1017
  else
1001
- Rails.logger.error("Failsafe: Unhandled sync type: #{sync_type}")
1018
+ # Rails.logger.error("Failsafe: Unhandled sync type: #{sync_type}")
1002
1019
  end
1003
1020
  end
1004
1021
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "2.4.0"
4
+ VERSION = "2.4.2"
5
5
  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.0
4
+ version: 2.4.2
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-02-26 00:00:00.000000000 Z
11
+ date: 2026-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty