planning

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateDatabase

func UpdateDatabase(
	ctx context.Context,
	tx postgres.DBTX,
	doc newsdoc.Document,
	version int64,
) error

Types

type AssigneeLink struct {
	UUID uuid.UUID `newsdoc:"uuid"`
	Role string    `newsdoc:"role"`
}

type AssignmentBlock

type AssignmentBlock struct {
	ID           uuid.UUID         `newsdoc:"id"`
	Publish      *time.Time        `newsdoc:"data.publish"`
	PublishSlot  *int16            `newsdoc:"data.publish_slot"`
	Starts       time.Time         `newsdoc:"data.start"`
	Ends         *time.Time        `newsdoc:"data.end"`
	StartDate    time.Time         `newsdoc:"data.start_date,format=2006-01-02"`
	EndDate      time.Time         `newsdoc:"data.end_date,format=2006-01-02"`
	Status       *string           `newsdoc:"data.status"`
	FullDay      bool              `newsdoc:"data.full_day"`
	Public       bool              `newsdoc:"data.public"`
	Kind         []AssignmentKind  `newsdoc:"meta,type=core/assignment-type"`
	Assignees    []AssigneeLink    `newsdoc:"links,rel=assignee"`
	Deliverables []DeliverableLink `newsdoc:"links,rel=deliverable"`
}

type AssignmentKind

type AssignmentKind struct {
	Value string `newsdoc:"value"`
}
type DeliverableLink struct {
	UUID uuid.UUID `newsdoc:"uuid"`
	Type string    `newsdoc:"type"`
}

type DescriptionBlock

type DescriptionBlock struct {
	Role string `newsdoc:"role"`
	Text string `newsdoc:"data.text"`
}
type EventLink struct {
	UUID uuid.UUID `newsdoc:"uuid"`
}

type Item

type Item struct {
	UUID                uuid.UUID         `newsdoc:"uuid"`
	Title               string            `newsdoc:"title"`
	Meta                ItemMeta          `newsdoc:"meta,type=core/planning-item"`
	InternalDescription *DescriptionBlock `newsdoc:"meta,type=core/description,role=internal"`
	PublicDescription   *DescriptionBlock `newsdoc:"meta,type=core/description,role=public"`
	Assignments         []AssignmentBlock `newsdoc:"meta,type=core/assignment"`
	Event               *EventLink        `newsdoc:"links,type=core/event,rel=associated"`
}

func NewItemFromDocument

func NewItemFromDocument(doc newsdoc.Document) (*Item, error)

func (*Item) ToRows

func (p *Item) ToRows(version int64) (*Rows, error)

type ItemMeta

type ItemMeta struct {
	StartDate time.Time `newsdoc:"data.start_date,format=2006-01-02"`
	EndDate   time.Time `newsdoc:"data.end_date,format=2006-01-02"`
	Public    bool      `newsdoc:"data.public"`
	Tentative bool      `newsdoc:"data.tentative"`
	Priority  *int16    `newsdoc:"data.priority"`
}

Jump to

Keyboard shortcuts

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