models

package
v0.0.0-...-99e730b Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReportModel

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

ReportModel handles MongoDB operations for report documents

func NewReportModel

func NewReportModel(docDB documents.DocumentDB) *ReportModel

NewReportModel creates a new report model instance

func (*ReportModel) AddReportExecution

func (m *ReportModel) AddReportExecution(ctx context.Context, id string, execution schema.ReportExecutionDoc) error

AddReportExecution adds an execution record to the report's recent executions

func (*ReportModel) CountReports

func (m *ReportModel) CountReports(ctx context.Context, filter bson.M) (int64, error)

CountReports returns the count of reports matching the filter

func (*ReportModel) CreateIndexes

func (m *ReportModel) CreateIndexes(ctx context.Context) error

CreateIndexes creates the required indexes for the Reports collection

func (*ReportModel) CreateReport

func (m *ReportModel) CreateReport(ctx context.Context, report *schema.ReportDocument) (string, error)

CreateReport creates a new report document in MongoDB

func (*ReportModel) DeleteReport

func (m *ReportModel) DeleteReport(ctx context.Context, id string) error

DeleteReport soft deletes a report document (sets active to false)

func (*ReportModel) GetDefaultReport

func (m *ReportModel) GetDefaultReport(ctx context.Context) (*schema.ReportDocument, error)

GetDefaultReport retrieves the default report

func (*ReportModel) GetReportByID

func (m *ReportModel) GetReportByID(ctx context.Context, id string) (*schema.ReportDocument, error)

GetReportByID retrieves a report document by its ID

func (*ReportModel) GetReportByName

func (m *ReportModel) GetReportByName(ctx context.Context, name string) (*schema.ReportDocument, error)

GetReportByName retrieves a report document by name

func (*ReportModel) GetReportsByCategory

func (m *ReportModel) GetReportsByCategory(ctx context.Context, category string, opts *documents.FindOptions) ([]*schema.ReportDocument, error)

GetReportsByCategory retrieves reports by category

func (*ReportModel) HardDeleteReport

func (m *ReportModel) HardDeleteReport(ctx context.Context, id string) error

HardDeleteReport permanently deletes a report document

func (*ReportModel) ListReports

func (m *ReportModel) ListReports(ctx context.Context, filter bson.M, opts *documents.FindOptions) ([]*schema.ReportDocument, error)

ListReports retrieves reports with filtering, sorting, and pagination

func (*ReportModel) SearchReports

func (m *ReportModel) SearchReports(ctx context.Context, searchText string, opts *documents.FindOptions) ([]*schema.ReportDocument, error)

SearchReports performs a text search on report names and descriptions

func (*ReportModel) UpdateManyReports

func (m *ReportModel) UpdateManyReports(ctx context.Context, filter bson.M, update bson.M) (int64, error)

UpdateManyReports updates multiple report documents matching the filter

func (*ReportModel) UpdateReport

func (m *ReportModel) UpdateReport(ctx context.Context, id string, update bson.M) error

UpdateReport updates a report document

func (*ReportModel) UpdateReportRevision

func (m *ReportModel) UpdateReportRevision(ctx context.Context, id string, modifiedBy string) error

UpdateReportRevision creates a new revision of the report

Jump to

Keyboard shortcuts

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