mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
chore: update client schema
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/hazemKrimi/crimson-vault/internal/models"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
)
|
||||
|
||||
type API struct {
|
||||
@@ -18,8 +18,8 @@ func (api *API) Initialize() {
|
||||
db.Connect()
|
||||
db.MigrateClients()
|
||||
|
||||
api.db = db
|
||||
api.instance = ech
|
||||
api.db = db
|
||||
|
||||
api.ClientRoutes()
|
||||
api.instance.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||
|
||||
@@ -12,20 +12,32 @@ type Client struct {
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `json:"deletedAt" gorm:"index"`
|
||||
Name string `json:"name"`
|
||||
FiscalCode string `json:"fiscalCode"`
|
||||
Address string `json:"address"`
|
||||
Zip string `json:"zip"`
|
||||
Country string `json:"country"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type CreateClientBody struct {
|
||||
Name string `json:"name"`
|
||||
FiscalCode string `json:"fiscalCode"`
|
||||
Address string `json:"address"`
|
||||
Zip string `json:"zip"`
|
||||
Country string `json:"country"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type UpdateClientBody struct {
|
||||
Name string `json:"name"`
|
||||
FiscalCode string `json:"fiscalCode"`
|
||||
Address string `json:"address"`
|
||||
Zip string `json:"zip"`
|
||||
Country string `json:"country"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
func (db *DB) MigrateClients() {
|
||||
|
||||
Reference in New Issue
Block a user