def self.primary_key_name : Symbol | Nil
#
class UserOrder
- UserOrder
- BaseModel
- Avram::Model
- Reference
- Object
Included Modules
- Avram::PrimaryKeyMethods
- DB::Mappable
Defined in:
models/user_order.crConstant 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
- .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)
- .new(__temp_269 : DB::ResultSet)
Class Method Summary
- .bonus_amount(total_cost)
- .column_names : Array(Symbol)
- .columns : Array(NamedTuple(name: Symbol, nilable: Bool, type: String))
- .ensure_correct_column_mappings!
- .from_rs(__temp_269 : DB::ResultSet)
- .primary_key_name : Symbol | Nil
- .schema_enforcer_validations
- .table_name : String
Instance Method Summary
- #_delivery_point_preloaded? : Bool
- #_preloaded_delivery_point : UserStoreDeliveryPoint | UserAddressDeliveryPoint | Nil
-
#base_query_class : ::UserOrder::BaseQuery.class
This makes it easy for plugins and extensions to use the base SaveOperation
- #bonus_amount
- #created_at : Time
- #created_at=(_created_at : Time::Lucky::ColumnType)
- #delete_operation_class : ::UserOrder::DeleteOperation.class
- #delivered_at : Time | Nil
- #delivered_at=(_delivered_at : Time::Lucky::ColumnType | Nil)
- #delivery_point : UserStoreDeliveryPoint | UserAddressDeliveryPoint
-
#delivery_point! : UserStoreDeliveryPoint | UserAddressDeliveryPoint
Based on avram/src/avram/associations.cr, define_public_preloaded_getters
- #delivery_point_id : Int32
- #delivery_point_id=(_delivery_point_id : Int32::Lucky::ColumnType)
- #delivery_point_type : String
- #delivery_point_type=(_delivery_point_type : String::Lucky::ColumnType)
- #earned_bonuses : Int16
- #earned_bonuses=(_earned_bonuses : Int16::Lucky::ColumnType)
- #earned_bonuses_state : Int16
- #earned_bonuses_state=(_earned_bonuses_state : Int16::Lucky::ColumnType)
- #id : Int32
- #id=(_id : Int32::Lucky::ColumnType)
- #planned_delivery_date : Time | Nil
- #planned_delivery_date=(_planned_delivery_date : Time::Lucky::ColumnType | Nil)
- #planned_delivery_time_interval : Int16 | Nil
- #planned_delivery_time_interval=(_planned_delivery_time_interval : Int16::Lucky::ColumnType | Nil)
- #save_operation_class : ::UserOrder::SaveOperation.class
- #set_preloaded_delivery_point(record : UserStoreDeliveryPoint | UserAddressDeliveryPoint | Nil)
- #total_cost : Float64
- #total_cost=(_total_cost : PG::Numeric)
- #total_weight : Float64
- #total_weight=(_total_weight : PG::Numeric)
- #updated_at : Time
- #updated_at=(_updated_at : Time::Lucky::ColumnType)
- #used_bonuses : Int16
- #used_bonuses=(_used_bonuses : Int16::Lucky::ColumnType)
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)
#
Class Method Detail
Instance Method Detail
This makes it easy for plugins and extensions to use the base SaveOperation
Based on avram/src/avram/associations.cr, define_public_preloaded_getters
def planned_delivery_time_interval=(_planned_delivery_time_interval : Int16::Lucky::ColumnType | Nil)
#
def set_preloaded_delivery_point(record : UserStoreDeliveryPoint | UserAddressDeliveryPoint | Nil)
#