Documentation
¶
Overview ¶
Package contract is the waitlist plugin's forge-dashboard contract surface. Six intents wrap the plugin's Store: list, detail, approve, reject, delete, counts.
Index ¶
- func Register(d *dispatcher.Dispatcher, reg contract.Registry, wreg contract.WardenRegistry, ...) error
- type ApproveInput
- type CountsResponse
- type DeleteInput
- type Deps
- type EntryList
- type EntryListRows
- type EntryQuery
- type EntryRow
- type EntrySummary
- type GetEntryInput
- type ListEntriesInput
- type RejectInput
- type WaitlistStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register( d *dispatcher.Dispatcher, reg contract.Registry, wreg contract.WardenRegistry, deps Deps, ) error
Types ¶
type ApproveInput ¶
type CountsResponse ¶
type DeleteInput ¶
type DeleteInput struct {
ID string `json:"id"`
}
type Deps ¶
type Deps struct {
Engine *authsome.Engine
Store WaitlistStore
}
type EntryList ¶
type EntryList struct {
Entries []EntrySummary `json:"entries"`
Total int `json:"total,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
}
EntryList wraps a paginated list response.
type EntryListRows ¶
type EntryQuery ¶
type EntryRow ¶
type EntryRow struct {
ID id.WaitlistID
AppID id.AppID
Email string
Name string
Status string
UserID *id.UserID
IPAddress string
Note string
CreatedAt time.Time
UpdatedAt time.Time
}
EntryRow + EntryQuery + EntryList are the package-internal wire types the plugin's Store fronts. They mirror waitlist.WaitlistEntry / WaitlistQuery / WaitlistList so the contract subpackage stays decoupled from the parent (cycle avoidance).
type EntrySummary ¶
type EntrySummary struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name,omitempty"`
Status string `json:"status"`
UserID string `json:"userId,omitempty"`
IPAddress string `json:"ipAddress,omitempty"`
Note string `json:"note,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
EntrySummary is the wire shape for waitlist.list rows.
type GetEntryInput ¶
type GetEntryInput struct {
ID string `json:"id"`
}
type ListEntriesInput ¶
type RejectInput ¶
type WaitlistStore ¶
type WaitlistStore interface {
GetEntry(ctx context.Context, id id.WaitlistID) (*EntryRow, error)
UpdateEntryStatus(ctx context.Context, id id.WaitlistID, status, note string) error
ListEntries(ctx context.Context, q *EntryQuery) (*EntryListRows, error)
CountByStatus(ctx context.Context, appID id.AppID) (pending, approved, rejected int, err error)
DeleteEntry(ctx context.Context, id id.WaitlistID) error
}
WaitlistStore is the surface this package needs from the waitlist plugin's Store.
Click to show internal directories.
Click to hide internal directories.