34 lines
820 B
Go
34 lines
820 B
Go
package org
|
|
|
|
import "time"
|
|
|
|
type Organization struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type CreateOrgRequest struct {
|
|
Name string `json:"name" binding:"required,min=2,max=100" example:"My Corp"`
|
|
Slug string `json:"slug" binding:"required,min=2,max=50" example:"my-corp"`
|
|
}
|
|
|
|
type UpdateOrgRequest struct {
|
|
Name string `json:"name" binding:"required,min=2,max=100" example:"My Corp Updated"`
|
|
}
|
|
|
|
type OrgResponse struct {
|
|
Organization Organization `json:"organization"`
|
|
}
|
|
|
|
type OrgListResponse struct {
|
|
Organizations []Organization `json:"organizations"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
type ErrorResponse struct {
|
|
Error string `json:"error"`
|
|
}
|