Manuel Bustillo 86b9d0b56c
All checks were successful
Check usage of free licenses / check-licenses (pull_request) Successful in 1m5s
Add copyright notice / copyright_notice (pull_request) Successful in 1m49s
Run unit tests / unit_tests (pull_request) Successful in 8m24s
Document expenses endpoint and add some specs
2024-11-16 10:22:10 +01:00

23 lines
610 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
# == Schema Information
#
# Table name: expenses
#
# id :uuid not null, primary key
# amount :decimal(, )
# name :string
# pricing_type :enum default("fixed"), not null
# created_at :datetime not null
# updated_at :datetime not null
#
class Expense < ApplicationRecord
enum :pricing_type,
fixed: 'fixed',
per_person: 'per_person'
validates :name, presence: true
validates :amount, presence: true, numericality: { greater_than: 0 }
validates :pricing_type, presence: true
end