Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 GET Receipts #110

Open
marfavi opened this issue Nov 16, 2022 · 2 comments
Open

v2 GET Receipts #110

marfavi opened this issue Nov 16, 2022 · 2 comments
Labels
api-v2 Related to new API version 2 enhancement New idea, feature or request

Comments

@marfavi
Copy link
Member

marfavi commented Nov 16, 2022

Right now, the app uses two API v1 calls to retrieve all user receipts:

  • GET Tickets (used: true)
  • GET Purchases

I propose a new GET Receipts endpoint to retrieve all receipts data through one endpoint. On the app side, it would mean reduced complexity (one less type to parse) and increased performance (one less API call).

@marfavi marfavi added enhancement New idea, feature or request api-v2 Related to new API version 2 labels Nov 16, 2022
@marfavi
Copy link
Member Author

marfavi commented Nov 16, 2022

schema suggestion: list of ReceiptResponse

      "ReceiptResponse": {
        "type": "object",
        "description": "Representing a receipt for either a swipe or a purchase",
        "additionalProperties": false,
        "required": [
          "id",
          "productName",
          "type"
          "time",
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id of swipe or purchase",
            "format": "int32",
            "example": 122
          },
          "time": {
            "type": "string",
            "description": "Time of swipe/purchase in Utc format",
            "format": "date-time",
            "minLength": 1,
            "example": "2022-01-09T21:03:52.2283208Z"
          },
          "productName": {
            "type": "string",
            "description": "Name of product a receipt is for",
            "minLength": 1,
            "example": "Fancy Coffee"
          },
          "type": {
            "description": "What type (swipe/purchase) the receipt represents",
            "example": "Purchase",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReceiptType"
              }
            ]
          }
        }
      }

@jonasanker
Copy link
Member

I think we had this discussion previously. Maybe we can see if we can find the history for why we didn't go this way.

Also to understand the performance problem, do you know what each API call takes? Maybe there's a bottle neck in one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-v2 Related to new API version 2 enhancement New idea, feature or request
Projects
None yet
Development

No branches or pull requests

2 participants