new licenceController, moved api handling & renaming things

This commit is contained in:
Alex
2024-10-10 20:54:20 +02:00
parent fca5af2c9a
commit d54f2ae2e6
18 changed files with 259 additions and 220 deletions

View File

@@ -27,8 +27,8 @@ func Open(dbPath string, adminMail string) error {
&models.Membership{},
&models.Consent{},
&models.Verification{},
&models.DriversLicence{},
&models.LicenceCategory{},
&models.Licence{},
&models.Category{},
&models.BankAccount{}); err != nil {
logger.Error.Fatalf("Couldn't create database: %v", err)
return err
@@ -82,24 +82,24 @@ func createSubscriptionModels() []models.SubscriptionModel {
}
}
func createLicenceCategories() []models.LicenceCategory {
return []models.LicenceCategory{
{Category: "AM"},
{Category: "A1"},
{Category: "A2"},
{Category: "A"},
{Category: "B"},
{Category: "C1"},
{Category: "C"},
{Category: "D1"},
{Category: "D"},
{Category: "BE"},
{Category: "C1E"},
{Category: "CE"},
{Category: "D1E"},
{Category: "DE"},
{Category: "T"},
{Category: "L"},
func createLicenceCategories() []models.Category {
return []models.Category{
{Name: "AM"},
{Name: "A1"},
{Name: "A2"},
{Name: "A"},
{Name: "B"},
{Name: "C1"},
{Name: "C"},
{Name: "D1"},
{Name: "D"},
{Name: "BE"},
{Name: "C1E"},
{Name: "CE"},
{Name: "D1E"},
{Name: "DE"},
{Name: "T"},
{Name: "L"},
}
}
@@ -143,7 +143,7 @@ func createAdmin(userMail string, subscriptionModelID uint) (*models.User, error
SubscriptionModelID: subscriptionModelID,
},
BankAccount: models.BankAccount{},
DriversLicence: models.DriversLicence{
Licence: models.Licence{
Status: constants.UnverifiedStatus,
},
}, nil