Skip to content

add a pdf generator for invoices - #665

Open
rawdaGastan wants to merge 9 commits into
development_flat_paymentfrom
development_invoices_pdf
Open

add a pdf generator for invoices#665
rawdaGastan wants to merge 9 commits into
development_flat_paymentfrom
development_invoices_pdf

Conversation

@rawdaGastan

Copy link
Copy Markdown
Collaborator

@rawdaGastan
rawdaGastanforce-pushed the development_invoices_pdf branch from cb24c71 to 70768d9CompareJanuary 13, 2025 12:34
@rawdaGastan
rawdaGastanforce-pushed the development_flat_payment branch from 26ced02 to 8f86730CompareJanuary 14, 2025 13:58
Comment threadserver/internal/pdf_generator.go Outdated
startX float64 = 25
startY float64 = 30

logoPath = "internal/img/codescalers.png"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this name more generic so it can be replaced e.g with threefold logo or any other company?

Comment threadserver/internal/email_sender.go Outdated

// SendMail sends verification mails
func SendMail(sender, sendGridKey, receiver, subject, bodystring) error {
func SendMail(sender, sendGridKey, receiver, subject, body, attachmentName string, attachmentBytes ...[]byte) error {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make it a Mailer that can be initialized with a Key e.g NewMailer(sendGridKey)

And then We can SendMail(sender, receiver, subject, body, attachments []Attachment)

and Attachments to be a struct of a name and bytes

LastReminderAt time.Time `json:"last_reminder_at"`
CreatedAt time.Time `json:"created_at"`
PaidAt time.Time `json:"paid_at"`
FileData []byte `json:"file_data" gorm:"type:blob"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the option of storing the invoices paths instead of storing the data itself, but if the size of the blob is quite small, then maybe we should go with that

Comment threadserver/app/invoice_handler.go Outdated
return nil, InternalServerError(errors.New(internalServerErrorMsg))
}

downloadsDir := filepath.Join(homeDir, "Downloads")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the full downloads home directory configurable and fallback to this if not defined, this allows the operator of the service to e.g mount external drives or use nfs directories .. etc

@rawdaGastan
rawdaGastanforce-pushed the development_invoices_pdf branch 2 times, most recently from 38f00f7 to fd0e22bCompareJanuary 15, 2025 12:46
@rawdaGastan
rawdaGastanforce-pushed the development_invoices_pdf branch from fd0e22b to 262861aCompareJanuary 15, 2025 12:49
@rawdaGastan
rawdaGastanforce-pushed the development_flat_payment branch from da94fa0 to c75afcdCompareFebruary 12, 2025 15:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@rawdaGastan@xmonader