You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
package entities
|
|
|
|
import (
|
|
"git.aiterp.net/stufflog3/stufflog3/models"
|
|
"time"
|
|
)
|
|
|
|
type Project struct {
|
|
ID int `json:"id"`
|
|
ScopeID int `json:"scopeId"`
|
|
OwnerID string `json:"ownerId"`
|
|
CreatedTime time.Time `json:"createdTime"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Status models.Status `json:"status"`
|
|
}
|
|
|
|
func (project *Project) Update(update models.ProjectUpdate) {
|
|
if update.OwnerID != nil {
|
|
project.OwnerID = *update.OwnerID
|
|
}
|
|
if update.Name != nil {
|
|
project.Name = *update.Name
|
|
}
|
|
if update.Description != nil {
|
|
project.Description = *update.Description
|
|
}
|
|
if update.Status != nil {
|
|
project.Status = *update.Status
|
|
}
|
|
}
|
|
|
|
type Requirement struct {
|
|
ID int `json:"id"`
|
|
ScopeID int `json:"scopeId"`
|
|
ProjectID int `json:"projectId"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Status models.Status `json:"status"`
|
|
}
|
|
|
|
func (requirement Requirement) Update(update models.RequirementUpdate) {
|
|
if update.Name != nil {
|
|
requirement.Name = *update.Name
|
|
}
|
|
if update.Description != nil {
|
|
requirement.Description = *update.Description
|
|
}
|
|
if update.Status != nil {
|
|
requirement.Status = *update.Status
|
|
}
|
|
}
|
|
|
|
type RequirementStat struct {
|
|
RequirementID int `json:"requirementId"`
|
|
StatID int `json:"statId"`
|
|
Required int `json:"required"`
|
|
}
|