Support Issue Reference in Title Info

Fixes #12
This commit is contained in:
Oliver Jakoubek 2023-03-24 17:04:31 +01:00
parent e8d1c806fc
commit 5037c728bc

View file

@ -11,6 +11,7 @@ type TitleInfo struct {
printObjectName string
titleName string
publicationDate time.Time
issueReference string
countryCode string
printObjectColor string
additionalInfo string
@ -97,12 +98,24 @@ func (ti *TitleInfo) Payload() string {
data := ti.PrintObjectName()
data += ti.TitleName()
data += ti.PublicationDate()
data += ti.IssueReference()
data += ti.CountryCode()
data += ti.PrintObjectColor()
data += ti.AdditionalInfo()
return data
}
func (ti *TitleInfo) SetIssueReference(issueReference string) {
ti.issueReference = issueReference
}
func (ti *TitleInfo) IssueReference() string {
if ti.issueReference == "" {
return ""
}
return fmt.Sprintf("+99195%8s", ti.issueReference)
}
// PrintObjectName returns the print object name segment (+93) FERAG-formatted
func (ti *TitleInfo) PrintObjectName() string {
if ti.printObjectName == "" {