protected GoogleCloudFirestoreTicketDocument buildTicketAsDocument(final Ticket ticket) throws Exception {
        val encTicket = encodeTicket(ticket);
        val json = serializeTicket(encTicket);
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Serialized ticket into a JSON document as\n [{}]",
                JsonValue.readJSON(json).toString(Stringify.FORMATTED));
        }
        val principal = getPrincipalIdFrom(ticket);

        val expireAt = getExpireAt(ticket);
        LOGGER.trace("Calculated expiration date for ticket ttl as [{}]", expireAt);

        return GoogleCloudFirestoreTicketDocument.builder()
            .type(encTicket.getClass().getName())
            .prefix(digestIdentifier(ticket.getPrefix()))
            .ticketId(encTicket.getId())
            .json(json)
            .principal(digestIdentifier(principal))
            .attributes(collectAndDigestTicketAttributes(ticket))
            .expireAt(expireAt)
            .service(ticket instanceof final ServiceAwareTicket sat && Objects.nonNull(sat.getService()) ? sat.getService().getId() : StringUtils.EMPTY)
            .build();
    }
This is {@link GoogleCloudFirestoreTicketRegistry}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-gcp-firestore-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/GoogleCloudFirestoreTicketRegistry.java