Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Nov 7, 2024
1 parent 0eb964e commit d673fc0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 10 deletions.
55 changes: 55 additions & 0 deletions api/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [🧑‍💼 Invite organization member](#-invite-organization-member)
- [⏳ List pending invitations](#-list-pending-invitations)
- [🤝 Accept organization invitation](#-accept-organization-invitation)
- [👥 Organization Subscription Info](#-organization_subscription-info)
- [🤠 Available organization members roles](#-available-organization-members-roles)
- [🏛️ Available organization types](#-available-organization-types)
- [💳 Plans](#-plans)
Expand Down Expand Up @@ -673,6 +674,60 @@ Only the following parameters can be changed. Every parameter is optional.
| `409` | `40901` | `duplicate conflict` |
| `500` | `50002` | `internal server error` |

### 👥 Organization subscription info

* **Path** `/organizations/{address}/subscription`
* **Method** `GET`
* **Request**
```json
{
"subscriptionDetails":{
"planID":3,
"startDate":"2024-11-07T15:25:49.218Z",
"endDate":"0001-01-01T00:00:00Z",
"renewalDate":"0001-01-01T00:00:00Z",
"active":true,
"maxCensusSize":10
},
"usage":{
"sentSMS":0,
"sentEmails":0,
"subOrgs":0,
"members":0
},
"plan":{
"id":3,
"name":"free",
"stripeID":"stripe_789",
"default":true,
"organization":{
"memberships":10,
"subOrgs":5,
"censusSize":10
},
"votingTypes":{
"approval":false,
"ranked":false,
"weighted":true
},
"features":{
"personalization":false,
"emailReminder":false,
"smsNotification":false
}
}
}
```

* **Errors**

| HTTP Status | Error code | Message |
|:---:|:---:|:---|
| `401` | `40001` | `user not authorized` |
| `400` | `40009` | `organization not found` |
| `400` | `40011` | `no organization provided` |
| `500` | `50002` | `internal server error` |

### 🤠 Available organization members roles
* **Path** `/organizations/roles`
* **Method** `GET`
Expand Down
20 changes: 10 additions & 10 deletions db/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ type Plan struct {
}

type OrganizationSubscription struct {
PlanID uint64 `bson:"planID"`
StartDate time.Time `bson:"startDate"`
EndDate time.Time `bson:"endDate"`
RenewalDate time.Time `bson:"renewalDate"`
Active bool `bson:"active"`
MaxCensusSize int `bson:"maxCensusSize"`
PlanID uint64 `json:"planID" bson:"planID"`
StartDate time.Time `json:"startDate" bson:"startDate"`
EndDate time.Time `json:"endDate" bson:"endDate"`
RenewalDate time.Time `json:"renewalDate" bson:"renewalDate"`
Active bool `json:"active" bson:"active"`
MaxCensusSize int `json:"maxCensusSize" bson:"maxCensusSize"`
}

type OrganizationCounters struct {
SentSMS int `bson:"sentSMS"`
SentEmails int `bson:"sentEmails"`
SubOrgs int `bson:"subOrgs"`
Members int `bson:"members"`
SentSMS int `json:"sentSMS" bson:"sentSMS"`
SentEmails int `json:"sentEmails" bson:"sentEmails"`
SubOrgs int `json:"subOrgs" bson:"subOrgs"`
Members int `json:"members" bson:"members"`
}

type OrganizationInvite struct {
Expand Down

0 comments on commit d673fc0

Please sign in to comment.