comment

package
v0.0.0-...-679f9ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CommentCreateV1 = "V1_COMMENT_CREATE"
	CommentUpdateV1 = "V1_COMMENT_UPDATE"
)
View Source
const (
	CommentAggregateType eventstore.AggregateType = "comment"
)

Variables

This section is empty.

Functions

func GetCommentObjectID

func GetCommentObjectID(aggregateID string, tenant string) string

func NewCommentCreateEvent

func NewCommentCreateEvent(aggregate eventstore.Aggregate, dataFields CommentDataFields, source commonmodel.Source, externalSystem commonmodel.ExternalSystem, createdAt, updatedAt time.Time) (eventstore.Event, error)

func NewCommentUpdateEvent

func NewCommentUpdateEvent(aggregate eventstore.Aggregate, content, contentType, source string, externalSystem commonmodel.ExternalSystem, updatedAt time.Time) (eventstore.Event, error)

Types

type Comment

type Comment struct {
	ID               string                       `json:"id"`
	Tenant           string                       `json:"tenant"`
	Content          string                       `json:"content"`
	ContentType      string                       `json:"contentType,omitempty"`
	AuthorUserId     string                       `json:"authorUserId,omitempty"`
	CommentedIssueId string                       `json:"commentedIssueId,omitempty"`
	Source           commonmodel.Source           `json:"source"`
	ExternalSystems  []commonmodel.ExternalSystem `json:"externalSystem"`
	CreatedAt        time.Time                    `json:"createdAt,omitempty"`
	UpdatedAt        time.Time                    `json:"updatedAt,omitempty"`
}

type CommentAggregate

type CommentAggregate struct {
	*eventstore.CommonTenantIdAggregate
	Comment *Comment
}

func NewCommentAggregateWithTenantAndID

func NewCommentAggregateWithTenantAndID(tenant, id string) *CommentAggregate

func (*CommentAggregate) HandleGRPCRequest

func (a *CommentAggregate) HandleGRPCRequest(ctx context.Context, request any, params map[string]any) (any, error)

func (*CommentAggregate) UpsertCommentGrpcRequest

func (a *CommentAggregate) UpsertCommentGrpcRequest(ctx context.Context, request *commentpb.UpsertCommentGrpcRequest) (string, error)

func (*CommentAggregate) When

func (a *CommentAggregate) When(evt eventstore.Event) error

type CommentCreateEvent

type CommentCreateEvent struct {
	Tenant           string                     `json:"tenant" validate:"required"`
	Content          string                     `json:"content"`
	ContentType      string                     `json:"contentType"`
	AuthorUserId     string                     `json:"authorUserId"`
	CommentedIssueId string                     `json:"commentedIssueId"`
	Source           string                     `json:"source"`
	AppSource        string                     `json:"appSource"`
	CreatedAt        time.Time                  `json:"createdAt"`
	UpdatedAt        time.Time                  `json:"updatedAt"`
	ExternalSystem   commonmodel.ExternalSystem `json:"externalSystem"`
}

type CommentDataFields

type CommentDataFields struct {
	Content          string
	ContentType      string
	AuthorUserId     *string
	CommentedIssueId *string
}

type CommentUpdateEvent

type CommentUpdateEvent struct {
	Tenant         string                     `json:"tenant" validate:"required"`
	Content        string                     `json:"content"`
	ContentType    string                     `json:"contentType"`
	UpdatedAt      time.Time                  `json:"updatedAt"`
	Source         string                     `json:"source"`
	ExternalSystem commonmodel.ExternalSystem `json:"externalSystem,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL