opportunity

package
v0.0.0-...-a7da96f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OpportunityCreateV1              = "V1_OPPORTUNITY_CREATE"
	OpportunityUpdateV1              = "V1_OPPORTUNITY_UPDATE"
	OpportunityCreateRenewalV1       = "V1_OPPORTUNITY_CREATE_RENEWAL"
	OpportunityUpdateRenewalV1       = "V1_OPPORTUNITY_UPDATE_RENEWAL"
	OpportunityUpdateNextCycleDateV1 = "V1_OPPORTUNITY_UPDATE_NEXT_CYCLE_DATE"
	OpportunityCloseWinV1            = "V1_OPPORTUNITY_CLOSE_WIN"
	OpportunityCloseLooseV1          = "V1_OPPORTUNITY_CLOSE_LOOSE"
)
View Source
const (
	FieldMaskName              = "name"
	FieldMaskAmount            = "amount"
	FieldMaskMaxAmount         = "maxAmount"
	FieldMaskComments          = "comments"
	FieldMaskRenewalLikelihood = "renewalLikelihood"
	FieldMaskRenewalApproved   = "renewalApproved"
	FieldMaskRenewedAt         = "renewedAt"
	FieldMaskAdjustedRate      = "adjustedRate"
	FieldMaskExternalType      = "externalType"
	FieldMaskInternalType      = "internalType"
	FieldMaskExternalStage     = "externalStage"
	FieldMaskInternalStage     = "internalStage"
	FieldMaskEstimatedClosedAt = "estimatedClosedAt"
	FieldMaskOwnerUserId       = "ownerUserId"
	FieldMaskCurrency          = "currency"
	FieldMaskNextSteps         = "nextSteps"
	FieldMaskLikelihoodRate    = "likelihoodRate"
)
View Source
const (
	OpportunityAggregateType eventstore.AggregateType = "opportunity"
)

Variables

This section is empty.

Functions

func NewOpportunityCloseLooseEvent

func NewOpportunityCloseLooseEvent(aggregate eventstore.Aggregate, closedAt time.Time) (eventstore.Event, error)

func NewOpportunityCreateRenewalEvent

func NewOpportunityCreateRenewalEvent(aggregate eventstore.Aggregate, contractId, renewalLikelihood string, renewalApproved bool, source common.Source, createdAt, updatedAt time.Time, renewedAt *time.Time, adjustedRate int64) (eventstore.Event, error)

func NewOpportunityUpdateNextCycleDateEvent

func NewOpportunityUpdateNextCycleDateEvent(aggregate eventstore.Aggregate, updatedAt time.Time, renewedAt *time.Time) (eventstore.Event, error)

Types

type OpportunityAggregate

type OpportunityAggregate struct {
	*eventstore.CommonTenantIdAggregate
}

func NewOpportunityAggregateWithTenantAndID

func NewOpportunityAggregateWithTenantAndID(tenant, id string) *OpportunityAggregate

type OpportunityCloseLooseEvent

type OpportunityCloseLooseEvent struct {
	Tenant   string    `json:"tenant" validate:"required"`
	ClosedAt time.Time `json:"closedAt" validate:"required"`
}

type OpportunityCreateRenewalEvent

type OpportunityCreateRenewalEvent struct {
	Tenant              string        `json:"tenant" validate:"required"`
	CreatedAt           time.Time     `json:"createdAt"`
	UpdatedAt           time.Time     `json:"updatedAt"`
	Source              common.Source `json:"source"`
	ContractId          string        `json:"contractId" validate:"required"`
	InternalType        string        `json:"internalType"`
	InternalStage       string        `json:"internalStage"`
	RenewalLikelihood   string        `json:"renewalLikelihood" validate:"required" enums:"HIGH,MEDIUM,LOW,ZERO"`
	RenewalApproved     bool          `json:"renewalApproved,omitempty"`
	RenewedAt           *time.Time    `json:"renewedAt,omitempty"`
	RenewalAdjustedRate int64         `json:"renewalAdjustedRate" validate:"min=0,max=100"`
}

type OpportunityUpdateNextCycleDateEvent

type OpportunityUpdateNextCycleDateEvent struct {
	Tenant    string     `json:"tenant" validate:"required"`
	UpdatedAt time.Time  `json:"updatedAt"`
	RenewedAt *time.Time `json:"renewedAt"`
}

Jump to

Keyboard shortcuts

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