{"modulePath":"github.com/oak/github-notifier","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pullrequest\n\n## Constants\n\n```go\nconst (\n\tEventNewPullRequestDetected = \"NewPullRequestDetected\"\n\tEventActivityDetected       = \"ActivityDetected\"\n\tEventMerged                 = \"Merged\"\n\tEventClosed                 = \"Closed\"\n\tEventStatusChanged          = \"StatusChanged\"\n\tEventReviewStateChanged     = \"ReviewStateChanged\"\n\tEventPipelineStatusChanged  = \"PipelineStatusChanged\"\n)\n```\nEventName constants for event type identification (used by event bus subscriptions)\n\n## Variables\n\n```go\nvar (\n\t// ErrInvalidPRIdentifier indicates an invalid PR identifier\n\tErrInvalidPRIdentifier = errors.New(\"invalid pull request identifier\")\n)\n```\n\n## Functions\n\n```go\nfunc ActivityIgnoreFilter(cfg *IgnoreConfig, repo, eventName, author, eventDetail string) bool\n```\nActivityIgnoreFilter reports whether an event should be suppressed based on the provided IgnoreConfig. It returns true if the event should be ignored.\n\nParameters:\n\n  - cfg:         the loaded ignore configuration; must not be nil.\n  - repo:        the repository name in \"owner/repo\" form.\n  - eventName:   the domain event name constant (e.g. EventPipelineStatusChanged).\n  - author:      the GitHub login of the actor that triggered the event.\n  - eventDetail: an optional sub-type string (e.g. pipeline status, review state, activity type). Used for event:detail matching in Except lists.\n\n## Types\n\n```go\ntype Activity struct {\n\t// contains filtered or unexported fields\n}\n```\nActivity represents an activity/event on a pull request\n\n```go\nfunc NewActivity(\n\tprIdentifier PRIdentifier,\n\tactivityType ActivityType,\n\tauthor Author,\n\tcreatedAt time.Time,\n\tbody string,\n) *Activity\n```\nNewActivity creates a new activity\n\n```go\nfunc (a *Activity) Author() Author\n```\nAuthor returns the activity author\n\n```go\nfunc (a *Activity) Body() string\n```\nBody returns the activity body/content\n\n```go\nfunc (a *Activity) CreatedAt() time.Time\n```\nCreatedAt returns when the activity was created\n\n```go\nfunc (a *Activity) PRIdentifier() PRIdentifier\n```\nPRIdentifier returns the PR identifier\n\n```go\nfunc (a *Activity) Type() ActivityType\n```\nType returns the activity type\n\n```go\ntype ActivityCheckScheduler struct {\n\t// contains filtered or unexported fields\n}\n```\nActivityCheckScheduler is a thin stateful wrapper around the pure determineChecks and recordChecked functions. It owns lastCheckMap and supplies the current time so that call sites in use cases remain unchanged.\n\n```go\nfunc NewActivityCheckScheduler(recentThresholdHours int, staleCheckIntervalMin int) *ActivityCheckScheduler\n```\nNewActivityCheckScheduler creates a new activity check scheduler.\n\n```go\nfunc (s *ActivityCheckScheduler) DeterminePRsToCheck(prs []*PullRequest) *scheduleResult\n```\nDeterminePRsToCheck calls determinePRsToCheckAt with the current time.\n\n```go\nfunc (s *ActivityCheckScheduler) MarkCheckedAt(now time.Time, prs []*PullRequest)\n```\nMarkCheckedAt records that the given PRs were checked at the given time. Thin wrapper around recordChecked using the scheduler's owned state.\n\n```go\nfunc (s *ActivityCheckScheduler) SeedLastChecked(url string, t time.Time)\n```\nSeedLastChecked pre-populates the last-check timestamp for a single PR URL. Used to restore the scheduler's state after a process restart so that stale PRs that were recently checked are not immediately re-checked. Zero-value timestamps are ignored.\n\n```go\ntype ActivityDetected struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tActivity      *Activity\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nActivityDetected is raised when new activity is detected on a PR\n\n```go\nfunc NewActivityDetected(pr *PullRequest, activity *Activity) ActivityDetected\n```\nNewActivityDetected creates a new event for a single activity\n\n```go\nfunc NewActivityDetectedAt(pr *PullRequest, activity *Activity, at time.Time) ActivityDetected\n```\nNewActivityDetectedAt creates a new event with an explicit timestamp\n\n```go\nfunc (e *ActivityDetected) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e ActivityDetected) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype ActivityType string\n```\nActivityType represents the type of activity\n\n```go\nconst (\n\tActivityTypeComment  ActivityType = \"comment\"\n\tActivityTypeReview   ActivityType = \"review\"\n\tActivityTypeCommit   ActivityType = \"commit\"\n\tActivityTypeReaction ActivityType = \"reaction\"\n\tActivityTypePush     ActivityType = \"push\"\n)\n```\n\n```go\ntype Author struct {\n\t// contains filtered or unexported fields\n}\n```\nAuthor represents a GitHub user\n\n```go\nfunc NewAuthor(login string) (Author, error)\n```\nNewAuthor creates a new author value object with validation\n\n```go\nfunc (a Author) Equals(other Author) bool\n```\nEquals compares two authors\n\n```go\nfunc (a Author) Login() string\n```\nLogin returns the author's GitHub username\n\n```go\nfunc (a Author) String() string\n```\nString returns a string representation\n\n```go\ntype Closed struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nClosed is raised when a PR is closed\n\n```go\nfunc NewClosed(pr *PullRequest) Closed\n```\nNewClosed creates a new event\n\n```go\nfunc NewClosedAt(pr *PullRequest, at time.Time) Closed\n```\nNewClosedAt creates a new event with an explicit timestamp\n\n```go\nfunc (e *Closed) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e Closed) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype Event interface {\n\tOccurredAt() time.Time\n\tName() string\n}\n```\nEvent is the base interface for domain events\n\n```go\ntype FilterFn func([]*PullRequest) []*PullRequest\n```\nFilterFn is a pure function from PR slice → filtered PR slice.\n\n```go\nfunc NewDraftFilter(includeDrafts bool) FilterFn\n```\nNewDraftFilter returns the appropriate FilterFn based on configuration. When includeDrafts is true, the returned function is a no-op passthrough. When includeDrafts is false, the returned function strips all draft PRs.\n\n```go\ntype IgnoreActorRule struct {\n\tLogin  string\n\tEvents []string\n\tExcept []string\n}\n```\nIgnoreActorRule filters events from a specific actor (GitHub login). Events and Except narrow which event types are suppressed for this actor. If Events is empty, all event types from this actor are suppressed (subject to Except).\n\n```go\ntype IgnoreConfig struct {\n\tIgnore IgnoreRuleSet\n}\n```\nIgnoreConfig holds user-defined rules for suppressing notifications. It is a pure domain type with no serialisation concerns; the infrastructure layer is responsible for loading it from storage (e.g. ignore.yaml) and mapping it to this type before injecting it into the application layer.\n\n```go\ntype IgnoreRuleSet struct {\n\tGlobal IgnoreScope\n\tRepos  map[string]IgnoreScope\n}\n```\nIgnoreRuleSet contains the global and per-repository ignore rules.\n\n```go\ntype IgnoreScope struct {\n\tEvents     []string\n\tExcept     []string\n\tRepos      []string\n\tAuthoredBy []IgnoreActorRule\n}\n```\nIgnoreScope holds ignore rules that apply either globally or to a specific repository.\n\n  - Events: ignore all events of these types, regardless of author.\n  - Except: never ignore these specific event:detail combinations even when Events matches.\n  - Repos: (global scope only) ignore all events from these repositories.\n  - AuthoredBy: per-author rules; each entry can further restrict by events/except.\n\n```go\ntype Merged struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nMerged is raised when a PR is merged\n\n```go\nfunc NewMerged(pr *PullRequest) Merged\n```\nNewMerged creates a new event\n\n```go\nfunc NewMergedAt(pr *PullRequest, at time.Time) Merged\n```\nNewMergedAt creates a new event with an explicit timestamp\n\n```go\nfunc (e *Merged) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e Merged) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype NewPullRequestDetected struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tAuthor        Author\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nNewPullRequestDetected is raised when a new PR is detected\n\n```go\nfunc NewNewPullRequestDetected(pr *PullRequest) NewPullRequestDetected\n```\nNewNewPullRequestDetected creates a new event\n\n```go\nfunc NewNewPullRequestDetectedAt(pr *PullRequest, at time.Time) NewPullRequestDetected\n```\nNewNewPullRequestDetectedAt creates a new event with an explicit timestamp\n\n```go\nfunc (e *NewPullRequestDetected) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e NewPullRequestDetected) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype PRActivityData struct {\n\tActivities     []*Activity\n\tHeadCommitSHA  *string\n\tPipelineStatus *PipelineStatus\n}\n```\nPRActivityData contains fetch-only enrichment facts for a PR. It is keyed by PR URL in PullRequestRepository.FetchActivities results. Optional fields are represented as pointers so callers can distinguish between \"not present in response\" and a concrete value.\n\n```go\ntype PRIdentifier struct {\n\t// contains filtered or unexported fields\n}\n```\nPRIdentifier uniquely identifies a pull request\n\n```go\nfunc NewPRIdentifier(url string, number int) (PRIdentifier, error)\n```\nNewPRIdentifier creates a new pull request identifier with validation\n\n```go\nfunc (id PRIdentifier) Equals(other PRIdentifier) bool\n```\nEquals compares two PR identifiers\n\n```go\nfunc (id PRIdentifier) Number() int\n```\nNumber returns the pull request number\n\n```go\nfunc (id PRIdentifier) String() string\n```\nString returns a string representation\n\n```go\nfunc (id PRIdentifier) URL() string\n```\nURL returns the pull request URL\n\n```go\ntype PRStatus int\n```\nPRStatus represents the status of a pull request\n\n```go\nconst (\n\t// StatusOpen indicates the PR is open\n\tStatusOpen PRStatus = iota\n\t// StatusMerged indicates the PR has been merged\n\tStatusMerged\n\t// StatusClosed indicates the PR has been closed without merging\n\tStatusClosed\n)\n```\n\n```go\nfunc (s PRStatus) IsOpen() bool\n```\nIsOpen returns true if the PR is open\n\n```go\nfunc (s PRStatus) MarshalText() ([]byte, error)\n```\nMarshalText implements encoding.TextMarshaler so PRStatus serialises as a human-readable string (\"open\", \"merged\", \"closed\") in JSON and other text-based formats.\n\n```go\nfunc (s PRStatus) String() string\n```\nString returns a string representation of the status\n\n```go\nfunc (s *PRStatus) UnmarshalText(text []byte) error\n```\nUnmarshalText implements encoding.TextUnmarshaler.\n\n```go\ntype PRTrackingRepository interface {\n\tFetch(prIdentifier PRIdentifier) (*PullRequest, error)\n\n\tLoadAll() ([]*PullRequest, error)\n\n\tUpdate(pullRequest *PullRequest) error\n\n\tSave(pullRequests []*PullRequest) error\n\n\tIsEmpty() bool\n\n\tClear() error\n}\n```\nPRTrackingRepository is the port for persisting the locally-tracked state of open pull requests across process restarts. It stores the identity and mutable fields that cannot be cheaply re-derived from the GitHub API each cycle (head commit SHA, pipeline status, last activity check timestamp, reviews, etc.).\n\nAdapters must treat Save as a full replacement of the stored set — it is not an upsert. Only open PRs are ever stored; closed/merged PRs are excluded before Save is called.\n\n```go\ntype PipelineStatus int\n```\nPipelineStatus represents the CI/CD pipeline (status check rollup) state of a PR\n\n```go\nconst (\n\t// PipelineStatusUnknown means no pipeline data is available\n\tPipelineStatusUnknown PipelineStatus = iota\n\t// PipelineStatusRunning means one or more checks are pending/in progress\n\tPipelineStatusRunning\n\t// PipelineStatusSuccess means all checks passed\n\tPipelineStatusSuccess\n\t// PipelineStatusFailed means one or more checks failed\n\tPipelineStatusFailed\n)\n```\n\n```go\nfunc (p PipelineStatus) Emoji() string\n```\nEmoji returns a display emoji for the pipeline status\n\n```go\nfunc (p PipelineStatus) Label() string\n```\nLabel returns a human-readable label for the pipeline status (e.g. \"Passed\", \"Failed\")\n\n```go\nfunc (p PipelineStatus) MarshalText() ([]byte, error)\n```\nMarshalText implements encoding.TextMarshaler so PipelineStatus serialises as a stable lowercase string in JSON and other text-based formats.\n\n```go\nfunc (p PipelineStatus) String() string\n```\nString returns a string representation of the pipeline status\n\n```go\nfunc (p *PipelineStatus) UnmarshalText(text []byte) error\n```\nUnmarshalText implements encoding.TextUnmarshaler.\n\n```go\ntype PipelineStatusChanged struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tOldStatus     PipelineStatus\n\tNewStatus     PipelineStatus\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nPipelineStatusChanged is raised when the CI/CD pipeline rollup status changes on a PR\n\n```go\nfunc NewPipelineStatusChanged(pr *PullRequest, oldStatus, newStatus PipelineStatus) PipelineStatusChanged\n```\nNewPipelineStatusChanged creates a new PipelineStatusChanged event\n\n```go\nfunc NewPipelineStatusChangedAt(pr *PullRequest, oldStatus, newStatus PipelineStatus, at time.Time) PipelineStatusChanged\n```\nNewPipelineStatusChangedAt creates a new PipelineStatusChanged event with an explicit timestamp\n\n```go\nfunc (e *PipelineStatusChanged) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e PipelineStatusChanged) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype PullRequest struct {\n\t// contains filtered or unexported fields\n}\n```\nPullRequest is the aggregate root for pull request domain\n\n```go\nfunc ClassifyPRs(prs []*PullRequest, since time.Time) (trulyNew, withActivity []*PullRequest)\n```\nClassifyPRs separates PRs into two categories: - trulyNew: Brand new PRs without recent activity - withActivity: PRs that have activity since the given time\n\nThis classification is used to determine notification messages and tracking semantics\n\n```go\nfunc NewPullRequest(\n\turl string,\n\tnumber int,\n\ttitle string,\n\trepository RepositoryInfo,\n\tauthor Author,\n\tcreatedAt time.Time,\n\tisDraft bool,\n) (*PullRequest, error)\n```\nNewPullRequest creates a new pull request with validation\n\n```go\nfunc ReconstitutePR(\n\tidentifier PRIdentifier,\n\ttitle string,\n\trepository RepositoryInfo,\n\tauthor Author,\n\tstatus PRStatus,\n\tcreatedAt time.Time,\n\tisDraft bool,\n\tactivities []*Activity,\n\tlastActivityCheck time.Time,\n\theadCommitSHA string,\n\treviews map[string]*Review,\n\tpipelineStatus PipelineStatus,\n\tseen bool,\n) *PullRequest\n```\n\n```go\nfunc (pr *PullRequest) Activities() []*Activity\n```\nActivities returns all activities for this PR\n\n```go\nfunc (pr *PullRequest) ActivitiesSince(since time.Time) []*Activity\n```\nActivitiesSince returns activities that occurred after the given time\n\n```go\nfunc (pr *PullRequest) AddActivities(activities []*Activity) []Event\n```\nAddActivities adds multiple activities at once and returns all resulting events.\n\n```go\nfunc (pr *PullRequest) AddActivity(activity *Activity) []Event\n```\nAddActivity adds a new activity to the PR and returns an ActivityDetected event. This maintains the aggregate's consistency boundary and follows the same pattern as Close/Merge which raise StatusChanged events. Returns nil for a nil activity.\n\n```go\nfunc (pr *PullRequest) AddReview(review *Review) []Event\n```\nAddReview adds or updates a review for a specific reviewer. If the reviewer already has a review with the same state, this is a no-op. If the state changed, it returns a ReviewStateChanged event. Returns nil for a nil review or when the state is unchanged.\n\n```go\nfunc (pr *PullRequest) AgeAt(now time.Time) time.Duration\n```\nAgeAt returns how long ago the PR was created, relative to the given time.\n\n```go\nfunc (pr *PullRequest) Author() Author\n```\nAuthor returns the PR author\n\n```go\nfunc (pr *PullRequest) AuthorLogin() string\n```\nAuthorLogin returns the author's login\n\n```go\nfunc (pr *PullRequest) ClearActivities()\n```\nClearActivities clears all activities (useful for testing or rebuilding state)\n\n```go\nfunc (pr *PullRequest) Close() []Event\n```\nClose marks the PR as closed and returns a Closed domain event. Returns nil if the PR is already closed.\n\n```go\nfunc (pr *PullRequest) CreatedAt() time.Time\n```\nCreatedAt returns when the PR was created\n\n```go\nfunc (pr *PullRequest) Equals(other *PullRequest) bool\n```\nEquals compares two pull requests by their identifier\n\n```go\nfunc (pr *PullRequest) HasActivitiesSince(since time.Time) bool\n```\nHasActivitiesSince returns true if there are any activities after the given time\n\n```go\nfunc (pr *PullRequest) HeadCommitSHA() string\n```\nHeadCommitSHA returns the current head commit SHA\n\n```go\nfunc (pr *PullRequest) Identifier() PRIdentifier\n```\nIdentifier returns the unique identifier for this PR\n\n```go\nfunc (pr *PullRequest) IsDraft() bool\n```\nIsDraft returns whether the PR is a draft\n\n```go\nfunc (pr *PullRequest) IsOpen() bool\n```\nIsOpen returns true if the PR is open\n\n```go\nfunc (pr *PullRequest) IsSeen() bool\n```\nIsSeen returns true if the PR has been marked as seen\n\n```go\nfunc (pr *PullRequest) IsStaleAt(now time.Time, threshold time.Duration) bool\n```\nIsStaleAt returns true if the PR is older than the given threshold at the given time.\n\n```go\nfunc (pr *PullRequest) LastActivityAt() time.Time\n```\nLastActivityAt returns when the last activity occurred\n\n```go\nfunc (pr *PullRequest) LastActivityCheck() time.Time\n```\nLastActivityCheck returns when we last checked for activities\n\n```go\nfunc (pr *PullRequest) MarkAsNewlyDetected() []Event\n```\nMarkAsNewlyDetected marks this PR as newly detected and returns the appropriate event.\n\n```go\nfunc (pr *PullRequest) MarkAsSeen()\n```\n\n```go\nfunc (pr *PullRequest) MarkAsUnseen()\n```\n\n```go\nfunc (pr *PullRequest) Merge() []Event\n```\nMerge marks the PR as merged and returns a Merged domain event. Returns nil if the PR is already merged.\n\n```go\nfunc (pr *PullRequest) Number() int\n```\nNumber returns the PR number\n\n```go\nfunc (pr *PullRequest) PipelineStatus() PipelineStatus\n```\nPipelineStatus returns the current CI/CD pipeline rollup status\n\n```go\nfunc (pr *PullRequest) RecordHeadCommitUpdate(newHeadSHA string) []Event\n```\nRecordHeadCommitUpdate detects if the head commit has changed and, if so, creates a push activity on the aggregate and returns an ActivityDetected event. The aggregate records all domain facts; notification filtering (e.g. suppressing self-pushes) is handled by the notification event handler. First-time initialization (empty current SHA) records the SHA without creating activity.\n\n```go\nfunc (pr *PullRequest) RecordHeadCommitUpdateAt(newHeadSHA string, now time.Time) []Event\n```\nRecordHeadCommitUpdateAt detects if the head commit has changed and, if so, creates a push activity on the aggregate and returns an ActivityDetected event. The aggregate records all domain facts; notification filtering (e.g. suppressing self-pushes) is handled by the notification event handler. First-time initialization (empty current SHA) records the SHA without creating activity.\n\n```go\nfunc (pr *PullRequest) Repository() RepositoryInfo\n```\nRepository returns the repository this PR belongs to\n\n```go\nfunc (pr *PullRequest) RepositoryName() string\n```\nRepositoryName returns the repository name with owner\n\n```go\nfunc (pr *PullRequest) ReviewSummary() *ReviewSummary\n```\nReviewSummary returns a ReviewSummary for display purposes\n\n```go\nfunc (pr *PullRequest) Reviews() map[string]*Review\n```\nReviews returns the current reviews map (copy)\n\n```go\nfunc (pr *PullRequest) Seen() bool\n```\n\n```go\nfunc (pr *PullRequest) SetHeadCommitSHA(sha string)\n```\nSetHeadCommitSHA sets the head commit SHA without raising any events. Used to restore or reset the known baseline across cycles.\n\n```go\nfunc (pr *PullRequest) SetInitialActivities(activities []*Activity)\n```\nSetInitialActivities hydrates the PR with activities during reconstruction (e.g. from the GitHub API) without raising domain events. Use this for data loading; use AddActivity / AddActivities only when new activity is discovered during business logic.\n\n```go\nfunc (pr *PullRequest) SetLastActivityCheck(t time.Time)\n```\nSetLastActivityCheck sets the last-activity-check timestamp without raising any events. Used both to restore a prior cycle's baseline (hydration) and to stamp the current check time after enrichment.\n\n```go\nfunc (pr *PullRequest) SetPipelineStatus(status PipelineStatus)\n```\nSetPipelineStatus sets the pipeline status without raising any events. Use this to restore or reset the baseline so that UpdatePipelineStatus can correctly detect changes vs. no-ops across check cycles.\n\n```go\nfunc (pr *PullRequest) SetReviews(reviews map[string]*Review)\n```\nSetReviews replaces the reviews map without raising events. Defensive-copies the supplied map so callers cannot mutate aggregate state after the call. Use this to restore a prior baseline (hydration or rollback for change detection); use AddReview when a new review is discovered during a cycle.\n\n```go\nfunc (pr *PullRequest) Status() PRStatus\n```\nStatus returns the current status\n\n```go\nfunc (pr *PullRequest) Title() string\n```\nTitle returns the pull request title\n\n```go\nfunc (pr *PullRequest) URL() string\n```\nURL returns the PR URL\n\n```go\nfunc (pr *PullRequest) UpdatePipelineStatus(newStatus PipelineStatus) []Event\n```\nUpdatePipelineStatus updates the pipeline status and returns a PipelineStatusChanged event if the status has changed. Returns nil when the status is unchanged.\n\n```go\ntype PullRequestRepository interface {\n\tFetchRequestedReviews() ([]*PullRequest, error)\n\n\tFetchUserCreated() ([]*PullRequest, error)\n\n\t// FetchActivities fetches raw activity/enrichment facts for the given PRs\n\t// since the provided time. Adapters return data only; aggregate mutation and\n\t// domain event creation/publishing happen in the application/domain layers.\n\tFetchActivities(prs []*PullRequest, since time.Time) (map[string]PRActivityData, error)\n\n\t// FetchPRStatus fetches the current status of a specific PR (open, merged, closed).\n\tFetchPRStatus(owner, repo string, number int) (PRStatus, error)\n\n\t// AuthenticatedUser returns the login of the authenticated user.\n\tAuthenticatedUser() string\n}\n```\nPullRequestRepository is the port for fetching pull requests from external sources\n\n```go\ntype RepositoryInfo struct {\n\t// contains filtered or unexported fields\n}\n```\nRepositoryInfo represents a GitHub repository\n\n```go\nfunc NewRepository(nameWithOwner string) (RepositoryInfo, error)\n```\nNewRepository creates a new repository value object with validation\n\n```go\nfunc (r RepositoryInfo) Equals(other RepositoryInfo) bool\n```\nEquals compares two repositories\n\n```go\nfunc (r RepositoryInfo) Name() string\n```\nName returns the repository name\n\n```go\nfunc (r RepositoryInfo) NameWithOwner() string\n```\nNameWithOwner returns the full repository name (owner/repo)\n\n```go\nfunc (r RepositoryInfo) Owner() string\n```\nOwner returns the repository owner\n\n```go\nfunc (r RepositoryInfo) String() string\n```\nString returns a string representation\n\n```go\ntype Review struct {\n\t// contains filtered or unexported fields\n}\n```\nReview represents a single reviewer's latest review state on a pull request\n\n```go\nfunc NewReview(reviewer Author, state ReviewState, submittedAt time.Time) *Review\n```\nNewReview creates a new review value object\n\n```go\nfunc (r *Review) Reviewer() Author\n```\nReviewer returns the reviewer\n\n```go\nfunc (r *Review) State() ReviewState\n```\nState returns the review state\n\n```go\nfunc (r *Review) SubmittedAt() time.Time\n```\nSubmittedAt returns when the review was submitted\n\n```go\ntype ReviewState int\n```\nReviewState represents the state of a pull request review\n\n```go\nconst (\n\t// ReviewStateApproved indicates the reviewer approved the PR\n\tReviewStateApproved ReviewState = iota\n\t// ReviewStateChangesRequested indicates the reviewer requested changes\n\tReviewStateChangesRequested\n\t// ReviewStateCommented indicates the reviewer left a comment without approving or requesting changes\n\tReviewStateCommented\n\t// ReviewStateDismissed indicates a previous review was dismissed\n\tReviewStateDismissed\n)\n```\n\n```go\nfunc (rs ReviewState) Emoji() string\n```\nEmoji returns a display emoji for the review state\n\n```go\nfunc (rs ReviewState) Label() string\n```\nLabel returns a human-readable label for the review state\n\n```go\nfunc (rs ReviewState) MarshalText() ([]byte, error)\n```\nMarshalText implements encoding.TextMarshaler so ReviewState serialises as a stable lowercase string in JSON and other text-based formats.\n\n```go\nfunc (rs ReviewState) String() string\n```\nString returns a string representation of the review state\n\n```go\nfunc (rs *ReviewState) UnmarshalText(text []byte) error\n```\nUnmarshalText implements encoding.TextUnmarshaler.\n\n```go\ntype ReviewStateChanged struct {\n\tPullRequestID PRIdentifier\n\tRepository    RepositoryInfo\n\tReviewer      Author\n\tState         ReviewState\n\tPullRequest   *PullRequest // Full PR for notification purposes\n\t// contains filtered or unexported fields\n}\n```\nReviewStateChanged is raised when a reviewer's review state changes on a PR\n\n```go\nfunc NewReviewStateChanged(pr *PullRequest, reviewer Author, state ReviewState) ReviewStateChanged\n```\nNewReviewStateChanged creates a new event\n\n```go\nfunc NewReviewStateChangedAt(pr *PullRequest, reviewer Author, state ReviewState, at time.Time) ReviewStateChanged\n```\nNewReviewStateChangedAt creates a new event with an explicit timestamp\n\n```go\nfunc (e *ReviewStateChanged) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e ReviewStateChanged) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n```go\ntype ReviewSummary struct {\n\t// contains filtered or unexported fields\n}\n```\nReviewSummary provides a formatted summary of all reviews on a PR\n\n```go\nfunc NewReviewSummary(reviews map[string]*Review) *ReviewSummary\n```\nNewReviewSummary creates a new review summary from a map of reviews\n\n```go\nfunc (rs *ReviewSummary) IsEmpty() bool\n```\nIsEmpty returns true if there are no reviews\n\n```go\nfunc (rs *ReviewSummary) ReviewersByState(state ReviewState) []string\n```\nReviewersByState returns reviewer logins for a given state\n\n```go\nfunc (rs *ReviewSummary) Reviews() map[string]*Review\n```\nReviews returns the individual reviews\n\n```go\ntype StatusChangeType string\n```\nStatusChangeType represents the type of status change\n\n```go\nconst (\n\tStatusChangeMerged StatusChangeType = \"merged\"\n\tStatusChangeClosed StatusChangeType = \"closed\"\n)\n```\n\n```go\ntype StatusChanged struct {\n\tPullRequestID PRIdentifier\n\tOldStatus     PRStatus\n\tNewStatus     PRStatus\n\t// contains filtered or unexported fields\n}\n```\nStatusChanged is raised when a PR status changes\n\n```go\nfunc NewStatusChanged(pr *PullRequest, oldStatus, newStatus PRStatus) StatusChanged\n```\nNewStatusChanged creates a new event\n\n```go\nfunc (e *StatusChanged) Name() string\n```\nName returns the event name constant\n\n```go\nfunc (e StatusChanged) OccurredAt() time.Time\n```\nOccurredAt returns when the event occurred\n\n","path":"github.com/oak/github-notifier/domain/pullrequest","name":"pullrequest","synopsis":"","isRedistributable":true}
