Skip to content

Commit

Permalink
updating accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
wes-kay committed Jan 6, 2023
1 parent f74b17a commit 37d0ffc
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 111 deletions.
109 changes: 68 additions & 41 deletions docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Account"
"$ref": "#/definitions/model.GroupAccount"
}
}
}
Expand Down Expand Up @@ -175,7 +175,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Account"
"$ref": "#/definitions/model.GroupAccount"
}
}
}
Expand Down Expand Up @@ -216,6 +216,34 @@ const docTemplate = `{
}
}
},
"/v1/group-account/{user-id}": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "Creates a group account under the user",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/role/{id}": {
"get": {
"consumes": [
Expand Down Expand Up @@ -504,38 +532,9 @@ const docTemplate = `{
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Account Role"
],
"summary": "Creates a user account role",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
}
}
}
}
},
"/v1/user-account-roles/{user-id}/{account-id}": {
"/v1/user-account-roles/{user-id}/{group-id}": {
"get": {
"consumes": [
"application/json"
Expand All @@ -546,7 +545,7 @@ const docTemplate = `{
"tags": [
"User Account Role"
],
"summary": "Gets the user account role by user ID and account ID",
"summary": "Gets the user account role by user ID and group ID",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -784,6 +783,37 @@ const docTemplate = `{
}
}
},
"/v1/user-account/{user-id}/group/{group-id}/role": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Account Role by user id and group id"
],
"summary": "Creates a user account role",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
}
}
}
}
},
"/v1/user-dashboard": {
"get": {
"consumes": [
Expand Down Expand Up @@ -817,7 +847,10 @@ const docTemplate = `{
}
},
"definitions": {
"model.Account": {
"model.Dashboard": {
"type": "object"
},
"model.GroupAccount": {
"type": "object",
"properties": {
"created": {
Expand All @@ -843,9 +876,6 @@ const docTemplate = `{
}
}
},
"model.Dashboard": {
"type": "object"
},
"model.UpdateUserAccountRoleDTO": {
"type": "object",
"required": [
Expand Down Expand Up @@ -909,9 +939,6 @@ const docTemplate = `{
},
"status_name": {
"type": "string"
},
"temp": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -978,7 +1005,7 @@ const docTemplate = `{
"model.UserAccountRole": {
"type": "object",
"properties": {
"fk_account_id": {
"fk_group_account_id": {
"type": "integer"
},
"fk_user_account_id": {
Expand Down
109 changes: 68 additions & 41 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Account"
"$ref": "#/definitions/model.GroupAccount"
}
}
}
Expand Down Expand Up @@ -168,7 +168,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Account"
"$ref": "#/definitions/model.GroupAccount"
}
}
}
Expand Down Expand Up @@ -209,6 +209,34 @@
}
}
},
"/v1/group-account/{user-id}": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Account"
],
"summary": "Creates a group account under the user",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/v1/role/{id}": {
"get": {
"consumes": [
Expand Down Expand Up @@ -497,38 +525,9 @@
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Account Role"
],
"summary": "Creates a user account role",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
}
}
}
}
},
"/v1/user-account-roles/{user-id}/{account-id}": {
"/v1/user-account-roles/{user-id}/{group-id}": {
"get": {
"consumes": [
"application/json"
Expand All @@ -539,7 +538,7 @@
"tags": [
"User Account Role"
],
"summary": "Gets the user account role by user ID and account ID",
"summary": "Gets the user account role by user ID and group ID",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -777,6 +776,37 @@
}
}
},
"/v1/user-account/{user-id}/group/{group-id}/role": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Account Role by user id and group id"
],
"summary": "Creates a user account role",
"parameters": [
{
"type": "string",
"description": "Authentication header",
"name": "Auth",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.UpdateUserAccountRoleDTO"
}
}
}
}
},
"/v1/user-dashboard": {
"get": {
"consumes": [
Expand Down Expand Up @@ -810,7 +840,10 @@
}
},
"definitions": {
"model.Account": {
"model.Dashboard": {
"type": "object"
},
"model.GroupAccount": {
"type": "object",
"properties": {
"created": {
Expand All @@ -836,9 +869,6 @@
}
}
},
"model.Dashboard": {
"type": "object"
},
"model.UpdateUserAccountRoleDTO": {
"type": "object",
"required": [
Expand Down Expand Up @@ -902,9 +932,6 @@
},
"status_name": {
"type": "string"
},
"temp": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -971,7 +998,7 @@
"model.UserAccountRole": {
"type": "object",
"properties": {
"fk_account_id": {
"fk_group_account_id": {
"type": "integer"
},
"fk_user_account_id": {
Expand Down
Loading

0 comments on commit 37d0ffc

Please sign in to comment.