pelican/internal/board/card.go

31 lines
484 B
Go
Raw Normal View History

2023-05-06 12:49:40 +01:00
package board
// Card represents a card on a Kanban board.
type Card struct {
ID int
Title string
Description string
Created string
2023-05-06 12:49:40 +01:00
}
// SetID updates the ID of the Card value only if
// the ID is < 1 (i.e. unset).
func (c *Card) SetID(id int) error {
if id < 1 {
return InvalidIDError{id}
}
if c.ID > 0 {
return IDAlreadySetError{}
}
2023-05-06 12:49:40 +01:00
c.ID = id
return nil
2023-05-06 12:49:40 +01:00
}
// GetID returns the ID of the Card value.
func (c *Card) GetID() int {
2023-05-06 12:49:40 +01:00
return c.ID
}