core_merchant 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f973a1881b08969b6c5ba44de3ea5c3a047f3e1b28d8fc76e856a3c61ad4101
4
- data.tar.gz: 1927e4b2202dcf7c0f25c41edc4bcdcac4abc89bf3f90d12f167afb392700c84
3
+ metadata.gz: fceb2084b15e74e2aebe360df8cade628ffd930afd2ef689a6779c3f59f5f70a
4
+ data.tar.gz: 96368a736ce980a109bfd9d863b56cbec0c814111edd4839874738d13cc6c9e3
5
5
  SHA512:
6
- metadata.gz: 98c6446f4aaa3337e281099ab45bba98fdeae286c8332a753b943c0bbb086e37c026a72d870fe557c92d817eb8c9928d49a148b7c5bfac472d44bae5a09bda1c
7
- data.tar.gz: e18ff914eaf377f8606c6b4766364678088cd1035384bd580d0ccad3b8bd6b920e513d11d63e9678c47d5e7bf35af8f34a2655377761e0eb5c71a9e758fe72e3
6
+ metadata.gz: 643e829909744d948af7a5270ebdd0f3be2dfa7f3d540da9f0fd728fc9d052731719d6ec6f93cfc73d7357f25c3bbd50a8fd32046b0c2a354058fc611d34e8ac
7
+ data.tar.gz: a2ecdd77b9628e2dee8b67b422f0d4fa2f1a62214c28bc9bb1ae72338986272b03bfce1a193969a3fbbc6e440e45ac041c8dd2c637de1fa0d7f796244f6b6daf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- core_merchant (0.5.1)
4
+ core_merchant (0.6.0)
5
5
  activesupport (~> 7.0)
6
6
  rails (~> 7.0)
7
7
 
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoreMerchant
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
@@ -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 plans table."
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.0
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: