{"openapi":"3.0.3","info":{"title":"ADlab API","version":"1.0.0","description":"Requires Bearer token authentication."},"security":[{"BearerAuth":[]}],"tags":[{"name":"Immagini Device","description":"Operations related to device images"},{"name":"Fatture","description":"Operations related to invoices"},{"name":"Clienti","description":"Operations related to customers"},{"name":"Dispositivi","description":"Operations related to device management (like assignment)"}],"paths":{"/immaginiDevice":{"post":{"tags":["Immagini Device"],"summary":"Uploads an image for a specific device (Auth Required).","description":"Accepts multipart/form-data to upload an image file associated with a device ID. Requires Bearer token authentication.\n","operationId":"uploadDeviceImage","requestBody":{"description":"Multipart request containing device ID, filename, and the image file.","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"IdDispositivo":{"type":"string","description":"The unique identifier of the device.","example":"a93e7fba-33b3-40f6-b36b-d960623101d8"},"Filename":{"type":"string","description":"The original filename or desired filename for the image.","example":"img1.jpg"},"File":{"type":"string","format":"binary","description":"The image file to be uploaded."}},"required":["IdDispositivo","Filename","File"]}}}},"responses":{"201":{"description":"Image uploaded successfully.","content":{"text/plain":{"schema":{"type":"string","example":"OK"}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}},"get":{"tags":["Immagini Device"],"summary":"Retrieves a specific device image (Auth Required).","description":"Returns the binary image file based on the device and image identifiers. Requires Bearer token authentication.","operationId":"getDeviceImage","parameters":[{"name":"IdDispositivo","in":"query","required":true,"description":"The unique identifier of the device.","schema":{"type":"string"},"example":"DEV-12345"},{"name":"IdImmagine","in":"query","required":true,"description":"The unique identifier of the image.","schema":{"type":"string","format":"uuid"},"example":"a1b2c3d4-e5f6-7890-1234-567890abcdef"}],"responses":{"200":{"description":"Image file retrieved successfully.","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error."}}},"delete":{"tags":["Immagini Device"],"summary":"Deletes a specific device image (Auth Required).","description":"Removes the image file based on the device and image identifiers. Requires Bearer token authentication.","operationId":"deleteDeviceImage","parameters":[{"name":"IdDispositivo","in":"query","required":true,"description":"The unique identifier of the device.","schema":{"type":"string"},"example":"DEV-12345"},{"name":"IdImmagine","in":"query","required":true,"description":"The unique identifier of the image to be deleted.","schema":{"type":"string","format":"uuid"},"example":"a1b2c3d4-e5f6-7890-1234-567890abcdef"}],"responses":{"200":{"description":"Image deleted successfully."},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error."}}}},"/immaginiId":{"get":{"tags":["Immagini Device"],"summary":"Retrieves a list of image IDs for a specific device (Auth Required).","description":"Returns a JSON object containing an array of image identifiers associated with the given device ID. Requires Bearer token authentication.","operationId":"getDeviceImageIds","parameters":[{"name":"IdDispositivo","in":"query","required":true,"description":"The unique identifier of the device for which to list image IDs.","schema":{"type":"string"},"example":"DEV-12345"}],"responses":{"200":{"description":"A list of image IDs for the specified device.","content":{"application/json":{"schema":{"type":"object","required":["Immagini"],"properties":{"Immagini":{"type":"array","description":"A list containing objects, each with an image ID.","items":{"type":"object","required":["IdImmagine"],"properties":{"IdImmagine":{"type":"string","format":"uuid","description":"The unique identifier of an image.","example":"a1b2c3d4-e5f6-7890-1234-567890abcdef"}}}}},"example":{"Immagini":[{"IdImmagine":"a1b2c3d4-e5f6-7890-1234-567890abcdef"},{"IdImmagine":"b2c3d4e5-f6a7-8901-2345-67890abcdef01"},{"IdImmagine":"c3d4e5f6-a7b8-9012-3456-7890abcdef012"}]}}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error."}}}},"/fatturePdf":{"get":{"tags":["Fatture"],"summary":"Retrieves a specific invoice as a PDF file (Auth Required).","description":"Returns the PDF file for the invoice specified by type, year, and number. Requires Bearer token authentication.","operationId":"getInvoicePdf","parameters":[{"name":"TipoDocumento","in":"query","required":true,"description":"The type of the document (e.g., 'Fattura').","schema":{"type":"string"},"example":"Fattura"},{"name":"Anno","in":"query","required":true,"description":"The year of the document.","schema":{"type":"integer","format":"int32"},"example":2023},{"name":"Numero","in":"query","required":true,"description":"The progressive number of the document within the year and type.","schema":{"type":"integer","format":"int32"},"example":101}],"responses":{"200":{"description":"PDF invoice retrieved successfully.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error."}}}},"/fatture":{"get":{"tags":["Fatture"],"summary":"Retrieves a detailed list of invoices for the authenticated customer (Auth Required).","description":"Returns a list of invoices (headers and line items) for the authenticated customer, optionally filtered by location (Sede) and date range (Dal/Al).\nRequires Bearer token authentication.\n","operationId":"getCustomerInvoicesDetailed","parameters":[{"name":"Sede","in":"query","required":false,"description":"Optional location identifier (sede) to filter invoices.","schema":{"type":"string"},"example":"SEDE-001"},{"name":"Dal","in":"query","required":false,"description":"Optional start date (inclusive) for filtering invoices (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2023-01-01"},{"name":"Al","in":"query","required":false,"description":"Optional end date (inclusive) for filtering invoices (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2023-12-31"}],"responses":{"200":{"description":"Successfully retrieved the list of detailed invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListDetailedResponse"},"example":{"CodiceCliente":"12345","RagioneSocialeCliente":"Azienda Esempio","FattureTestate":[{"TipoDocumento":"Fattura","Anno":2025,"Numero":1001,"Cliente":"Azienda Esempio","Sede":2,"Data":"2023-05-15","Imponibile":1000.0,"Iva":220.0,"Totale":1220.0,"TipoPagamento":"Bonifico Bancario","Righe":[{"TipoDocumento":"Fattura","Anno":2025,"Numero":1001,"Progressivo":1,"Articolo":"ART001","Descrizione":"Canone Noleggio","Unitario":100.0,"Quantita":1.0,"Imponibile":100.0,"Iva":22.0,"Totale":122.0},{"TipoDocumento":"Fattura","Anno":2025,"Numero":1001,"Progressivo":2,"Articolo":"ART002","Descrizione":"Canone Noleggio 2","Unitario":900.0,"Quantita":1.0,"Imponibile":900.0,"Iva":198.0,"Totale":1098.0}]}]}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}}},"/fattureShort":{"get":{"tags":["Fatture"],"summary":"Retrieves a summary list of invoices for the authenticated customer (Auth Required).","description":"Returns a list of invoice headers (without line items) for the authenticated customer, optionally filtered by location (Sede) and date range (Dal/Al).\nRequires Bearer token authentication.\n","operationId":"getCustomerInvoicesShort","parameters":[{"name":"Sede","in":"query","required":false,"description":"Optional location identifier (sede) to filter invoices.","schema":{"type":"string"},"example":"SEDE-001"},{"name":"Dal","in":"query","required":false,"description":"Optional start date (inclusive) for filtering invoices (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2023-01-01"},{"name":"Al","in":"query","required":false,"description":"Optional end date (inclusive) for filtering invoices (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"example":"2023-12-31"}],"responses":{"200":{"description":"Successfully retrieved the list of summarized invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListShortResponse"},"example":{"CodiceCliente":"12345","RagioneSocialeCliente":"Azienda Esempio","FattureTestate":[{"TipoDocumento":"Fattura","Anno":2025,"Numero":1001,"Cliente":"Azienda Esempio","Sede":2,"Data":"2023-05-15","Imponibile":1000.0,"Iva":220.0,"Totale":1220.0,"TipoPagamento":"Bonifico Bancario"},{"TipoDocumento":"Nota Credito","Anno":2025,"Numero":50,"Cliente":"Azienda Esempio","Sede":1,"Data":"2023-06-20","Imponibile":-100.0,"Iva":-22.0,"Totale":-122.0,"TipoPagamento":"Storno Fattura 1001"}]}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}}},"/creaCliente":{"post":{"tags":["Clienti"],"summary":"Creates a new customer (Auth Required).","description":"Creates a new customer record based on the provided email. Returns the ID of the created customer. Requires Bearer token authentication.","operationId":"createCustomer","requestBody":{"description":"JSON object containing the email of the customer to be created.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"Email":{"type":"string","format":"email","description":"The email address for the new customer.","example":"new.customer@example.com"}},"required":["Email"]}}}},"responses":{"201":{"description":"Customer created successfully. Returns the new customer's ID.","content":{"text/plain":{"schema":{"type":"string","example":"cst-a1b2c3d4-e5f6-7890-1234-567890abcdef"}}}},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}}},"/aggiungiCliente":{"post":{"tags":["Clienti"],"summary":"Aggiunge un nuovo cliente ad un manutentore (Auth Required).","description":"Questa richiesta inviata dal manutentore per aggiungere un nuovo cliente finale alla lista dei propri clienti. Requires Bearer token authentication.","operationId":"addClient","requestBody":{"description":"JSON object containing the id of the client to be added","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"IdCliente":{"type":"string","format":"uuid","description":"Id del cliente da aggiungere.","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"}},"required":["Email"]}}}},"responses":{"200":{"description":"Cliente aggiunto con successo al manutentore"},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}}},"/aggiungiManutentore":{"post":{"tags":["Clienti"],"summary":"Richiesta assegnazione a manutentore (Auth Required).","description":"Il cliente finale invia questa richiesta per potere essere aggiunto come cliente ad un manutentore. Requires Bearer token authentication.","operationId":"addTechnician","requestBody":{"description":"JSON object containing the id of the client to be added","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"IdManutentore":{"type":"string","format":"uuid","description":"Id del manutentore a cui il cliente viene aggiunto.","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"}},"required":["Email"]}}}},"responses":{"200":{"description":"Cliente aggiunto con successo al manutentore"},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal Server Error."}}}},"/assegnaDevice":{"post":{"tags":["Dispositivi"],"summary":"Assigns a device to a customer (Auth Required).","description":"Assigns an existing device (identified by its ID) to an existing customer (identified by their ID), optionally specifying a location/station ('Postazione'). Requires Bearer token authentication.","operationId":"assignDeviceToCustomer","requestBody":{"description":"JSON object containing the customer ID, the device ID, and optionally the station/location name ('Postazione') to assign.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"IdCliente":{"type":"string","format":"uuid","description":"The unique identifier of the customer to assign the device to.","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"},"IdDevice":{"type":"string","format":"uuid","description":"Device identifier","example":"4dae7d51-2bed-4e68-90f3-7690f8137967"},"Postazione":{"type":"string","description":"Campo obbligatorio.","example":"Riunito modello - Serial number: 12345"},"Stanza":{"type":"string","description":"Campo obbligatorio.","example":"Stanza 1"}},"required":["IdCliente","IdDevice"]}}}},"responses":{"200":{"description":"Device assigned successfully to the customer."},"400":{"description":"Bad Request."},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error."}}}}},"components":{"schemas":{"InvoiceLineItem":{"type":"object","description":"Represents a single line item within an invoice.","properties":{"TipoDocumento":{"type":"string","description":"Document type (matches header).","example":"Fattura"},"Anno":{"type":"integer","format":"int32","description":"Document year (matches header).","example":2025},"Numero":{"type":"integer","format":"int32","description":"Document number (matches header).","example":1001},"Progressivo":{"type":"integer","format":"int32","description":"Progressive line number within the invoice.","example":1},"Articolo":{"type":"string","description":"Item code or identifier.","example":"ART001"},"Descrizione":{"type":"string","description":"Description of the item or service.","example":"Canone Noleggio"},"Unitario":{"type":"number","format":"double","description":"Unit price of the item.","example":100.0},"Quantita":{"type":"number","format":"double","description":"Quantity of the item.","example":1.0},"Imponibile":{"type":"number","format":"double","description":"Taxable amount for this line item.","example":100.0},"Iva":{"type":"number","format":"double","description":"VAT amount for this line item.","example":22.0},"Totale":{"type":"number","format":"double","description":"Total amount for this line item (taxable + VAT).","example":122.0}},"required":["TipoDocumento","Anno","Numero","Progressivo","Descrizione","Unitario","Quantita","Imponibile","Iva","Totale"]},"InvoiceHeaderShort":{"type":"object","description":"Represents the header information of an invoice (summary).","properties":{"TipoDocumento":{"type":"string","description":"Type of the document (e.g., Fattura, Nota Credito).","example":"Fattura"},"Anno":{"type":"integer","format":"int32","description":"Year the document was issued.","example":2025},"Numero":{"type":"integer","format":"int32","description":"Progressive number of the document for the year/type.","example":1001},"Cliente":{"type":"string","description":"Name of the customer.","example":"Azienda Esempio"},"Sede":{"type":"integer","description":"Location identifier associated with the invoice.","example":2},"Data":{"type":"string","format":"date","description":"Date the document was issued (YYYY-MM-DD).","example":"2023-05-15"},"Imponibile":{"type":"number","format":"double","description":"Total taxable amount for the invoice.","example":1000.0},"Iva":{"type":"number","format":"double","description":"Total VAT amount for the invoice.","example":220.0},"Totale":{"type":"number","format":"double","description":"Total amount due for the invoice (taxable + VAT).","example":1220.0},"TipoPagamento":{"type":"string","description":"Payment terms or method.","example":"Bonifico Bancario"}},"required":["TipoDocumento","Anno","Numero","Cliente","Sede","Data","Imponibile","Iva","Totale","TipoPagamento"]},"InvoiceHeaderDetailed":{"allOf":[{"$ref":"#/components/schemas/InvoiceHeaderShort"}],"type":"object","description":"Represents the header and line items of an invoice (detailed).","properties":{"Righe":{"type":"array","description":"A list of line items included in the invoice.","items":{"$ref":"#/components/schemas/InvoiceLineItem"}}},"required":["Righe"]},"InvoiceListShortResponse":{"type":"object","description":"Response containing a list of summary invoice headers for the customer.","properties":{"CodiceCliente":{"type":"string","description":"The unique code of the authenticated customer.","example":"12345"},"RagioneSocialeCliente":{"type":"string","description":"The business name of the authenticated customer.","example":"Azienda Esempio"},"FattureTestate":{"type":"array","description":"A list of invoice headers (summary view).","items":{"$ref":"#/components/schemas/InvoiceHeaderShort"}}},"required":["CodiceCliente","RagioneSocialeCliente","FattureTestate"]},"InvoiceListDetailedResponse":{"type":"object","description":"Response containing a list of detailed invoices (headers and lines) for the customer.","properties":{"CodiceCliente":{"type":"string","description":"The unique code of the authenticated customer.","example":"12345"},"RagioneSocialeCliente":{"type":"string","description":"The business name of the authenticated customer.","example":"Azienda Esempio"},"FattureTestate":{"type":"array","description":"A list of invoices including header and line item details.","items":{"$ref":"#/components/schemas/InvoiceHeaderDetailed"}}},"required":["CodiceCliente","RagioneSocialeCliente","FattureTestate"]}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Enter the token with the `Bearer: ` prefix, e.g. \"Bearer abcde12345\"."}}}}