From e596b9483b7133818ce48975a6dc9c47f6280937 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 30 Nov 2024 21:08:11 +0100 Subject: [PATCH] Moved return types to models package --- .../codinux/invoicing/email/FetchEmailErrorType.kt | 13 ------------- .../codinux/invoicing/email/FetchEmailsOptions.kt | 1 + .../codinux/invoicing/email/FetchEmailsStatus.kt | 2 ++ .../invoicing/email/ListenForNewMailsOptions.kt | 1 + .../invoicing/email/{ => model}/FetchEmailError.kt | 2 +- .../invoicing/email/model/FetchEmailErrorType.kt | 13 +++++++++++++ .../email/{ => model}/FetchEmailsResult.kt | 4 +--- 7 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailErrorType.kt rename e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/{ => model}/FetchEmailError.kt (72%) create mode 100644 e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailErrorType.kt rename e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/{ => model}/FetchEmailsResult.kt (65%) diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailErrorType.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailErrorType.kt deleted file mode 100644 index 70a69d6..0000000 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailErrorType.kt +++ /dev/null @@ -1,13 +0,0 @@ -package net.codinux.invoicing.email - -enum class FetchEmailErrorType { - GetEmail, - - GetMesssageBody, - - GetAttachment, - - ExtractInvoice, - - ListenForNewEmails -} \ No newline at end of file diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsOptions.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsOptions.kt index fc897e4..da98e92 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsOptions.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsOptions.kt @@ -1,6 +1,7 @@ package net.codinux.invoicing.email import net.codinux.invoicing.email.model.Email +import net.codinux.invoicing.email.model.FetchEmailError import java.io.File import java.time.Instant import java.time.LocalDate diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsStatus.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsStatus.kt index f9b7d13..667b2ce 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsStatus.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsStatus.kt @@ -5,6 +5,8 @@ import jakarta.mail.Message import jakarta.mail.Part import jakarta.mail.Store import net.codinux.invoicing.email.model.EmailAccount +import net.codinux.invoicing.email.model.FetchEmailError +import net.codinux.invoicing.email.model.FetchEmailErrorType import net.codinux.invoicing.filesystem.FileUtil import org.eclipse.angus.mail.imap.IMAPFolder import java.io.File diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/ListenForNewMailsOptions.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/ListenForNewMailsOptions.kt index 5ae598a..6ed93c9 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/ListenForNewMailsOptions.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/ListenForNewMailsOptions.kt @@ -1,6 +1,7 @@ package net.codinux.invoicing.email import net.codinux.invoicing.email.model.Email +import net.codinux.invoicing.email.model.FetchEmailError import java.io.File import java.util.concurrent.atomic.AtomicBoolean diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailError.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailError.kt similarity index 72% rename from e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailError.kt rename to e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailError.kt index b02b02d..9ded5ad 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailError.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailError.kt @@ -1,4 +1,4 @@ -package net.codinux.invoicing.email +package net.codinux.invoicing.email.model data class FetchEmailError( val type: FetchEmailErrorType, diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailErrorType.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailErrorType.kt new file mode 100644 index 0000000..e51e5c1 --- /dev/null +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailErrorType.kt @@ -0,0 +1,13 @@ +package net.codinux.invoicing.email.model + +enum class FetchEmailErrorType { + GetEmail, + + GetMesssageBody, + + GetAttachment, + + ExtractInvoice, // TODO: due to orNull() these errors aren't caught anymore + + ListenForNewEmails +} \ No newline at end of file diff --git a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsResult.kt b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailsResult.kt similarity index 65% rename from e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsResult.kt rename to e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailsResult.kt index f4107a6..2b06df1 100644 --- a/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/FetchEmailsResult.kt +++ b/e-invoice-domain/src/main/kotlin/net/codinux/invoicing/email/model/FetchEmailsResult.kt @@ -1,6 +1,4 @@ -package net.codinux.invoicing.email - -import net.codinux.invoicing.email.model.Email +package net.codinux.invoicing.email.model data class FetchEmailsResult( val emails: List,