From a69b4ed4d33e1c8be3b02d39ae05975114d6f5bf Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 13 Dec 2024 05:52:41 +0100 Subject: [PATCH] Renamed Unit to UnitOfMeasure to not interfere with Kotlin's Unit type --- .../src/main/kotlin/net/codinux/invoicing/model/InvoiceItem.kt | 3 ++- .../invoicing/model/codes/{Unit.kt => UnitOfMeasure.kt} | 2 +- .../kotlin/net/codinux/invoicing/parser/model/CodeListType.kt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/{Unit.kt => UnitOfMeasure.kt} (99%) diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/InvoiceItem.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/InvoiceItem.kt index 1e1bb5a..0c37803 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/InvoiceItem.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/InvoiceItem.kt @@ -1,11 +1,12 @@ package net.codinux.invoicing.model +import net.codinux.invoicing.model.codes.UnitOfMeasure import java.math.BigDecimal class InvoiceItem( val name: String, val quantity: BigDecimal, - val unit: String, + val unit: UnitOfMeasure, val unitPrice: BigDecimal, val vatRate: BigDecimal, val articleNumber: String? = null, diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/Unit.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/UnitOfMeasure.kt similarity index 99% rename from e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/Unit.kt rename to e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/UnitOfMeasure.kt index d2f6e67..bf85d86 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/Unit.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/model/codes/UnitOfMeasure.kt @@ -1,6 +1,6 @@ package net.codinux.invoicing.model.codes -enum class Unit(val code: String, val englishName: String, val symbol: String?, val isFrequentlyUsedValue: Boolean) { +enum class UnitOfMeasure(val code: String, val englishName: String, val symbol: String?, val isFrequentlyUsedValue: Boolean) { _10("10", "group", null, false), _11("11", "outfit", null, false), _13("13", "ration", null, false), diff --git a/e-invoice-spec-parser/src/main/kotlin/net/codinux/invoicing/parser/model/CodeListType.kt b/e-invoice-spec-parser/src/main/kotlin/net/codinux/invoicing/parser/model/CodeListType.kt index 22bf692..976435e 100644 --- a/e-invoice-spec-parser/src/main/kotlin/net/codinux/invoicing/parser/model/CodeListType.kt +++ b/e-invoice-spec-parser/src/main/kotlin/net/codinux/invoicing/parser/model/CodeListType.kt @@ -16,7 +16,7 @@ enum class CodeListType(val className: String, val usesFullList: Boolean, val us UN_7143_ItemTypeIdentificationCode("ItemTypeIdentificationCode", true, listOf("BT-158-1")), // tab Item UN_7161_SpecialServiceDescriptionCodes("ChargeReasonCode", true, listOf("BT-105", "BT-145")), // tab Charge - Units("Unit", true, listOf("BT-130", "BT-150")), // UN/ECE Recommendation N°20 and UN/ECE Recommendation N°21 — Unit codes + Units("UnitOfMeasure", true, listOf("BT-130", "BT-150")), // UN/ECE Recommendation N°20 and UN/ECE Recommendation N°21 — Unit codes EAS("ElectronicAddressSchemeIdentifier", true, listOf("BT-34-1", "BT-49-1")), VATEX("VatExemptionReasonCode", true, listOf("BT-121")),