diff --git a/internal/models/clients.go b/internal/models/clients.go index bf958d36307193fd7edd4d4045bdc006967f96c9..d1af93b8a9e97cb991f4d7da19219ca63c6c5933 100644 --- a/internal/models/clients.go +++ b/internal/models/clients.go @@ -5,23 +5,10 @@ import ( "net/http" "strconv" "strings" - "time" "forge.grandlyon.com/apoyen/sdk-go/internal/auth" ) -// UserClient has many BankAccounts and one UserBanker -type UserClient struct { - ID uint `gorm:"primary_key"` - CreatedAt time.Time `json:"-"` - UpdatedAt time.Time `json:"-"` - DeletedAt *time.Time `json:"-"` - UserID int `gorm:"not null;unique"` - Name string - UserBankerID uint - BankAccounts []BankAccount -} - // HandleClients expose the UserClients API func (d *DataHandler) HandleClients(w http.ResponseWriter, r *http.Request) { id, _ := strconv.Atoi(strings.TrimPrefix(r.URL.Path, "/api/UserClients/")) diff --git a/internal/models/models.go b/internal/models/models.go index 8d5a4739c3488b63586e4706e1ab8a96dc3391b9..fffe5021b92451ea28bc61a94ee5229b7511c2c7 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -84,6 +84,18 @@ type UserBanker struct { UserClients []UserClient } +// UserClient has many BankAccounts and one UserBanker +type UserClient struct { + ID uint `gorm:"primary_key"` + CreatedAt time.Time `json:"-"` + UpdatedAt time.Time `json:"-"` + DeletedAt *time.Time `json:"-"` + UserID int `gorm:"not null;unique"` + Name string + UserBankerID uint + BankAccounts []BankAccount +} + // BankAccount belongs to an UserClient type BankAccount struct { ID uint `gorm:"primary_key"`