logic

package
v0.0.0-...-f2e39e4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenQuestionnaireExport

func BenQuestionnaireExport(ben, qID string, db qExportDatabase, uDB qUserLookup, u auth.User) (*impact.Export, error)

BenQuestionnaireExport creates a XLSX export of all the records for a particular beneficiary and a questionnaire

func QuestionnaireExport

func QuestionnaireExport(qID string, db qExportDatabase, uDB qUserLookup, u auth.User) (*impact.Export, error)

QuestionnaireExport creates a XLSX export of all the records belonging to a given questionnaire

func Report

func Report(args impact.ReportArgs, db ReportDB, u auth.User) (*impact.Report, error)

func ReportExport

func ReportExport(rArgs impact.ReportArgs, r *impact.Report, db ReportExportDatabase, uDB qUserLookup, u auth.User) (*impact.Export, error)

ReportExport converts a Report into an Export. It converts the report into a CSV file.

func ReportOnRecords

func ReportOnRecords(reportDuration time.Duration, minRequiredRecords int, records []impact.Meeting, questionnaire impact.OutcomeSet) (*impact.Report, error)

Types

type ReportDB

type ReportDB interface {
	GetOutcomeSet(id string, u auth.User) (impact.OutcomeSet, error)
	GetFilteredOSMeetingsForBeneficiaries(beneficiaries []string, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)
	GetFilteredOSMeetingsInTimeRange(start, end time.Time, outcomeSetID string, tags []string, or bool, u auth.User) ([]impact.Meeting, error)
}

type ReportExportDatabase

type ReportExportDatabase interface {
	GetOutcomeSet(id string, u auth.User) (impact.OutcomeSet, error)
}

Jump to

Keyboard shortcuts

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