Repository: Sundsvallskommun/api-service-self-service-ai
Pull request #18: UF-15320 Fetch invoice rows.
Author: login: AndreSoderlund
Created: 2025-04-04T09:12:08Z | Merged: 2025-04-07T08:10:23Z

* Added another resource in the Invoice client. 
* Updated the business logic to fetch invoice details for each invoice and map these to InvoiceRow objects. These are passed on to intric.
* Updated some of the Invoice mapping to have easier access to each invoice when fetching the invoice details.
* Added some utility methods for creating testdata.

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix
- [x] New feature
- [ ] Removed feature
- [x] Code style update (formatting etc.)
- [x] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Content/Data

## Does this PR introduce a breaking change?
- [ ] Yes (I have stepped the version number accordingly)
- [x] No
      
## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [x] My code follows the code style of this project.
- [x] I have updated the documentation accordingly (if applicable).
- [x] I have added/updated tests to cover my changes (if applicable).



Diff:
diff --git a/src/integration-test/java/apptest/AssistantIT.java b/src/integration-test/java/apptest/AssistantIT.java
index 8f630f0..cc184ea 100644
--- a/src/integration-test/java/apptest/AssistantIT.java
+++ b/src/integration-test/java/apptest/AssistantIT.java
@@ -10,21 +10,19 @@
 import static org.springframework.http.HttpStatus.CREATED;
 import static org.springframework.http.HttpStatus.NO_CONTENT;
 import static org.springframework.http.HttpStatus.OK;
+import static org.springframework.http.MediaType.APPLICATION_JSON;
 import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
 
 import java.time.Duration;
 import java.util.List;
 import java.util.UUID;
-
 import org.awaitility.Awaitility;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
 import org.springframework.test.context.jdbc.Sql;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.support.TransactionTemplate;
-
 import se.sundsvall.dept44.test.AbstractAppTest;
 import se.sundsvall.dept44.test.annotation.wiremock.WireMockAppTestSuite;
 import se.sundsvall.selfserviceai.Application;
@@ -62,7 +60,7 @@ void setUp() {
 	void test01_createSession() {
 		setupCall()
 			.withServicePath(PATH)
-			.withContentType(MediaType.APPLICATION_JSON)
+			.withContentType(APPLICATION_JSON)
 			.withHttpMethod(POST)
 			.withRequest(REQUEST_FILE)
 			.withExpectedResponseStatus(CREATED)
@@ -72,7 +70,7 @@ void test01_createSession() {
 	}
 
 	@Test
-	void test02_checkIfReadyWhenAssistantReady() throws Exception {
+	void test02_checkIfReadyWhenAssistantReady() {
 		setupCall()
 			.withServicePath(PATH + "/4dc21d5e-8a70-45fb-b225-367fcd383a2e/ready")
 			.withHttpMethod(GET)
@@ -85,7 +83,7 @@ void test02_checkIfReadyWhenAssistantReady() throws Exception {
 	@Test
 	void test03_checkIfReadyWhenAssistantNotReady() {
 		setupCall()
-			.withServicePath(PATH + "/" + UUID.randomUUID().toString() + "/ready")
+			.withServicePath(PATH + "/" + UUID.randomUUID() + "/ready")
 			.withHttpMethod(GET)
 			.withExpectedResponseStatus(OK)
 			.withExpectedResponseHeader(CONTENT_TYPE, List.of(APPLICATION_JSON_VALUE))
@@ -121,7 +119,7 @@ void test05_interactWithNonReadyAssistant() {
 	void test06_deleteSession() {
 		final var sessionId = "158cfabe-1c3d-433c-b71f-1c909beaa291";
 		final var fileId = "811bcd0e-fe12-448e-85c5-2248a4a12e6d";
-		
+
 		transactionTemplate.executeWithoutResult(status -> {
 			final var session = sessionRepository.getReferenceById(sessionId);
 
diff --git a/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json b/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json
index f230712..385fbf4 100644
--- a/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json
+++ b/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json
@@ -303,6 +303,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-04-09",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -321,7 +322,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -329,6 +346,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-04-07",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -347,7 +365,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -355,6 +389,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-03-13",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -373,7 +408,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -381,6 +432,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-03-10",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -399,7 +451,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -407,6 +475,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-02-10",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -425,7 +494,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -433,6 +518,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-02-06",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -451,7 +537,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -459,6 +561,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-01-09",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -477,7 +580,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -485,6 +604,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-01-08",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -503,7 +623,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -511,6 +647,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-12-11",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -529,7 +666,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -537,6 +690,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-12-09",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -555,7 +709,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -563,6 +733,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-11-08",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -581,7 +752,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -589,6 +776,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-11-07",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -607,7 +795,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -615,6 +819,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-10-10",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -633,7 +838,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -641,6 +862,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-10-09",
+											"facilityId": "735999109220108018",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -659,7 +881,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										}
 									]
 								},
@@ -999,6 +1237,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-03-31",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1017,7 +1256,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1025,6 +1280,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-04-07",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1043,7 +1299,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1051,6 +1323,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-03-03",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1069,7 +1342,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1077,6 +1366,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-03-10",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1095,7 +1385,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1103,6 +1409,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-01-30",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1121,7 +1428,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1129,6 +1452,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-02-06",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1147,7 +1471,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1155,6 +1495,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-12-30",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1173,7 +1514,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1181,6 +1538,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-01-08",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1199,7 +1557,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1207,6 +1581,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-12-02",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1225,7 +1600,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1233,6 +1624,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-12-09",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1251,7 +1643,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1259,6 +1667,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-10-29",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1277,7 +1686,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1285,6 +1710,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-11-07",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1303,7 +1729,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1311,6 +1753,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-09-30",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1329,7 +1772,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1337,6 +1796,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-10-09",
+											"facilityId": "735999109222306054",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1355,7 +1815,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										}
 									]
 								},
@@ -1961,6 +2437,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-04-09",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -1979,7 +2456,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -1987,6 +2480,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-04-07",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2005,7 +2499,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2013,6 +2523,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-03-13",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2031,7 +2542,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2039,6 +2566,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-03-10",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2057,7 +2585,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2065,6 +2609,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-02-10",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2083,7 +2628,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2091,6 +2652,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-02-06",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2109,7 +2671,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2117,6 +2695,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2025-01-09",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2135,7 +2714,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2143,6 +2738,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2025-01-08",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2161,7 +2757,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2169,6 +2781,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-12-11",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2187,7 +2800,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2195,6 +2824,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-12-09",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2213,7 +2843,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2221,6 +2867,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-11-08",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2239,7 +2886,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2247,6 +2910,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-11-07",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2265,7 +2929,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2273,6 +2953,7 @@
 											"currency": "sek",
 											"description": "El",
 											"dueDate": "2024-10-10",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2291,7 +2972,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 0.00,
@@ -2299,6 +2996,7 @@
 											"currency": "sek",
 											"description": "Elhandel",
 											"dueDate": "2024-10-09",
+											"facilityId": "735999109260723035",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2317,7 +3015,23 @@
 											"status": "VOID",
 											"totalAmount": 0.00,
 											"vat": 0.00,
-											"vatEligibleAmount": 0.00
+											"vatEligibleAmount": 0.00,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										}
 									]
 								},
@@ -2705,6 +3419,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2025-03-28",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2723,7 +3438,23 @@
 											"status": "SENT",
 											"totalAmount": 2734.00,
 											"vat": 546.76,
-											"vatEligibleAmount": 2187.04
+											"vatEligibleAmount": 2187.04,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 3130.08,
@@ -2731,6 +3462,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2025-02-28",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2749,7 +3481,23 @@
 											"status": "PAID",
 											"totalAmount": 3130.00,
 											"vat": 626.02,
-											"vatEligibleAmount": 2504.06
+											"vatEligibleAmount": 2504.06,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 2801.81,
@@ -2757,6 +3505,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2025-01-28",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2775,7 +3524,23 @@
 											"status": "PAID",
 											"totalAmount": 2802.00,
 											"vat": 560.36,
-											"vatEligibleAmount": 2241.45
+											"vatEligibleAmount": 2241.45,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 2439.93,
@@ -2783,6 +3548,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2024-12-30",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2801,7 +3567,23 @@
 											"status": "PAID",
 											"totalAmount": 2440.00,
 											"vat": 487.99,
-											"vatEligibleAmount": 1951.94
+											"vatEligibleAmount": 1951.94,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 1781.65,
@@ -2809,6 +3591,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2024-11-28",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2827,7 +3610,23 @@
 											"status": "PAID",
 											"totalAmount": 1782.00,
 											"vat": 356.33,
-											"vatEligibleAmount": 1425.32
+											"vatEligibleAmount": 1425.32,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 1152.85,
@@ -2835,6 +3634,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2024-10-29",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2853,7 +3653,23 @@
 											"status": "PAID",
 											"totalAmount": 1153.00,
 											"vat": 230.57,
-											"vatEligibleAmount": 922.28
+											"vatEligibleAmount": 922.28,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										},
 										{
 											"amountVatIncluded": 435.78,
@@ -2861,6 +3677,7 @@
 											"currency": "sek",
 											"description": "Fjärrvärme",
 											"dueDate": "2024-09-30",
+											"facilityId": "9222306053",
 											"invoiceAddress": {
 												"careOf": "Parker Peter",
 												"street": "Gröna trollets gränd 5",
@@ -2879,7 +3696,23 @@
 											"status": "PAID",
 											"totalAmount": 436.00,
 											"vat": 87.16,
-											"vatEligibleAmount": 348.62
+											"vatEligibleAmount": 348.62,
+											"invoiceRows": [
+												{
+													"amount": 10.00,
+													"amountVatExcluded": 8.00,
+													"vat": 2.00,
+													"vatRate": 20.00,
+													"quantity": 10.00,
+													"unit": "unit",
+													"unitPrice": 1.00,
+													"description": "description",
+													"productCode": "productCode",
+													"productName": "productName",
+													"periodFrom": "2023-01-01",
+													"periodTo": "2023-01-31"
+												}
+											]
 										}
 									]
 								}
