mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Crush out shared code in contact flows, especially transfer
Although the delta implies that this is actually adding code, it's better than it looks, because some of the stuff in ContactFlowUtils is duplicating more generic methods in ResourceFlowUtils, which can be deleted when the domain and host flows are cut over. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133149104
This commit is contained in:
parent
3978b4f169
commit
1ee02108ae
15 changed files with 194 additions and 157 deletions
|
@ -23,6 +23,7 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
|||
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
||||
|
@ -49,6 +50,7 @@ import javax.inject.Inject;
|
|||
public class ContactCreateFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
@Inject ResourceCommand resourceCommand;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject HistoryEntry.Builder historyBuilder;
|
||||
@Inject ContactCreateFlow() {}
|
||||
|
||||
|
@ -66,8 +68,8 @@ public class ContactCreateFlow extends LoggedInFlow implements TransactionalFlow
|
|||
Builder builder = new Builder();
|
||||
command.applyTo(builder);
|
||||
ContactResource newResource = builder
|
||||
.setCreationClientId(getClientId())
|
||||
.setCurrentSponsorClientId(getClientId())
|
||||
.setCreationClientId(clientId)
|
||||
.setCurrentSponsorClientId(clientId)
|
||||
.setRepoId(createContactHostRoid(ObjectifyService.allocateId()))
|
||||
.build();
|
||||
validateAsciiPostalInfo(newResource.getInternationalizedPostalInfo());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue