From 16a9edc20d53cec25161f3678237149529dd6b1d Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 3 Dec 2022 16:38:15 -0900 Subject: [PATCH] code-gen --- backend/app/api/static/docs/docs.go | 68 ++++++++++++++++++++++++ backend/app/api/static/docs/swagger.json | 68 ++++++++++++++++++++++++ backend/app/api/static/docs/swagger.yaml | 41 ++++++++++++++ frontend/lib/api/types/data-contracts.ts | 6 +++ 4 files changed, 183 insertions(+) diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.go index d3a89a1..8383e37 100644 --- a/backend/app/api/static/docs/docs.go +++ b/backend/app/api/static/docs/docs.go @@ -161,6 +161,60 @@ const docTemplate = `{ } } }, + "/v1/groups/statistics/labels": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get the current user's group statistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/repo.TotalsByOrganizer" + } + } + } + } + } + }, + "/v1/groups/statistics/locations": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get the current user's group statistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/repo.TotalsByOrganizer" + } + } + } + } + } + }, "/v1/groups/statistics/purchase-price": { "get": { "security": [ @@ -1791,6 +1845,20 @@ const docTemplate = `{ } } }, + "repo.TotalsByOrganizer": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "total": { + "type": "number" + } + } + }, "repo.UserOut": { "type": "object", "properties": { diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.json index 5148bed..3ba718e 100644 --- a/backend/app/api/static/docs/swagger.json +++ b/backend/app/api/static/docs/swagger.json @@ -153,6 +153,60 @@ } } }, + "/v1/groups/statistics/labels": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get the current user's group statistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/repo.TotalsByOrganizer" + } + } + } + } + } + }, + "/v1/groups/statistics/locations": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Statistics" + ], + "summary": "Get the current user's group statistics", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/repo.TotalsByOrganizer" + } + } + } + } + } + }, "/v1/groups/statistics/purchase-price": { "get": { "security": [ @@ -1783,6 +1837,20 @@ } } }, + "repo.TotalsByOrganizer": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "total": { + "type": "number" + } + } + }, "repo.UserOut": { "type": "object", "properties": { diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yaml index f953715..658a9f3 100644 --- a/backend/app/api/static/docs/swagger.yaml +++ b/backend/app/api/static/docs/swagger.yaml @@ -396,6 +396,15 @@ definitions: total: type: integer type: object + repo.TotalsByOrganizer: + properties: + id: + type: string + name: + type: string + total: + type: number + type: object repo.UserOut: properties: email: @@ -637,6 +646,38 @@ paths: summary: Get the current user's group statistics tags: - Statistics + /v1/groups/statistics/labels: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/repo.TotalsByOrganizer' + type: array + security: + - Bearer: [] + summary: Get the current user's group statistics + tags: + - Statistics + /v1/groups/statistics/locations: + get: + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/repo.TotalsByOrganizer' + type: array + security: + - Bearer: [] + summary: Get the current user's group statistics + tags: + - Statistics /v1/groups/statistics/purchase-price: get: parameters: diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index f93f6c2..8799a19 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -248,6 +248,12 @@ export interface PaginationResultRepoItemSummary { total: number; } +export interface TotalsByOrganizer { + id: string; + name: string; + total: number; +} + export interface UserOut { email: string; groupId: string;