core_merchant 0.6.0 → 0.6.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/core_merchant/subscription.rb +1 -1
- data/lib/core_merchant/version.rb +1 -1
- data/lib/generators/core_merchant/install_generator.rb +5 -2
- data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscriptions.erb +26 -0
- metadata +3 -2
- /data/lib/generators/core_merchant/templates/{create_core_merchant_subscription_plans.erb → migrate/create_core_merchant_subscription_plans.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fceb2084b15e74e2aebe360df8cade628ffd930afd2ef689a6779c3f59f5f70a
|
4
|
+
data.tar.gz: 96368a736ce980a109bfd9d863b56cbec0c814111edd4839874738d13cc6c9e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 643e829909744d948af7a5270ebdd0f3be2dfa7f3d540da9f0fd728fc9d052731719d6ec6f93cfc73d7357f25c3bbd50a8fd32046b0c2a354058fc611d34e8ac
|
7
|
+
data.tar.gz: a2ecdd77b9628e2dee8b67b422f0d4fa2f1a62214c28bc9bb1ae72338986272b03bfce1a193969a3fbbc6e440e45ac041c8dd2c637de1fa0d7f796244f6b6daf
|
data/Gemfile.lock
CHANGED
@@ -27,7 +27,6 @@ module CoreMerchant
|
|
27
27
|
# **Attributes**:
|
28
28
|
# - `customer`: Polymorphic association to the customer
|
29
29
|
# - `subscription_plan`: The current plan for this subscription
|
30
|
-
# - `next_subscription_plan`: The plan to change to at next renewal (if any)
|
31
30
|
# - `status`: Current status of the subscription (see enum definition)
|
32
31
|
# - `start_date`: When the subscription started
|
33
32
|
# - `end_date`: When the subscription ended (or will end)
|
@@ -37,6 +36,7 @@ module CoreMerchant
|
|
37
36
|
# - `current_period_end`: End of the current billing period
|
38
37
|
# - `pause_start_date`: When the subscription was paused
|
39
38
|
# - `pause_end_date`: When the paused subscription will resume
|
39
|
+
# - `current_period_price_cents`: Price for the current period
|
40
40
|
# - `next_renewal_price_cents`: Price for the next renewal (if different from plan)
|
41
41
|
# - `cancellation_reason`: Reason for cancellation (if applicable)
|
42
42
|
#
|
@@ -27,8 +27,11 @@ module CoreMerchant
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def create_migration_file
|
30
|
-
migration_template "create_core_merchant_subscription_plans.erb",
|
30
|
+
migration_template "migrate/create_core_merchant_subscription_plans.erb",
|
31
31
|
"db/migrate/create_core_merchant_subscription_plans.rb"
|
32
|
+
|
33
|
+
migration_template "migrate/create_core_merchant_subscriptions.erb",
|
34
|
+
"db/migrate/create_core_merchant_subscriptions.rb"
|
32
35
|
end
|
33
36
|
|
34
37
|
def show_post_install
|
@@ -36,7 +39,7 @@ module CoreMerchant
|
|
36
39
|
say <<~MESSAGE
|
37
40
|
Customer class: #{@customer_class}. Please update this model to include the CoreMerchant::CustomerBehavior module.
|
38
41
|
MESSAGE
|
39
|
-
say "Please run `rails db:migrate` to create the subscription
|
42
|
+
say "Please run `rails db:migrate` to create the subscription and subscription plan tables.", :yellow
|
40
43
|
end
|
41
44
|
|
42
45
|
def self.banner
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Created by: rails generate core_merchant:install
|
2
|
+
class CreateCoreMerchantSubscriptions < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
3
|
+
def change
|
4
|
+
create_table :core_merchant_subscriptions do |t|
|
5
|
+
t.references :customer, polymorphic: true, null: false
|
6
|
+
t.references :subscription_plan, null: false
|
7
|
+
t.integer :status, null: false, default: 0
|
8
|
+
t.datetime :canceled_at
|
9
|
+
t.string :cancellation_reason
|
10
|
+
|
11
|
+
t.datetime :start_date, null: false
|
12
|
+
t.datetime :trial_end_date
|
13
|
+
t.datetime :end_date
|
14
|
+
t.datetime :current_period_start_date
|
15
|
+
t.datetime :current_period_end_date
|
16
|
+
t.datetime :pause_start_date
|
17
|
+
t.datetime :pause_end_date
|
18
|
+
|
19
|
+
t.integer :current_period_price_cents
|
20
|
+
|
21
|
+
t.timestamps
|
22
|
+
|
23
|
+
t.index :status
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core_merchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seyithan Teymur
|
@@ -138,7 +138,8 @@ files:
|
|
138
138
|
- lib/generators/core_merchant/install_generator.rb
|
139
139
|
- lib/generators/core_merchant/templates/core_merchant.en.yml
|
140
140
|
- lib/generators/core_merchant/templates/core_merchant.erb
|
141
|
-
- lib/generators/core_merchant/templates/create_core_merchant_subscription_plans.erb
|
141
|
+
- lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_plans.erb
|
142
|
+
- lib/generators/core_merchant/templates/migrate/create_core_merchant_subscriptions.erb
|
142
143
|
- sig/core_merchant.rbs
|
143
144
|
homepage: https://github.com/theseyithan/core_merchant
|
144
145
|
licenses:
|