Skip to content

Commit

Permalink
feat(projects): add source and documentation links to projects
Browse files Browse the repository at this point in the history
  • Loading branch information
lmquang committed Jan 23, 2025
1 parent 68334bd commit ef4424b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- +migrate Up
ALTER TABLE projects
ADD COLUMN source_link VARCHAR(255),
ADD COLUMN doc_link VARCHAR(255);

-- +migrate Down
ALTER TABLE projects
DROP COLUMN source_link,
DROP COLUMN doc_link;
2 changes: 2 additions & 0 deletions pkg/model/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type Project struct {
LeadRating int
ImportantLevel ProjectImportantLevel
ArtifactLink string `gorm:"default:null"`
SourceLink string `gorm:"default:null"`
DocLink string `gorm:"default:null"`

ProjectNotion *ProjectNotion `gorm:"foreignKey:project_id"`
Organization *Organization
Expand Down
10 changes: 10 additions & 0 deletions pkg/view/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type Project struct {
DeliveryRating int `json:"deliveryRating"`
LeadRating int `json:"leadRating"`
ImportantLevel string `json:"importantLevel"`
ArtifactLink string `json:"artifactLink"`
SourceLink string `json:"sourceLink"`
DocLink string `json:"docLink"`
ProjectNotion *ProjectNotion `json:"projectNotion"`
Organization *Organization `json:"organization"`
BankAccount *BankAccount `json:"bankAccount"`
Expand Down Expand Up @@ -74,6 +77,9 @@ func ToProject(project *model.Project) *Project {
Status: project.Status.String(),
ProjectEmail: project.ProjectEmail,
ClientEmail: project.ClientEmail,
ArtifactLink: project.ArtifactLink,
SourceLink: project.SourceLink,
DocLink: project.DocLink,
Avatar: project.Avatar,
AllowsSendingSurvey: project.AllowsSendingSurvey,
Code: project.Code,
Expand Down Expand Up @@ -289,6 +295,8 @@ type ProjectData struct {
StartDate *time.Time `json:"startDate"`
EndDate *time.Time `json:"endDate"`
ArtifactLink string `json:"artifactLink"`
SourceLink string `json:"sourceLink"`
DocLink string `json:"docLink"`
Members []ProjectMember `json:"members"`
TechnicalLead []ProjectHead `json:"technicalLeads"`
AccountManagers []ProjectHead `json:"accountManagers"`
Expand Down Expand Up @@ -589,6 +597,8 @@ func ToProjectData(in *model.Project, userInfo *model.CurrentLoggedUserInfo, com
StartDate: in.StartDate,
EndDate: in.EndDate,
ArtifactLink: in.ArtifactLink,
SourceLink: in.SourceLink,
DocLink: in.DocLink,
Members: members,
TechnicalLead: technicalLeads,
DeliveryManagers: deliveryManagers,
Expand Down

0 comments on commit ef4424b

Please sign in to comment.