### LinkedIn Historical Metrics - Tests HTTP
### Remplacer {{baseUrl}}, {{token}} et {{companyId}} par vos valeurs

@baseUrl = http://localhost:8000
@token = YOUR_AUTH_TOKEN_HERE
@companyId = 03d78dcf-a401-4b95-9962-d978f3611adb

###############################################
# 1. GET Stats - Statistiques du dashboard
###############################################

GET {{baseUrl}}/api/linkedin-historical/stats?entreprise_id={{companyId}}
Authorization: Bearer {{token}}
Content-Type: application/json

###############################################
# 2. GET Collections - Liste des collectes
###############################################

GET {{baseUrl}}/api/linkedin-historical/collections?entreprise_id={{companyId}}&page=1&per_page=10
Authorization: Bearer {{token}}
Content-Type: application/json

###############################################
# 3. GET Posts - Posts d'une période
###############################################

GET {{baseUrl}}/api/linkedin-historical/posts?entreprise_id={{companyId}}&start_date=2025-01-01&end_date=2026-12-31&page=1&per_page=50
Authorization: Bearer {{token}}
Content-Type: application/json

###############################################
# 4. POST Posts - Sauvegarder des posts (CREATE)
###############################################

POST {{baseUrl}}/api/linkedin-historical/posts
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "entreprise_id": "{{companyId}}",
  "posts": [
    {
      "url": "https://www.linkedin.com/posts/test-http-1",
      "content": "Premier post de test via HTTP",
      "type": "texte",
      "date": "2026-05-15",
      "likes": 25,
      "comments": 5,
      "shares": 2
    },
    {
      "url": "https://www.linkedin.com/posts/test-http-2",
      "content": "Deuxième post de test via HTTP avec image",
      "type": "image",
      "date": "2026-05-16",
      "likes": 45,
      "comments": 12,
      "shares": 8
    }
  ]
}

###############################################
# 5. POST Posts - Mettre à jour un post (UPDATE)
###############################################

POST {{baseUrl}}/api/linkedin-historical/posts
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "entreprise_id": "{{companyId}}",
  "posts": [
    {
      "id": "REMPLACER_PAR_UUID_DU_POST",
      "url": "https://www.linkedin.com/posts/test-http-1-updated",
      "content": "Post mis à jour via HTTP",
      "type": "video",
      "date": "2026-05-15",
      "likes": 100,
      "comments": 25,
      "shares": 15
    }
  ]
}

###############################################
# 6. DELETE Post - Supprimer un post
###############################################

DELETE {{baseUrl}}/api/linkedin-historical/posts/REMPLACER_PAR_UUID_DU_POST?entreprise_id={{companyId}}
Authorization: Bearer {{token}}
Content-Type: application/json

###############################################
# 7. GET Download Template - Télécharger Excel
###############################################

GET {{baseUrl}}/api/linkedin-posts/historical/download-template?entreprise_id={{companyId}}
Authorization: Bearer {{token}}

###############################################
# 8. POST Import Metrics - Importer Excel
###############################################

POST {{baseUrl}}/api/linkedin-posts/historical/import-metrics
Authorization: Bearer {{token}}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="entreprise_id"

{{companyId}}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="excel_file"; filename="metrics.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

< ./path/to/your/file.xlsx
------WebKitFormBoundary7MA4YWxkTrZu0gW--
