{
  "info": {
    "name": "Jukebox API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8000/api"
    },
    {
      "key": "token",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Register",
          "request": {
            "method": "POST",
            "header": [{ "key": "Accept", "value": "application/json" }],
            "url": { "raw": "{{base_url}}/register", "host": ["{{base_url}}"], "path": ["register"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"John Doe\",\n  \"email\": \"admin@example.com\",\n  \"password\": \"password\",\n  \"password_confirmation\": \"password\"\n}"
            }
          }
        },
        {
          "name": "Login",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var json = pm.response.json();",
                  "if (json.token) { pm.collectionVariables.set('token', json.token); }"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [{ "key": "Accept", "value": "application/json" }],
            "url": { "raw": "{{base_url}}/login", "host": ["{{base_url}}"], "path": ["login"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"email\": \"john@example.com\",\n  \"password\": \"password123\"\n}"
            }
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/logout", "host": ["{{base_url}}"], "path": ["logout"] }
          }
        },
        {
          "name": "Me",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/me", "host": ["{{base_url}}"], "path": ["me"] }
          }
        }
      ]
    },
    {
      "name": "Likes",
      "item": [
        {
          "name": "My Liked Tracks",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/me/likes", "host": ["{{base_url}}"], "path": ["me", "likes"] }
          }
        },
        {
          "name": "Like a Track",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks/1/like", "host": ["{{base_url}}"], "path": ["tracks", "1", "like"] }
          }
        },
        {
          "name": "Unlike a Track",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks/1/like", "host": ["{{base_url}}"], "path": ["tracks", "1", "like"] }
          }
        }
      ]
    },
    {
      "name": "Labels",
      "item": [
        {
          "name": "List Labels",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/labels", "host": ["{{base_url}}"], "path": ["labels"] }
          }
        },
        {
          "name": "Show Label",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/labels/1", "host": ["{{base_url}}"], "path": ["labels", "1"] }
          }
        },
        {
          "name": "Create Label (admin)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/labels", "host": ["{{base_url}}"], "path": ["labels"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"Sony Music\"\n}"
            }
          }
        },
        {
          "name": "Update Label (admin)",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/labels/1", "host": ["{{base_url}}"], "path": ["labels", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"Sony Music Updated\"\n}"
            }
          }
        },
        {
          "name": "Delete Label (admin)",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/labels/1", "host": ["{{base_url}}"], "path": ["labels", "1"] }
          }
        }
      ]
    },
    {
      "name": "Genres",
      "item": [
        {
          "name": "List Genres",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/genres", "host": ["{{base_url}}"], "path": ["genres"] }
          }
        },
        {
          "name": "Show Genre",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/genres/1", "host": ["{{base_url}}"], "path": ["genres", "1"] }
          }
        },
        {
          "name": "Create Genre (admin)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/genres", "host": ["{{base_url}}"], "path": ["genres"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"Jazz\"\n}"
            }
          }
        },
        {
          "name": "Update Genre (admin)",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/genres/1", "host": ["{{base_url}}"], "path": ["genres", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"Jazz Updated\"\n}"
            }
          }
        },
        {
          "name": "Delete Genre (admin)",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/genres/1", "host": ["{{base_url}}"], "path": ["genres", "1"] }
          }
        }
      ]
    },
    {
      "name": "Artists",
      "item": [
        {
          "name": "List Artists",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/artists", "host": ["{{base_url}}"], "path": ["artists"] }
          }
        },
        {
          "name": "Show Artist",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/artists/1", "host": ["{{base_url}}"], "path": ["artists", "1"] }
          }
        },
        {
          "name": "Create Artist (admin)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/artists", "host": ["{{base_url}}"], "path": ["artists"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"The Beatles\",\n  \"cover_path\": null,\n  \"release_date\": \"1960-01-01\",\n  \"label_id\": 1,\n  \"duration\": 3600\n}"
            }
          }
        },
        {
          "name": "Update Artist (admin)",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/artists/1", "host": ["{{base_url}}"], "path": ["artists", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"The Beatles Updated\"\n}"
            }
          }
        },
        {
          "name": "Delete Artist (admin)",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/artists/1", "host": ["{{base_url}}"], "path": ["artists", "1"] }
          }
        }
      ]
    },
    {
      "name": "Albums",
      "item": [
        {
          "name": "List Albums",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/albums", "host": ["{{base_url}}"], "path": ["albums"] }
          }
        },
        {
          "name": "Show Album",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/albums/1", "host": ["{{base_url}}"], "path": ["albums", "1"] }
          }
        },
        {
          "name": "Create Album (admin)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/albums", "host": ["{{base_url}}"], "path": ["albums"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"title\": \"Abbey Road\",\n  \"cover_path\": null,\n  \"release_date\": \"1969-09-26\",\n  \"duration_seconds\": 2872,\n  \"type\": \"album\",\n  \"label_id\": 1\n}"
            }
          }
        },
        {
          "name": "Update Album (admin)",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/albums/1", "host": ["{{base_url}}"], "path": ["albums", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"title\": \"Abbey Road (Remastered)\"\n}"
            }
          }
        },
        {
          "name": "Delete Album (admin)",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/albums/1", "host": ["{{base_url}}"], "path": ["albums", "1"] }
          }
        }
      ]
    },
    {
      "name": "Tracks",
      "item": [
        {
          "name": "List Tracks",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks", "host": ["{{base_url}}"], "path": ["tracks"] }
          }
        },
        {
          "name": "Show Track",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks/1", "host": ["{{base_url}}"], "path": ["tracks", "1"] }
          }
        },
        {
          "name": "Create Track (admin)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks", "host": ["{{base_url}}"], "path": ["tracks"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"title\": \"Come Together\",\n  \"file_path\": \"tracks/come_together.mp3\",\n  \"duration_seconds\": 259,\n  \"album_id\": 1,\n  \"artist_ids\": [1],\n  \"genre_ids\": [1]\n}"
            }
          }
        },
        {
          "name": "Update Track (admin)",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks/1", "host": ["{{base_url}}"], "path": ["tracks", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"title\": \"Come Together (Remastered)\",\n  \"artist_ids\": [1],\n  \"genre_ids\": [1, 2]\n}"
            }
          }
        },
        {
          "name": "Delete Track (admin)",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/tracks/1", "host": ["{{base_url}}"], "path": ["tracks", "1"] }
          }
        }
      ]
    },
    {
      "name": "Users (admin)",
      "item": [
        {
          "name": "List Users",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/users", "host": ["{{base_url}}"], "path": ["users"] }
          }
        },
        {
          "name": "Show User",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/users/1", "host": ["{{base_url}}"], "path": ["users", "1"] }
          }
        },
        {
          "name": "Update User",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/users/1", "host": ["{{base_url}}"], "path": ["users", "1"] },
            "body": {
              "mode": "raw",
              "options": { "raw": { "language": "json" } },
              "raw": "{\n  \"name\": \"Jane Doe\",\n  \"email\": \"jane@example.com\",\n  \"role_id\": 1\n}"
            }
          }
        },
        {
          "name": "Delete User",
          "request": {
            "method": "DELETE",
            "header": [
              { "key": "Accept", "value": "application/json" },
              { "key": "Authorization", "value": "Bearer {{token}}" }
            ],
            "url": { "raw": "{{base_url}}/users/1", "host": ["{{base_url}}"], "path": ["users", "1"] }
          }
        }
      ]
    }
  ]
}
