wip
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"GoMembership/internal/config"
|
||||
"GoMembership/pkg/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@@ -48,3 +50,10 @@ func (b *BankAccount) Update(db *gorm.DB) error {
|
||||
func (b *BankAccount) Delete(db *gorm.DB) error {
|
||||
return db.Delete(&b).Error
|
||||
}
|
||||
|
||||
func (b *BankAccount) GenerateMandateReference(id uint) string {
|
||||
if b.IBAN == "" {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s-%s%d-%s", config.Company.SepaPrefix, time.Now().Format("20060102"), id, b.IBAN[len(b.IBAN)-4:])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user