Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientIDs ¶
GetClientIDs returns a list of client IDs by scanning the directory where client data is stored.
Types ¶
type Client ¶
type Client struct { // ID is the unique identifier of the client. ID uint `survey:"id" json:"id"` // Name is the name of the client. Name string `survey:"name" json:"name"` // Address is the address of the client. Address string `survey:"address" json:"address"` // Bank is a string that represents the user's bank details. Bank string `survey:"bank" json:"bank"` // Email is the email address(es) of the client. Email []string `survey:"email" json:"email"` // Currency is the currency of the client. Currency string `survey:"currency" json:"currency"` }
Client represents a client of the business.
func ReadClientInfo ¶
ReadClientInfo reads the client info for the given client ID from the storage. Returns an error if the client info cannot be read.
func (*Client) WriteClientInfo ¶
type Config ¶
type Config struct { GenOnCreate bool `survey:"generate_on_create" yaml:"generate_on_create"` GenOnUpdate bool `survey:"generate_on_update" yaml:"generate_on_update"` SMTP SMTPConfig `survey:"smtp" yaml:"smtp"` }
type Invoice ¶
type Invoice struct { // ID is the unique identifier of the invoice. ID uint `json:"id"` // ClientID is the unique identifier of the client associated with the invoice. ClientID uint `json:"client_id"` // Number is the invoice number. Number string `survey:"number" json:"number"` // Issued is the date the invoice was issued. Issued time.Time `json:"issued"` // Due is the due date for the invoice. Due time.Time `survey:"due" json:"due"` // Sent is the date when the invoice was sent. Sent time.Time `json:"sent"` // Notes is any additional notes associated with the invoice. Notes string `survey:"notes" json:"notes"` // Items is a list of line items on the invoice. Items []Item `survey:"items" json:"items"` // Subtotal is subtotal of the invoice. Subtotal float32 `json:"subtotal"` }
Invoice represents an invoice for a client.
func (*Invoice) GeneratePDF ¶
func (*Invoice) GetInvoiceTotal ¶
func (*Invoice) WriteInvoice ¶
type Item ¶
type Item struct { // ID is the unique identifier of the item. ID uint `json:"id"` // Description is a brief description of the item. Description string `survey:"description" json:"description"` // Quantity is the quantity of the item. Quantity float64 `survey:"quantity" json:"quantity"` // UnitPrice is the unit price of the item. UnitPrice float64 `survey:"unit_price" json:"unit_price"` }
Item represents a line item on an invoice.
type Profile ¶
type Profile struct { // Name is a string that represents the user's name. Name string `survey:"name" yaml:"name" json:"name"` // Currency is a string that represents the user's preferred currency. Currency string `survey:"currency" yaml:"currency" json:"currency"` // Due is a string that represents the user's preferred due date. Due string `survey:"default_due" yaml:"default_due" json:"default_due"` // Address is a string that represents the user's address. Address string `survey:"address" yaml:"address" json:"address"` // IBAN is a string that represents the user's International Bank Account Number (IBAN). IBAN string `survey:"iban" yaml:"iban" json:"iban"` // Bank is a string that represents the user's bank details. Bank string `survey:"bank_details" yaml:"bank_details" json:"bank_details"` }
Profile represents a user's profile information.
type SMTPConfig ¶
type SMTPConfig struct { Host string `survey:"host" yaml:"host"` // The hostname of the SMTP server. Port int `survey:"port" yaml:"port"` // The port number to use for the SMTP server. Username string `survey:"username" yaml:"username"` // The username to use for authentication with the SMTP server. Password string `survey:"password" yaml:"password"` // The password to use for authentication with the SMTP server. }
func PromptSMTP ¶
func PromptSMTP() (SMTPConfig, error)
func (*SMTPConfig) SendEmailWithAttachment ¶
func (cfg *SMTPConfig) SendEmailWithAttachment(to []string, subject, body, attachmentPath string) error
Click to show internal directories.
Click to hide internal directories.