form

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(db *database.GormDB, logger logging.Logger) form.Repository

NewStore creates a new form store

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements form.Repository interface

func (*Store) Count added in v0.2.0

func (s *Store) Count(ctx context.Context) (int, error)

Count returns the total number of forms

func (*Store) Create added in v0.2.0

func (s *Store) Create(ctx context.Context, formModel *model.Form) error

Create creates a new form

func (*Store) Delete added in v0.2.0

func (s *Store) Delete(ctx context.Context, id string) error

Delete deletes a form

func (*Store) GetActiveForms added in v0.2.0

func (s *Store) GetActiveForms(ctx context.Context) ([]*model.Form, error)

GetActiveForms returns all active forms

func (*Store) GetByID added in v0.2.0

func (s *Store) GetByID(ctx context.Context, id string) (*model.Form, error)

GetByID retrieves a form by ID

func (*Store) GetByUserID added in v0.2.0

func (s *Store) GetByUserID(ctx context.Context, userID string) ([]*model.Form, error)

GetByUserID retrieves all forms for a given user

func (*Store) GetFormSubmissions added in v0.2.0

func (s *Store) GetFormSubmissions(ctx context.Context, formID string) ([]*model.FormSubmission, error)

GetFormSubmissions retrieves all submissions for a form

func (*Store) GetFormsByStatus

func (s *Store) GetFormsByStatus(ctx context.Context, active bool) ([]*model.Form, error)

GetFormsByStatus returns forms by their active status

func (*Store) List added in v0.2.0

func (s *Store) List(ctx context.Context, offset, limit int) ([]*model.Form, error)

List returns a paginated list of forms

func (*Store) Search added in v0.2.0

func (s *Store) Search(ctx context.Context, query string, offset, limit int) ([]*model.Form, error)

Search searches forms by title or description

func (*Store) Update added in v0.2.0

func (s *Store) Update(ctx context.Context, formModel *model.Form) error

Update updates a form

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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