mirror of
https://github.com/google/nomulus.git
synced 2025-05-30 01:10:14 +02:00
Filter cancellation records for only cancellable records
Previously, I would cancel all the records associated with HistoryEntry that's available for cancellation. This could cause unexpected behavior if we cancelled a historyEntry which itself had cancelled records (in effect we would negate the negation unintentionally). This is easily remedied by only cancelling records which want to be cancelled. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=167204383
This commit is contained in:
parent
d8c1501213
commit
3809ff59a5
5 changed files with 29 additions and 10 deletions
|
@ -960,8 +960,11 @@ public class DomainFlowUtils {
|
|||
ImmutableSet.Builder<DomainTransactionRecord> recordsBuilder = new ImmutableSet.Builder<>();
|
||||
if (entryToCancel.isPresent()) {
|
||||
for (DomainTransactionRecord record : entryToCancel.get().getDomainTransactionRecords()) {
|
||||
int cancelledAmount = -1 * record.getReportAmount();
|
||||
recordsBuilder.add(record.asBuilder().setReportAmount(cancelledAmount).build());
|
||||
// Only cancel fields which are cancelable
|
||||
if (cancelableFields.contains(record.getReportField())) {
|
||||
int cancelledAmount = -1 * record.getReportAmount();
|
||||
recordsBuilder.add(record.asBuilder().setReportAmount(cancelledAmount).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
return recordsBuilder.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue