50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
package entities
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type User struct {
|
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"`
|
|
FirstName string `gorm:"size:255"`
|
|
LastName string `gorm:"size:255"`
|
|
Email string `gorm:"unique;not null;size:255"`
|
|
PhoneNumber string `gorm:"size:255"`
|
|
CreatedAt time.Time `gorm:"default:now()"`
|
|
UpdatedAt time.Time `gorm:"default:now()"`
|
|
}
|
|
|
|
type DevUser struct {
|
|
User
|
|
}
|
|
|
|
type ClientUser struct {
|
|
User
|
|
ClientId uuid.UUID
|
|
RoleInCompany string
|
|
}
|
|
|
|
type ClientUser_Project_Join struct {
|
|
gorm.Model
|
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"`
|
|
ClientId uuid.UUID `gorm:"foreignKey:ClientId;index:clientIdProjectIndex" `
|
|
ProjectId uuid.UUID `gorm:"foreignKey:ProjectId;index:projectIdClientIndex"`
|
|
CreatedAt time.Time `gorm:"default:now()"`
|
|
UpdatedAt time.Time `gorm:"default:now()"`
|
|
IsStakeholder bool `gorm:"size:1"`
|
|
Notes string `gorm:"type:text"`
|
|
}
|
|
|
|
type DevUser_Project_Join struct {
|
|
gorm.Model
|
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"`
|
|
ClientId uuid.UUID `gorm:"foreignKey:ClientId;index:clientIdDevIndex" `
|
|
ProjectId uuid.UUID `gorm:"foreignKey:ProjectId;index:projectIdDevIndex"`
|
|
CreatedAt time.Time `gorm:"default:now()"`
|
|
UpdatedAt time.Time `gorm:"default:now()"`
|
|
IsLead bool `gorm:"size:1"`
|
|
Notes string `gorm:"type:text"`
|
|
}
|