Class: StoreTransfer

Inherits:
ApplicationRecord show all
Includes:
Models::Auditable
Defined in:
app/models/store_transfer.rb

Overview

== Schema Information

Table name: store_transfers
Database name: primary

id :bigint not null, primary key
created_at :datetime not null
updated_at :datetime not null
consignee_party_id :integer not null
creator_id :integer
from_store_id :integer not null
sold_to_customer_id :integer not null
to_store_id :integer not null
updater_id :integer

Indexes

index_store_transfers_on_consignee_party_id (consignee_party_id)
index_store_transfers_on_from_store_id_and_to_store_id (from_store_id,to_store_id) UNIQUE
index_store_transfers_on_sold_to_customer_id (sold_to_customer_id)
index_store_transfers_on_to_store_id (to_store_id)

Foreign Keys

fk_rails_... (consignee_party_id => parties.id)
fk_rails_... (from_store_id => stores.id)
fk_rails_... (sold_to_customer_id => parties.id)
fk_rails_... (to_store_id => stores.id)

Constant Summary

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Belongs to collapse

Methods included from Models::Auditable

#creator, #updater

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #should_not_save_version, #stamp_record

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Method Details

#consignee_partyCustomer

Returns:

See Also:



37
# File 'app/models/store_transfer.rb', line 37

belongs_to :consignee_party, class_name: 'Customer'

#from_storeStore

Returns:

See Also:



34
# File 'app/models/store_transfer.rb', line 34

belongs_to :from_store, class_name: 'Store'

#sold_to_customerCustomer

Returns:

See Also:



36
# File 'app/models/store_transfer.rb', line 36

belongs_to :sold_to_customer, class_name: 'Customer'

#storeStore

Returns:

See Also:



33
# File 'app/models/store_transfer.rb', line 33

belongs_to :store, optional: true

#to_storeStore

Returns:

See Also:



35
# File 'app/models/store_transfer.rb', line 35

belongs_to :to_store, class_name: 'Store'