35 lines
879 B
Go
35 lines
879 B
Go
package documents
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/tech/sendico/billing/documents/internal/docstore"
|
|
"github.com/tech/sendico/billing/documents/renderer"
|
|
)
|
|
|
|
// Config holds document service settings loaded from YAML.
|
|
type Config struct {
|
|
Issuer renderer.Issuer `yaml:"issuer"`
|
|
Templates TemplateConfig `yaml:"templates"`
|
|
Protection ProtectionConfig `yaml:"protection"`
|
|
Storage docstore.Config `yaml:"storage"`
|
|
}
|
|
|
|
// TemplateConfig defines document template locations.
|
|
type TemplateConfig struct {
|
|
AcceptancePath string `yaml:"acceptance_path"`
|
|
}
|
|
|
|
// ProtectionConfig configures PDF protection.
|
|
type ProtectionConfig struct {
|
|
OwnerPassword string `yaml:"owner_password"`
|
|
}
|
|
|
|
func (c Config) AcceptanceTemplatePath() string {
|
|
if strings.TrimSpace(c.Templates.AcceptancePath) == "" {
|
|
return "templates/acceptance.tpl"
|
|
}
|
|
|
|
return c.Templates.AcceptancePath
|
|
}
|