improved JWTToken update, added list-users endpoint, debug of getCountries

This commit is contained in:
Daniel Goc
2026-03-30 16:19:26 +02:00
parent 68f4850445
commit d0ce65c287
41 changed files with 654 additions and 284 deletions

View File

@@ -1,31 +1,17 @@
package model
import "git.ma-al.com/goc_daniel/b2b/app/model/dbmodel"
// Represents a country together with its associated currency
type Country struct {
ID uint `gorm:"primaryKey;column:id" json:"id"`
Name string `gorm:"column:name" json:"name"`
Flag string `gorm:"size:16;not null;column:flag" json:"flag"`
CurrencyID uint `gorm:"column:id_currency" json:"currency_id"`
CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"`
CurrencyName string `gorm:"column:name" json:"currency_name"`
// PSCountryID int `gorm:"column:id_country" json:"ps_country_id"`
// PSCountry *PSCountry `gorm:"foreignKey:PSCountryID;references:ID" json:"ps_country"`
PSCurrencyID uint `gorm:"column:currency" json:"currency"`
PSCurrency *PSCurrency `gorm:"foreignKey:PSCurrencyID;references:currency_id" json:"ps_currency"`
ID uint `gorm:"primaryKey;column:id" json:"id"`
Name string `gorm:"column:name" json:"name"`
Flag string `gorm:"size:16;not null;column:flag" json:"flag"`
PSCurrencyID uint `gorm:"column:currency_id" json:"currency_id"`
PSCurrency *dbmodel.PsCurrency `gorm:"foreignKey:PSCurrencyID;references:IDCurrency" json:"ps_currency"`
}
func (Country) TableName() string {
return "b2b_countries"
}
type PSCountry struct {
CurrencyID uint `gorm:"column:id_currency" json:"currency_id"`
}
func (PSCountry) TableName() string {
return "ps_country"
}
type PSCurrency struct {
Currency int `gorm:"column:currency" json:"currency"`
}

View File

@@ -144,3 +144,11 @@ type RefreshToken struct {
func (RefreshToken) TableName() string {
return "b2b_refresh_tokens"
}
type UserInList struct {
UserID uint `gorm:"primaryKey;column:id" json:"user_id"`
Email string `gorm:"column:email" json:"email"`
FirstName string `gorm:"column:first_name" json:"first_name"`
LastName string `gorm:"column:last_name" json:"last_name"`
Role string `gorm:"column:role" json:"role"`
}

View File

@@ -21,12 +21,12 @@ func (*PsGroupReduction) TableName() string {
var PsGroupReductionCols = struct {
IDGroupReduction gormcol.Field
IDGroup gormcol.Field
IDCategory gormcol.Field
Reduction gormcol.Field
IDGroup gormcol.Field
IDCategory gormcol.Field
Reduction gormcol.Field
}{
IDGroupReduction: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "id_group_reduction"),
IDGroup: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "id_group"),
IDCategory: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "id_category"),
Reduction: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "reduction"),
IDGroup: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "id_group"),
IDCategory: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "id_category"),
Reduction: gormcol.Field{}.Set((&PsGroupReduction{}).TableName(), "reduction"),
}

View File

@@ -18,9 +18,9 @@ func (*PsProductAttributeCombination) TableName() string {
}
var PsProductAttributeCombinationCols = struct {
IDAttribute gormcol.Field
IDAttribute gormcol.Field
IDProductAttribute gormcol.Field
}{
IDAttribute: gormcol.Field{}.Set((&PsProductAttributeCombination{}).TableName(), "id_attribute"),
IDAttribute: gormcol.Field{}.Set((&PsProductAttributeCombination{}).TableName(), "id_attribute"),
IDProductAttribute: gormcol.Field{}.Set((&PsProductAttributeCombination{}).TableName(), "id_product_attribute"),
}

View File

@@ -20,10 +20,10 @@ func (*PsProductGroupReductionCache) TableName() string {
var PsProductGroupReductionCacheCols = struct {
IDProduct gormcol.Field
IDGroup gormcol.Field
IDGroup gormcol.Field
Reduction gormcol.Field
}{
IDProduct: gormcol.Field{}.Set((&PsProductGroupReductionCache{}).TableName(), "id_product"),
IDGroup: gormcol.Field{}.Set((&PsProductGroupReductionCache{}).TableName(), "id_group"),
IDGroup: gormcol.Field{}.Set((&PsProductGroupReductionCache{}).TableName(), "id_group"),
Reduction: gormcol.Field{}.Set((&PsProductGroupReductionCache{}).TableName(), "reduction"),
}

View File

@@ -19,11 +19,11 @@ func (*PsPshowPshowproducttabsHook) TableName() string {
}
var PsPshowPshowproducttabsHookCols = struct {
IDHook gormcol.Field
HookName gormcol.Field
IDHook gormcol.Field
HookName gormcol.Field
PrestaIDHook gormcol.Field
}{
IDHook: gormcol.Field{}.Set((&PsPshowPshowproducttabsHook{}).TableName(), "id_hook"),
HookName: gormcol.Field{}.Set((&PsPshowPshowproducttabsHook{}).TableName(), "hook_name"),
IDHook: gormcol.Field{}.Set((&PsPshowPshowproducttabsHook{}).TableName(), "id_hook"),
HookName: gormcol.Field{}.Set((&PsPshowPshowproducttabsHook{}).TableName(), "hook_name"),
PrestaIDHook: gormcol.Field{}.Set((&PsPshowPshowproducttabsHook{}).TableName(), "presta_id_hook"),
}