pdfbuilder

package
v0.0.0-...-9d843bf Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

Types

type CBFFBuilder

type CBFFBuilder interface {
	GeneratePDF(dto *CBFFBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

func NewCBFFBuilder

func NewCBFFBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) CBFFBuilder

type CBFFBuilderRequestDTO

type CBFFBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`   // 1 = 'No Cover Date Year
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"` // 13 = label: "No Cover Date Month"
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	IsKeyIssue                         bool                            `bson:"is_key_issue" json:"is_key_issue"`
	KeyIssue                           int8                            `bson:"key_issue" json:"key_issue"`
	KeyIssueOther                      string                          `bson:"key_issue_other" json:"key_issue_other"`
	KeyIssueDetail                     string                          `bson:"key_issue_detail" json:"key_issue_detail"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type CCBuilder

type CCBuilder interface {
	GeneratePDF(dto *CCBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

CCBuilder interface for building the "CPS C-Capsule Indie Mint Gem" edition document.

func NewCCBuilder

func NewCCBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) CCBuilder

type CCBuilderRequestDTO

type CCBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"`
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type CCIMGBuilder

type CCIMGBuilder interface {
	GeneratePDF(dto *CCIMGBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

CCIMGBuilder interface for building the "CPS C-Capsule Indie Mint Gem" edition document.

func NewCCIMGBuilder

func NewCCIMGBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) CCIMGBuilder

type CCIMGBuilderRequestDTO

type CCIMGBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"`
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type CCSCBuilder

type CCSCBuilder interface {
	GeneratePDF(dto *CCSCBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

CCSCBuilder interface for building the "CPS C-Capsule Indie Mint Gem" edition document.

func NewCCSCBuilder

func NewCCSCBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) CCSCBuilder

type CCSCBuilderRequestDTO

type CCSCBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"`
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type CCUGBuilder

type CCUGBuilder interface {
	GeneratePDF(dto *CCUGBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

CCUGBuilder interface for building the "CPS C-Capsule Indie Mint Gem" edition document.

func NewCCUGBuilder

func NewCCUGBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) CCUGBuilder

type CCUGBuilderRequestDTO

type CCUGBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"`
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type PCBuilder

type PCBuilder interface {
	GeneratePDF(dto *PCBuilderRequestDTO) (*PDFBuilderResponseDTO, error)
}

func NewPCBuilder

func NewPCBuilder(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) PCBuilder

type PCBuilderRequestDTO

type PCBuilderRequestDTO struct {
	CPSRN                              string                          `bson:"cpsrn" json:"cpSrn"`
	Filename                           string                          `bson:"filename" json:"filename"`
	SubmissionDate                     time.Time                       `bson:"submission_date" json:"submission_date"`
	Item                               string                          `bson:"item" json:"item"`
	SeriesTitle                        string                          `bson:"series_title" json:"series_title"`
	IssueVol                           string                          `bson:"issue_vol" json:"issue_vol"`
	IssueNo                            string                          `bson:"issue_no" json:"issue_no"`
	IssueCoverYear                     int64                           `bson:"issue_cover_year" json:"issue_cover_year"`   // 1 = 'No Cover Date Year
	IssueCoverMonth                    int8                            `bson:"issue_cover_month" json:"issue_cover_month"` // 13 = label: "No Cover Date Month"
	PublisherName                      string                          `bson:"publisher_name" json:"publisher_name"`
	IsKeyIssue                         bool                            `bson:"is_key_issue" json:"is_key_issue"`
	KeyIssue                           int8                            `bson:"key_issue" json:"key_issue"`
	KeyIssueOther                      string                          `bson:"key_issue_other" json:"key_issue_other"`
	KeyIssueDetail                     string                          `bson:"key_issue_detail" json:"key_issue_detail"`
	SpecialNotes                       string                          `bson:"special_notes" json:"special_notes"`
	GradingNotes                       string                          `bson:"grading_notes" json:"grading_notes"`
	CreasesFinding                     string                          `bson:"creases_finding" json:"creases_finding"`
	TearsFinding                       string                          `bson:"tears_finding" json:"tears_finding"`
	MissingPartsFinding                string                          `bson:"missing_parts_finding" json:"missing_parts_finding"`
	StainsFinding                      string                          `bson:"stains_finding" json:"stains_finding"`
	DistortionFinding                  string                          `bson:"distortion_finding" json:"distortion_finding"`
	PaperQualityFinding                string                          `bson:"paper_quality_finding" json:"paper_quality_finding"`
	SpineFinding                       string                          `bson:"spine_finding" json:"spine_finding"`
	CoverFinding                       string                          `bson:"cover_finding" json:"cover_finding"`
	ShowsSignsOfTamperingOrRestoration bool                            `bson:"shows_signs_of_tampering_or_restoration" json:"shows_signs_of_tampering_or_restoration"`
	GradingScale                       int8                            `bson:"grading_scale" json:"grading_scale"`
	OverallLetterGrade                 string                          `bson:"overall_letter_grade" json:"overall_letter_grade"`
	IsOverallLetterGradeNearMintPlus   bool                            `bson:"is_overall_letter_grade_near_mint_plus" json:"is_overall_letter_grade_near_mint_plus"`
	OverallNumberGrade                 float64                         `bson:"overall_number_grade" json:"overall_number_grade"`
	CpsPercentageGrade                 float64                         `bson:"cps_percentage_grade" json:"cps_percentage_grade"`
	InspectorFirstName                 string                          `bson:"inspector_first_name" json:"inspector_first_name"`
	InspectorLastName                  string                          `bson:"inspector_last_name" json:"inspector_last_name"`
	InspectorStoreName                 string                          `bson:"inspector_store_name" json:"inspector_store_name"`
	Signatures                         []*s_d.ComicSubmissionSignature `bson:"signatures" json:"signatures,omitempty"`
	PrimaryLabelDetails                int8                            `bson:"primary_label_details" json:"primary_label_details"`
	PrimaryLabelDetailsOther           string                          `bson:"primary_label_details_other" json:"primary_label_details_other"`
}

type PDFBuilderResponseDTO

type PDFBuilderResponseDTO struct {
	FileName string `json:"file_name"`
	FilePath string `json:"file_path"`
	Content  []byte `json:"content"`
}

Jump to

Keyboard shortcuts

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