entries

package
v0.0.0-...-1f6e3fe Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	UUID        uuid.UUID      `gorm:"type:uuid;primaryKey" json:"uuid" binding:"-"`
	CreatedAt   time.Time      `json:"createdAt" binding:"-"`
	UpdatedAt   time.Time      `json:"updatedAt" binding:"-"`
	DeletedAt   gorm.DeletedAt `json:"-" binding:"-"`
	Date        time.Time      `json:"date" binding:"required"`
	Type        bool           `json:"type" binding:"required"`
	Pending     bool           `json:"pending"`
	Name        string         `json:"name" binding:"required"`
	Value       float64        `json:"value" binding:"required"`
	Description string         `json:"description"  `
	IsTransfer  bool           `json:"isTransfer"`
	Origin      uuid.UUID      `json:"origin"`
	Category    uuid.UUID      `json:"category" binding:"required" gorm:"index,not null"`
	Account     uuid.UUID      `json:"account" binding:"required" gorm:"index,not null"`
	Owner       uuid.UUID      `gorm:"index,not null" json:"owner" `
}

Entry to iterate with database

func (*Entry) BeforeCreate

func (e *Entry) BeforeCreate(scope *gorm.DB) error

BeforeCreate execute commands before creating a Entry

func (Entry) TableName

func (Entry) TableName() string

TableName returns Entry table name

type EntryTag

type EntryTag struct {
	UUID      uuid.UUID  `gorm:"type:uuid;primaryKey" json:"uuid" binding:"-"`
	CreatedAt time.Time  `json:"createdAt" binding:"-"`
	UpdatedAt time.Time  `json:"updatedAt" binding:"-"`
	DeletedAt *time.Time `json:"-" binding:"-"`
	Entry     uuid.UUID  `gorm:"index:entry_tag_entry;not null" json:"entry" `
	Tag       uuid.UUID  `gorm:"index:entry_tag_tag;not null" json:"tag" `
}

EntryTag is a association between Entry and Tag entities

func (*EntryTag) BeforeCreate

func (e *EntryTag) BeforeCreate(scope *gorm.DB) (err error)

BeforeCreate execute command before creating a EntryTag

func (EntryTag) TableName

func (EntryTag) TableName() string

TableName returns Entry table name

type Repository

type Repository interface {
	Delete(ctx context.Context, pk uuid.UUID, owner uuid.UUID) error
	Get(ctx context.Context, pk uuid.UUID, owner uuid.UUID) (*Entry, error)
	Save(ctx context.Context, row *Entry) error
	Query(ctx context.Context, filters *rest.Query) ([]Entry, error)
}

Repository interface defines methods to manipute user entries

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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