{"openapi":"3.0.0","info":{"title":"API AssurMoi","description":"SDV Cours de Renforcement Backend.","version":"1.0.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/BRICENOGUE_1/AssurMoi/1.0.0"},{"url":"http://localhost:3000","description":"Serveur Local de Développement"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["ADMIN","GESTIONNAIRE","CHARGE_SUIVI","CHARGE_CLIENTELE","ASSURE"]},"active":{"type":"boolean"}}},"Sinister":{"type":"object","required":["plate","driver_firstname","driver_lastname","driver_engaged_responsability"],"properties":{"id":{"type":"integer"},"plate":{"type":"string","pattern":"^[A-Z]{2}-\\d{3}-[A-Z]{2}$"},"driver_firstname":{"type":"string"},"driver_lastname":{"type":"string"},"driver_is_insured":{"type":"boolean","default":true},"sinister_datetime":{"type":"string","format":"date-time"},"context":{"type":"string"},"driver_engaged_responsability":{"type":"integer","enum":[0,50,100]},"validated":{"type":"boolean"}}},"Request":{"type":"object","properties":{"id":{"type":"integer"},"sinister_id":{"type":"integer"},"status":{"type":"string","enum":["INITIALIZED","EXPERTISE_PENDING","REPAIR_IN_PROGRESS","CLOSED"]},"diagnostic":{"type":"string","enum":["PENDING","REPAIRABLE","NOT_REPAIRABLE"]},"case1_pickup_plan_date":{"type":"string","format":"date"},"case1_third_party_invoice_paid":{"type":"boolean"},"case2_estimated_compensation":{"type":"number","format":"float"},"case2_approved_compensation":{"type":"boolean"},"closed":{"type":"boolean"}}},"Document":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["CNI","CARTE_GRISE","ATTESTATION","FACTURE","RIB"]},"path":{"type":"string","description":"URL sécurisée du fichier (Hébergement France)"},"validated":{"type":"boolean"}}}}},"security":[{"bearerAuth":[]}],"paths":{"/users":{"get":{"summary":"Liste des utilisateurs (ADMIN)","tags":["Users"],"parameters":[{"name":"search","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Succès"}}},"post":{"summary":"Création d'utilisateur (ADMIN)","tags":["Users"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"201":{"description":"Créé"}}}},"/sinisters":{"post":{"summary":"Déclaration de sinistre (CHARGE_CLIENTELE)","tags":["Sinistres"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sinister"}}}},"responses":{"201":{"description":"Sinistre et Request initialisés"}}}},"/sinisters/{id}":{"put":{"summary":"Validation/Modification du sinistre (GESTIONNAIRE)","tags":["Sinistres"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sinister"}}}},"responses":{"200":{"description":"Mis à jour"}}}},"/requests/{id}":{"get":{"summary":"Détails du dossier et avancement","tags":["Dossiers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Retourne la Request avec son Sinistre lié"}}},"patch":{"summary":"Mise à jour étape par étape (CHARGE_SUIVI / GESTIONNAIRE)","tags":["Dossiers"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"200":{"description":"État du dossier mis à jour (Historisation auto)"}}}},"/documents/upload":{"post":{"summary":"Upload de document (ASSURÉ / CHARGÉ)","tags":["Documents"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"type":{"type":"string"}}}}}},"responses":{"201":{"description":"Document enregistré"}}}},"/documents/{id}/validate":{"patch":{"summary":"Valider une pièce justificative (GESTIONNAIRE)","tags":["Documents"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Document marqué comme valide"}}}},"/history/request/{requestId}":{"get":{"summary":"Consulter l'historique d'un dossier (RGPD Compliance)","tags":["Audit"],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Liste chronologique des actions (Qui/Quand/Quoi)"}}}}}}