Skip to content

Conversation

@baenv
Copy link
Contributor

@baenv baenv commented Dec 1, 2023

API to get list earn transactions

cURL

curl -X 'GET' \
  'http://localhost:8080/api/v1/discords/421992793582469130/earns/transactions?page=1&size=1' \
  -H 'accept: application/json'

Response

{
  "data": [
    {
      "ID": "string",
      "action": "string",
      "amount": "string",
      "amountEachProfiles": [
        {
          "amount": "string",
          "profileID": "string",
          "usdAmount": 0
        }
      ],
      "chainID": "string",
      "createdAt": "string",
      "expiredAt": "string",
      "externalID": "string",
      "fromAmount": "string",
      "fromProfile": {
        "ID": "string",
        "application": {
          "ID": 0,
          "active": true,
          "applicationProfileID": "string",
          "name": "string",
          "ownerProfileID": "string",
          "serviceFee": 0
        },
        "associatedAccounts": [
          {
            "ID": "string",
            "createdAt": "string",
            "isGuildMember": true,
            "platform": "string",
            "platformIdentifier": "string",
            "platformMetadata": "string",
            "profileID": "string",
            "updatedAt": "string"
          }
        ],
        "avatar": "string",
        "createdAt": "string",
        "profileName": "string",
        "type": "string",
        "updatedAt": "string"
      },
      "fromProfileID": "string",
      "fromProfileSource": "string",
      "fromToken": {
        "ID": "string",
        "address": "string",
        "chain": {
          "ID": "string",
          "chainID": "string",
          "explorer": "string",
          "icon": "string",
          "name": "string",
          "rpc": "string",
          "symbol": "string",
          "type": "string"
        },
        "chainID": "string",
        "coinGeckoID": "string",
        "decimal": 0,
        "icon": "string",
        "name": "string",
        "native": true,
        "price": 0,
        "symbol": "string"
      },
      "fromTokenId": "string",
      "internalID": 0,
      "metadata": {
        "additionalProp1": {}
      },
      "onchainTxHash": "string",
      "originalTxID": "string",
      "otherProfile": {
        "ID": "string",
        "application": {
          "ID": 0,
          "active": true,
          "applicationProfileID": "string",
          "name": "string",
          "ownerProfileID": "string",
          "serviceFee": 0
        },
        "associatedAccounts": [
          {
            "ID": "string",
            "createdAt": "string",
            "isGuildMember": true,
            "platform": "string",
            "platformIdentifier": "string",
            "platformMetadata": "string",
            "profileID": "string",
            "updatedAt": "string"
          }
        ],
        "avatar": "string",
        "createdAt": "string",
        "profileName": "string",
        "type": "string",
        "updatedAt": "string"
      },
      "otherProfileID": "string",
      "otherProfileIds": [
        "string"
      ],
      "otherProfileSource": "string",
      "otherProfiles": [
        {
          "ID": "string",
          "application": {
            "ID": 0,
            "active": true,
            "applicationProfileID": "string",
            "name": "string",
            "ownerProfileID": "string",
            "serviceFee": 0
          },
          "associatedAccounts": [
            {
              "ID": "string",
              "createdAt": "string",
              "isGuildMember": true,
              "platform": "string",
              "platformIdentifier": "string",
              "platformMetadata": "string",
              "profileID": "string",
              "updatedAt": "string"
            }
          ],
          "avatar": "string",
          "createdAt": "string",
          "profileName": "string",
          "type": "string",
          "updatedAt": "string"
        }
      ],
      "settledAt": "string",
      "sourcePlatform": "string",
      "status": "string",
      "toAmount": "string",
      "toToken": {
        "ID": "string",
        "address": "string",
        "chain": {
          "ID": "string",
          "chainID": "string",
          "explorer": "string",
          "icon": "string",
          "name": "string",
          "rpc": "string",
          "symbol": "string",
          "type": "string"
        },
        "chainID": "string",
        "coinGeckoID": "string",
        "decimal": 0,
        "icon": "string",
        "name": "string",
        "native": true,
        "price": 0,
        "symbol": "string"
      },
      "toTokenId": "string",
      "token": {
        "ID": "string",
        "address": "string",
        "chain": {
          "ID": "string",
          "chainID": "string",
          "explorer": "string",
          "icon": "string",
          "name": "string",
          "rpc": "string",
          "symbol": "string",
          "type": "string"
        },
        "chainID": "string",
        "coinGeckoID": "string",
        "decimal": 0,
        "icon": "string",
        "name": "string",
        "native": true,
        "price": 0,
        "symbol": "string"
      },
      "tokenID": "string",
      "totalAmount": "string",
      "type": "string",
      "updatedAt": "string",
      "usdAmount": 0
    }
  ],
  "page": 0,
  "size": 0,
  "total": 0
}

API to get total earns of employee by discord id

cURL

curl -X 'GET' \
  'http://localhost:8080/api/v1/discords/421992793582469130/earns/total' \
  -H 'accept: application/json'

Response

{
  "data": {
    "totalEarnsICY": "680",
    "totalEarnsUSD": 1020
  }
}

image

phucledien
phucledien previously approved these changes Dec 1, 2023
Copy link
Contributor

@namnhce namnhce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thay vì

{
  "data": {
    "last_5_txns": [
      {}
    ]
  }
}

thì


{
  "data": [
    {}
  ]
}

Mình có thể add thêm query để query lấy 5 last txns luôn.

Copy link
Contributor

@namnhce namnhce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request và response in camelCase.
id ở sau từ thứ 2 là ID thay vì Id
discordId -> discordID cho consistent.

@baenv baenv force-pushed the feat/api-salary-advance-report branch 2 times, most recently from faf443d to 1403daa Compare December 4, 2023 12:07
@baenv baenv force-pushed the feat/api-get-employee-earns-report branch from c0f29ef to b118965 Compare December 4, 2023 12:16
@baenv baenv force-pushed the feat/api-salary-advance-report branch 2 times, most recently from 0b87f4b to b11c79e Compare December 4, 2023 14:19
Base automatically changed from feat/api-salary-advance-report to develop December 4, 2023 14:23
@namnhce namnhce dismissed phucledien’s stale review December 4, 2023 14:23

The base branch was changed.

@baenv baenv force-pushed the feat/api-get-employee-earns-report branch from b118965 to f352857 Compare December 4, 2023 20:33
@baenv baenv changed the title feat: api employee earns report feat: apis to get employee earns report Dec 4, 2023
@baenv baenv force-pushed the feat/api-get-employee-earns-report branch 2 times, most recently from 8271d55 to bdc5b48 Compare December 6, 2023 02:37
@baenv baenv force-pushed the feat/api-get-employee-earns-report branch 2 times, most recently from aa3a2ec to 3421000 Compare December 6, 2023 03:23
type: object
Application:
properties:
ID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ID -> id

type: object
AssociatedAccounts:
properties:
ID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too

type: object
Chain:
properties:
ID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to

@baenv baenv force-pushed the feat/api-get-employee-earns-report branch from 3421000 to b27a26a Compare December 6, 2023 03:45
@namnhce namnhce merged commit c0a368c into develop Dec 6, 2023
@namnhce namnhce deleted the feat/api-get-employee-earns-report branch December 6, 2023 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants