Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change abroad type to principal #1139

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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