Skip to content

Commit

Permalink
Add support for positions with unspecified location our outside of Sw…
Browse files Browse the repository at this point in the history
…eden
  • Loading branch information
buren committed May 22, 2017
1 parent 72e5182 commit 27a45d2
Show file tree
Hide file tree
Showing 4 changed files with 395 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ publication = Publication.new(
)

schedule = Schedule.new(
full_time: false,
summary: '3 days a week 8.00-17.00',
start_date: Date.today,
end_date: nil
Expand Down
7 changes: 4 additions & 3 deletions lib/arbetsformedlingen/models/position.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ module Arbetsformedlingen
required(:address).schema do
required(:municipality, Types::Municipality).filled(:municipality?)
required(:country_code, Types::Country).filled(:str?, :country_code?)
required(:street, Types::StrippedString).filled
required(:city, Types::StrippedString).filled
required(:zip, Types::Zip).filled(:str?, :zip?)

optional(:street, Types::StrippedString).filled
optional(:city, Types::StrippedString).filled
optional(:zip, Types::Zip).filled(:str?, :zip?)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/arbetsformedlingen/output_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def append_job_position_description(node, position)
node.JobPositionDescription do |job_pos_desc|
job_pos_desc.JobPositionPurpose(position.fetch(:purpose))
job_pos_desc.JobPositionLocation do |job_pos_loc|
append_job_position_address(job_pos_loc, position.fetch(:company).fetch(:address))
append_job_position_address(job_pos_loc, position.fetch(:address))
end
job_pos_desc.Classification do |classification|
append_schedule(classification, position.fetch(:schedule))
Expand Down Expand Up @@ -207,7 +207,7 @@ def append_delivery_address(node, data)
def append_job_position_address(node, address)
node.PostalAddress do |a_node|
a_node.CountryCode(address.fetch(:country_code))
a_node.PostalCode(address.fetch(:zip))
a_node.PostalCode(address.fetch(:zip)) if address.key?(:zip)
a_node.Municipality(address.fetch(:municipality))
append_delivery_address(a_node, address)
end
Expand Down
Loading

0 comments on commit 27a45d2

Please sign in to comment.