atlas_engine 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (298) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +123 -0
  3. data/Rakefile +20 -0
  4. data/app/assets/config/atlas_engine_manifest.js +3 -0
  5. data/app/assets/stylesheets/atlas_engine/application.css +15 -0
  6. data/app/concerns/atlas_engine/handles_blob.rb +26 -0
  7. data/app/concerns/atlas_engine/handles_interruption.rb +22 -0
  8. data/app/controllers/atlas_engine/application_controller.rb +7 -0
  9. data/app/controllers/atlas_engine/connectivity_controller.rb +21 -0
  10. data/app/controllers/atlas_engine/country_imports_controller.rb +73 -0
  11. data/app/controllers/atlas_engine/graphql_controller.rb +59 -0
  12. data/app/countries/atlas_engine/ar/country_profile.yml +9 -0
  13. data/app/countries/atlas_engine/at/address_importer/corrections/open_address/city_corrector.rb +23 -0
  14. data/app/countries/atlas_engine/at/country_profile.yml +24 -0
  15. data/app/countries/atlas_engine/at/index_configuration.yml +63 -0
  16. data/app/countries/atlas_engine/at/synonyms.yml +6 -0
  17. data/app/countries/atlas_engine/at/validation_transcriber/address_parser.rb +58 -0
  18. data/app/countries/atlas_engine/au/address_importer/open_address/filter.rb +26 -0
  19. data/app/countries/atlas_engine/au/address_importer/open_address/mapper.rb +41 -0
  20. data/app/countries/atlas_engine/au/country_profile.yml +13 -0
  21. data/app/countries/atlas_engine/au/synonyms.yml +209 -0
  22. data/app/countries/atlas_engine/au/validation_transcriber/address_parser.rb +121 -0
  23. data/app/countries/atlas_engine/be/country_profile.yml +12 -0
  24. data/app/countries/atlas_engine/bm/address_importer/corrections/open_address/city_alias_corrector.rb +38 -0
  25. data/app/countries/atlas_engine/bm/address_importer/open_address/mapper.rb +40 -0
  26. data/app/countries/atlas_engine/bm/country_profile.yml +12 -0
  27. data/app/countries/atlas_engine/br/country_profile.yml +4 -0
  28. data/app/countries/atlas_engine/ca/country_profile.yml +7 -0
  29. data/app/countries/atlas_engine/ca/synonyms.yml +1615 -0
  30. data/app/countries/atlas_engine/ch/address_importer/corrections/open_address/city_corrector.rb +29 -0
  31. data/app/countries/atlas_engine/ch/address_importer/corrections/open_address/locale_corrector.rb +74 -0
  32. data/app/countries/atlas_engine/ch/address_importer/open_address/mapper.rb +40 -0
  33. data/app/countries/atlas_engine/ch/country_profile.yml +15 -0
  34. data/app/countries/atlas_engine/ch/locales/de/country_profile.yml +15 -0
  35. data/app/countries/atlas_engine/ch/locales/de/index_configuration.yml +63 -0
  36. data/app/countries/atlas_engine/ch/locales/de/synonyms.yml +7 -0
  37. data/app/countries/atlas_engine/ch/locales/fr/synonyms.yml +21 -0
  38. data/app/countries/atlas_engine/cz/country_profile.yml +6 -0
  39. data/app/countries/atlas_engine/de/country_profile.yml +19 -0
  40. data/app/countries/atlas_engine/de/index_configuration.yml +64 -0
  41. data/app/countries/atlas_engine/de/synonyms.yml +2 -0
  42. data/app/countries/atlas_engine/de/validation_transcriber/address_parser.rb +19 -0
  43. data/app/countries/atlas_engine/dk/country_profile.yml +6 -0
  44. data/app/countries/atlas_engine/dk/synonyms.yml +3 -0
  45. data/app/countries/atlas_engine/dk/validation_transcriber/address_parser.rb +21 -0
  46. data/app/countries/atlas_engine/fo/country_profile.yml +5 -0
  47. data/app/countries/atlas_engine/fr/address_importer/corrections/open_address/city_corrector.rb +28 -0
  48. data/app/countries/atlas_engine/fr/country_profile.yml +13 -0
  49. data/app/countries/atlas_engine/fr/synonyms.yml +21 -0
  50. data/app/countries/atlas_engine/fr/validation_transcriber/address_parser.rb +34 -0
  51. data/app/countries/atlas_engine/gb/address_validation/es/query_builder.rb +98 -0
  52. data/app/countries/atlas_engine/gb/country_profile.yml +10 -0
  53. data/app/countries/atlas_engine/gb/validation_transcriber/full_address_parser.rb +164 -0
  54. data/app/countries/atlas_engine/gb/validation_transcriber/parsed_address.rb +120 -0
  55. data/app/countries/atlas_engine/gg/address_validation/validators/full_address/restrictions/unsupported_city.rb +39 -0
  56. data/app/countries/atlas_engine/gg/country_profile.yml +7 -0
  57. data/app/countries/atlas_engine/ie/country_profile.yml +3 -0
  58. data/app/countries/atlas_engine/it/address_importer/corrections/open_address/city_corrector.rb +27 -0
  59. data/app/countries/atlas_engine/it/address_importer/corrections/open_address/province_corrector.rb +29 -0
  60. data/app/countries/atlas_engine/it/address_importer/open_address/mapper.rb +42 -0
  61. data/app/countries/atlas_engine/it/country_profile.yml +11 -0
  62. data/app/countries/atlas_engine/jp/address_validation/es/data_mapper.rb +63 -0
  63. data/app/countries/atlas_engine/jp/country_profile.yml +6 -0
  64. data/app/countries/atlas_engine/kr/address_importer/open_address/mapper.rb +41 -0
  65. data/app/countries/atlas_engine/kr/country_profile.yml +11 -0
  66. data/app/countries/atlas_engine/li/address_importer/corrections/open_address/city_corrector.rb +25 -0
  67. data/app/countries/atlas_engine/li/country_profile.yml +21 -0
  68. data/app/countries/atlas_engine/li/index_configuration.yml +63 -0
  69. data/app/countries/atlas_engine/li/synonyms.yml +6 -0
  70. data/app/countries/atlas_engine/lt/country_profile.yml +6 -0
  71. data/app/countries/atlas_engine/lt/synonyms.yml +7 -0
  72. data/app/countries/atlas_engine/lt/validation_transcriber/address_parser.rb +24 -0
  73. data/app/countries/atlas_engine/lu/address_importer/corrections/open_address/locale_corrector.rb +54 -0
  74. data/app/countries/atlas_engine/lu/country_profile.yml +12 -0
  75. data/app/countries/atlas_engine/nl/address_importer/corrections/open_address/city_corrector.rb +25 -0
  76. data/app/countries/atlas_engine/nl/country_profile.yml +18 -0
  77. data/app/countries/atlas_engine/nl/index_configuration.yml +52 -0
  78. data/app/countries/atlas_engine/nl/synonyms.yml +92 -0
  79. data/app/countries/atlas_engine/nl/validation_transcriber/address_parser.rb +85 -0
  80. data/app/countries/atlas_engine/no/country_profile.yml +5 -0
  81. data/app/countries/atlas_engine/nz/country_profile.yml +3 -0
  82. data/app/countries/atlas_engine/pl/country_profile.yml +5 -0
  83. data/app/countries/atlas_engine/pl/validation_transcriber/address_parser.rb +19 -0
  84. data/app/countries/atlas_engine/pt/address_importer/corrections/open_address/city_corrector.rb +32 -0
  85. data/app/countries/atlas_engine/pt/address_importer/open_address/mapper.rb +39 -0
  86. data/app/countries/atlas_engine/pt/country_profile.yml +10 -0
  87. data/app/countries/atlas_engine/pt/synonyms.yml +7 -0
  88. data/app/countries/atlas_engine/sa/country_profile.yml +10 -0
  89. data/app/countries/atlas_engine/se/country_profile.yml +5 -0
  90. data/app/countries/atlas_engine/tt/address_importer/open_address/mapper.rb +38 -0
  91. data/app/countries/atlas_engine/tt/country_profile.yml +7 -0
  92. data/app/countries/atlas_engine/us/country_profile.yml +12 -0
  93. data/app/countries/atlas_engine/us/synonyms.yml +350 -0
  94. data/app/graphql/atlas_engine/errors/locale_unsupported_error.rb +17 -0
  95. data/app/graphql/atlas_engine/schema.graphql +1293 -0
  96. data/app/graphql/atlas_engine/schema.rb +23 -0
  97. data/app/graphql/atlas_engine/types/address_validation/address_input.rb +51 -0
  98. data/app/graphql/atlas_engine/types/address_validation/concern_type.rb +20 -0
  99. data/app/graphql/atlas_engine/types/address_validation/enums/concern_enum.rb +15 -0
  100. data/app/graphql/atlas_engine/types/address_validation/field_type.rb +15 -0
  101. data/app/graphql/atlas_engine/types/address_validation/suggestion_type.rb +21 -0
  102. data/app/graphql/atlas_engine/types/base_argument.rb +9 -0
  103. data/app/graphql/atlas_engine/types/base_enum.rb +9 -0
  104. data/app/graphql/atlas_engine/types/base_field.rb +10 -0
  105. data/app/graphql/atlas_engine/types/base_input_object.rb +9 -0
  106. data/app/graphql/atlas_engine/types/base_interface.rb +10 -0
  107. data/app/graphql/atlas_engine/types/base_object.rb +9 -0
  108. data/app/graphql/atlas_engine/types/base_scalar.rb +9 -0
  109. data/app/graphql/atlas_engine/types/base_union.rb +9 -0
  110. data/app/graphql/atlas_engine/types/matching_strategy_type.rb +12 -0
  111. data/app/graphql/atlas_engine/types/mutation_type.rb +9 -0
  112. data/app/graphql/atlas_engine/types/query_type.rb +61 -0
  113. data/app/graphql/atlas_engine/types/validation_supported_country.rb +12 -0
  114. data/app/graphql/atlas_engine/types/validation_type.rb +22 -0
  115. data/app/helpers/atlas_engine/address_importer/import_log_helper.rb +66 -0
  116. data/app/helpers/atlas_engine/application_helper.rb +7 -0
  117. data/app/helpers/atlas_engine/locale_format_helper.rb +40 -0
  118. data/app/helpers/atlas_engine/log_base.rb +32 -0
  119. data/app/helpers/atlas_engine/log_helper.rb +24 -0
  120. data/app/helpers/atlas_engine/metrics_helper.rb +25 -0
  121. data/app/jobs/atlas_engine/address_importer/clear_records_job.rb +39 -0
  122. data/app/jobs/atlas_engine/address_importer/open_address/geo_json_import_job.rb +212 -0
  123. data/app/jobs/atlas_engine/address_importer/open_address/geo_json_import_launcher_job.rb +67 -0
  124. data/app/jobs/atlas_engine/address_importer/open_address/prepares_geo_json_file.rb +41 -0
  125. data/app/jobs/atlas_engine/address_importer/resumable_import_job.rb +49 -0
  126. data/app/jobs/atlas_engine/address_importer/street_backfill_job.rb +63 -0
  127. data/app/jobs/atlas_engine/application_job.rb +10 -0
  128. data/app/jobs/atlas_engine/concerns/address_importer/handles_errors.rb +43 -0
  129. data/app/lib/atlas_engine/concern_formatter.rb +40 -0
  130. data/app/lib/atlas_engine/restrictions/base.rb +20 -0
  131. data/app/lib/atlas_engine/restrictions/unsupported_script.rb +31 -0
  132. data/app/lib/atlas_engine/validation_transcriber/address_parser_base.rb +201 -0
  133. data/app/lib/atlas_engine/validation_transcriber/address_parser_factory.rb +27 -0
  134. data/app/lib/atlas_engine/validation_transcriber/address_parser_north_america.rb +39 -0
  135. data/app/lib/atlas_engine/validation_transcriber/address_parser_oceanic.rb +17 -0
  136. data/app/lib/atlas_engine/validation_transcriber/address_parser_preprocessor.rb +132 -0
  137. data/app/lib/atlas_engine/validation_transcriber/address_parsing_helper.rb +38 -0
  138. data/app/lib/atlas_engine/validation_transcriber/address_parsings.rb +54 -0
  139. data/app/lib/atlas_engine/validation_transcriber/constants.rb +50 -0
  140. data/app/lib/atlas_engine/validation_transcriber/english_street_parser.rb +59 -0
  141. data/app/lib/atlas_engine/validation_transcriber/formatter.rb +46 -0
  142. data/app/lib/atlas_engine/validation_transcriber/french_street_parser.rb +50 -0
  143. data/app/lib/atlas_engine/validation_transcriber/province_code_normalizer.rb +45 -0
  144. data/app/lib/atlas_engine/validation_transcriber/street_parser.rb +18 -0
  145. data/app/lib/atlas_engine/validation_transcriber/zip_normalizer.rb +23 -0
  146. data/app/mailers/atlas_engine/application_mailer.rb +9 -0
  147. data/app/models/atlas_engine/address_importer/corrections/corrector.rb +33 -0
  148. data/app/models/atlas_engine/address_importer/import_events_notifier/base.rb +35 -0
  149. data/app/models/atlas_engine/address_importer/import_events_notifier/notifier.rb +26 -0
  150. data/app/models/atlas_engine/address_importer/open_address/default_mapper.rb +46 -0
  151. data/app/models/atlas_engine/address_importer/open_address/feature_helper.rb +110 -0
  152. data/app/models/atlas_engine/address_importer/open_address/filter.rb +17 -0
  153. data/app/models/atlas_engine/address_importer/open_address/loader.rb +27 -0
  154. data/app/models/atlas_engine/address_importer/open_address/transformer.rb +39 -0
  155. data/app/models/atlas_engine/address_importer/open_address.rb +10 -0
  156. data/app/models/atlas_engine/address_importer/validation/base_validator.rb +86 -0
  157. data/app/models/atlas_engine/address_importer/validation/default_validator.rb +27 -0
  158. data/app/models/atlas_engine/address_importer/validation/field_validations/city.rb +47 -0
  159. data/app/models/atlas_engine/address_importer/validation/field_validations/interface.rb +29 -0
  160. data/app/models/atlas_engine/address_importer/validation/field_validations/province.rb +73 -0
  161. data/app/models/atlas_engine/address_importer/validation/field_validations/zip.rb +84 -0
  162. data/app/models/atlas_engine/address_importer/validation/validator.rb +17 -0
  163. data/app/models/atlas_engine/address_importer/validation/wrapper.rb +70 -0
  164. data/app/models/atlas_engine/address_number.rb +36 -0
  165. data/app/models/atlas_engine/address_number_range.rb +200 -0
  166. data/app/models/atlas_engine/address_validation/abstract_address.rb +49 -0
  167. data/app/models/atlas_engine/address_validation/address.rb +47 -0
  168. data/app/models/atlas_engine/address_validation/candidate.rb +109 -0
  169. data/app/models/atlas_engine/address_validation/candidate_tuple.rb +15 -0
  170. data/app/models/atlas_engine/address_validation/concern.rb +74 -0
  171. data/app/models/atlas_engine/address_validation/concern_producer.rb +19 -0
  172. data/app/models/atlas_engine/address_validation/concern_queue.rb +20 -0
  173. data/app/models/atlas_engine/address_validation/concern_record.rb +122 -0
  174. data/app/models/atlas_engine/address_validation/datastore_base.rb +27 -0
  175. data/app/models/atlas_engine/address_validation/errors.rb +13 -0
  176. data/app/models/atlas_engine/address_validation/es/candidate_selector.rb +70 -0
  177. data/app/models/atlas_engine/address_validation/es/data_mappers/decompounding_data_mapper.rb +39 -0
  178. data/app/models/atlas_engine/address_validation/es/data_mappers/default_data_mapper.rb +110 -0
  179. data/app/models/atlas_engine/address_validation/es/datastore.rb +229 -0
  180. data/app/models/atlas_engine/address_validation/es/default_query_builder.rb +30 -0
  181. data/app/models/atlas_engine/address_validation/es/query_builder.rb +160 -0
  182. data/app/models/atlas_engine/address_validation/es/term_vectors.rb +78 -0
  183. data/app/models/atlas_engine/address_validation/es/validators/full_address.rb +123 -0
  184. data/app/models/atlas_engine/address_validation/es/validators/full_address_street.rb +18 -0
  185. data/app/models/atlas_engine/address_validation/es/validators/restriction_evaluator.rb +37 -0
  186. data/app/models/atlas_engine/address_validation/field.rb +30 -0
  187. data/app/models/atlas_engine/address_validation/full_address_validator_base.rb +27 -0
  188. data/app/models/atlas_engine/address_validation/log_emitter.rb +66 -0
  189. data/app/models/atlas_engine/address_validation/matching_strategies.rb +16 -0
  190. data/app/models/atlas_engine/address_validation/normalizer.rb +38 -0
  191. data/app/models/atlas_engine/address_validation/predicate_pipeline.rb +80 -0
  192. data/app/models/atlas_engine/address_validation/request.rb +12 -0
  193. data/app/models/atlas_engine/address_validation/result.rb +154 -0
  194. data/app/models/atlas_engine/address_validation/runs_validation.rb +16 -0
  195. data/app/models/atlas_engine/address_validation/session.rb +47 -0
  196. data/app/models/atlas_engine/address_validation/statsd_emitter.rb +72 -0
  197. data/app/models/atlas_engine/address_validation/strategies.rb +10 -0
  198. data/app/models/atlas_engine/address_validation/suggestion.rb +97 -0
  199. data/app/models/atlas_engine/address_validation/token/comparator.rb +44 -0
  200. data/app/models/atlas_engine/address_validation/token/comparison.rb +76 -0
  201. data/app/models/atlas_engine/address_validation/token/sequence/comparator.rb +158 -0
  202. data/app/models/atlas_engine/address_validation/token/sequence/comparison.rb +166 -0
  203. data/app/models/atlas_engine/address_validation/token/sequence.rb +147 -0
  204. data/app/models/atlas_engine/address_validation/token/synonyms.rb +77 -0
  205. data/app/models/atlas_engine/address_validation/token.rb +113 -0
  206. data/app/models/atlas_engine/address_validation/validator.rb +147 -0
  207. data/app/models/atlas_engine/address_validation/validators/full_address/address_comparison.rb +97 -0
  208. data/app/models/atlas_engine/address_validation/validators/full_address/candidate_result.rb +164 -0
  209. data/app/models/atlas_engine/address_validation/validators/full_address/candidate_result_base.rb +46 -0
  210. data/app/models/atlas_engine/address_validation/validators/full_address/comparison_helper.rb +135 -0
  211. data/app/models/atlas_engine/address_validation/validators/full_address/components_to_validate.rb +88 -0
  212. data/app/models/atlas_engine/address_validation/validators/full_address/concern_builder.rb +127 -0
  213. data/app/models/atlas_engine/address_validation/validators/full_address/exclusions/exclusion_base.rb +23 -0
  214. data/app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_concern_builder.rb +42 -0
  215. data/app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_country_concern.rb +37 -0
  216. data/app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_province_concern.rb +37 -0
  217. data/app/models/atlas_engine/address_validation/validators/full_address/no_candidate_result.rb +26 -0
  218. data/app/models/atlas_engine/address_validation/validators/full_address/number_comparison.rb +31 -0
  219. data/app/models/atlas_engine/address_validation/validators/full_address/postal_code_matcher.rb +60 -0
  220. data/app/models/atlas_engine/address_validation/validators/full_address/result_updater.rb +42 -0
  221. data/app/models/atlas_engine/address_validation/validators/full_address/suggestion_builder.rb +140 -0
  222. data/app/models/atlas_engine/address_validation/validators/full_address/unknown_address_concern.rb +30 -0
  223. data/app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern.rb +38 -0
  224. data/app/models/atlas_engine/address_validation/validators/full_address/unknown_zip_for_address_concern.rb +32 -0
  225. data/app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern.rb +84 -0
  226. data/app/models/atlas_engine/address_validation/validators/full_address/unsupported_script_result.rb +22 -0
  227. data/app/models/atlas_engine/address_validation/validators/predicates/cache.rb +38 -0
  228. data/app/models/atlas_engine/address_validation/validators/predicates/city/present.rb +36 -0
  229. data/app/models/atlas_engine/address_validation/validators/predicates/country/exists.rb +34 -0
  230. data/app/models/atlas_engine/address_validation/validators/predicates/country/valid_for_zip.rb +60 -0
  231. data/app/models/atlas_engine/address_validation/validators/predicates/no_emojis.rb +38 -0
  232. data/app/models/atlas_engine/address_validation/validators/predicates/no_html_tags.rb +39 -0
  233. data/app/models/atlas_engine/address_validation/validators/predicates/no_url.rb +38 -0
  234. data/app/models/atlas_engine/address_validation/validators/predicates/not_exceed_max_length.rb +34 -0
  235. data/app/models/atlas_engine/address_validation/validators/predicates/not_exceed_max_token_count.rb +63 -0
  236. data/app/models/atlas_engine/address_validation/validators/predicates/phone/valid.rb +41 -0
  237. data/app/models/atlas_engine/address_validation/validators/predicates/predicate.rb +37 -0
  238. data/app/models/atlas_engine/address_validation/validators/predicates/province/exists.rb +43 -0
  239. data/app/models/atlas_engine/address_validation/validators/predicates/province/valid_for_country.rb +48 -0
  240. data/app/models/atlas_engine/address_validation/validators/predicates/street/building_number_in_address1.rb +45 -0
  241. data/app/models/atlas_engine/address_validation/validators/predicates/street/building_number_in_address1_or_address2.rb +43 -0
  242. data/app/models/atlas_engine/address_validation/validators/predicates/street/present.rb +35 -0
  243. data/app/models/atlas_engine/address_validation/validators/predicates/zip/present.rb +58 -0
  244. data/app/models/atlas_engine/address_validation/validators/predicates/zip/valid_for_country.rb +45 -0
  245. data/app/models/atlas_engine/address_validation/validators/predicates/zip/valid_for_province.rb +55 -0
  246. data/app/models/atlas_engine/address_validation/validators/predicates/zip/zip_base.rb +25 -0
  247. data/app/models/atlas_engine/address_validation/zip_truncator.rb +32 -0
  248. data/app/models/atlas_engine/application_record.rb +8 -0
  249. data/app/models/atlas_engine/coded_error.rb +18 -0
  250. data/app/models/atlas_engine/coded_errors.rb +17 -0
  251. data/app/models/atlas_engine/country_import.rb +44 -0
  252. data/app/models/atlas_engine/country_profile.rb +270 -0
  253. data/app/models/atlas_engine/country_profile_ingestion_subset.rb +42 -0
  254. data/app/models/atlas_engine/country_profile_subset_base.rb +22 -0
  255. data/app/models/atlas_engine/country_profile_validation_subset.rb +48 -0
  256. data/app/models/atlas_engine/country_repository.rb +110 -0
  257. data/app/models/atlas_engine/elasticsearch/client.rb +116 -0
  258. data/app/models/atlas_engine/elasticsearch/client_interface.rb +89 -0
  259. data/app/models/atlas_engine/elasticsearch/repository.rb +246 -0
  260. data/app/models/atlas_engine/elasticsearch/repository_interface.rb +82 -0
  261. data/app/models/atlas_engine/elasticsearch/response.rb +20 -0
  262. data/app/models/atlas_engine/event.rb +12 -0
  263. data/app/models/atlas_engine/field_decompounder.rb +36 -0
  264. data/app/models/atlas_engine/index_configuration_factory.rb +188 -0
  265. data/app/models/atlas_engine/post_address.rb +114 -0
  266. data/app/models/atlas_engine/post_address_importer.rb +34 -0
  267. data/app/models/atlas_engine/services/service_helper.rb +21 -0
  268. data/app/models/atlas_engine/services/validation.rb +65 -0
  269. data/app/models/atlas_engine/services/validation_eligibility.rb +18 -0
  270. data/app/models/atlas_engine/street.rb +34 -0
  271. data/app/tasks/maintenance/atlas_engine/elasticsearch_index_create_task.rb +106 -0
  272. data/app/tasks/maintenance/atlas_engine/geo_json_import_task.rb +29 -0
  273. data/app/views/atlas_engine/connectivity/index.html.erb +50 -0
  274. data/app/views/atlas_engine/country_imports/index.html.erb +49 -0
  275. data/app/views/atlas_engine/country_imports/show.html.erb +73 -0
  276. data/app/views/layouts/atlas_engine/application.html.erb +15 -0
  277. data/config/initializers/1.ruby_patches.rb +18 -0
  278. data/config/initializers/sorbet.rb +5 -0
  279. data/config/initializers/worldwide.rb +5 -0
  280. data/config/locales/internal/en.yml +14 -0
  281. data/config/routes.rb +17 -0
  282. data/db/data/address_synonyms/index_configurations/default.yml +141 -0
  283. data/db/data/country_profiles/default.yml +23 -0
  284. data/db/data/transcriber.yml +760 -0
  285. data/db/data/validation_pipelines/es.yml +58 -0
  286. data/db/data/validation_pipelines/es_street.yml +58 -0
  287. data/db/data/validation_pipelines/local.yml +60 -0
  288. data/db/migrate/20230919173037_create_atlas_engine_post_addresses.rb +25 -0
  289. data/db/migrate/20231117142735_add_building_and_unit_ranges_column.rb +7 -0
  290. data/db/migrate/20231117143536_create_atlas_engine_country_imports.rb +11 -0
  291. data/db/migrate/20231117145844_create_atlas_engine_events_table.rb +13 -0
  292. data/db/migrate/20231123153554_add_unique_index_to_atlas_engine_post_addresses.rb +14 -0
  293. data/db/migrate/20231123154658_add_index_to_post_addresses_on_source_id_locale_country_code.rb +12 -0
  294. data/lib/atlas_engine/engine.rb +10 -0
  295. data/lib/atlas_engine/version.rb +6 -0
  296. data/lib/atlas_engine.rb +66 -0
  297. data/lib/tasks/atlas_engine/address_importer.rake +20 -0
  298. metadata +553 -0
