Class: TranslationCms::Api::Order
- Inherits:
-
Base
- Object
- JsonApiClient::Resource
- Base
- TranslationCms::Api::Order
show all
- Extended by:
- EnumField::EnumeratedAttribute
- Includes:
- HumanizeFields
- Defined in:
- lib/translation_cms/api/order.rb
Constant Summary
collapse
- AVAILABLE_STATES =
%w[evaluation waiting test to_check free pending to_upload for_revision problematic
refunded revised done archived deleted canceled recovered].freeze
- COMPLETED_STATES =
%w[refunded done archived].freeze
- CANCELED_STATES =
%w[canceled].freeze
- PROCESSING_STATES =
(AVAILABLE_STATES - COMPLETED_STATES - CANCELED_STATES - %w[deleted]).freeze
- PENDING_STATES =
%w[evaluation].freeze
- REFUNDED_STATES =
%w[refunded].freeze
%w[evaluation refunded revised done archived deleted canceled].freeze
- REF_MATERIALS_MANAGE_STATES =
%w[evaluation waiting test].freeze
Instance Method Summary
collapse
#human_name, #human_value
Methods inherited from Base
all!, custom_scope!, default_attributes, destroy, dummy_resource!, #method_missing_with_translations_will_change, parsed!, path_with_custom_scope, resource_type!, update
Instance Method Details
#deafult_features ⇒ Object
90
91
92
93
94
|
# File 'lib/translation_cms/api/order.rb', line 90
def deafult_features
return [] if features.blank?
features.reject(&:extras?)
end
|
80
81
82
83
84
|
# File 'lib/translation_cms/api/order.rb', line 80
def
return [] if features.blank?
features.select(&:extras?)
end
|
#not_paid? ⇒ Boolean
68
69
70
|
# File 'lib/translation_cms/api/order.rb', line 68
def not_paid?
waiting_payment_token.present?
end
|
#state_title ⇒ Object
72
73
74
|
# File 'lib/translation_cms/api/order.rb', line 72
def state_title
I18n.t state, scope: [:account, :state]
end
|
#target_title ⇒ Object
76
77
78
|
# File 'lib/translation_cms/api/order.rb', line 76
def target_title
industry_expertise_title
end
|
#urgency ⇒ Object
86
87
88
|
# File 'lib/translation_cms/api/order.rb', line 86
def urgency
@urgency ||= urgency_type.try(:title)
end
|