events

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package events contains the wire types for NATS events published by the project service. Any struct that appears in a NATS message payload lives here so other services can import the canonical definitions.

Convention: if a type is used in a NATS message payload it belongs in pkg/events, not internal/. Internal domain types may differ from event types; explicit converters in internal/service map between them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Username string `json:"username"`
	Name     string `json:"name"`
	Email    string `json:"email"`
}

Actor represents the user who triggered a settings change.

type InviteAccepted

type InviteAccepted struct {
	InviteUID string `json:"invite_uid"`
	Username  string `json:"username"`
}

InviteAccepted is the NATS event payload published by the LFX self-serve web app on lfx.invite.accepted when a user completes LFID account creation and accepts their invite. Resource services subscribe to this subject to promote the user from email-only to LFID and clean up pending invite state.

type InviteInfo

type InviteInfo struct {
	UID       string     `json:"uid"`
	Email     string     `json:"email"`
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
}

InviteInfo holds the pending invite metadata for a user without an LFID.

type ProjectSettings

type ProjectSettings struct {
	UID                 string     `json:"uid"`
	MissionStatement    string     `json:"mission_statement"`
	AnnouncementDate    *time.Time `json:"announcement_date"`
	Auditors            []UserInfo `json:"auditors"`
	Writers             []UserInfo `json:"writers"`
	MeetingCoordinators []UserInfo `json:"meeting_coordinators"`
	ExecutiveDirector   *UserInfo  `json:"executive_director,omitempty"`
	ProgramManager      *UserInfo  `json:"program_manager,omitempty"`
	OpportunityOwner    *UserInfo  `json:"opportunity_owner,omitempty"`
	CreatedAt           *time.Time `json:"created_at"`
	UpdatedAt           *time.Time `json:"updated_at"`
}

ProjectSettings is the project-settings representation used in event payloads.

type ProjectSettingsUpdatedMessage

type ProjectSettingsUpdatedMessage struct {
	ProjectUID  string          `json:"project_uid"`
	OldSettings ProjectSettings `json:"old_settings"`
	NewSettings ProjectSettings `json:"new_settings"`
	Actor       Actor           `json:"actor"`
}

ProjectSettingsUpdatedMessage is published on lfx.projects-api.project_settings.updated whenever project settings change. It carries both the before and after states so subscribers can diff them.

type UserInfo

type UserInfo struct {
	Name     string      `json:"name"`
	Email    string      `json:"email"`
	Username string      `json:"username"`
	Avatar   string      `json:"avatar"`
	Invite   *InviteInfo `json:"invite,omitempty"`
}

UserInfo is the user representation used in project event payloads.

Jump to

Keyboard shortcuts

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