1
0
Fork 0
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:
Zach Gollwitzer 2025-05-02 13:50:38 -04:00
parent bc7e32deab
commit 186062d633
6 changed files with 54 additions and 0 deletions

View file

@ -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"

View file

@ -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)

View file

@ -0,0 +1,3 @@
class Subscription < ApplicationRecord
belongs_to :family_id
end

View 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
View 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

View file

@ -0,0 +1,7 @@
require "test_helper"
class SubscriptionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end