-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PriorNotificationIdentifier domain entity in Backend
- Loading branch information
1 parent
4407458
commit b3b23bd
Showing
9 changed files
with
148 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...r/gouv/cnsp/monitorfish/domain/entities/prior_notification/PriorNotificationIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.prior_notification | ||
|
||
import java.time.ZonedDateTime | ||
|
||
data class PriorNotificationIdentifier( | ||
val reportId: String, | ||
val operationDate: ZonedDateTime, | ||
val isManualPriorNotification: Boolean, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 23 additions & 1 deletion
24
...ouv/cnsp/monitorfish/domain/use_cases/prior_notification/DeletePriorNotificationUpload.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.prior_notification | ||
|
||
import fr.gouv.cnsp.monitorfish.config.UseCase | ||
import fr.gouv.cnsp.monitorfish.domain.entities.prior_notification.PriorNotificationIdentifier | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.LogbookReportRepository | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.ManualPriorNotificationRepository | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.PriorNotificationUploadRepository | ||
|
||
@UseCase | ||
class DeletePriorNotificationUpload( | ||
private val logbookReportRepository: LogbookReportRepository, | ||
private val manualPriorNotificationRepository: ManualPriorNotificationRepository, | ||
private val priorNotificationUploadRepository: PriorNotificationUploadRepository, | ||
) { | ||
fun execute(priorNotificationUploadId: String) { | ||
fun execute(identifier: PriorNotificationIdentifier, priorNotificationUploadId: String) { | ||
priorNotificationUploadRepository.deleteById(priorNotificationUploadId) | ||
|
||
if (identifier.isManualPriorNotification) { | ||
manualPriorNotificationRepository.updateState( | ||
reportId = identifier.reportId, | ||
isBeingSent = false, | ||
isSent = false, | ||
isVerified = false, | ||
) | ||
} else { | ||
logbookReportRepository.updatePriorNotificationState( | ||
reportId = identifier.reportId, | ||
operationDate = identifier.operationDate, | ||
isBeingSent = false, | ||
isSent = false, | ||
isVerified = false, | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters