mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Return all applicable reserved list entries associated with a label
Instead of only returning the most severe one, return all applicable ones. This is because the reserved list has grown to a list of types that are not strictly comparable but orthogonal to each other. We can no longer depend on the fact that the most severe type incorporates all properties of those beneath it. Therefore returning all of them and treat them one by one in the calling site is the correct behavior. Due to constraint imposed in eppcom.xsd, during domain checks the response can only contain a reservation reason of fewer than 32 characters, therefore we are returning the message for the type with highest severity, in case of multiple reservation types for a label. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149776106
This commit is contained in:
parent
9a11f125ff
commit
ebcdae7361
8 changed files with 199 additions and 86 deletions
|
@ -19,7 +19,7 @@ import static com.google.common.base.Strings.emptyToNull;
|
|||
import static google.registry.model.registry.Registry.TldState.SUNRISE;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.getPremiumPrice;
|
||||
import static google.registry.model.registry.label.ReservationType.NAME_COLLISION;
|
||||
import static google.registry.model.registry.label.ReservedList.getReservation;
|
||||
import static google.registry.model.registry.label.ReservedList.getReservationTypes;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromDomainName;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
@ -46,7 +46,7 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin
|
|||
Optional<Money> premiumPrice = getPremiumPrice(label, registry);
|
||||
boolean isNameCollisionInSunrise =
|
||||
registry.getTldState(priceTime).equals(SUNRISE)
|
||||
&& getReservation(label, tld) == NAME_COLLISION;
|
||||
&& getReservationTypes(label, tld).contains(NAME_COLLISION);
|
||||
String feeClass = emptyToNull(Joiner.on('-').skipNulls().join(
|
||||
premiumPrice.isPresent() ? "premium" : null,
|
||||
isNameCollisionInSunrise ? "collision" : null));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue