Class: Effective::RegistrarAction

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/effective/registrar_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bad_standing_reasonObject

Bad Standing



13
14
15
# File 'app/models/effective/registrar_action.rb', line 13

def bad_standing_reason
  @bad_standing_reason
end

#category_idObject

Reclassify & Register



16
17
18
# File 'app/models/effective/registrar_action.rb', line 16

def category_id
  @category_id
end

#category_idsObject

Assign



21
22
23
# File 'app/models/effective/registrar_action.rb', line 21

def category_ids
  @category_ids
end

#current_actionObject

Returns the value of attribute current_action.



9
10
11
# File 'app/models/effective/registrar_action.rb', line 9

def current_action
  @current_action
end

#current_userObject

All Actions



8
9
10
# File 'app/models/effective/registrar_action.rb', line 8

def current_user
  @current_user
end

#membership_numberObject

Returns the value of attribute membership_number.



17
18
19
# File 'app/models/effective/registrar_action.rb', line 17

def membership_number
  @membership_number
end

#note_internalObject

Returns the value of attribute note_internal.



27
28
29
# File 'app/models/effective/registrar_action.rb', line 27

def note_internal
  @note_internal
end

#note_to_buyerObject

Returns the value of attribute note_to_buyer.



26
27
28
# File 'app/models/effective/registrar_action.rb', line 26

def note_to_buyer
  @note_to_buyer
end

#ownerObject

Returns the value of attribute owner.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner
  @owner
end

#owner_idObject

Returns the value of attribute owner_id.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner_id
  @owner_id
end

#owner_typeObject

Returns the value of attribute owner_type.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner_type
  @owner_type
end

#payment_cardObject

Returns the value of attribute payment_card.



25
26
27
# File 'app/models/effective/registrar_action.rb', line 25

def payment_card
  @payment_card
end

#payment_providerObject

Mark Fees Paid - Order Attributes



24
25
26
# File 'app/models/effective/registrar_action.rb', line 24

def payment_provider
  @payment_provider
end

#skip_feesObject

Returns the value of attribute skip_fees.



18
19
20
# File 'app/models/effective/registrar_action.rb', line 18

def skip_fees
  @skip_fees
end

Instance Method Details

#assign!Object



57
58
59
60
# File 'app/models/effective/registrar_action.rb', line 57

def assign!
  update!(current_action: :assign)
  EffectiveMemberships.Registrar.assign!(owner, categories: categories, number: membership_number.presence)
end

#bad_standing!Object



67
68
69
70
# File 'app/models/effective/registrar_action.rb', line 67

def bad_standing!
  update!(current_action: :bad_standing)
  EffectiveMemberships.Registrar.bad_standing!(owner, reason: bad_standing_reason)
end

#fees_paid!Object



72
73
74
75
# File 'app/models/effective/registrar_action.rb', line 72

def fees_paid!
  update!(current_action: :fees_paid)
  EffectiveMemberships.Registrar.fees_paid!(owner, order_attributes: order_attributes)
end

#good_standing!Object



62
63
64
65
# File 'app/models/effective/registrar_action.rb', line 62

def good_standing!
  update!(current_action: :good_standing)
  EffectiveMemberships.Registrar.good_standing!(owner)
end

#reclassify!Object



52
53
54
55
# File 'app/models/effective/registrar_action.rb', line 52

def reclassify!
  update!(current_action: :reclassify)
  EffectiveMemberships.Registrar.reclassify!(owner, to: category, skip_fees: skip_fees?)
end

#register!Object



47
48
49
50
# File 'app/models/effective/registrar_action.rb', line 47

def register!
  update!(current_action: :register)
  EffectiveMemberships.Registrar.register!(owner, to: category, number: membership_number.presence, skip_fees: skip_fees?)
end

#remove!Object



77
78
79
80
# File 'app/models/effective/registrar_action.rb', line 77

def remove!
  update!(current_action: :remove)
  EffectiveMemberships.Registrar.remove!(owner)
end

#save!Object



86
87
88
# File 'app/models/effective/registrar_action.rb', line 86

def save!
  valid? ? true : raise('invalid')
end

#to_sObject



43
44
45
# File 'app/models/effective/registrar_action.rb', line 43

def to_s
  'action'
end

#update!(atts) ⇒ Object



82
83
84
# File 'app/models/effective/registrar_action.rb', line 82

def update!(atts)
  assign_attributes(atts); save!
end