module Ecom module Core class JobCard < ApplicationRecord belongs_to :maintenance_service_order belongs_to :service_provider, class_name: 'Ecom::Core::EquipmentLocation' belongs_to :checkout_by, class_name: 'Ecom::Core::User', optional: true belongs_to :checkout_to, class_name: 'Ecom::Core::EquipmentLocation', optional: true belongs_to :maintenance_status belongs_to :checkin_by, class_name: 'Ecom::Core::User', optional: true belongs_to :checkin_to, class_name: 'Ecom::Core::EquipmentLocation', optional: true belongs_to :prepared_by, class_name: 'Ecom::Core::User' validates :code, presence: true, uniqueness: true end end end