google-nomulus/java/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
..
annotations Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
billing Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
common Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
contact Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
domain Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
eppcommon Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
eppinput Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
eppoutput Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
host Remove all vestiges of memcache 2017-06-14 10:28:24 -04:00
index Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
mark Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ofy Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
poll Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
pricing Return all applicable reserved list entries associated with a label 2017-03-13 11:22:56 -04:00
rde Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
registrar Convert Registrar entity class to use more Java 8 features 2017-10-10 12:09:41 -04:00
registry Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
reporting Fix code to always set HistoryEntry modification time using txn time 2017-10-04 16:16:45 -04:00
server Check if lock owner is finished on lock acquisition 2017-09-20 10:27:17 -04:00
smd Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
tmch Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
transfer Persist transferredRegistrationExpirationTime (exDate) on TransferData 2017-10-24 16:53:47 -04:00
translators Clarify diff display of MutatingCommand 2017-10-04 16:16:45 -04:00
BackupGroupRoot.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
BUILD Define Stackdriver metrics for premium and reserved lists 2017-03-21 14:55:00 -04:00
Buildable.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
CacheUtils.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
CreateAutoTimestamp.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
EntityClasses.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
EppResource.java Remove migration @OnLoad for EppResource StatusValue LINKED 2017-05-23 17:22:49 -04:00
EppResourceUtils.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
ImmutableObject.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
Jsonifiable.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
JsonMapBuilder.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
ModelUtils.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
package-info.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
SchemaVersion.java Run automatic Java 8 conversion over codebase 2017-10-10 12:09:41 -04:00
UpdateAutoTimestamp.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00