google-nomulus/javatests/google/registry/model
nickfelt 184b2b56ac Persist transferredRegistrationExpirationTime (exDate) on TransferData
This CL adds transferredRegistrationExpirationTime as a TransferData field
persisted to Datastore.  It's only relevant for domains, and it represents the
registration expiration time resulting from the approval of the most recent
transfer request.  For pending transfers, we assume the transfer will be
server-approved, and thus in DomainTransferRequestFlow we set this field to the
existing computed value serverApproveNewExpirationTime, which is what we use
for setting up the server-approve autorenew billing event and poll message.
In DomainTransferApproveFlow we overwrite this field with the freshly computed
newExpirationTime, whereas in DomainTransferCancel/RejectFlow (and in the
implicit cancel of DomainDeleteFlow during a pending transfer) we null it out.

There are two key benefits to having this field, which are described in more
detail in b/36405140.

1) b/25084229 - it allows storage of a frozen value to back the "exDate" field
   of DomainTransferResponse, which we can use to fix various errors with how
   exDate display currently works.

2) b/36354434 - it allows DomainResource.cloneProjectedAtTime() to just directly
   set the registrationExpirationTime to this value, without computing it de
   novo, which reduces duplicated logic and ensures that the new expiration time
   matches the autorenew child objects.

This CL only starts writing the field on TransferData as persisted directly on
the DomainResource itself.  We'll then want to backfill the field for at
least pending transfers, whether expired or not (so we can do (2) above), but
I think we might as well backfill it for all pending and approved transfers
so that we also fix (1) even for historical transfers.  And then we can start
actually reading the field for both purposes.  (Note that for (1), this will
only fix synchronous transfer responses served via DomainTransferQueryFlow,
not async transfer responses served via poll messages, since these have already
been persisted with a potentially bad exDate, but I don't think it's worth a
backfill for those).

One last naming note: I chose the verbose transferredRegistrationExpirationTime
rather than the extendedRegistrationExpirationTime of DomainTransferResponse
because (as is the case in autorenew grace, or for a superuser transfer) the
new registration time isn't necessarily extended at all; it may be the same as
the pre-transfer expiration time.  Also, including "registration" helps clarify
w.r.t. pendingTransferExpirationTime which refers confusingly to the expiry of
the transfer itself, rather than the domain registration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171858083
2017-10-24 16:53:47 -04:00
..
billing Make Registrar load methods return Optionals instead of Nullables 2017-08-01 16:58:59 -04:00
common Remove long-dead LogsExportCursor and PersistedRangeLong 2017-09-20 10:27:17 -04:00
contact Refactor out creation of server TRIDs so they can be tested 2017-04-13 10:55:47 -04:00
domain Persist transferredRegistrationExpirationTime (exDate) on TransferData 2017-10-24 16:53:47 -04:00
eppinput Add and adjust EppInput accessors for more useful properties 2017-04-26 10:51:47 -04:00
eppoutput Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
host Refactor out creation of server TRIDs so they can be tested 2017-04-13 10:55:47 -04:00
index Finalize local variable to fix kokoro 2017-10-04 16:16:44 -04:00
mark Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ofy Add test for wrong bucketId order in CommitLogCheckpoint.create 2017-08-29 15:49:14 -04:00
poll Refactor out creation of server TRIDs so they can be tested 2017-04-13 10:55:47 -04:00
rde Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
registrar Make Registrar load methods return Optionals instead of Nullables 2017-08-01 16:58:59 -04:00
registry Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
reporting Unnest transactionFieldAmount from DomainTransactionRecord 2017-08-29 17:05:15 -04:00
server Check if lock owner is finished on lock acquisition 2017-09-20 10:27:17 -04:00
smd Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
tmch Perform some minor test cleanup 2017-08-01 16:20:49 -04:00
transfer Change transfer flow tests to assert on entire TransferData contents 2017-10-05 11:44:46 -04:00
translators Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
BUILD Allow EventSample.record to accept numSamples=0 2017-10-24 16:50:30 -04:00
CreateAutoTimestampTest.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EntityClassesTest.java Fix mismatch in types of Predicates being used 2017-10-04 16:16:45 -04:00
EntityTestCase.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
EppResourceUtilsTest.java Remove the ofy().load() inside of HostResource.cloneProjectedAtTime 2017-03-13 11:22:55 -04:00
ImmutableObjectTest.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ModelUtilsTest.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ResourceCommandTestCase.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
schema.txt Persist transferredRegistrationExpirationTime (exDate) on TransferData 2017-10-24 16:53:47 -04:00
SchemaVersionTest.java Add golden files for request component routing maps 2017-06-05 18:17:09 -04:00
UpdateAutoTimestampTest.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00