diff --git a/api/docs.md b/api/docs.md index a3a4f81..304d5e3 100644 --- a/api/docs.md +++ b/api/docs.md @@ -466,7 +466,8 @@ This method invalidates any previous JWT token for the user, so it returns a new "subdomain": "mysubdomain", "country": "Germany", "timezone": "GMT+2", - "language": "EN" + "language": "EN", + "communication": true } ``` By default, the organization is created with `activated: true`. @@ -513,7 +514,8 @@ Only the following parameters can be changed. Every parameter is optional. "country": "Germany", "timezone": "GMT+2", "Language": "EN", - "active": true + "active": true, + "communication": false } ``` @@ -548,6 +550,7 @@ Only the following parameters can be changed. Every parameter is optional. "timezone": "GMT+2", "Language": "EN", "active": true, + "communications": true, "parent": { "...": "..." } diff --git a/api/organizations.go b/api/organizations.go index a6fcc31..bfc89cc 100644 --- a/api/organizations.go +++ b/api/organizations.go @@ -87,9 +87,11 @@ func (a *API) createOrganizationHandler(w http.ResponseWriter, r *http.Request) Type: db.OrganizationType(orgInfo.Type), Size: orgInfo.Size, Color: orgInfo.Color, + Country: orgInfo.Country, Subdomain: orgInfo.Subdomain, Timezone: orgInfo.Timezone, Active: true, + Communications: orgInfo.Communications, TokensPurchased: 0, TokensRemaining: 0, Parent: parentOrg, diff --git a/api/types.go b/api/types.go index f0d0a72..70b76cd 100644 --- a/api/types.go +++ b/api/types.go @@ -9,19 +9,20 @@ import ( // Organization is the struct that represents an organization in the API type OrganizationInfo struct { - Address string `json:"address"` - Website string `json:"website"` - CreatedAt string `json:"createdAt"` - Type string `json:"type"` - Size string `json:"size"` - Color string `json:"color"` - Subdomain string `json:"subdomain"` - Country string `json:"country"` - Timezone string `json:"timezone"` - Active bool `json:"active"` - Parent *OrganizationInfo `json:"parent"` - Subscription *db.OrganizationSubscription `json:"subscription"` - Counters *db.OrganizationCounters `json:"counters"` + Address string `json:"address"` + Website string `json:"website"` + CreatedAt string `json:"createdAt"` + Type string `json:"type"` + Size string `json:"size"` + Color string `json:"color"` + Subdomain string `json:"subdomain"` + Country string `json:"country"` + Timezone string `json:"timezone"` + Active bool `json:"active"` + Communications bool `json:"communications"` + Parent *OrganizationInfo `json:"parent"` + Subscription *db.OrganizationSubscription `json:"subscription"` + Counters *db.OrganizationCounters `json:"counters"` } // OrganizationMembers is the struct that represents a list of members of diff --git a/db/types.go b/db/types.go index b3af6f4..4a7c0ff 100644 --- a/db/types.go +++ b/db/types.go @@ -54,6 +54,7 @@ type Organization struct { Country string `json:"country" bson:"country"` Timezone string `json:"timezone" bson:"timezone"` Active bool `json:"active" bson:"active"` + Communications bool `json:"communications" bson:"communications"` TokensPurchased uint64 `json:"tokensPurchased" bson:"tokensPurchased"` TokensRemaining uint64 `json:"tokensRemaining" bson:"tokensRemaining"` Parent string `json:"parent" bson:"parent"`