eventyay-tickets icon indicating copy to clipboard operation
eventyay-tickets copied to clipboard

Add orientation and height fields to Badgelayouts API response

Open Sak1012 opened this issue 8 months ago • 0 comments

The Badges plugin API currently returns the following JSON structure for badge layouts for the following call

GET /api/v1/organizers/(organizer)/events/(event)/badgelayouts/

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "name": "event",
            "default": true,
            "layout": [
                {
                    "type": "textarea",
                    "left": "13.09",
                    "bottom": "49.73",
                    "fontsize": "23.6",
                    "color": [
                        0,
                        0,
                        0,
                        1
                    ],
                    "fontfamily": "Open Sans",
                    "bold": true,
                    "italic": false,
                    "width": "121.83",
                    "content": "attendee_name",
                    "text": "Max Mustermann",
                    "align": "center"
                }
            ],
            "background": null,
            "item_assignments": []
        }
    ]
}

Enhance this API response to include additional fields: orientation and height. This will help in defining the badge layout more precisely.

Proposed JSON structure:

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "event",
      "default": true,
      "layout": [
        {
          "type": "textarea",
          "left": "13.09",
          "bottom": "49.73",
          "fontsize": "23.6",
          "color": [0, 0, 0, 1],
          "fontfamily": "Open Sans",
          "bold": true,
          "italic": false,
          "width": "121.83",
          "height": "100.0"  // new field
          "content": "attendee_name",
          "text": "Max Mustermann",
          "align": "center",
          "orientation": "portrait",  // new field
        }
      ],
      "background": null,
      "item_assignments": []
    }
  ]
}

These fields will allow for more flexible and detailed badge layout configurations, which are necessary for upcoming features.

Sak1012 avatar Jun 20 '24 05:06 Sak1012