pdf

package
v0.0.0-...-8ac9c69 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCompetenceByParent

func GetCompetenceByParent(competences map[string][]db.Competence, parent db.Competence) []db.Competence

func GetUserCompetencesByCompetenceId

func GetUserCompetencesByCompetenceId(userCompetences map[string][]db.UserCompetence, competence db.Competence) []db.UserCompetence

func Subjects

func Subjects(competences []db.Competence) []db.Competence

Types

type AllReportData

type AllReportData struct {
	Entries []EntryReportData
}

type Competence

type Competence struct {
	Name         string
	Level        int
	Color        string
	IsCompetence bool
	Competences  []Competence
}

type CompetenceStruct

type CompetenceStruct struct {
	Parents    []*db.Competence
	Competence *db.Competence
	Grades     string
}

type CompetencesData

type CompetencesData struct {
	Student db.User
	Teacher db.User
	Report  db.Report
}

type CompetencesTemplateData

type CompetencesTemplateData struct {
	OrganisationName          string
	OrganisationAddress       string
	OrganisationLogoURL       string
	StudentName               string
	StudentBirthday           string
	StudentGrade              string
	StudentMissedHours        string
	StudentMissedHoursExcused string
	SchoolYear                string
	Competences               []Competence
}

type EntryReportData

type EntryReportData struct {
	Entry       db.Entry
	Date        string
	CreatedAt   string
	Competences []CompetenceStruct
}

type FootData

type FootData struct {
	CreatorFullName string
	CreatedAt       string
	From            string
	To              string
}

type Generator

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

func NewPDFReportsGenerator

func NewPDFReportsGenerator(cfg config.ReportGenerationConfig) *Generator

func (*Generator) AllEntriesReportData

func (g *Generator) AllEntriesReportData(report db.Report) (*AllReportData, error)

func (*Generator) BaseCompetencesReportData

func (g *Generator) BaseCompetencesReportData(ctx context.Context, report db.Report) (*CompetencesTemplateData, error)

func (*Generator) CompetencesReportData

func (g *Generator) CompetencesReportData(report db.Report) (*CompetencesTemplateData, error)

func (*Generator) EntriesReportData

func (g *Generator) EntriesReportData(report db.Report) (*ReportData, error)

func (*Generator) GeneratePDF

func (g *Generator) GeneratePDF(report db.Report) error

func (*Generator) LearnedCompetencesReportData

func (g *Generator) LearnedCompetencesReportData(report db.Report) (*CompetencesTemplateData, error)

func (*Generator) UpdateReportStatus

func (g *Generator) UpdateReportStatus(reportId string, status db.ReportStatus) error

func (*Generator) UploadPDFToBucket

func (g *Generator) UploadPDFToBucket(report db.Report, pdf []byte) error

type HeadData

type HeadData struct {
	ReportKind      string
	StudentFullName string
}

type ReportData

type ReportData struct {
	Entries []struct {
		Entry           db.Entry
		Date            string
		CreatedAt       string
		User            db.User
		UserCompetences []struct {
			UserCompetence []db.UserCompetence
			Parents        []db.Competence
			Competence     db.Competence
			Grades         string
			AtLeastOne     bool
			AtLeastTwo     bool
			AtLeastThree   bool
		}
	}
}

Jump to

Keyboard shortcuts

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