mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Inject a DomainPricingLogic into ExpandRecurringBillingEventsAction (#1648)
* Inject a DomainPricingLogic into ExpandRecurringBillingEventsAction This will be used in other PRs to set the renewal price correctly based on the renewal price behavior of the BillingRecurrence event. Note that, in order for this to work, a not-null constraint has been lifted on the EPP flow state when the DomainPricingCustomLogic is being constructed, as the pricing here will occur in a backend action outside the context of any EPP flow.
This commit is contained in:
@@ -17,6 +17,7 @@ package google.registry.flows.custom;
|
||||
import google.registry.flows.FlowMetadata;
|
||||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import java.util.Optional;
|
||||
|
||||
/** A custom logic factory for testing. */
|
||||
public class TestCustomLogicFactory extends CustomLogicFactory {
|
||||
@@ -29,7 +30,10 @@ public class TestCustomLogicFactory extends CustomLogicFactory {
|
||||
|
||||
@Override
|
||||
public DomainPricingCustomLogic forDomainPricing(
|
||||
EppInput eppInput, SessionMetadata sessionMetadata, FlowMetadata flowMetadata) {
|
||||
return new TestDomainPricingCustomLogic(eppInput, sessionMetadata, flowMetadata);
|
||||
Optional<EppInput> eppInput,
|
||||
Optional<SessionMetadata> sessionMetadata,
|
||||
Optional<FlowMetadata> flowMetadata) {
|
||||
return new TestDomainPricingCustomLogic(
|
||||
eppInput.orElse(null), sessionMetadata.orElse(null), flowMetadata.orElse(null));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class TestDomainCreateFlowCustomLogic extends DomainCreateFlowCustomLogic
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setParent(parameters.historyEntry())
|
||||
.setEventTime(tm().getTransactionTime())
|
||||
.setRegistrarId(getSessionMetadata().getRegistrarId())
|
||||
.setRegistrarId(getSessionMetadata().get().getRegistrarId())
|
||||
.setMsg("Custom logic was triggered")
|
||||
.build();
|
||||
return EntityChanges.newBuilder()
|
||||
|
||||
Reference in New Issue
Block a user