Skip to content

Commit

Permalink
OTT-139: Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
willfish committed Apr 17, 2024
1 parent 503db58 commit c3a017a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 29 deletions.
45 changes: 19 additions & 26 deletions app/lib/reporting/differences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,35 +129,28 @@ def generate(only: [])
add_missing_from_uk_worksheet
add_missing_from_xi_worksheet
add_indentation_worksheet
add_hierarchy_worksheet
add_endline_worksheet
add_start_date_worksheet
add_end_date_worksheet
add_mfn_missing_worksheet
add_mfn_duplicated_worksheet
add_misapplied_action_code_worksheet
add_incomplete_measure_condition_worksheet
add_me32_worksheet
add_seasonal_worksheet
add_omitted_duty_measures_worksheet
add_missing_vat_measure_worksheet
add_missing_quota_origins_worksheet
add_measure_quota_coverage_worksheet
add_bad_quota_association_worksheet
add_quota_exclusion_misalignment_worksheet
add_missing_supplementary_units_from_uk_worksheet
add_missing_supplementary_units_from_xi_worksheet
add_candidate_supplementary_units
add_me16_worksheet
add_overview_worksheet
]
# methods = %i[
# add_missing_from_uk_worksheet
# add_missing_from_xi_worksheet
# add_indentation_worksheet
# add_hierarchy_worksheet
# add_endline_worksheet
# add_start_date_worksheet
# add_end_date_worksheet
# add_mfn_missing_worksheet
# add_mfn_duplicated_worksheet
# add_misapplied_action_code_worksheet
# add_incomplete_measure_condition_worksheet
# add_me32_worksheet
# add_seasonal_worksheet
# add_omitted_duty_measures_worksheet
# add_missing_vat_measure_worksheet
# add_missing_quota_origins_worksheet
# add_measure_quota_coverage_worksheet
# add_bad_quota_association_worksheet
# add_quota_exclusion_misalignment_worksheet
# add_missing_supplementary_units_from_uk_worksheet
# add_missing_supplementary_units_from_xi_worksheet
# add_candidate_supplementary_units
# add_me16_worksheet
# add_overview_worksheet
# ]

methods = (methods & only) if only.any?

Expand Down
6 changes: 3 additions & 3 deletions app/lib/reporting/differences/goods_nomenclature_end_date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ def build_row_for(matching)
matching_uk_goods_nomenclature_for_comparison = uk_goods_nomenclature_ids_for_comparison[matching]
matching_xi_goods_nomenclature_for_comparison = xi_goods_nomenclature_ids_for_comparison[matching]

if matching_uk_goods_nomenclature_for_comparison.nil? || matching_xi_goods_nomenclature_for_comparison.nil?
new_issue = true
else
if matching_uk_goods_nomenclature_for_comparison.present? || matching_xi_goods_nomenclature_for_comparison.present?
uk_end_date_for_comparison = matching_uk_goods_nomenclature_for_comparison['End date']&.to_date&.strftime('%d/%m/%Y')
eu_end_date_for_comparison = matching_xi_goods_nomenclature_for_comparison['End date']&.to_date&.strftime('%d/%m/%Y')
new_issue = uk_end_date_for_comparison == eu_end_date_for_comparison
else
new_issue = true
end

[
Expand Down

0 comments on commit c3a017a

Please sign in to comment.