module Mks module Rate class RateChangeRequest < ApplicationRecord SUBMITTED = 'SUBMITTED' APPROVED = 'APPROVED' DECLINED = 'DECLINED' validates :reference_number, :authorized_by, :effective_on, :authorized_on, :rates, :status, presence: true validates :reference_number, uniqueness: true validates_inclusion_of :status, in: %w[SUBMITTED APPROVED DECLINED] belongs_to :created_by, class_name: 'Mks::Auth::User' belongs_to :approved_by, class_name: 'Mks::Auth::User', optional: true end end end