Skip to content

Commit

Permalink
ingress awards also
Browse files Browse the repository at this point in the history
  • Loading branch information
binq committed Mar 25, 2024
1 parent 885726d commit efbd47e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 7 additions & 6 deletions modules/vye/app/models/vye/award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ class Vye::Award < ApplicationRecord

enum cur_award_ind: { current: 'C', future: 'F', past: 'P' }

REQUIRED_ATTRIBUTES = %i[
award_begin_date award_end_date begin_rsn cur_award_ind end_rsn
monthly_rate number_hours payment_date training_time type_hours type_training
].freeze

validates(*REQUIRED_ATTRIBUTES, presence: true)
validates(
*%i[
award_end_date cur_award_ind end_rsn
monthly_rate number_hours payment_date training_time
].freeze,
presence: true
)
end
end
4 changes: 3 additions & 1 deletion modules/vye/lib/vye/batch_transfer/ingress_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def bdn_import(data)
profile = Vye::UserProfile.build(parsed.attributes[:profile])
info = profile.user_infos.build(parsed.attributes[:info])
info.address_changes.build({ origin: 'backend' }.merge(parsed.attributes[:address]))

parsed.attributes[:awards].each do |award|
info.awards.build(award)
end
profile.save!
end
end
Expand Down

0 comments on commit efbd47e

Please sign in to comment.