refactor(models): Move options model to models
This commit is contained in:
parent
62f04f7d1c
commit
bd70ac4542
@ -55,7 +55,7 @@ func GenerateContract(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := generator.Execute(template, &services.ContractTemplateOptions{
|
result, err := generator.Execute(template, &models.ContractTemplateOptions{
|
||||||
Runners: contract.Runners,
|
Runners: contract.Runners,
|
||||||
CurrencySymbol: "€",
|
CurrencySymbol: "€",
|
||||||
Disclaimer: "This is a disclaimer",
|
Disclaimer: "This is a disclaimer",
|
||||||
|
@ -18,3 +18,14 @@ type Group struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
ParentGroup *Group `json:"parent_group"`
|
ParentGroup *Group `json:"parent_group"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ContractTemplateOptions struct {
|
||||||
|
Runners []Runner `json:"runners"`
|
||||||
|
CurrencySymbol string `json:"currency_symbol"`
|
||||||
|
Disclaimer string `json:"disclaimer"`
|
||||||
|
ReceiptMinimumAmount int `json:"receipt_minimum_amount"`
|
||||||
|
EventName string `json:"event_name"`
|
||||||
|
SponsoringHeader string `json:"base_url"`
|
||||||
|
BarcodeFormat string `json:"barcode_format"`
|
||||||
|
BarcodePrefix string `json:"barcode_prefix"`
|
||||||
|
}
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"image/png"
|
"image/png"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"git.odit.services/lfk/document-server/models"
|
|
||||||
"github.com/boombuler/barcode"
|
"github.com/boombuler/barcode"
|
||||||
"github.com/boombuler/barcode/code128"
|
"github.com/boombuler/barcode/code128"
|
||||||
"github.com/boombuler/barcode/ean"
|
"github.com/boombuler/barcode/ean"
|
||||||
@ -23,17 +22,6 @@ type Templater interface {
|
|||||||
type DefaultTemplater struct {
|
type DefaultTemplater struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContractTemplateOptions struct {
|
|
||||||
Runners []models.Runner `json:"runners"`
|
|
||||||
CurrencySymbol string `json:"currency_symbol"`
|
|
||||||
Disclaimer string `json:"disclaimer"`
|
|
||||||
ReceiptMinimumAmount int `json:"receipt_minimum_amount"`
|
|
||||||
EventName string `json:"event_name"`
|
|
||||||
SponsoringHeader string `json:"base_url"`
|
|
||||||
BarcodeFormat string `json:"barcode_format"`
|
|
||||||
BarcodePrefix string `json:"barcode_prefix"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func idToEan13(id int, prefix string) (string, error) {
|
func idToEan13(id int, prefix string) (string, error) {
|
||||||
idStr := strconv.Itoa(id)
|
idStr := strconv.Itoa(id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user