Skip to content

Commit

Permalink
Change abroad type to principal (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl authored Oct 10, 2024
1 parent a00ccd7 commit ea70ca3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/services/asp/mappers/adresse_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ASP
module Mappers
class AdresseMapper
PRINCIPAL_ADDRESS_TYPE = "PRINCIPALE"
ABROAD_ADDRESS_TYPE = "ADMIN" # From ASP Doc
ABROAD_ADDRESS_TYPE = "ADMIN" # From ASP Doc (Apparently not supported by ASP!)

MAPPING = {
codecominsee: :address_city_insee_code,
Expand Down
2 changes: 1 addition & 1 deletion lib/asp/entities/adresse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.from_payment_request(payment_request) # rubocop:disable Metrics/AbcSize
raise ASP::Errors::MissingEstablishmentPostalCodeError if establishment.postal_code.blank?

new(
codetypeadr: Mappers::AdresseMapper::ABROAD_ADDRESS_TYPE,
codetypeadr: Mappers::AdresseMapper::PRINCIPAL_ADDRESS_TYPE,
codecominsee: establishment.commune_code,
codepostalcedex: establishment.postal_code,
codeinseepays: InseeCodes::FRANCE_INSEE_COUNTRY_CODE
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/asp/entities/adresse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
it "creates an Adresse instance with establishment details" do # rubocop:disable RSpec/ExampleLength
adresse = described_class.from_payment_request(request)
expect(adresse).to have_attributes(
codetypeadr: ASP::Mappers::AdresseMapper::ABROAD_ADDRESS_TYPE,
codetypeadr: ASP::Mappers::AdresseMapper::PRINCIPAL_ADDRESS_TYPE,
codecominsee: establishment.commune_code,
codepostalcedex: establishment.postal_code,
codeinseepays: InseeCodes::FRANCE_INSEE_COUNTRY_CODE
Expand Down

0 comments on commit ea70ca3

Please sign in to comment.