diff --git a/docs/docs.go b/docs/docs.go index 35cb36fa..e333e7e5 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -7448,6 +7448,9 @@ const docTemplate = `{ "$ref": "#/definitions/ClientContact" } }, + "country": { + "type": "string" + }, "description": { "type": "string" }, @@ -8446,6 +8449,37 @@ const docTemplate = `{ } } }, + "DiscordResearchTopic": { + "type": "object", + "properties": { + "msgCount": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sortedActiveUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscordTopicActiveUser" + } + }, + "url": { + "type": "string" + } + } + }, + "DiscordTopicActiveUser": { + "type": "object", + "properties": { + "msgCount": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, "Domain": { "type": "object", "properties": { @@ -8651,7 +8685,11 @@ const docTemplate = `{ }, "status": { "description": "working info", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/WorkingStatus" + } + ] }, "teamEmail": { "type": "string" @@ -9746,7 +9784,7 @@ const docTemplate = `{ "data": { "type": "array", "items": { - "$ref": "#/definitions/pkg_view.DiscordResearchTopic" + "$ref": "#/definitions/DiscordResearchTopic" } }, "page": { @@ -12705,7 +12743,7 @@ const docTemplate = `{ "type": "object", "properties": { "employeeStatus": { - "type": "string" + "$ref": "#/definitions/WorkingStatus" } } }, @@ -13174,6 +13212,23 @@ const docTemplate = `{ "WorkUnitTypeLearning" ] }, + "WorkingStatus": { + "type": "string", + "enum": [ + "on-boarding", + "left", + "probation", + "full-time", + "contractor" + ], + "x-enum-varnames": [ + "WorkingStatusOnBoarding", + "WorkingStatusLeft", + "WorkingStatusProbation", + "WorkingStatusFullTime", + "WorkingStatusContractor" + ] + }, "github_com_dwarvesf_fortress-api_pkg_model.SortOrder": { "type": "string", "enum": [ @@ -13184,37 +13239,6 @@ const docTemplate = `{ "SortOrderASC", "SortOrderDESC" ] - }, - "pkg_view.DiscordResearchTopic": { - "type": "object", - "properties": { - "msgCount": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "sortedActiveUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/pkg_view.DiscordTopicActiveUser" - } - }, - "url": { - "type": "string" - } - } - }, - "pkg_view.DiscordTopicActiveUser": { - "type": "object", - "properties": { - "msgCount": { - "type": "integer" - }, - "userID": { - "type": "string" - } - } } }, "securityDefinitions": { diff --git a/docs/swagger.json b/docs/swagger.json index a7caf4c6..823d2c13 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -7441,6 +7441,9 @@ "$ref": "#/definitions/ClientContact" } }, + "country": { + "type": "string" + }, "description": { "type": "string" }, @@ -8439,6 +8442,37 @@ } } }, + "DiscordResearchTopic": { + "type": "object", + "properties": { + "msgCount": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "sortedActiveUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscordTopicActiveUser" + } + }, + "url": { + "type": "string" + } + } + }, + "DiscordTopicActiveUser": { + "type": "object", + "properties": { + "msgCount": { + "type": "integer" + }, + "userID": { + "type": "string" + } + } + }, "Domain": { "type": "object", "properties": { @@ -8644,7 +8678,11 @@ }, "status": { "description": "working info", - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/WorkingStatus" + } + ] }, "teamEmail": { "type": "string" @@ -9739,7 +9777,7 @@ "data": { "type": "array", "items": { - "$ref": "#/definitions/pkg_view.DiscordResearchTopic" + "$ref": "#/definitions/DiscordResearchTopic" } }, "page": { @@ -12698,7 +12736,7 @@ "type": "object", "properties": { "employeeStatus": { - "type": "string" + "$ref": "#/definitions/WorkingStatus" } } }, @@ -13167,6 +13205,23 @@ "WorkUnitTypeLearning" ] }, + "WorkingStatus": { + "type": "string", + "enum": [ + "on-boarding", + "left", + "probation", + "full-time", + "contractor" + ], + "x-enum-varnames": [ + "WorkingStatusOnBoarding", + "WorkingStatusLeft", + "WorkingStatusProbation", + "WorkingStatusFullTime", + "WorkingStatusContractor" + ] + }, "github_com_dwarvesf_fortress-api_pkg_model.SortOrder": { "type": "string", "enum": [ @@ -13177,37 +13232,6 @@ "SortOrderASC", "SortOrderDESC" ] - }, - "pkg_view.DiscordResearchTopic": { - "type": "object", - "properties": { - "msgCount": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "sortedActiveUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/pkg_view.DiscordTopicActiveUser" - } - }, - "url": { - "type": "string" - } - } - }, - "pkg_view.DiscordTopicActiveUser": { - "type": "object", - "properties": { - "msgCount": { - "type": "integer" - }, - "userID": { - "type": "string" - } - } } }, "securityDefinitions": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 4d87aaf1..0228132d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -423,6 +423,8 @@ definitions: items: $ref: '#/definitions/ClientContact' type: array + country: + type: string description: type: string id: @@ -1082,6 +1084,26 @@ definitions: type: string type: array type: object + DiscordResearchTopic: + properties: + msgCount: + type: integer + name: + type: string + sortedActiveUsers: + items: + $ref: '#/definitions/DiscordTopicActiveUser' + type: array + url: + type: string + type: object + DiscordTopicActiveUser: + properties: + msgCount: + type: integer + userID: + type: string + type: object Domain: properties: average: @@ -1217,8 +1239,9 @@ definitions: $ref: '#/definitions/Stack' type: array status: + allOf: + - $ref: '#/definitions/WorkingStatus' description: working info - type: string teamEmail: type: string updatedAt: @@ -1935,7 +1958,7 @@ definitions: properties: data: items: - $ref: '#/definitions/pkg_view.DiscordResearchTopic' + $ref: '#/definitions/DiscordResearchTopic' type: array page: description: page index @@ -3911,7 +3934,7 @@ definitions: UpdateWorkingStatusRequest: properties: employeeStatus: - type: string + $ref: '#/definitions/WorkingStatus' type: object UpdatedProject: properties: @@ -4219,6 +4242,20 @@ definitions: - WorkUnitTypeManagement - WorkUnitTypeTraining - WorkUnitTypeLearning + WorkingStatus: + enum: + - on-boarding + - left + - probation + - full-time + - contractor + type: string + x-enum-varnames: + - WorkingStatusOnBoarding + - WorkingStatusLeft + - WorkingStatusProbation + - WorkingStatusFullTime + - WorkingStatusContractor github_com_dwarvesf_fortress-api_pkg_model.SortOrder: enum: - asc @@ -4227,26 +4264,6 @@ definitions: x-enum-varnames: - SortOrderASC - SortOrderDESC - pkg_view.DiscordResearchTopic: - properties: - msgCount: - type: integer - name: - type: string - sortedActiveUsers: - items: - $ref: '#/definitions/pkg_view.DiscordTopicActiveUser' - type: array - url: - type: string - type: object - pkg_view.DiscordTopicActiveUser: - properties: - msgCount: - type: integer - userID: - type: string - type: object info: contact: email: benjamin@d.foundation diff --git a/pkg/handler/project/project.go b/pkg/handler/project/project.go index 3c91c578..632dea73 100644 --- a/pkg/handler/project/project.go +++ b/pkg/handler/project/project.go @@ -1876,6 +1876,10 @@ func (h *handler) UpdateGeneralInfo(c *gin.Context) { p.BankAccountID = model.UUID(body.BankAccountID) } + if !body.CompanyInfoID.IsZero() { + p.CompanyInfoID = model.UUID(body.CompanyInfoID) + } + projectNotion, err := h.store.ProjectNotion.OneByProjectID(tx.DB(), p.ID.String()) if err != nil { diff --git a/pkg/handler/project/testdata/get_project/200.json b/pkg/handler/project/testdata/get_project/200.json index e4c37b82..9e5a8774 100644 --- a/pkg/handler/project/testdata/get_project/200.json +++ b/pkg/handler/project/testdata/get_project/200.json @@ -27,7 +27,8 @@ "name": "Lorem Ipsum Inc.", "registrationNumber": "", "address": "Hado Centrosa", - "contacts": null + "contacts": null, + "country": "Vietnam" }, "clientEmail": [ "team@d.foundation" diff --git a/pkg/view/project.go b/pkg/view/project.go index 4e1434c1..5a089237 100644 --- a/pkg/view/project.go +++ b/pkg/view/project.go @@ -315,6 +315,7 @@ type BasicClientInfo struct { Description string `json:"description"` RegistrationNumber string `json:"registrationNumber"` Address string `json:"address"` + Country string `json:"country"` Contacts []ClientContact `json:"contacts"` } // @name BasicClientInfo @@ -342,6 +343,7 @@ func ToBasicClientInfo(client *model.Client) *BasicClientInfo { //Description: client.Description, //RegistrationNumber: client.RegistrationNumber, Address: client.Address, + Country: client.Country, //Contacts: clientContacts, } } diff --git a/pkg/view/research_topic.go b/pkg/view/research_topic.go index 0496dca9..8b2ab828 100644 --- a/pkg/view/research_topic.go +++ b/pkg/view/research_topic.go @@ -8,13 +8,13 @@ type DiscordResearchTopic struct { URL string MsgCount int64 SortedActiveUsers []DiscordTopicActiveUser -} +} // @name DiscordResearchTopic // DiscordTopicActiveUser represents active users who send most messages in topic type DiscordTopicActiveUser struct { UserID string MsgCount int64 -} +} // @name DiscordTopicActiveUser // ListResearchTopicResponse represents list of research topic type ListResearchTopicResponse struct {