@@ -0,0 +1,1293 @@
1
+ """
2
+ Address fields used to fulfill a validation request
3
+ """
4
+ input AddressInput {
5
+ address1: String
6
+ address2: String
7
+ city: String
8
+ countryCode: ValidationSupportedCountry
9
+ phone: String
10
+ provinceCode: String
11
+ zip: String
12
+ }
13
+
14
+ """
15
+ A piece of relevant information regarding the address validation result.They can
16
+ be categorized as either a Warning or Error.
17
+ """
18
+ type Concern {
19
+ code: String!
20
+ fieldNames: [String!]!
21
+ message: String!
22
+ suggestionIds: [String!]!
23
+ type: ConcernEnum!
24
+ typeLevel: Int!
25
+ }
26
+
27
+ enum ConcernEnum {
28
+ ERROR
29
+ WARNING
30
+ }
31
+
32
+ """
33
+ An individual field which in conjunction with others compose an address
34
+ """
35
+ type Field {
36
+ name: String!
37
+ value: String!
38
+ }
39
+
40
+ enum MatchingStrategy {
41
+ ES
42
+ ES_STREET
43
+ LOCAL
44
+ }
45
+
46
+ type Query {
47
+ validation(address: AddressInput!, locale: String!, matchingStrategy: MatchingStrategy): Validation!
48
+ }
49
+
50
+ """
51
+ An address-like object containing some value corrections derived during address validation
52
+ """
53
+ type Suggestion {
54
+ address1: String
55
+ address2: String
56
+ city: String
57
+ countryCode: ValidationSupportedCountry
58
+ id: String!
59
+ province: String
60
+ provinceCode: String
61
+ zip: String
62
+ }
63
+
64
+ """
65
+ An address validation result object
66
+ """
67
+ type Validation {
68
+ candidate: String @deprecated(reason: "Temporary field meant for internal use only.")
69
+ concerns: [Concern!]!
70
+ fields: [Field!]!
71
+ id: String!
72
+ locale: String!
73
+ matchingStrategy: MatchingStrategy!
74
+ suggestions: [Suggestion!]!
75
+ validationScope: [String!]!
76
+ }
77
+
78
+ enum ValidationSupportedCountry {
79
+ """
80
+ Ascension Island
81
+ """
82
+ AC
83
+
84
+ """
85
+ Andorra
86
+ """
87
+ AD
88
+
89
+ """
90
+ United Arab Emirates
91
+ """
92
+ AE
93
+
94
+ """
95
+ Afghanistan
96
+ """
97
+ AF
98
+
99
+ """
100
+ Antigua & Barbuda
101
+ """
102
+ AG
103
+
104
+ """
105
+ Anguilla
106
+ """
107
+ AI
108
+
109
+ """
110
+ Albania
111
+ """
112
+ AL
113
+
114
+ """
115
+ Armenia
116
+ """
117
+ AM
118
+
119
+ """
120
+ Angola
121
+ """
122
+ AO
123
+
124
+ """
125
+ Argentina
126
+ """
127
+ AR
128
+
129
+ """
130
+ Austria
131
+ """
132
+ AT
133
+
134
+ """
135
+ Australia
136
+ """
137
+ AU
138
+
139
+ """
140
+ Aruba
141
+ """
142
+ AW
143
+
144
+ """
145
+ Åland Islands
146
+ """
147
+ AX
148
+
149
+ """
150
+ Azerbaijan
151
+ """
152
+ AZ
153
+
154
+ """
155
+ Bosnia & Herzegovina
156
+ """
157
+ BA
158
+
159
+ """
160
+ Barbados
161
+ """
162
+ BB
163
+
164
+ """
165
+ Bangladesh
166
+ """
167
+ BD
168
+
169
+ """
170
+ Belgium
171
+ """
172
+ BE
173
+
174
+ """
175
+ Burkina Faso
176
+ """
177
+ BF
178
+
179
+ """
180
+ Bulgaria
181
+ """
182
+ BG
183
+
184
+ """
185
+ Bahrain
186
+ """
187
+ BH
188
+
189
+ """
190
+ Burundi
191
+ """
192
+ BI
193
+
194
+ """
195
+ Benin
196
+ """
197
+ BJ
198
+
199
+ """
200
+ St. Barthélemy
201
+ """
202
+ BL
203
+
204
+ """
205
+ Bermuda
206
+ """
207
+ BM
208
+
209
+ """
210
+ Brunei
211
+ """
212
+ BN
213
+
214
+ """
215
+ Bolivia
216
+ """
217
+ BO
218
+
219
+ """
220
+ Caribbean Netherlands
221
+ """
222
+ BQ
223
+
224
+ """
225
+ Brazil
226
+ """
227
+ BR
228
+
229
+ """
230
+ Bahamas
231
+ """
232
+ BS
233
+
234
+ """
235
+ Bhutan
236
+ """
237
+ BT
238
+
239
+ """
240
+ Bouvet Island
241
+ """
242
+ BV
243
+
244
+ """
245
+ Botswana
246
+ """
247
+ BW
248
+
249
+ """
250
+ Belarus
251
+ """
252
+ BY
253
+
254
+ """
255
+ Belize
256
+ """
257
+ BZ
258
+
259
+ """
260
+ Canada
261
+ """
262
+ CA
263
+
264
+ """
265
+ Cocos (Keeling) Islands
266
+ """
267
+ CC
268
+
269
+ """
270
+ Congo - Kinshasa
271
+ """
272
+ CD
273
+
274
+ """
275
+ Central African Republic
276
+ """
277
+ CF
278
+
279
+ """
280
+ Congo - Brazzaville
281
+ """
282
+ CG
283
+
284
+ """
285
+ Switzerland
286
+ """
287
+ CH
288
+
289
+ """
290
+ Côte d’Ivoire
291
+ """
292
+ CI
293
+
294
+ """
295
+ Cook Islands
296
+ """
297
+ CK
298
+
299
+ """
300
+ Chile
301
+ """
302
+ CL
303
+
304
+ """
305
+ Cameroon
306
+ """
307
+ CM
308
+
309
+ """
310
+ China
311
+ """
312
+ CN
313
+
314
+ """
315
+ Colombia
316
+ """
317
+ CO
318
+
319
+ """
320
+ Costa Rica
321
+ """
322
+ CR
323
+
324
+ """
325
+ Cuba
326
+ """
327
+ CU
328
+
329
+ """
330
+ Cape Verde
331
+ """
332
+ CV
333
+
334
+ """
335
+ Curaçao
336
+ """
337
+ CW
338
+
339
+ """
340
+ Christmas Island
341
+ """
342
+ CX
343
+
344
+ """
345
+ Cyprus
346
+ """
347
+ CY
348
+
349
+ """
350
+ Czechia
351
+ """
352
+ CZ
353
+
354
+ """
355
+ Germany
356
+ """
357
+ DE
358
+
359
+ """
360
+ Djibouti
361
+ """
362
+ DJ
363
+
364
+ """
365
+ Denmark
366
+ """
367
+ DK
368
+
369
+ """
370
+ Dominica
371
+ """
372
+ DM
373
+
374
+ """
375
+ Dominican Republic
376
+ """
377
+ DO
378
+
379
+ """
380
+ Algeria
381
+ """
382
+ DZ
383
+
384
+ """
385
+ Ecuador
386
+ """
387
+ EC
388
+
389
+ """
390
+ Estonia
391
+ """
392
+ EE
393
+
394
+ """
395
+ Egypt
396
+ """
397
+ EG
398
+
399
+ """
400
+ Western Sahara
401
+ """
402
+ EH
403
+
404
+ """
405
+ Eritrea
406
+ """
407
+ ER
408
+
409
+ """
410
+ Spain
411
+ """
412
+ ES
413
+
414
+ """
415
+ Ethiopia
416
+ """
417
+ ET
418
+
419
+ """
420
+ Finland
421
+ """
422
+ FI
423
+
424
+ """
425
+ Fiji
426
+ """
427
+ FJ
428
+
429
+ """
430
+ Falkland Islands
431
+ """
432
+ FK
433
+
434
+ """
435
+ Faroe Islands
436
+ """
437
+ FO
438
+
439
+ """
440
+ France
441
+ """
442
+ FR
443
+
444
+ """
445
+ Gabon
446
+ """
447
+ GA
448
+
449
+ """
450
+ United Kingdom
451
+ """
452
+ GB
453
+
454
+ """
455
+ Grenada
456
+ """
457
+ GD
458
+
459
+ """
460
+ Georgia
461
+ """
462
+ GE
463
+
464
+ """
465
+ French Guiana
466
+ """
467
+ GF
468
+
469
+ """
470
+ Guernsey
471
+ """
472
+ GG
473
+
474
+ """
475
+ Ghana
476
+ """
477
+ GH
478
+
479
+ """
480
+ Gibraltar
481
+ """
482
+ GI
483
+
484
+ """
485
+ Greenland
486
+ """
487
+ GL
488
+
489
+ """
490
+ Gambia
491
+ """
492
+ GM
493
+
494
+ """
495
+ Guinea
496
+ """
497
+ GN
498
+
499
+ """
500
+ Guadeloupe
501
+ """
502
+ GP
503
+
504
+ """
505
+ Equatorial Guinea
506
+ """
507
+ GQ
508
+
509
+ """
510
+ Greece
511
+ """
512
+ GR
513
+
514
+ """
515
+ South Georgia & South Sandwich Islands
516
+ """
517
+ GS
518
+
519
+ """
520
+ Guatemala
521
+ """
522
+ GT
523
+
524
+ """
525
+ Guinea-Bissau
526
+ """
527
+ GW
528
+
529
+ """
530
+ Guyana
531
+ """
532
+ GY
533
+
534
+ """
535
+ Hong Kong SAR
536
+ """
537
+ HK
538
+
539
+ """
540
+ Heard & McDonald Islands
541
+ """
542
+ HM
543
+
544
+ """
545
+ Honduras
546
+ """
547
+ HN
548
+
549
+ """
550
+ Croatia
551
+ """
552
+ HR
553
+
554
+ """
555
+ Haiti
556
+ """
557
+ HT
558
+
559
+ """
560
+ Hungary
561
+ """
562
+ HU
563
+
564
+ """
565
+ Indonesia
566
+ """
567
+ ID
568
+
569
+ """
570
+ Ireland
571
+ """
572
+ IE
573
+
574
+ """
575
+ Israel
576
+ """
577
+ IL
578
+
579
+ """
580
+ Isle of Man
581
+ """
582
+ IM
583
+
584
+ """
585
+ India
586
+ """
587
+ IN
588
+
589
+ """
590
+ British Indian Ocean Territory
591
+ """
592
+ IO
593
+
594
+ """
595
+ Iraq
596
+ """
597
+ IQ
598
+
599
+ """
600
+ Iran
601
+ """
602
+ IR
603
+
604
+ """
605
+ Iceland
606
+ """
607
+ IS
608
+
609
+ """
610
+ Italy
611
+ """
612
+ IT
613
+
614
+ """
615
+ Jersey
616
+ """
617
+ JE
618
+
619
+ """
620
+ Jamaica
621
+ """
622
+ JM
623
+
624
+ """
625
+ Jordan
626
+ """
627
+ JO
628
+
629
+ """
630
+ Japan
631
+ """
632
+ JP
633
+
634
+ """
635
+ Kenya
636
+ """
637
+ KE
638
+
639
+ """
640
+ Kyrgyzstan
641
+ """
642
+ KG
643
+
644
+ """
645
+ Cambodia
646
+ """
647
+ KH
648
+
649
+ """
650
+ Kiribati
651
+ """
652
+ KI
653
+
654
+ """
655
+ Comoros
656
+ """
657
+ KM
658
+
659
+ """
660
+ St. Kitts & Nevis
661
+ """
662
+ KN
663
+
664
+ """
665
+ North Korea
666
+ """
667
+ KP
668
+
669
+ """
670
+ South Korea
671
+ """
672
+ KR
673
+
674
+ """
675
+ Kuwait
676
+ """
677
+ KW
678
+
679
+ """
680
+ Cayman Islands
681
+ """
682
+ KY
683
+
684
+ """
685
+ Kazakhstan
686
+ """
687
+ KZ
688
+
689
+ """
690
+ Laos
691
+ """
692
+ LA
693
+
694
+ """
695
+ Lebanon
696
+ """
697
+ LB
698
+
699
+ """
700
+ St. Lucia
701
+ """
702
+ LC
703
+
704
+ """
705
+ Liechtenstein
706
+ """
707
+ LI
708
+
709
+ """
710
+ Sri Lanka
711
+ """
712
+ LK
713
+
714
+ """
715
+ Liberia
716
+ """
717
+ LR
718
+
719
+ """
720
+ Lesotho
721
+ """
722
+ LS
723
+
724
+ """
725
+ Lithuania
726
+ """
727
+ LT
728
+
729
+ """
730
+ Luxembourg
731
+ """
732
+ LU
733
+
734
+ """
735
+ Latvia
736
+ """
737
+ LV
738
+
739
+ """
740
+ Libya
741
+ """
742
+ LY
743
+
744
+ """
745
+ Morocco
746
+ """
747
+ MA
748
+
749
+ """
750
+ Monaco
751
+ """
752
+ MC
753
+
754
+ """
755
+ Moldova
756
+ """
757
+ MD
758
+
759
+ """
760
+ Montenegro
761
+ """
762
+ ME
763
+
764
+ """
765
+ St. Martin
766
+ """
767
+ MF
768
+
769
+ """
770
+ Madagascar
771
+ """
772
+ MG
773
+
774
+ """
775
+ North Macedonia
776
+ """
777
+ MK
778
+
779
+ """
780
+ Mali
781
+ """
782
+ ML
783
+
784
+ """
785
+ Myanmar (Burma)
786
+ """
787
+ MM
788
+
789
+ """
790
+ Mongolia
791
+ """
792
+ MN
793
+
794
+ """
795
+ Macao SAR
796
+ """
797
+ MO
798
+
799
+ """
800
+ Martinique
801
+ """
802
+ MQ
803
+
804
+ """
805
+ Mauritania
806
+ """
807
+ MR
808
+
809
+ """
810
+ Montserrat
811
+ """
812
+ MS
813
+
814
+ """
815
+ Malta
816
+ """
817
+ MT
818
+
819
+ """
820
+ Mauritius
821
+ """
822
+ MU
823
+
824
+ """
825
+ Maldives
826
+ """
827
+ MV
828
+
829
+ """
830
+ Malawi
831
+ """
832
+ MW
833
+
834
+ """
835
+ Mexico
836
+ """
837
+ MX
838
+
839
+ """
840
+ Malaysia
841
+ """
842
+ MY
843
+
844
+ """
845
+ Mozambique
846
+ """
847
+ MZ
848
+
849
+ """
850
+ Namibia
851
+ """
852
+ NA
853
+
854
+ """
855
+ New Caledonia
856
+ """
857
+ NC
858
+
859
+ """
860
+ Niger
861
+ """
862
+ NE
863
+
864
+ """
865
+ Norfolk Island
866
+ """
867
+ NF
868
+
869
+ """
870
+ Nigeria
871
+ """
872
+ NG
873
+
874
+ """
875
+ Nicaragua
876
+ """
877
+ NI
878
+
879
+ """
880
+ Netherlands
881
+ """
882
+ NL
883
+
884
+ """
885
+ Norway
886
+ """
887
+ NO
888
+
889
+ """
890
+ Nepal
891
+ """
892
+ NP
893
+
894
+ """
895
+ Nauru
896
+ """
897
+ NR
898
+
899
+ """
900
+ Niue
901
+ """
902
+ NU
903
+
904
+ """
905
+ New Zealand
906
+ """
907
+ NZ
908
+
909
+ """
910
+ Oman
911
+ """
912
+ OM
913
+
914
+ """
915
+ Panama
916
+ """
917
+ PA
918
+
919
+ """
920
+ Peru
921
+ """
922
+ PE
923
+
924
+ """
925
+ French Polynesia
926
+ """
927
+ PF
928
+
929
+ """
930
+ Papua New Guinea
931
+ """
932
+ PG
933
+
934
+ """
935
+ Philippines
936
+ """
937
+ PH
938
+
939
+ """
940
+ Pakistan
941
+ """
942
+ PK
943
+
944
+ """
945
+ Poland
946
+ """
947
+ PL
948
+
949
+ """
950
+ St. Pierre & Miquelon
951
+ """
952
+ PM
953
+
954
+ """
955
+ Pitcairn Islands
956
+ """
957
+ PN
958
+
959
+ """
960
+ Palestinian Territories
961
+ """
962
+ PS
963
+
964
+ """
965
+ Portugal
966
+ """
967
+ PT
968
+
969
+ """
970
+ Paraguay
971
+ """
972
+ PY
973
+
974
+ """
975
+ Qatar
976
+ """
977
+ QA
978
+
979
+ """
980
+ Réunion
981
+ """
982
+ RE
983
+
984
+ """
985
+ Romania
986
+ """
987
+ RO
988
+
989
+ """
990
+ Serbia
991
+ """
992
+ RS
993
+
994
+ """
995
+ Russia
996
+ """
997
+ RU
998
+
999
+ """
1000
+ Rwanda
1001
+ """
1002
+ RW
1003
+
1004
+ """
1005
+ Saudi Arabia
1006
+ """
1007
+ SA
1008
+
1009
+ """
1010
+ Solomon Islands
1011
+ """
1012
+ SB
1013
+
1014
+ """
1015
+ Seychelles
1016
+ """
1017
+ SC
1018
+
1019
+ """
1020
+ Sudan
1021
+ """
1022
+ SD
1023
+
1024
+ """
1025
+ Sweden
1026
+ """
1027
+ SE
1028
+
1029
+ """
1030
+ Singapore
1031
+ """
1032
+ SG
1033
+
1034
+ """
1035
+ St. Helena
1036
+ """
1037
+ SH
1038
+
1039
+ """
1040
+ Slovenia
1041
+ """
1042
+ SI
1043
+
1044
+ """
1045
+ Svalbard & Jan Mayen
1046
+ """
1047
+ SJ
1048
+
1049
+ """
1050
+ Slovakia
1051
+ """
1052
+ SK
1053
+
1054
+ """
1055
+ Sierra Leone
1056
+ """
1057
+ SL
1058
+
1059
+ """
1060
+ San Marino
1061
+ """
1062
+ SM
1063
+
1064
+ """
1065
+ Senegal
1066
+ """
1067
+ SN
1068
+
1069
+ """
1070
+ Somalia
1071
+ """
1072
+ SO
1073
+
1074
+ """
1075
+ Suriname
1076
+ """
1077
+ SR
1078
+
1079
+ """
1080
+ South Sudan
1081
+ """
1082
+ SS
1083
+
1084
+ """
1085
+ São Tomé & Príncipe
1086
+ """
1087
+ ST
1088
+
1089
+ """
1090
+ El Salvador
1091
+ """
1092
+ SV
1093
+
1094
+ """
1095
+ Sint Maarten
1096
+ """
1097
+ SX
1098
+
1099
+ """
1100
+ Syria
1101
+ """
1102
+ SY
1103
+
1104
+ """
1105
+ Eswatini
1106
+ """
1107
+ SZ
1108
+
1109
+ """
1110
+ Tristan da Cunha
1111
+ """
1112
+ TA
1113
+
1114
+ """
1115
+ Turks & Caicos Islands
1116
+ """
1117
+ TC
1118
+
1119
+ """
1120
+ Chad
1121
+ """
1122
+ TD
1123
+
1124
+ """
1125
+ French Southern Territories
1126
+ """
1127
+ TF
1128
+
1129
+ """
1130
+ Togo
1131
+ """
1132
+ TG
1133
+
1134
+ """
1135
+ Thailand
1136
+ """
1137
+ TH
1138
+
1139
+ """
1140
+ Tajikistan
1141
+ """
1142
+ TJ
1143
+
1144
+ """
1145
+ Tokelau
1146
+ """
1147
+ TK
1148
+
1149
+ """
1150
+ Timor-Leste
1151
+ """
1152
+ TL
1153
+
1154
+ """
1155
+ Turkmenistan
1156
+ """
1157
+ TM
1158
+
1159
+ """
1160
+ Tunisia
1161
+ """
1162
+ TN
1163
+
1164
+ """
1165
+ Tonga
1166
+ """
1167
+ TO
1168
+
1169
+ """
1170
+ Turkey
1171
+ """
1172
+ TR
1173
+
1174
+ """
1175
+ Trinidad & Tobago
1176
+ """
1177
+ TT
1178
+
1179
+ """
1180
+ Tuvalu
1181
+ """
1182
+ TV
1183
+
1184
+ """
1185
+ Taiwan
1186
+ """
1187
+ TW
1188
+
1189
+ """
1190
+ Tanzania
1191
+ """
1192
+ TZ
1193
+
1194
+ """
1195
+ Ukraine
1196
+ """
1197
+ UA
1198
+
1199
+ """
1200
+ Uganda
1201
+ """
1202
+ UG
1203
+
1204
+ """
1205
+ U.S. Outlying Islands
1206
+ """
1207
+ UM
1208
+
1209
+ """
1210
+ United States
1211
+ """
1212
+ US
1213
+
1214
+ """
1215
+ Uruguay
1216
+ """
1217
+ UY
1218
+
1219
+ """
1220
+ Uzbekistan
1221
+ """
1222
+ UZ
1223
+
1224
+ """
1225
+ Vatican City
1226
+ """
1227
+ VA
1228
+
1229
+ """
1230
+ St. Vincent & Grenadines
1231
+ """
1232
+ VC
1233
+
1234
+ """
1235
+ Venezuela
1236
+ """
1237
+ VE
1238
+
1239
+ """
1240
+ British Virgin Islands
1241
+ """
1242
+ VG
1243
+
1244
+ """
1245
+ Vietnam
1246
+ """
1247
+ VN
1248
+
1249
+ """
1250
+ Vanuatu
1251
+ """
1252
+ VU
1253
+
1254
+ """
1255
+ Wallis & Futuna
1256
+ """
1257
+ WF
1258
+
1259
+ """
1260
+ Samoa
1261
+ """
1262
+ WS
1263
+
1264
+ """
1265
+ Kosovo
1266
+ """
1267
+ XK
1268
+
1269
+ """
1270
+ Yemen
1271
+ """
1272
+ YE
1273
+
1274
+ """
1275
+ Mayotte
1276
+ """
1277
+ YT
1278
+
1279
+ """
1280
+ South Africa
1281
+ """
1282
+ ZA
1283
+
1284
+ """
1285
+ Zambia
1286
+ """
1287
+ ZM
1288
+
1289
+ """
1290
+ Zimbabwe
1291
+ """
1292
+ ZW
1293
+ }