diff --git a/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-invoices-get-invoice-details.json b/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-invoices-get-invoice-details.json
new file mode 100644
index 0000000..9702acf
--- /dev/null
+++ b/src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-invoices-get-invoice-details.json
@@ -0,0 +1,18 @@
+{
+	"request": {
+		"headers": {
+			"Authorization": {
+				"equalTo": "Bearer MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI4"
+			}
+		},
+		"method": "GET",
+		"urlPathPattern": "/invoices/2281/COMMERCIAL/[^/]+/[^/]+/details"
+	},
+	"response": {
+		"headers": {
+			"Content-Type": "application/json"
+		},
+		"status": 200,
+		"bodyFileName": "test01_createSession/responses/api-invoices-get-invoice-details.json"
+	}
+}
diff --git a/src/integration-test/resources/AssistantIT/__files/test01_createSession/responses/api-invoices-get-invoice-details.json b/src/integration-test/resources/AssistantIT/__files/test01_createSession/responses/api-invoices-get-invoice-details.json
new file mode 100644
index 0000000..8e6143e
--- /dev/null
+++ b/src/integration-test/resources/AssistantIT/__files/test01_createSession/responses/api-invoices-get-invoice-details.json
@@ -0,0 +1,18 @@
+{
+	"details": [
+		{
+			"amount": 10,
+			"amountVatExcluded": 8,
+			"vat": 2,
+			"vatRate": 20,
+			"quantity": 10,
+			"unit": "unit",
+			"unitPrice": 1,
+			"description": "description",
+			"productCode": "productCode",
+			"productName": "productName",
+			"fromDate": "2023-01-01",
+			"toDate": "2023-01-31"
+		}
+	]
+}
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java b/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
index be6ff12..b9a74f1 100644
--- a/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
@@ -13,6 +13,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
@@ -30,7 +31,7 @@
 @Component
 public class IntricMapper {
 
-	private static final <T> Predicate<T> distinctByValue(Function<? super T, ?> keyExtractor) {
+	private static <T> Predicate<T> distinctByValue(final Function<? super T, ?> keyExtractor) {
 		final Set<Object> seen = ConcurrentHashMap.newKeySet();
 		return t -> seen.add(keyExtractor.apply(t));
 	}
@@ -41,7 +42,7 @@ private static final <T> Predicate<T> distinctByValue(Function<? super T, ?> key
 	 * @param  input question to be asked
 	 * @return       AskAssistant object with provided data
 	 */
-	public AskAssistant toAskAssistant(String input) {
+	public AskAssistant toAskAssistant(final String input) {
 		return toAskAssistant(input, emptyList());
 	}
 
@@ -52,21 +53,21 @@ public AskAssistant toAskAssistant(String input) {
 	 * @param  fileReferences id of previously stored files that shall be used to answer question
 	 * @return                AskAssistant object with provided data
 	 */
-	public AskAssistant toAskAssistant(String input, List<String> fileReferences) {
+	public AskAssistant toAskAssistant(final String input, List<String> fileReferences) {
 		return AskAssistant.builder()
 			.withQuestion(input)
 			.withFiles(toFilesPublic(fileReferences))
 			.build();
 	}
 
-	static List<FilePublic> toFilesPublic(List<String> fileReferences) {
+	static List<FilePublic> toFilesPublic(final List<String> fileReferences) {
 		return ofNullable(fileReferences).orElse(emptyList()).stream()
 			.map(IntricMapper::toFilePublic)
 			.filter(Objects::nonNull)
 			.toList();
 	}
 
-	static FilePublic toFilePublic(String fileId) {
+	static FilePublic toFilePublic(final String fileId) {
 		return ofNullable(fileId)
 			.map(UUID::fromString)
 			.map(id -> FilePublic.builder()
@@ -81,7 +82,7 @@ static FilePublic toFilePublic(String fileId) {
 	 * @param  data string of json data that is to be the content of the file
 	 * @return      a InformationFile object representing the provided data
 	 */
-	public InformationFile toInformationFile(String data) {
+	public InformationFile toInformationFile(final String data) {
 		return InformationFile
 			.create()
 			.withData(data);
@@ -98,7 +99,7 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 		final var intricModel = ofNullable(installedBaseCustomers)
 			.filter(MapUtils::isNotEmpty)
 			.map(ibc -> IntricModel.builder()
-				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrive customer nr and party id (as its always the same for all ib:s)
+				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrieve customer nr and party id (as its always the same for all ib:s)
 				.withPartyId(ibc.values().iterator().next().getPartyId())
 				.withFacilities(toFacilities(ibc))
 				.build())
@@ -106,7 +107,7 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 
 		// Attach matching installed bases to each facility
 		if (nonNull(intricModel)) {
-			final var installedBases = ofNullable(installedBaseCustomers).orElse(emptyMap()).values().stream()
+			final var installedBases = Optional.of(installedBaseCustomers).orElse(emptyMap()).values().stream()
 				.map(InstalledBaseCustomer::getItems)
 				.flatMap(List::stream)
 				.toList();
@@ -117,7 +118,7 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 		return intricModel;
 	}
 
-	List<Facility> toFacilities(Map<String, InstalledBaseCustomer> installedBases) {
+	List<Facility> toFacilities(final Map<String, InstalledBaseCustomer> installedBases) {
 		return ofNullable(installedBases).orElse(emptyMap()).entrySet().stream()
 			.map(this::toFacilities)
 			.flatMap(List::stream)
@@ -125,7 +126,7 @@ List<Facility> toFacilities(Map<String, InstalledBaseCustomer> installedBases) {
 			.toList();
 	}
 
-	List<Facility> toFacilities(Entry<String, InstalledBaseCustomer> installedBaseEntry) {
+	List<Facility> toFacilities(final Entry<String, InstalledBaseCustomer> installedBaseEntry) {
 		return ofNullable(installedBaseEntry)
 			.map(Entry::getValue)
 			.map(InstalledBaseCustomer::getItems)
@@ -136,7 +137,7 @@ List<Facility> toFacilities(Entry<String, InstalledBaseCustomer> installedBaseEn
 			.toList();
 	}
 
-	Facility toFacility(InstalledBaseItem item) {
+	Facility toFacility(final InstalledBaseItem item) {
 		return ofNullable(item)
 			.map(i -> Facility.builder()
 				.withAddress(toAddress(i.getAddress()))
@@ -145,7 +146,7 @@ Facility toFacility(InstalledBaseItem item) {
 			.orElse(null);
 	}
 
-	void addInstalledBases(Facility facility, List<InstalledBaseItem> installedBaseItems) {
+	void addInstalledBases(final Facility facility, final List<InstalledBaseItem> installedBaseItems) {
 		ofNullable(facility).ifPresent(f -> f.getInstalledBases().addAll(
 			ofNullable(installedBaseItems).orElse(emptyList()).stream()
 				.filter(Objects::nonNull)
@@ -154,7 +155,7 @@ void addInstalledBases(Facility facility, List<InstalledBaseItem> installedBaseI
 				.toList()));
 	}
 
-	InstalledBase toInstalledBase(InstalledBaseItem installedBaseItem) {
+	InstalledBase toInstalledBase(final InstalledBaseItem installedBaseItem) {
 		return ofNullable(installedBaseItem)
 			.map(item -> InstalledBase.builder()
 				.withType(item.getType())
@@ -167,14 +168,14 @@ InstalledBase toInstalledBase(InstalledBaseItem installedBaseItem) {
 			.orElse(null);
 	}
 
-	List<InstalledBase.Metadata> toMetadatas(List<InstalledBaseItemMetaData> metadatas) {
+	List<InstalledBase.Metadata> toMetadatas(final List<InstalledBaseItemMetaData> metadatas) {
 		return ofNullable(metadatas).orElse(emptyList()).stream()
 			.map(this::toMetadata)
 			.filter(Objects::nonNull)
 			.toList();
 	}
 
-	InstalledBase.Metadata toMetadata(InstalledBaseItemMetaData metadata) {
+	InstalledBase.Metadata toMetadata(final InstalledBaseItemMetaData metadata) {
 		return ofNullable(metadata)
 			.map(m -> InstalledBase.Metadata.builder()
 				.withDisplayName(metadata.getDisplayName())
@@ -185,7 +186,7 @@ InstalledBase.Metadata toMetadata(InstalledBaseItemMetaData metadata) {
 			.orElse(null);
 	}
 
-	se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address toAddress(InstalledBaseItemAddress address) {
+	se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address toAddress(final InstalledBaseItemAddress address) {
 		return ofNullable(address)
 			.map(a -> se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address.builder()
 				.withCareOf(a.getCareOf())
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecorator.java b/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecorator.java
index d8270c1..46cb1b2 100644
--- a/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecorator.java
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecorator.java
@@ -5,14 +5,20 @@
 import static se.sundsvall.selfserviceai.integration.intric.util.ConversionUtil.toBigDecimal;
 import static se.sundsvall.selfserviceai.integration.intric.util.ConversionUtil.toBoolean;
 
-import generated.se.sundsvall.invoices.Address;
-import generated.se.sundsvall.invoices.Invoice;
+import generated.se.sundsvall.invoices.InvoiceDetail;
+import generated.se.sundsvall.invoices.InvoiceStatus;
+import generated.se.sundsvall.invoices.InvoiceType;
+import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.Objects;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address;
 import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Facility;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.InvoiceRow;
 
 public class InvoiceDecorator {
-	private static final int DECIMAL_POINTS = 2;
+
+	static final int DECIMAL_POINTS = 2;
 
 	private InvoiceDecorator() {}
 
@@ -28,36 +34,57 @@ private static void attachToFacility(List<Facility> facilities, Invoice invoice)
 			.stream()
 			.filter(f -> f.getFacilityId().equals(invoice.getFacilityId()))
 			.findFirst()
-			.ifPresent(f -> f.getInvoices().add(toInvoice(invoice)));
+			.ifPresent(f -> f.getInvoices().add(invoice));
 	}
 
-	private static se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice toInvoice(Invoice invoice) {
-		return se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice.builder()
+	public static Invoice toDecoratedInvoice(final generated.se.sundsvall.invoices.Invoice invoice, final List<InvoiceDetail> invoiceDetails) {
+		return Invoice.builder()
 			.withAmountVatExcluded(toBigDecimal(invoice.getAmountVatExcluded(), DECIMAL_POINTS))
 			.withAmountVatIncluded(toBigDecimal(invoice.getAmountVatIncluded(), DECIMAL_POINTS))
 			.withCurrency(invoice.getCurrency())
 			.withDescription(invoice.getInvoiceDescription())
 			.withDueDate(invoice.getDueDate())
+			.withFacilityId(invoice.getFacilityId())
 			.withInvoiceAddress(toAddress(invoice.getInvoiceAddress()))
 			.withInvoiceName(invoice.getInvoiceName())
 			.withInvoiceNumber(invoice.getInvoiceNumber())
-			.withInvoiceType(invoice.getInvoiceType().name())
+			.withInvoiceType(ofNullable(invoice.getInvoiceType()).map(InvoiceType::name).orElse(null))
 			.withInvoicingDate(invoice.getInvoiceDate())
 			.withOcrNumber(invoice.getOcrNumber())
 			.withOrganizationNumber(invoice.getOrganizationNumber())
 			.withPdfAvailable(toBoolean(invoice.getPdfAvailable()))
 			.withReversedVat(toBoolean(invoice.getReversedVat()))
 			.withRounding(toBigDecimal(invoice.getRounding(), DECIMAL_POINTS))
-			.withStatus(invoice.getInvoiceStatus().name())
+			.withStatus(ofNullable(invoice.getInvoiceStatus()).map(InvoiceStatus::name).orElse(null))
 			.withTotalAmount(toBigDecimal(invoice.getTotalAmount(), DECIMAL_POINTS))
 			.withVat(toBigDecimal(invoice.getVat(), DECIMAL_POINTS))
 			.withVatEligibleAmount(toBigDecimal(invoice.getVatEligibleAmount(), DECIMAL_POINTS))
+			.withInvoiceRows(invoiceDetails.stream()
+				.map(InvoiceDecorator::toInvoiceRow)
+				.toList())
+			.build();
+	}
+
+	static InvoiceRow toInvoiceRow(final InvoiceDetail invoiceDetail) {
+		return InvoiceRow.builder()
+			.withAmount(toBigDecimal(invoiceDetail.getAmount(), DECIMAL_POINTS))
+			.withAmountVatExcluded(toBigDecimal(invoiceDetail.getAmountVatExcluded(), DECIMAL_POINTS))
+			.withVat(toBigDecimal(invoiceDetail.getVat(), DECIMAL_POINTS))
+			.withVatRate(toBigDecimal(invoiceDetail.getVatRate(), DECIMAL_POINTS))
+			.withQuantity(toBigDecimal(invoiceDetail.getQuantity(), DECIMAL_POINTS))
+			.withUnit(invoiceDetail.getUnit())
+			.withUnitPrice(toBigDecimal(invoiceDetail.getUnitPrice(), DECIMAL_POINTS))
+			.withDescription(invoiceDetail.getDescription())
+			.withProductCode(invoiceDetail.getProductCode())
+			.withProductName(invoiceDetail.getProductName())
+			.withPeriodFrom(ofNullable(invoiceDetail.getFromDate()).map(date -> date.format(DateTimeFormatter.ISO_LOCAL_DATE)).orElse(null))
+			.withPeriodTo(ofNullable(invoiceDetail.getToDate()).map(date -> date.format(DateTimeFormatter.ISO_LOCAL_DATE)).orElse(null))
 			.build();
 	}
 
-	private static se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address toAddress(Address address) {
+	static Address toAddress(final generated.se.sundsvall.invoices.Address address) {
 		return ofNullable(address)
-			.map(a -> se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address.builder()
+			.map(a -> Address.builder()
 				.withCareOf(a.getCareOf())
 				.withCity(a.getCity())
 				.withPostalCode(a.getPostcode())
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/Invoice.java b/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/Invoice.java
index 86aed10..f5cb0a4 100644
--- a/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/Invoice.java
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/Invoice.java
@@ -3,6 +3,8 @@
 import io.swagger.v3.oas.annotations.media.Schema;
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
 import lombok.AccessLevel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -26,6 +28,8 @@ public class Invoice {
 
 	private LocalDate dueDate;
 
+	private String facilityId;
+
 	private Address invoiceAddress;
 
 	private LocalDate invoicingDate;
@@ -53,4 +57,7 @@ public class Invoice {
 	private BigDecimal vat;
 
 	private BigDecimal vatEligibleAmount;
+
+	@Builder.Default
+	private List<InvoiceRow> invoiceRows = new ArrayList<>();
 }
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceRow.java b/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceRow.java
new file mode 100644
index 0000000..2db98f7
--- /dev/null
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceRow.java
@@ -0,0 +1,41 @@
+package se.sundsvall.selfserviceai.integration.intric.model.filecontent;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.math.BigDecimal;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor(access = AccessLevel.PACKAGE)
+@Builder(setterPrefix = "with")
+@Schema(description = "Model for invoice rows data sent to intric")
+public class InvoiceRow {
+
+	private BigDecimal amount;
+
+	private BigDecimal amountVatExcluded;
+
+	private BigDecimal vat;
+
+	private BigDecimal vatRate;
+
+	private BigDecimal quantity;
+
+	private String unit;
+
+	private BigDecimal unitPrice;
+
+	private String description;
+
+	private String productCode;
+
+	private String productName;
+
+	private String periodFrom;
+
+	private String periodTo;
+}
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesClient.java b/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesClient.java
index c744714..a162f61 100644
--- a/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesClient.java
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesClient.java
@@ -3,6 +3,7 @@
 import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
 import static se.sundsvall.selfserviceai.integration.invoices.configuration.InvoicesConfiguration.CLIENT_ID;
 
+import generated.se.sundsvall.invoices.InvoiceDetailsResponse;
 import generated.se.sundsvall.invoices.InvoiceOrigin;
 import generated.se.sundsvall.invoices.InvoicesResponse;
 import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
@@ -31,4 +32,18 @@ InvoicesResponse getInvoices(
 		@RequestParam("organizationGroup") final String organizationGroup,
 		@RequestParam("invoiceDateFrom") final String invoiceDateFrom,
 		@RequestParam("invoiceDateTo") final String invoiceDateTo);
+
+	/**
+	 * Get invoice details for a specific invoice
+	 *
+	 * @param  municipalityId     the municipality id
+	 * @param  organizationNumber the organization number
+	 * @param  invoiceNumber      the invoice number
+	 * @return                    InvoiceDetailsResponse containing details for the specific invoice
+	 */
+	@GetMapping(path = "/{municipalityId}/COMMERCIAL/{organizationNumber}/{invoiceNumber}/details", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
+	InvoiceDetailsResponse getInvoiceDetails(
+		@PathVariable("municipalityId") final String municipalityId,
+		@PathVariable("organizationNumber") final String organizationNumber,
+		@PathVariable("invoiceNumber") final String invoiceNumber);
 }
diff --git a/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesIntegration.java b/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesIntegration.java
index 5bd2e5d..bee3374 100644
--- a/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesIntegration.java
+++ b/src/main/java/se/sundsvall/selfserviceai/integration/invoices/InvoicesIntegration.java
@@ -6,6 +6,7 @@
 import static org.zalando.problem.Status.NOT_FOUND;
 
 import generated.se.sundsvall.invoices.Invoice;
+import generated.se.sundsvall.invoices.InvoiceDetail;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -24,7 +25,12 @@ public class InvoicesIntegration {
 		this.invoicesClient = invoicesClient;
 	}
 
-	public List<Invoice> getInvoices(String municipalityId, String partyId) {
+	public List<InvoiceDetail> getInvoiceDetails(final String municipalityId, final Invoice invoice) {
+		var response = invoicesClient.getInvoiceDetails(municipalityId, invoice.getOrganizationNumber(), invoice.getInvoiceNumber());
+		return response.getDetails();
+	}
+
+	public List<Invoice> getInvoices(final String municipalityId, final String partyId) {
 		final var fromDate = LocalDate.now().withDayOfMonth(1).minusMonths(6); // First day of previous 6:th month
 		final var toDate = LocalDate.now(); // Todays date
 
@@ -38,7 +44,7 @@ public List<Invoice> getInvoices(String municipalityId, String partyId) {
 		}
 	}
 
-	private List<Invoice> getInvoices(String municipalityId, String partyId, LocalDate fromDate, LocalDate toDate, int page, List<Invoice> invoices) {
+	private List<Invoice> getInvoices(final String municipalityId, final String partyId, final LocalDate fromDate, final LocalDate toDate, final int page, final List<Invoice> invoices) {
 
 		final var response = invoicesClient.getInvoices(municipalityId, COMMERCIAL, page, 100, partyId, ORGANIZATION_GROUP, toString(fromDate), toString(toDate));
 		ofNullable(response.getInvoices()).ifPresent(invoices::addAll);
@@ -50,7 +56,7 @@ private List<Invoice> getInvoices(String municipalityId, String partyId, LocalDa
 		return invoices;
 	}
 
-	private String toString(LocalDate date) {
+	private String toString(final LocalDate date) {
 		return ofNullable(date)
 			.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
 			.orElse(null);
diff --git a/src/main/java/se/sundsvall/selfserviceai/service/AssistantService.java b/src/main/java/se/sundsvall/selfserviceai/service/AssistantService.java
index a67e74e..5b52bca 100644
--- a/src/main/java/se/sundsvall/selfserviceai/service/AssistantService.java
+++ b/src/main/java/se/sundsvall/selfserviceai/service/AssistantService.java
@@ -7,6 +7,7 @@
 import static org.zalando.problem.Status.NOT_FOUND;
 import static se.sundsvall.selfserviceai.integration.db.DatabaseMapper.toFileEntity;
 import static se.sundsvall.selfserviceai.integration.db.DatabaseMapper.toSessionEntity;
+import static se.sundsvall.selfserviceai.integration.intric.mapper.InvoiceDecorator.toDecoratedInvoice;
 import static se.sundsvall.selfserviceai.service.mapper.AssistantMapper.toQuestionResponse;
 import static se.sundsvall.selfserviceai.service.mapper.AssistantMapper.toSessionResponse;
 
@@ -139,8 +140,13 @@ private IntricModel buildIntricModel(final String municipalityId, final String p
 		// Enrich all facility with agreement, invoice and measurement information
 		final var facilities = ofNullable(intricModel.getFacilities()).orElse(emptyList());
 
+		// Fetch all invoices and their respective details.
+		var decoratedInvoices = invoicesIntegration.getInvoices(municipalityId, partyId).stream()
+			.map(invoice -> toDecoratedInvoice(invoice, invoicesIntegration.getInvoiceDetails(municipalityId, invoice)))
+			.toList();
+
 		AgreementDecorator.addAgreements(facilities, agreementIntegration.getAgreements(municipalityId, partyId));
-		InvoiceDecorator.addInvoices(facilities, invoicesIntegration.getInvoices(municipalityId, partyId));
+		InvoiceDecorator.addInvoices(facilities, decoratedInvoices);
 		MeasurementDecorator.addMeasurements(facilities, measurementDataIntegration.getMeasurementData(municipalityId, partyId, facilities));
 
 		return intricModel;
@@ -192,8 +198,8 @@ public void cleanUpInactiveSessions(final Integer inactivityThreshold) {
 	}
 
 	/**
-	 * To be subject for removal the session must either have a last accessed timestamp, or a
-	 * created timestamp that is before the defined threshold for inactivity
+	 * To be subject for removal the session must either have a last accessed timestamp, or a created timestamp that is
+	 * before the defined threshold for inactivity
 	 *
 	 * @param  timestamp timestamp when session is interpreted as inactive
 	 * @param  session   session to evaluate
diff --git a/src/test/java/se/sundsvall/selfserviceai/TestFactory.java b/src/test/java/se/sundsvall/selfserviceai/TestFactory.java
index 869f39c..b1e9446 100644
--- a/src/test/java/se/sundsvall/selfserviceai/TestFactory.java
+++ b/src/test/java/se/sundsvall/selfserviceai/TestFactory.java
@@ -6,8 +6,7 @@
 import generated.se.sundsvall.installedbase.InstalledBaseItem;
 import generated.se.sundsvall.installedbase.InstalledBaseItemAddress;
 import generated.se.sundsvall.installedbase.InstalledBaseItemMetaData;
-import generated.se.sundsvall.invoices.Address;
-import generated.se.sundsvall.invoices.Invoice;
+import generated.se.sundsvall.invoices.InvoiceDetail;
 import generated.se.sundsvall.invoices.InvoiceStatus;
 import generated.se.sundsvall.invoices.InvoiceType;
 import generated.se.sundsvall.measurementdata.Data;
@@ -19,6 +18,7 @@
 import java.time.ZoneId;
 import java.util.List;
 import java.util.UUID;
+import java.util.function.Consumer;
 import se.sundsvall.selfserviceai.integration.intric.model.Assistant;
 import se.sundsvall.selfserviceai.integration.intric.model.CompletionModel;
 import se.sundsvall.selfserviceai.integration.intric.model.FilePublic;
@@ -28,6 +28,10 @@
 import se.sundsvall.selfserviceai.integration.intric.model.SessionFeedback;
 import se.sundsvall.selfserviceai.integration.intric.model.SessionPublic;
 import se.sundsvall.selfserviceai.integration.intric.model.Tools;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Facility;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice;
+import se.sundsvall.selfserviceai.integration.intric.model.filecontent.InvoiceRow;
 
 public class TestFactory {
 	private TestFactory() {}
@@ -383,54 +387,143 @@ public static List<Data> createMeasurements(boolean containsMatches) {
 				.facilityId(NO_MATCH));
 	}
 
-	public static List<Invoice> createInvoices(boolean containsMatches) {
-		return containsMatches ? List.of(
-			new Invoice()
-				.facilityId(IB1_FACILITY_ID)
-				.amountVatExcluded(Float.valueOf(IB1_INVOICE1_AMOUNT_VAT_EXCLUDED))
-				.amountVatIncluded(Float.valueOf(IB1_INVOICE1_AMOUNT_VAT_INCLUDED))
-				.currency(IB1_INVOICE1_CURRENCY)
-				.dueDate(IB1_INVOICE1_DUE_DATE)
-				.invoiceDate(IB1_INVOICE1_DATE)
-				.invoiceAddress(new Address()
-					.careOf(IB1_INVOICE1_CARE_OF)
-					.city(IB1_INVOICE1_CITY)
-					.postcode(IB1_INVOICE1_POSTAL_CODE)
-					.street(IB1_INVOICE1_STREET))
-				.invoiceDescription(IB1_INVOICE1_DESCRIPTION)
-				.invoiceName(IB1_INVOICE1_NAME)
-				.invoiceNumber(IB1_INVOICE1_NUMBER)
-				.invoiceStatus(IB1_INVOICE1_STATUS)
-				.invoiceType(IB1_INVOICE1_TYPE)
-				.ocrNumber(IB1_INVOICE1_OCR_NUMBER)
-				.organizationNumber(IB1_INVOICE1_ORGANIZATION_NUMBER)
-				.pdfAvailable(IB1_INVOICE1_PDF_AVAILABLE)
-				.reversedVat(IB1_INVOICE1_REVERSED_VAT)
-				.rounding(Float.valueOf(IB1_INVOICE1_ROUNDING))
-				.totalAmount(Float.valueOf(IB1_INVOICE1_TOTAL_AMOUNT))
-				.vat(Float.valueOf(IB1_INVOICE1_VAT))
-				.vatEligibleAmount(Float.valueOf(IB1_INVOICE1_VAT_ELIGIBLE_AMOUNT)),
-			new Invoice()
-				.facilityId(IB1_FACILITY_ID)
-				.amountVatExcluded(Float.valueOf(IB1_INVOICE2_AMOUNT_VAT_EXCLUDED))
-				.amountVatIncluded(Float.valueOf(IB1_INVOICE2_AMOUNT_VAT_INCLUDED))
-				.currency(IB1_INVOICE2_CURRENCY)
-				.dueDate(IB1_INVOICE2_DUE_DATE)
-				.invoiceDate(IB1_INVOICE2_DATE)
-				.invoiceDescription(IB1_INVOICE2_DESCRIPTION)
-				.invoiceName(IB1_INVOICE2_NAME)
-				.invoiceNumber(IB1_INVOICE2_NUMBER)
-				.invoiceStatus(IB1_INVOICE2_STATUS)
-				.invoiceType(IB1_INVOICE2_TYPE)
-				.ocrNumber(IB1_INVOICE2_OCR_NUMBER)
-				.organizationNumber(IB1_INVOICE2_ORGANIZATION_NUMBER)
-				.reversedVat(IB1_INVOICE2_REVERSED_VAT)
-				.rounding(Float.valueOf(IB1_INVOICE2_ROUNDING))
-				.totalAmount(Float.valueOf(IB1_INVOICE2_TOTAL_AMOUNT))
-				.vat(Float.valueOf(IB1_INVOICE2_VAT))
-				.vatEligibleAmount(Float.valueOf(IB1_INVOICE2_VAT_ELIGIBLE_AMOUNT))
-
-		) : List.of(new Invoice().facilityId(NO_MATCH));
+	public static Facility createFacility() {
+		return createFacility(null);
+	}
+
+	public static Facility createFacility(final Consumer<Facility> consumer) {
+		var facility = Facility.builder()
+			.withFacilityId("facilityId1")
+			.withAddress(Address.builder()
+				.withStreet("street")
+				.withPostalCode("postalCode")
+				.withCareOf("careOf")
+				.withCity("city")
+				.build())
+			.build();
+
+		if (consumer != null) {
+			consumer.accept(facility);
+		}
+
+		return facility;
+	}
+
+	public static se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice createInvoice() {
+		return createInvoice(null);
+	}
+
+	public static se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice createInvoice(final Consumer<Invoice> consumer) {
+		var invoice = se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice.builder()
+			.withAmountVatExcluded(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_AMOUNT_VAT_EXCLUDED)))
+			.withAmountVatIncluded(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_AMOUNT_VAT_INCLUDED)))
+			.withCurrency(IB1_INVOICE1_CURRENCY)
+			.withDescription(IB1_INVOICE1_DESCRIPTION)
+			.withFacilityId(IB1_FACILITY_ID)
+			.withInvoiceAddress(se.sundsvall.selfserviceai.integration.intric.model.filecontent.Address.builder()
+				.withCareOf(IB1_CARE_OF)
+				.withCity(IB1_CITY)
+				.withPostalCode(IB1_POSTAL_CODE)
+				.withStreet(IB1_STREET)
+				.build())
+			.withInvoicingDate(IB1_INVOICE1_DATE)
+			.withInvoiceName(IB1_INVOICE1_NAME)
+			.withInvoiceNumber(IB1_INVOICE1_NUMBER)
+			.withInvoiceType(IB1_TYPE)
+			.withDueDate(IB1_INVOICE1_DUE_DATE)
+			.withOcrNumber(IB1_INVOICE1_OCR_NUMBER)
+			.withOrganizationNumber(IB1_INVOICE1_ORGANIZATION_NUMBER)
+			.withPdfAvailable(IB1_INVOICE1_PDF_AVAILABLE)
+			.withReversedVat(IB1_INVOICE1_REVERSED_VAT)
+			.withRounding(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_ROUNDING)))
+			.withStatus(IB1_INVOICE1_STATUS.toString())
+			.withTotalAmount(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_TOTAL_AMOUNT)))
+			.withVat(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_VAT)))
+			.withVatEligibleAmount(BigDecimal.valueOf(Double.parseDouble(IB1_INVOICE1_VAT_ELIGIBLE_AMOUNT)))
+			.withInvoiceRows(List.of(createInvoiceRow()))
+			.build();
+
+		if (consumer != null) {
+			consumer.accept(invoice);
+		}
+
+		return invoice;
+	}
+
+	public static InvoiceDetail createInvoiceDetail() {
+		return new InvoiceDetail()
+			.amount(12f)
+			.amountVatExcluded(12f)
+			.fromDate(LocalDate.now())
+			.toDate(LocalDate.now())
+			.vat(10f)
+			.vatRate(10f)
+			.quantity(10f)
+			.description("description")
+			.productCode("productCode")
+			.productName("productName")
+			.unit("unit");
+	}
+
+	public static generated.se.sundsvall.invoices.Address createAddress() {
+		return new generated.se.sundsvall.invoices.Address()
+			.careOf("careOf")
+			.city("city")
+			.postcode("postcode")
+			.street("street");
+	}
+
+	public static InvoiceRow createInvoiceRow() {
+		return createInvoiceRow(null);
+	}
+
+	public static InvoiceRow createInvoiceRow(final Consumer<InvoiceRow> consumer) {
+		var invoiceRow = InvoiceRow.builder()
+			.withAmount(BigDecimal.ONE)
+			.withAmountVatExcluded(BigDecimal.ONE)
+			.withVat(BigDecimal.ONE)
+			.withVatRate(BigDecimal.ONE)
+			.withQuantity(BigDecimal.ONE)
+			.withUnit("unit")
+			.withUnitPrice(BigDecimal.ONE)
+			.withPeriodFrom("periodFrom")
+			.withPeriodTo("periodTo")
+			.withProductCode("productCode")
+			.withProductName("productName")
+			.build();
+
+		if (consumer != null) {
+			consumer.accept(invoiceRow);
+		}
+
+		return invoiceRow;
+	}
 
+	public static generated.se.sundsvall.invoices.Invoice createGeneratedInvoice() {
+		return new generated.se.sundsvall.invoices.Invoice()
+			.facilityId(IB1_FACILITY_ID)
+			.amountVatExcluded(Float.valueOf(IB1_INVOICE1_AMOUNT_VAT_EXCLUDED))
+			.amountVatIncluded(Float.valueOf(IB1_INVOICE1_AMOUNT_VAT_INCLUDED))
+			.currency(IB1_INVOICE1_CURRENCY)
+			.dueDate(IB1_INVOICE1_DUE_DATE)
+			.invoiceDate(IB1_INVOICE1_DATE)
+			.invoiceAddress(new generated.se.sundsvall.invoices.Address()
+				.careOf(IB1_INVOICE1_CARE_OF)
+				.city(IB1_INVOICE1_CITY)
+				.postcode(IB1_INVOICE1_POSTAL_CODE)
+				.street(IB1_INVOICE1_STREET))
+			.invoiceDescription(IB1_INVOICE1_DESCRIPTION)
+			.invoiceName(IB1_INVOICE1_NAME)
+			.invoiceNumber(IB1_INVOICE1_NUMBER)
+			.invoiceStatus(IB1_INVOICE1_STATUS)
+			.invoiceType(IB1_INVOICE1_TYPE)
+			.ocrNumber(IB1_INVOICE1_OCR_NUMBER)
+			.organizationNumber(IB1_INVOICE1_ORGANIZATION_NUMBER)
+			.pdfAvailable(IB1_INVOICE1_PDF_AVAILABLE)
+			.reversedVat(IB1_INVOICE1_REVERSED_VAT)
+			.rounding(Float.valueOf(IB1_INVOICE1_ROUNDING))
+			.totalAmount(Float.valueOf(IB1_INVOICE1_TOTAL_AMOUNT))
+			.vat(Float.valueOf(IB1_INVOICE1_VAT))
+			.vatEligibleAmount(Float.valueOf(IB1_INVOICE1_VAT_ELIGIBLE_AMOUNT));
 	}
 }
diff --git a/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecoratorTest.java b/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecoratorTest.java
index 70a9c68..e905a3e 100644
--- a/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecoratorTest.java
+++ b/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/InvoiceDecoratorTest.java
@@ -1,104 +1,124 @@
 package se.sundsvall.selfserviceai.integration.intric.mapper;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static se.sundsvall.selfserviceai.TestFactory.createCustomer;
-import static se.sundsvall.selfserviceai.TestFactory.createInvoices;
+import static se.sundsvall.selfserviceai.TestFactory.createAddress;
+import static se.sundsvall.selfserviceai.TestFactory.createFacility;
+import static se.sundsvall.selfserviceai.TestFactory.createGeneratedInvoice;
+import static se.sundsvall.selfserviceai.TestFactory.createInvoice;
+import static se.sundsvall.selfserviceai.TestFactory.createInvoiceDetail;
+import static se.sundsvall.selfserviceai.integration.intric.mapper.InvoiceDecorator.DECIMAL_POINTS;
+import static se.sundsvall.selfserviceai.integration.intric.util.ConversionUtil.toBigDecimal;
+import static se.sundsvall.selfserviceai.integration.intric.util.ConversionUtil.toBoolean;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Map;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
 import org.junit.jupiter.api.Test;
-import se.sundsvall.selfserviceai.TestFactory;
-import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Facility;
-import se.sundsvall.selfserviceai.integration.intric.model.filecontent.Invoice;
 
 class InvoiceDecoratorTest {
 
-	private static final IntricMapper INTRIC_MAPPER = new IntricMapper();
-
 	@Test
 	void addInvoices() {
-		// Arrange
-		final var intricModel = INTRIC_MAPPER.toIntricModel(Map.of("123456", createCustomer()));
-		final var invoices = new ArrayList<>(createInvoices(true));
-		invoices.add(null);
-
-		// Act
-		InvoiceDecorator.addInvoices(intricModel.getFacilities(), invoices);
-
-		// Assert
-		assertThat(intricModel.getFacilities()).satisfiesExactlyInAnyOrder(f -> {
-			assertThat(f.getInvoices()).hasSize(2).satisfiesExactlyInAnyOrder(this::assertInvoiceWithAddress, this::assertInvoiceWithoutAddress);
-		}, f -> assertThat(f.getInvoices()).isEmpty());
-	}
+		var facilities = List.of(createFacility(facility -> facility.setFacilityId("123")));
 
-	private void assertInvoiceWithoutAddress(Invoice i) {
-		assertThat(i.getAmountVatExcluded()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_AMOUNT_VAT_EXCLUDED));
-		assertThat(i.getAmountVatIncluded()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_AMOUNT_VAT_INCLUDED));
-		assertThat(i.getCurrency()).isEqualTo(TestFactory.IB1_INVOICE2_CURRENCY);
-		assertThat(i.getDescription()).isEqualTo(TestFactory.IB1_INVOICE2_DESCRIPTION);
-		assertThat(i.getDueDate()).isEqualTo(TestFactory.IB1_INVOICE2_DUE_DATE);
-		assertThat(i.getInvoiceAddress()).isNull();
-		assertThat(i.getInvoiceName()).isEqualTo(TestFactory.IB1_INVOICE2_NAME);
-		assertThat(i.getInvoiceNumber()).isEqualTo(TestFactory.IB1_INVOICE2_NUMBER);
-		assertThat(i.getInvoiceType()).isEqualTo(TestFactory.IB1_INVOICE2_TYPE.name());
-		assertThat(i.getInvoicingDate()).isEqualTo(TestFactory.IB1_INVOICE2_DATE);
-		assertThat(i.getOcrNumber()).isEqualTo(TestFactory.IB1_INVOICE2_OCR_NUMBER);
-		assertThat(i.getOrganizationNumber()).isEqualTo(TestFactory.IB1_INVOICE2_ORGANIZATION_NUMBER);
-		assertThat(i.getRounding()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_ROUNDING));
-		assertThat(i.getStatus()).isEqualTo(TestFactory.IB1_INVOICE2_STATUS.name());
-		assertThat(i.getTotalAmount()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_TOTAL_AMOUNT));
-		assertThat(i.getVat()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_VAT));
-		assertThat(i.getVatEligibleAmount()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE2_VAT_ELIGIBLE_AMOUNT));
-	}
+		var invoice1 = createInvoice(invoice -> invoice.setFacilityId("123"));
+		var invoice2 = createInvoice(invoice -> invoice.setFacilityId("321"));
+		var invoice3 = createInvoice(invoice -> invoice.setFacilityId("123"));
+		var invoices = List.of(invoice1, invoice2, invoice3);
 
-	private void assertInvoiceWithAddress(Invoice i) {
-		assertThat(i.getAmountVatExcluded()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_AMOUNT_VAT_EXCLUDED));
-		assertThat(i.getAmountVatIncluded()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_AMOUNT_VAT_INCLUDED));
-		assertThat(i.getCurrency()).isEqualTo(TestFactory.IB1_INVOICE1_CURRENCY);
-		assertThat(i.getDescription()).isEqualTo(TestFactory.IB1_INVOICE1_DESCRIPTION);
-		assertThat(i.getDueDate()).isEqualTo(TestFactory.IB1_INVOICE1_DUE_DATE);
-		assertThat(i.getInvoiceAddress()).isNotNull().satisfies(a -> {
-			assertThat(a.getCareOf()).isEqualTo(TestFactory.IB1_INVOICE1_CARE_OF);
-			assertThat(a.getCity()).isEqualTo(TestFactory.IB1_INVOICE1_CITY);
-			assertThat(a.getPostalCode()).isEqualTo(TestFactory.IB1_INVOICE1_POSTAL_CODE);
-			assertThat(a.getStreet()).isEqualTo(TestFactory.IB1_INVOICE1_STREET);
-		});
-		assertThat(i.getInvoiceName()).isEqualTo(TestFactory.IB1_INVOICE1_NAME);
-		assertThat(i.getInvoiceNumber()).isEqualTo(TestFactory.IB1_INVOICE1_NUMBER);
-		assertThat(i.getInvoiceType()).isEqualTo(TestFactory.IB1_INVOICE1_TYPE.name());
-		assertThat(i.getInvoicingDate()).isEqualTo(TestFactory.IB1_INVOICE1_DATE);
-		assertThat(i.getOcrNumber()).isEqualTo(TestFactory.IB1_INVOICE1_OCR_NUMBER);
-		assertThat(i.getOrganizationNumber()).isEqualTo(TestFactory.IB1_INVOICE1_ORGANIZATION_NUMBER);
-		assertThat(i.getRounding()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_ROUNDING));
-		assertThat(i.getStatus()).isEqualTo(TestFactory.IB1_INVOICE1_STATUS.name());
-		assertThat(i.getTotalAmount()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_TOTAL_AMOUNT));
-		assertThat(i.getVat()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_VAT));
-		assertThat(i.getVatEligibleAmount()).isEqualTo(new BigDecimal(TestFactory.IB1_INVOICE1_VAT_ELIGIBLE_AMOUNT));
+		InvoiceDecorator.addInvoices(facilities, invoices);
+
+		var facility = facilities.getFirst();
+		assertThat(facility.getInvoices()).isNotNull().hasSize(2).containsExactlyInAnyOrder(invoice1, invoice3);
 	}
 
 	@Test
 	void addInvoicesNoMatches() {
-		// Arrange
-		final var installedBase = INTRIC_MAPPER.toIntricModel(Map.of("123456", createCustomer()));
-		final var invoices = new ArrayList<>(createInvoices(false));
+		var facilities = List.of(createFacility(facility -> facility.setFacilityId("123")));
+
+		var invoice1 = createInvoice(invoice -> invoice.setFacilityId("321"));
+		var invoice2 = createInvoice(invoice -> invoice.setFacilityId("321"));
+		var invoice3 = createInvoice(invoice -> invoice.setFacilityId("321"));
+		var invoices = List.of(invoice1, invoice2, invoice3);
 
-		// Act
-		InvoiceDecorator.addInvoices(installedBase.getFacilities(), invoices);
+		InvoiceDecorator.addInvoices(facilities, invoices);
 
-		// Assert
-		assertThat(installedBase.getFacilities()).flatExtracting(Facility::getInvoices).isEmpty();
+		var facility = facilities.getFirst();
+		assertThat(facility.getInvoices()).isNotNull().isEmpty();
 	}
 
 	@Test
 	void addInvoicesFromNull() {
-		// Arrange
-		final var installedBase = INTRIC_MAPPER.toIntricModel(Map.of("123456", createCustomer()));
+		var facilities = List.of(createFacility(facility -> facility.setFacilityId("123")));
+
+		InvoiceDecorator.addInvoices(facilities, null);
+
+		var facility = facilities.getFirst();
+		assertThat(facility.getInvoices()).isNotNull().isEmpty();
+	}
+
+	@Test
+	void toDecoratedInvoice() {
+		generated.se.sundsvall.invoices.Invoice invoice = createGeneratedInvoice();
+		var invoiceDetail1 = createInvoiceDetail();
+		var invoiceDetail2 = createInvoiceDetail();
+		var invoiceDetail3 = createInvoiceDetail();
+		var invoiceDetails = List.of(invoiceDetail1, invoiceDetail2, invoiceDetail3);
+
+		var result = InvoiceDecorator.toDecoratedInvoice(invoice, invoiceDetails);
 
-		// Act
-		InvoiceDecorator.addInvoices(installedBase.getFacilities(), null);
+		assertThat(result.getAmountVatExcluded()).isEqualTo(toBigDecimal(invoice.getAmountVatExcluded(), DECIMAL_POINTS));
+		assertThat(result.getAmountVatIncluded()).isEqualTo(toBigDecimal(invoice.getAmountVatIncluded(), DECIMAL_POINTS));
+		assertThat(result.getCurrency()).isEqualTo(invoice.getCurrency());
+		assertThat(result.getDescription()).isEqualTo(invoice.getInvoiceDescription());
+		assertThat(result.getDueDate()).isEqualTo(invoice.getDueDate());
+		assertThat(result.getFacilityId()).isEqualTo(invoice.getFacilityId());
+		assertThat(result.getInvoiceAddress()).usingRecursiveComparison().isEqualTo(InvoiceDecorator.toAddress(invoice.getInvoiceAddress()));
+		assertThat(result.getInvoiceName()).isEqualTo(invoice.getInvoiceName());
+		assertThat(result.getInvoiceNumber()).isEqualTo(invoice.getInvoiceNumber());
+		assertThat(result.getInvoiceType()).isEqualTo(invoice.getInvoiceType().name());
+		assertThat(result.getInvoicingDate()).isEqualTo(invoice.getInvoiceDate());
+		assertThat(result.getOrganizationNumber()).isEqualTo(invoice.getOrganizationNumber());
+		assertThat(result.isPdfAvailable()).isEqualTo(toBoolean(invoice.getPdfAvailable()));
+		assertThat(result.isReversedVat()).isEqualTo(toBoolean(invoice.getReversedVat()));
+		assertThat(result.getRounding()).isEqualTo(toBigDecimal(invoice.getRounding(), DECIMAL_POINTS));
+		assertThat(result.getStatus()).isEqualTo(invoice.getInvoiceStatus().name());
+		assertThat(result.getTotalAmount()).isEqualTo(toBigDecimal(invoice.getTotalAmount(), DECIMAL_POINTS));
+		assertThat(result.getVat()).isEqualTo(toBigDecimal(invoice.getVat(), DECIMAL_POINTS));
+		assertThat(result.getVatEligibleAmount()).isEqualTo(toBigDecimal(invoice.getVatEligibleAmount(), DECIMAL_POINTS));
+		assertThat(result.getInvoiceRows()).hasSize(3);
+	}
+
+	@Test
+	void toInvoiceRow() {
+		var invoiceDetail = createInvoiceDetail();
 
-		// Assert
-		assertThat(installedBase.getFacilities()).flatExtracting(Facility::getInvoices).isEmpty();
+		var result = InvoiceDecorator.toInvoiceRow(invoiceDetail);
+
+		assertThat(result.getAmount()).isEqualTo(toBigDecimal(invoiceDetail.getAmount(), DECIMAL_POINTS));
+		assertThat(result.getAmountVatExcluded()).isEqualTo(toBigDecimal(invoiceDetail.getAmountVatExcluded(), DECIMAL_POINTS));
+		assertThat(result.getVat()).isEqualTo(toBigDecimal(invoiceDetail.getVat(), DECIMAL_POINTS));
+		assertThat(result.getVatRate()).isEqualTo(toBigDecimal(invoiceDetail.getVatRate(), DECIMAL_POINTS));
+		assertThat(result.getQuantity()).isEqualTo(toBigDecimal(invoiceDetail.getQuantity(), DECIMAL_POINTS));
+		assertThat(result.getUnit()).isEqualTo(invoiceDetail.getUnit());
+		assertThat(result.getUnitPrice()).isEqualTo(toBigDecimal(invoiceDetail.getUnitPrice(), DECIMAL_POINTS));
+		assertThat(result.getDescription()).isEqualTo(invoiceDetail.getDescription());
+		assertThat(result.getProductCode()).isEqualTo(invoiceDetail.getProductCode());
+		assertThat(result.getProductName()).isEqualTo(invoiceDetail.getProductName());
+		assertThat(result.getPeriodFrom()).isEqualTo(invoiceDetail.getFromDate().format(DateTimeFormatter.ISO_LOCAL_DATE));
+		assertThat(result.getPeriodTo()).isEqualTo(invoiceDetail.getToDate().format(DateTimeFormatter.ISO_LOCAL_DATE));
 	}
+
+	@Test
+	void toAddress() {
+		var address = createAddress();
+
+		var result = InvoiceDecorator.toAddress(address);
+
+		assertThat(result.getCareOf()).isEqualTo(address.getCareOf());
+		assertThat(result.getCity()).isEqualTo(address.getCity());
+		assertThat(result.getPostalCode()).isEqualTo(address.getPostcode());
+		assertThat(result.getStreet()).isEqualTo(address.getStreet());
+
+	}
+
 }
diff --git a/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/JsonBuilderTest.java b/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/JsonBuilderTest.java
index c3235aa..c4ce5f3 100644
--- a/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/JsonBuilderTest.java
+++ b/src/test/java/se/sundsvall/selfserviceai/integration/intric/mapper/JsonBuilderTest.java
@@ -7,10 +7,11 @@
 import static org.zalando.problem.Status.INTERNAL_SERVER_ERROR;
 import static se.sundsvall.selfserviceai.TestFactory.createAgreements;
 import static se.sundsvall.selfserviceai.TestFactory.createCustomer;
-import static se.sundsvall.selfserviceai.TestFactory.createInvoices;
+import static se.sundsvall.selfserviceai.TestFactory.createInvoice;
 import static se.sundsvall.selfserviceai.TestFactory.createMeasurements;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import java.util.List;
 import java.util.Map;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -25,12 +26,16 @@ class JsonBuilderTest {
 	private static final IntricMapper INTRIC_MAPPER = new IntricMapper();
 
 	@Test
-	void toJson(@Load(value = "junit/expected-structure.json", as = Load.ResourceType.STRING) String expected) throws Exception {
+	void toJson(@Load(value = "junit/expected-structure.json", as = Load.ResourceType.STRING) String expected) {
 		final var intricModel = INTRIC_MAPPER.toIntricModel(Map.of("123456789", createCustomer()));
 
+		var invoice1 = createInvoice();
+		var invoice2 = createInvoice();
+		var invoices = List.of(invoice1, invoice2);
+
 		AgreementDecorator.addAgreements(intricModel.getFacilities(), createAgreements(true));
 		MeasurementDecorator.addMeasurements(intricModel.getFacilities(), createMeasurements(true));
-		InvoiceDecorator.addInvoices(intricModel.getFacilities(), createInvoices(true));
+		InvoiceDecorator.addInvoices(intricModel.getFacilities(), invoices);
 
 		final var jsonBuilder = new JsonBuilder(new ObjectMapper());
 		assertThat(jsonBuilder.toJsonString(intricModel)).isEqualToIgnoringWhitespace(expected);
diff --git a/src/test/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceTest.java b/src/test/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceTest.java
index d49a027..231f653 100644
--- a/src/test/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceTest.java
+++ b/src/test/java/se/sundsvall/selfserviceai/integration/intric/model/filecontent/InvoiceTest.java
@@ -40,6 +40,7 @@ void testBuilderMethodsForInvoice() {
 		final var currency = "currency";
 		final var description = "description";
 		final var dueDate = LocalDate.now();
+		final var facilityId = "facilityId";
 		final var invoiceAddress = Address.builder().build();
 		final var invoiceName = "invoiceName";
 		final var invoiceNumber = "invoiceNumber";
@@ -61,6 +62,7 @@ void testBuilderMethodsForInvoice() {
 			.withCurrency(currency)
 			.withDescription(description)
 			.withDueDate(dueDate)
+			.withFacilityId(facilityId)
 			.withInvoiceAddress(invoiceAddress)
 			.withInvoiceName(invoiceName)
 			.withInvoiceNumber(invoiceNumber)
@@ -83,6 +85,7 @@ void testBuilderMethodsForInvoice() {
 		assertThat(bean.getCurrency()).isEqualTo(currency);
 		assertThat(bean.getDescription()).isEqualTo(description);
 		assertThat(bean.getDueDate()).isEqualTo(dueDate);
+		assertThat(bean.getFacilityId()).isEqualTo(facilityId);
 		assertThat(bean.getInvoiceAddress()).isEqualTo(invoiceAddress);
 		assertThat(bean.getInvoiceName()).isEqualTo(invoiceName);
 		assertThat(bean.getInvoiceNumber()).isEqualTo(invoiceNumber);
@@ -100,11 +103,11 @@ void testBuilderMethodsForInvoice() {
 	@Test
 	void testNoDirtOnCreatedBean() {
 		assertThat(Invoice.builder().build())
-			.hasAllNullFieldsOrPropertiesExcept("pdfAvailable", "reversedVat")
+			.hasAllNullFieldsOrPropertiesExcept("pdfAvailable", "reversedVat", "invoiceRows")
 			.hasFieldOrPropertyWithValue("pdfAvailable", false)
 			.hasFieldOrPropertyWithValue("reversedVat", false);
 		assertThat(new Invoice())
-			.hasAllNullFieldsOrPropertiesExcept("pdfAvailable", "reversedVat")
+			.hasAllNullFieldsOrPropertiesExcept("pdfAvailable", "reversedVat", "invoiceRows")
 			.hasFieldOrPropertyWithValue("pdfAvailable", false)
 			.hasFieldOrPropertyWithValue("reversedVat", false);
 	}
diff --git a/src/test/java/se/sundsvall/selfserviceai/service/AssistantServiceTest.java b/src/test/java/se/sundsvall/selfserviceai/service/AssistantServiceTest.java
index 52e90c2..adad656 100644
--- a/src/test/java/se/sundsvall/selfserviceai/service/AssistantServiceTest.java
+++ b/src/test/java/se/sundsvall/selfserviceai/service/AssistantServiceTest.java
@@ -113,9 +113,6 @@ class AssistantServiceTest {
 	@Mock
 	private FileRepository fileRepositoryMock;
 
-	@Spy
-	private RequestId requestIdSpy;
-
 	@InjectMocks
 	private AssistantService assistantService;
 
@@ -129,7 +126,7 @@ class AssistantServiceTest {
 	private ArgumentCaptor<IntricModel> installedBaseCaptor;
 
 	@AfterEach
-	void verifyNoMoreMockInterations() {
+	void verifyNoMoreMockInteractions() {
 		RequestId.reset();
 		verifyNoMoreInteractions(
 			intricPropertiesMock,
@@ -193,7 +190,7 @@ void createSessionThrowsException() {
 		assertThat(e).isSameAs(exception);
 	}
 
-	private static final Stream<Arguments> informationArgumentProvider() {
+	private static Stream<Arguments> informationArgumentProvider() {
 		return Stream.of(
 			Arguments.of(
 				null,
@@ -257,6 +254,7 @@ void populateWithInformation(List<Agreement> agreements, List<Invoice> invoices,
 		verify(intricIntegrationMock).uploadFile(installedBaseCaptor.capture());
 		verify(fileRepositoryMock).save(fileEntityCaptor.capture());
 		verify(sessionRepositoryMock).save(sessionEntityCaptor.capture());
+		verify(invoicesIntegrationMock, times(invoices.size())).getInvoiceDetails(eq(MUNICIPALITY_ID), any());
 
 		assertThat(installedBaseCaptor.getValue().getPartyId()).isEqualTo(PARTY_ID);
 		assertThat(fileEntityCaptor.getValue().getFileId()).isEqualTo(fileId.toString());
@@ -299,7 +297,6 @@ private void assertListcontent(List<Agreement> agreements, List<Invoice> invoice
 	@Test
 	void populateWithInformationWhenNoInstalledbaseResponse() {
 		// Arrange
-		Problem.valueOf(Status.I_AM_A_TEAPOT, "Big and stout");
 		final var sessionEntity = SessionEntity.builder()
 			.withMunicipalityId(MUNICIPALITY_ID)
 			.build();
diff --git a/src/test/resources/junit/expected-structure.json b/src/test/resources/junit/expected-structure.json
index fe8067c..e19a1d4 100644
--- a/src/test/resources/junit/expected-structure.json
+++ b/src/test/resources/junit/expected-structure.json
@@ -62,21 +62,22 @@
 			],
 			"invoices": [
 				{
-					"amountVatIncluded": 1250.00,
-					"amountVatExcluded": 1000.00,
+					"amountVatIncluded": 1250.0,
+					"amountVatExcluded": 1000.0,
 					"currency": "currency1",
 					"description": "invoiceDescription1",
 					"dueDate": "2020-02-28",
+					"facilityId": "facilityId1",
 					"invoiceAddress": {
-						"careOf": "invoiceCareOf1",
-						"street": "invoiceStreet1",
-						"postalCode": "invoicePostalCode1",
-						"city": "invoiceCity1"
+						"careOf": "careOf1",
+						"street": "street1",
+						"postalCode": "postalCode1",
+						"city": "city1"
 					},
 					"invoicingDate": "2020-02-01",
 					"invoiceName": "invoiceName1",
 					"invoiceNumber": "invoiceNumber1",
-					"invoiceType": "INVOICE",
+					"invoiceType": "type1",
 					"ocrNumber": "invoiceOcrNumber1",
 					"organizationNumber": "organizationNumber1",
 					"pdfAvailable": true,
@@ -85,27 +86,64 @@
 					"status": "SENT",
 					"totalAmount": 1250.35,
 					"vat": 0.25,
-					"vatEligibleAmount": 456.78
+					"vatEligibleAmount": 456.78,
+					"invoiceRows": [
+						{
+							"amount": 1,
+							"amountVatExcluded": 1,
+							"vat": 1,
+							"vatRate": 1,
+							"quantity": 1,
+							"unit": "unit",
+							"unitPrice": 1,
+							"productCode": "productCode",
+							"productName": "productName",
+							"periodFrom": "periodFrom",
+							"periodTo": "periodTo"
+						}
+					]
 				},
 				{
-					"amountVatIncluded": 3000.00,
-					"amountVatExcluded": 2500.00,
-					"currency": "currency2",
-					"description": "invoiceDescription2",
-					"dueDate": "2024-02-13",
-					"invoicingDate": "2024-02-28",
-					"invoiceName": "invoiceName2",
-					"invoiceNumber": "invoiceNumber2",
-					"invoiceType": "CONSOLIDATED_INVOICE",
-					"ocrNumber": "invoiceOcrNumber2",
-					"organizationNumber": "organizationNumber2",
-					"pdfAvailable": false,
-					"reversedVat": true,
-					"rounding": 0.49,
-					"status": "REMINDER",
-					"totalAmount": 2999.51,
+					"amountVatIncluded": 1250.0,
+					"amountVatExcluded": 1000.0,
+					"currency": "currency1",
+					"description": "invoiceDescription1",
+					"dueDate": "2020-02-28",
+					"facilityId": "facilityId1",
+					"invoiceAddress": {
+						"careOf": "careOf1",
+						"street": "street1",
+						"postalCode": "postalCode1",
+						"city": "city1"
+					},
+					"invoicingDate": "2020-02-01",
+					"invoiceName": "invoiceName1",
+					"invoiceNumber": "invoiceNumber1",
+					"invoiceType": "type1",
+					"ocrNumber": "invoiceOcrNumber1",
+					"organizationNumber": "organizationNumber1",
+					"pdfAvailable": true,
+					"reversedVat": false,
+					"rounding": -0.35,
+					"status": "SENT",
+					"totalAmount": 1250.35,
 					"vat": 0.25,
-					"vatEligibleAmount": 123.65
+					"vatEligibleAmount": 456.78,
+					"invoiceRows": [
+						{
+							"amount": 1,
+							"amountVatExcluded": 1,
+							"vat": 1,
+							"vatRate": 1,
+							"quantity": 1,
+							"unit": "unit",
+							"unitPrice": 1,
+							"productCode": "productCode",
+							"productName": "productName",
+							"periodFrom": "periodFrom",
+							"periodTo": "periodTo"
+						}
+					]
 				}
 			]
 		},


Reviews:
user: login: josc04
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T07:25:17Z
user: login: AndreSoderlund
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T07:35:01Z
user: login: AndreSoderlund
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T07:40:11Z
user: login: josc04
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T07:44:50Z
user: login: josc04
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T08:07:47Z

Review comments:
diff_hunk: @@ -16,2877 +16,7 @@
 					"Content-Type": {
 						"contains": "application/json"
 					}
-				},
-				"bodyPatterns": [
path: src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json
user: login: josc04
body: Dont we want to verify the content of the file being sent here?
created_at: 2025-04-07T06:22:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -98,15 +99,15 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 		final var intricModel = ofNullable(installedBaseCustomers)
 			.filter(MapUtils::isNotEmpty)
 			.map(ibc -> IntricModel.builder()
-				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrive customer nr and party id (as its always the same for all ib:s)
+				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrieve customer nr and party id (as its always the same for all ib:s)
 				.withPartyId(ibc.values().iterator().next().getPartyId())
 				.withFacilities(toFacilities(ibc))
 				.build())
 			.orElse(null);
 
 		// Attach matching installed bases to each facility
 		if (nonNull(intricModel)) {
-			final var installedBases = ofNullable(installedBaseCustomers).orElse(emptyMap()).values().stream()
+			final var installedBases = Optional.of(installedBaseCustomers).orElse(emptyMap()).values().stream()
path: src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
user: login: josc04
body: Sonar complains that there might be a NPE problem if using Optional.of:
![image](https://github.com/user-attachments/assets/6e6272f5-719e-47bf-b888-102dbff16f02)

created_at: 2025-04-07T06:46:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,2877 +16,7 @@
 					"Content-Type": {
 						"contains": "application/json"
 					}
-				},
-				"bodyPatterns": [
path: src/integration-test/resources/AssistantIT/__files/test01_createSession/mappings/api-intric-upload-file.json
user: login: AndreSoderlund
body: I didn't want to re-write the whole test and i also didn't want to edit a 3000 row json file manually. 
created_at: 2025-04-07T07:35:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -98,15 +99,15 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 		final var intricModel = ofNullable(installedBaseCustomers)
 			.filter(MapUtils::isNotEmpty)
 			.map(ibc -> IntricModel.builder()
-				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrive customer nr and party id (as its always the same for all ib:s)
+				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrieve customer nr and party id (as its always the same for all ib:s)
 				.withPartyId(ibc.values().iterator().next().getPartyId())
 				.withFacilities(toFacilities(ibc))
 				.build())
 			.orElse(null);
 
 		// Attach matching installed bases to each facility
 		if (nonNull(intricModel)) {
-			final var installedBases = ofNullable(installedBaseCustomers).orElse(emptyMap()).values().stream()
+			final var installedBases = Optional.of(installedBaseCustomers).orElse(emptyMap()).values().stream()
path: src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
user: login: AndreSoderlund
body: If installedBaseCustomers is null, then "intricModel" would be null. In that case the this code never runs. 

If i use Optional.ofNullable, my intellisense recommends Optional.of().
`'Optional.ofNullable()' with non-null argument should be replaced with 'Optional.of()'`
created_at: 2025-04-07T07:40:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -98,15 +99,15 @@ public IntricModel toIntricModel(final Map<String, InstalledBaseCustomer> instal
 		final var intricModel = ofNullable(installedBaseCustomers)
 			.filter(MapUtils::isNotEmpty)
 			.map(ibc -> IntricModel.builder()
-				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrive customer nr and party id (as its always the same for all ib:s)
+				.withCustomerNumber(ibc.values().iterator().next().getCustomerNumber()) // Use first entry to retrieve customer nr and party id (as its always the same for all ib:s)
 				.withPartyId(ibc.values().iterator().next().getPartyId())
 				.withFacilities(toFacilities(ibc))
 				.build())
 			.orElse(null);
 
 		// Attach matching installed bases to each facility
 		if (nonNull(intricModel)) {
-			final var installedBases = ofNullable(installedBaseCustomers).orElse(emptyMap()).values().stream()
+			final var installedBases = Optional.of(installedBaseCustomers).orElse(emptyMap()).values().stream()
path: src/main/java/se/sundsvall/selfserviceai/integration/intric/mapper/IntricMapper.java
user: login: josc04
body: 😄 Funny how different IDE:s interprets NPE possibilities, but I agree with you and IntelliJ on this one 👍 
created_at: 2025-04-07T07:44:50Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-04-07T08:02:35Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=Sundsvallskommun_api-service-self-service-ai&pullRequest=18)


author_association: NONE