class UserOrder

Included Modules

Defined in:

models/user_order.cr

Constant Summary

ASSOCIATIONS = [] of Nil
BONUS = 10
COLUMNS = [{name: id, type: Int32, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: delivery_point_type, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: delivery_point_id, type: Int32, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: planned_delivery_date, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: delivered_at, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: total_cost, type: Float64, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: total_weight, type: Float64, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: planned_delivery_time_interval, type: Int16, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: used_bonuses, type: Int16, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: earned_bonuses, type: Int16, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: earned_bonuses_state, type: Int16, nilable: false, autogenerated: false, value: nil, serialized: false}] of Nil
DELIVERY_TIME_TEXT = ["08:00-12:00", "10:00-18:00", "18:00-22:00"]
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = Int32

Constructors

Class Method Summary

Instance Method Summary

Class methods inherited from class BaseModel

database : Avram::Database.class database

Constructor Detail

def self.new(id : Int32, created_at : Time, updated_at : Time, delivery_point_type : String, delivery_point_id : Int32, planned_delivery_date : Time | Nil, delivered_at : Time | Nil, total_cost : PG::Numeric, total_weight : PG::Numeric, planned_delivery_time_interval : Int16 | Nil, used_bonuses : Int16, earned_bonuses : Int16, earned_bonuses_state : Int16) #

def self.new(__temp_269 : DB::ResultSet) #

Class Method Detail

def self.bonus_amount(total_cost) #

[View source]
def self.column_names : Array(Symbol) #

def self.columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String)) #

def self.ensure_correct_column_mappings! #

def self.from_rs(__temp_269 : DB::ResultSet) #

def self.primary_key_name : Symbol | Nil #

def self.schema_enforcer_validations #

def self.table_name : String #

Instance Method Detail

def _delivery_point_preloaded? : Bool #

def _preloaded_delivery_point : UserStoreDeliveryPoint | UserAddressDeliveryPoint | Nil #

def base_query_class : ::UserOrder::BaseQuery.class #

This makes it easy for plugins and extensions to use the base SaveOperation


def bonus_amount #

[View source]
def created_at : Time #

def created_at=(_created_at : Time::Lucky::ColumnType) #

def delete_operation_class : ::UserOrder::DeleteOperation.class #

def delivered_at : Time | Nil #

def delivered_at=(_delivered_at : Time::Lucky::ColumnType | Nil) #


[View source]

Based on avram/src/avram/associations.cr, define_public_preloaded_getters


[View source]
def delivery_point_id : Int32 #

def delivery_point_id=(_delivery_point_id : Int32::Lucky::ColumnType) #

def delivery_point_type : String #

def delivery_point_type=(_delivery_point_type : String::Lucky::ColumnType) #

def earned_bonuses : Int16 #

def earned_bonuses=(_earned_bonuses : Int16::Lucky::ColumnType) #

def earned_bonuses_state : Int16 #

def earned_bonuses_state=(_earned_bonuses_state : Int16::Lucky::ColumnType) #

def id : Int32 #

def id=(_id : Int32::Lucky::ColumnType) #

def planned_delivery_date : Time | Nil #

def planned_delivery_date=(_planned_delivery_date : Time::Lucky::ColumnType | Nil) #

def planned_delivery_time_interval : Int16 | Nil #

def planned_delivery_time_interval=(_planned_delivery_time_interval : Int16::Lucky::ColumnType | Nil) #

def save_operation_class : ::UserOrder::SaveOperation.class #

def set_preloaded_delivery_point(record : UserStoreDeliveryPoint | UserAddressDeliveryPoint | Nil) #

[View source]
def total_cost : Float64 #

def total_cost=(_total_cost : PG::Numeric) #

def total_weight : Float64 #

def total_weight=(_total_weight : PG::Numeric) #

def updated_at : Time #

def updated_at=(_updated_at : Time::Lucky::ColumnType) #

def used_bonuses : Int16 #

def used_bonuses=(_used_bonuses : Int16::Lucky::ColumnType) #