package types

// Project is a struct that holds the information about a project
type Project struct {
	ID          int    `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	Description string `json:"description" db:"description"`
	Owner       string `json:"owner" db:"owner_user_id"`
}

// As it arrives from the client, Owner is derived from the JWT token
type NewProject struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

// Used to change the role of a user in a project.
// If name is identical to the name contained in the token, the role can be changed.
// If the name is different, only a project manager can change the role.
type RoleChange struct {
	UserName    string `json:"username"`
	Role        string `json:"role" tstype:"'project_manager' | 'user'"`
	Projectname string `json:"projectname"`
}

type NameChange struct {
	ID   int    `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}
