fixup! Merge branch 'main' into org_api_merge

This commit is contained in:
Iraq Jaber
2025-05-30 15:55:21 +02:00
parent f073a8ff3a
commit f4b6b3a06c
7 changed files with 144 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ package object
import (
"context"
"time"
"google.golang.org/protobuf/types/known/timestamppb"
@@ -115,6 +116,36 @@ func DomainValidationTypeFromModel(validationType domain.OrgDomainValidationType
}
}
func ToViewDetailsPb(
sequence uint64,
creationDate,
changeDate time.Time,
resourceOwner string,
) *object.Details {
details := &object.Details{
Sequence: sequence,
ResourceOwner: resourceOwner,
}
if !creationDate.IsZero() {
details.CreationDate = timestamppb.New(creationDate)
}
if !changeDate.IsZero() {
details.ChangeDate = timestamppb.New(changeDate)
}
return details
}
func DomainToChangeDetailsPb(objectDetail *domain.ObjectDetails) *object.Details {
details := &object.Details{
Sequence: objectDetail.Sequence,
ResourceOwner: objectDetail.ResourceOwner,
}
if !objectDetail.EventDate.IsZero() {
details.ChangeDate = timestamppb.New(objectDetail.EventDate)
}
return details
}
func DomainValidationTypeToDomain(validationType org_pb.DomainValidationType) domain.OrgDomainValidationType {
switch validationType {
case org_pb.DomainValidationType_DOMAIN_VALIDATION_TYPE_HTTP: