From 3f7336c331cfce56b01865e1d9a44584bd258081 Mon Sep 17 00:00:00 2001 From: Maksym Hrynenko Date: Mon, 22 Apr 2024 20:04:19 +0300 Subject: [PATCH] fix: docs --- docs/spec/components/schemas/Airdrop.yaml | 10 ++++++++++ .../paths/integrations@airdrop-svc@airdrops@{id}.yaml | 4 ++-- internal/service/handlers/get_airdrop.go | 2 ++ resources/model_airdrop_attributes.go | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/spec/components/schemas/Airdrop.yaml b/docs/spec/components/schemas/Airdrop.yaml index 55308d1..4599f1e 100644 --- a/docs/spec/components/schemas/Airdrop.yaml +++ b/docs/spec/components/schemas/Airdrop.yaml @@ -9,6 +9,8 @@ allOf: required: - address - status + - amount + - tx_hash - created_at - updated_at properties: @@ -30,3 +32,11 @@ allOf: format: time.Time description: RFC3339 UTC timestamp of the airdrop successful tx example: "2021-09-01T00:00:00Z" + amount: + type: string + description: Amount of airdropped coins + example: "100stake" + tx_hash: + type: string + description: Hash of the airdrop transaction + example: "F1CC0E80E151A67F75E41F2CDBF07920C29C9A3CDB6131B2A23A7C9D1964AD0B" diff --git a/docs/spec/paths/integrations@airdrop-svc@airdrops@{id}.yaml b/docs/spec/paths/integrations@airdrop-svc@airdrops@{id}.yaml index 6d4d4fc..ef42277 100644 --- a/docs/spec/paths/integrations@airdrop-svc@airdrops@{id}.yaml +++ b/docs/spec/paths/integrations@airdrop-svc@airdrops@{id}.yaml @@ -1,8 +1,8 @@ get: tags: - Airdrop - summary: Create airdrop - description: Create an airdrop for unique user. The proof will be verified. + summary: Get an airdrop + description: Get an airdrop for unique user. operationId: createAirdrop parameters: - in: path diff --git a/internal/service/handlers/get_airdrop.go b/internal/service/handlers/get_airdrop.go index afcccbb..3049d46 100644 --- a/internal/service/handlers/get_airdrop.go +++ b/internal/service/handlers/get_airdrop.go @@ -47,6 +47,8 @@ func toAirdropResponse(p data.Participant) resources.AirdropResponse { Status: p.Status, CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt, + Amount: p.Amount, + TxHash: p.TxHash, }, }, } diff --git a/resources/model_airdrop_attributes.go b/resources/model_airdrop_attributes.go index 9fa2d59..04d00c3 100644 --- a/resources/model_airdrop_attributes.go +++ b/resources/model_airdrop_attributes.go @@ -9,10 +9,14 @@ import "time" type AirdropAttributes struct { // Destination address for the airdrop Address string `json:"address"` + // Amount of airdropped coins + Amount string `json:"amount"` // RFC3339 UTC timestamp of the airdrop creation CreatedAt time.Time `json:"created_at"` // Status of the airdrop transaction Status string `json:"status"` + // Hash of the airdrop transaction + TxHash string `json:"tx_hash"` // RFC3339 UTC timestamp of the airdrop successful tx UpdatedAt time.Time `json:"updated_at"` }