feat: initial commit

This commit is contained in:
Björn Benouarets
2025-10-18 21:02:31 +02:00
parent 44ce70090e
commit 692f8a29c9
11 changed files with 177 additions and 0 deletions

24
models/organization.go Normal file
View File

@@ -0,0 +1,24 @@
package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type Organization struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()" json:"id"`
Name string `gorm:"unique;not null" json:"name"`
DisplayName string `gorm:"not null" json:"display_name"`
CreatedBy uuid.UUID `gorm:"type:uuid;" json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Creator User `gorm:"foreignKey:CreatedBy" json:"creator,omitempty"`
}
func (Organization) TableName() string {
return "organizations"
}