-
Notifications
You must be signed in to change notification settings - Fork 0
add a pdf generator for invoices #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development_flat_payment
Are you sure you want to change the base?
Conversation
f89cead to
cb24c71
Compare
cb24c71 to
70768d9
Compare
26ced02 to
8f86730
Compare
…ud4students into development_invoices_pdf
server/internal/pdf_generator.go
Outdated
| startX float64 = 25 | ||
| startY float64 = 30 | ||
|
|
||
| logoPath = "internal/img/codescalers.png" |
There was a problem hiding this comment.
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?
server/internal/email_sender.go
Outdated
|
|
||
| // SendMail sends verification mails | ||
| func SendMail(sender, sendGridKey, receiver, subject, body string) error { | ||
| func SendMail(sender, sendGridKey, receiver, subject, body, attachmentName string, attachmentBytes ...[]byte) error { |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
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
server/app/invoice_handler.go
Outdated
| return nil, InternalServerError(errors.New(internalServerErrorMsg)) | ||
| } | ||
|
|
||
| downloadsDir := filepath.Join(homeDir, "Downloads") |
There was a problem hiding this comment.
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
38f00f7 to
fd0e22b
Compare
fd0e22b to
262861a
Compare
da94fa0 to
c75afcd
Compare
Related Issues