mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Save work
This commit is contained in:
parent
bc7e32deab
commit
186062d633
6 changed files with 54 additions and 0 deletions
4
Gemfile
4
Gemfile
|
@ -63,6 +63,10 @@ gem "rotp", "~> 6.3"
|
|||
gem "rqrcode", "~> 3.0"
|
||||
gem "activerecord-import"
|
||||
|
||||
# State Machines
|
||||
gem "aasm"
|
||||
gem "after_commit_everywhere", "~> 1.0"
|
||||
|
||||
# AI
|
||||
gem "ruby-openai"
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ GIT
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
aasm (5.5.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
actioncable (7.2.2.1)
|
||||
actionpack (= 7.2.2.1)
|
||||
activesupport (= 7.2.2.1)
|
||||
|
@ -561,6 +563,7 @@ PLATFORMS
|
|||
x86_64-linux-musl
|
||||
|
||||
DEPENDENCIES
|
||||
aasm
|
||||
activerecord-import
|
||||
aws-sdk-s3 (~> 1.177.0)
|
||||
bcrypt (~> 3.1)
|
||||
|
|
3
app/models/subscription.rb
Normal file
3
app/models/subscription.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Subscription < ApplicationRecord
|
||||
belongs_to :family_id
|
||||
end
|
24
db/migrate/20250502164951_create_subscriptions.rb
Normal file
24
db/migrate/20250502164951_create_subscriptions.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
class CreateSubscriptions < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :subscriptions, id: :uuid do |t|
|
||||
t.references :family_id, null: false, foreign_key: true, type: :uuid
|
||||
|
||||
t.string :status, null: false
|
||||
|
||||
t.string :stripe_id
|
||||
t.string :name
|
||||
t.decimal :amount, precision: 19, scale: 4
|
||||
t.string :currency
|
||||
t.string :interval
|
||||
t.datetime :current_period_end
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
13
test/fixtures/subscriptions.yml
vendored
Normal file
13
test/fixtures/subscriptions.yml
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
stripe_id: MyString
|
||||
family_id: one
|
||||
name: MyString
|
||||
status: MyString
|
||||
|
||||
two:
|
||||
stripe_id: MyString
|
||||
family_id: two
|
||||
name: MyString
|
||||
status: MyString
|
7
test/models/subscription_test.rb
Normal file
7
test/models/subscription_test.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class SubscriptionTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue