Skip to content

Commit b60095f

Browse files
committed
Delete item tariff class validation
1 parent eb05c46 commit b60095f

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Customs/WooShippingCustomsFormViewModel.swift

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,11 @@ private extension WooShippingCustomsFormViewModel {
120120
}
121121
.assign(to: &$isMissingITN)
122122

123-
let hsTariffNumberTotalValueDictionary = $itemsViewModels
124-
.map { childViewModels in
125-
childViewModels.map { $0.$hsTariffNumberTotalValue.eraseToAnyPublisher() }
126-
}
127-
.flatMap { childPublishers in
128-
childPublishers.combineLatest()
129-
}
130-
.map { values in
131-
var hsTariffNumberTotalValueDictionary: [String: Decimal] = [:]
132-
for (hsTariffNumber, totalValuePerItem) in values.compacted() {
133-
hsTariffNumberTotalValueDictionary[hsTariffNumber, default: 0] += totalValuePerItem
134-
}
135-
return hsTariffNumberTotalValueDictionary
136-
}
137-
138123
$internationalTransactionNumber.combineLatest(
139124
$itemsViewModels,
140-
hsTariffNumberTotalValueDictionary,
141125
$destinationCountryCode)
142126
.map { input -> ITNValidationError? in
143-
let (itn, items, hsTariffNumberTotalValueDictionary, countryCode) = input
127+
let (itn, items, countryCode) = input
144128
guard itn.isEmpty else {
145129
return ITNNumberValidator.isValid(itn) ? nil : .invalidFormat
146130
}
@@ -160,11 +144,6 @@ private extension WooShippingCustomsFormViewModel {
160144
return .missingForRequiredDestination
161145
}
162146

163-
for (_, value) in hsTariffNumberTotalValueDictionary {
164-
if value > Constants.minimumValueForRequiredITN {
165-
return .missingForTariffClass
166-
}
167-
}
168147
return nil
169148
}
170149
.assign(to: &$itnValidationError)

0 commit comments

Comments
 (0)