-
Notifications
You must be signed in to change notification settings - Fork 1
feat(backend): update Sati #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xtiannyeto
wants to merge
4
commits into
main
Choose a base branch
from
feature/1434-update-backend-regarding-new-form
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
6 changes: 4 additions & 2 deletions
6
...src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/fish/ControlResource.kt
This file contains hidden or 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,6 +1,8 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.fish | ||
|
|
||
| data class ControlResource( | ||
| val id: Int, | ||
| val name: String, | ||
| val id: Int? = null, | ||
| val name: String? = null, | ||
| val registrationId: String? = null, | ||
| val radioFrequency: String? = null | ||
| ) |
36 changes: 36 additions & 0 deletions
36
.../gouv/dgampa/rapportnav/domain/entities/mission/fish/fishActions/LogbookMessagePurpose.kt
This file contains hidden or 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,36 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.fish.fishActions | ||
|
|
||
| enum class LogbookMessagePurpose { | ||
| // TODO Find out what this purpose code means. | ||
| ACS, | ||
|
|
||
| /** Emergency. */ | ||
| ECY, | ||
|
|
||
| /** Vessels grounded and called by the authorities. */ | ||
| GRD, | ||
|
|
||
| /** Landing. */ | ||
| LAN, | ||
|
|
||
| /** Other. */ | ||
| OTH, | ||
|
|
||
| /** Refueling. */ | ||
| REF, | ||
|
|
||
| /** Repair. */ | ||
| REP, | ||
|
|
||
| /** Rest. */ | ||
| RES, | ||
|
|
||
| /** Return for Scientific Research. */ | ||
| SCR, | ||
|
|
||
| /** Sheltering. */ | ||
| SHE, | ||
|
|
||
| /** Transhipment. */ | ||
| TRA, | ||
| } |
This file contains hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
...d/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/AuthorityType.kt
This file contains hidden or 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,7 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| enum class AuthorityType { | ||
| AECP, | ||
| OTHERS, | ||
| MEMBER_FR | ||
| } |
11 changes: 6 additions & 5 deletions
11
...d/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/ContactEntity.kt
This file contains hidden or 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,15 +1,16 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import com.neovisionaries.i18n.CountryCode | ||
| import java.time.Instant | ||
| import java.util.UUID | ||
|
|
||
| data class ContactEntity( | ||
| val id: UUID? = null, | ||
| val id: Int? = null, | ||
| val fullName: String? = null, | ||
| val nationality: CountryCode? = null, | ||
| val firstName: String? = null, | ||
| val lastName: String? = null, | ||
| val nationality: String? = null, | ||
| val email: String? = null, | ||
| val phone: String? = null, | ||
| val address: AddressEntity? = null, | ||
| val createdAt: Instant? = null | ||
| val createdAt: Instant? = null, | ||
| val updatedAt: Instant? = null | ||
| ) |
76 changes: 13 additions & 63 deletions
76
backend/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiEntity.kt
This file contains hidden or 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,69 +1,19 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import com.neovisionaries.i18n.CountryCode | ||
| import fr.gouv.dgampa.rapportnav.domain.entities.mission.env.controlResources.ControlResourceEntity | ||
| import java.time.Instant | ||
| import java.util.UUID | ||
| import java.util.* | ||
|
|
||
| data class SatiEntity( | ||
| val id: UUID? = null, | ||
| val module: String, | ||
| val actionId: String, | ||
| val createdAt: Instant? = null, | ||
| val updatedAt: Instant? = null, | ||
| val actionTaken: String? = null, | ||
|
|
||
| val agentContact: ContactEntity? = null, | ||
| val appointingAuthority: String? = null, | ||
| val beneficialOwnerContact: ContactEntity? = null, | ||
| val catchCertificateInfo: Boolean? = null, | ||
| val chartererContact: ContactEntity? = null, | ||
| val commonMarketingStandards: Boolean? = null, | ||
| val driverContact: ContactEntity? = null, | ||
| val euFishingTripId: String? = null, | ||
| val fisheryLotLabelling: Boolean? = null, | ||
| val fisheryProductDocumentsInspection: Boolean? = null, | ||
| val fisheryProductStorageMechanismInspected: Boolean? = null, | ||
| val fisheryProductWeighedBeforeSale: Boolean? = null, | ||
| val freshnessCategories: String? = null, | ||
| val importerContact: ContactEntity? = null, | ||
| val infringementsObservations: String? = null, | ||
| val inspectionEndDatetimeUtc: Instant? = null, | ||
| val inspectionStartDatetimeUtc: Instant, | ||
| val inspectionLocationAddressId: String? = null, | ||
| val inspectorComments: String? = null, | ||
| val inspectorNameOrId: String? = null, | ||
| val inspectorSignature: Boolean? = null, | ||
| val inspectorUniqueId: String? = null, | ||
| val landingDeclarationInfo: Boolean? = null, | ||
| val lotIdSpeciesQuantities: String? = null, | ||
| val lotsArt58Compliance: Boolean? = null, | ||
| val marketOwnerContact: ContactEntity? = null, | ||
| val marketOwnerRepresentativeContact: ContactEntity? = null, | ||
| val marketPremisesAddressId: String? = null, | ||
| val marketPremisesLocation: String? = null, | ||
| val marketPremisesName: String? = null, | ||
| val masterComments: String? = null, | ||
| val masterContact: ContactEntity? = null, | ||
| val newLotCompositionInfo: String? = null, | ||
| val operatorComments: String? = null, | ||
| val operatorSignature: Boolean? = null, | ||
| val patrolVesselExternalMarking: String? = null, | ||
| val patrolVesselRadioCallSign: String? = null, | ||
| val registeredBuyerContact: ContactEntity? = null, | ||
| val responsiblePersonSignature: Boolean? = null, | ||
| val sizeGradingCategories: String? = null, | ||
| val supplierInvoiceInfo: Boolean? = null, | ||
| val takeOverDeclarationInfo: Boolean? = null, | ||
| val traceabilityRecordingSystemArt58: Boolean? = null, | ||
| val traceabilitySupplierIdentificationSystem: Boolean? = null, | ||
| val tractorRegistrationNumber: String? = null, | ||
| val trailerRegistrationNumber: String? = null, | ||
| val transportDocumentInfo: Boolean? = null, | ||
| val transporterComments: String? = null, | ||
| val transporterSignature: Boolean? = null, | ||
| val useOfUndersizedFisheryProducts: Boolean? = null, | ||
| val vehicleNationality: CountryCode? = null, | ||
| val vehicleOwnerContact: ContactEntity? = null, | ||
| val vehicleType: String? = null, | ||
| val vesselOwnerContact: ContactEntity? = null | ||
| data class SatiEntity( | ||
| var id: UUID? = null, | ||
| var module: SatiModuleType, | ||
| var actionId: String, | ||
| var resource: ControlResourceEntity? = null, | ||
| var vessel: SatiVesselEntity? = null, | ||
| var createdAt: Instant? = null, | ||
| var updatedAt: Instant? = null, | ||
| var startDatetimeUtc: Instant? = null, | ||
| var endDatetimeUtc: Instant? = null, | ||
| var inspectors: List<SatiInspectorEntity>? = emptyList(), | ||
| ) |
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
...main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiInspectorEntity.kt
This file contains hidden or 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,14 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import java.time.Instant | ||
|
|
||
| data class SatiInspectorEntity( | ||
| val id: Int? = null, | ||
| val agentId: Int? = null, | ||
| val party: SatiPartyEntity? = null, | ||
| val authorityType: AuthorityType? = null, | ||
| val externalAgentId: String? = null, | ||
| val isOutOfUnit: Boolean = false, | ||
| val createdAt: Instant? = null, | ||
| val updatedAt: Instant? = null | ||
| ) |
13 changes: 13 additions & 0 deletions
13
...d/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiJpeEntity.kt
This file contains hidden or 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,13 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import fr.gouv.dgampa.rapportnav.domain.entities.mission.fish.fishActions.LogbookMessagePurpose | ||
| import java.time.Instant | ||
|
|
||
| data class SatiJpeEntity( | ||
| val pnoId: String? = null, | ||
| val portId: String? = null, | ||
| val portName: String? = null, | ||
| val tripNumber: String? = null, | ||
| val lastStopDate: Instant? = null, | ||
| val pnoType: LogbookMessagePurpose? = null | ||
| ) |
22 changes: 22 additions & 0 deletions
22
.../src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiModuleType.kt
This file contains hidden or 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,22 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import fr.gouv.dgampa.rapportnav.domain.entities.mission.fish.fishActions.MissionActionType | ||
|
|
||
|
|
||
| enum class SatiModuleType { | ||
| M1, | ||
| M3, | ||
| M5, | ||
| M6, | ||
| M7; | ||
|
|
||
| companion object { | ||
| fun fromMissionActionType(type: MissionActionType): SatiModuleType = when (type) { | ||
| MissionActionType.SEA_CONTROL -> M1 | ||
| MissionActionType.LAND_CONTROL -> M3 | ||
| MissionActionType.AIR_CONTROL -> M5 | ||
| MissionActionType.AIR_SURVEILLANCE -> M6 | ||
| MissionActionType.OBSERVATION -> M7 | ||
| } | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
...src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiPartyEntity.kt
This file contains hidden or 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,13 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import java.time.Instant | ||
|
|
||
| data class SatiPartyEntity( | ||
| val id: Int? = null, | ||
| val partyType: String? = null, | ||
| val comments: String? = null, | ||
| val signature: Boolean = false, | ||
| val contact: ContactEntity? = null, | ||
| val createdAt: Instant? = null, | ||
| val updatedAt: Instant? = null | ||
| ) | ||
24 changes: 24 additions & 0 deletions
24
...rc/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/sati/SatiVesselEntity.kt
This file contains hidden or 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,24 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.sati | ||
|
|
||
| import com.neovisionaries.i18n.CountryCode | ||
| import java.time.Instant | ||
|
|
||
| data class SatiVesselEntity( | ||
| val id: Int? = null, | ||
| val jpe: SatiJpeEntity? = null, | ||
| val type: String? = null, | ||
| val name: String? = null, | ||
| val immat: String? = null, | ||
| val imo: String? = null, | ||
| val length: Double? = null, | ||
| val extRef: String? = null, | ||
| val ircs: String? = null, | ||
| val owner: SatiPartyEntity? = null, | ||
| val flagState: CountryCode? = null, | ||
| val charterer: SatiPartyEntity? = null, | ||
| val agent: SatiPartyEntity? = null, | ||
| val master: SatiPartyEntity? = null, | ||
| val isMasterOwner: Boolean = false, | ||
| val createdAt: Instant? = null, | ||
| val updatedAt: Instant? = null | ||
| ) |
16 changes: 16 additions & 0 deletions
16
...rc/main/kotlin/fr/gouv/dgampa/rapportnav/domain/use_cases/mission/action/v2/EnableSati.kt
This file contains hidden or 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,16 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.use_cases.mission.action.v2 | ||
|
|
||
| import fr.gouv.dgampa.rapportnav.config.UseCase | ||
| import fr.gouv.dgampa.rapportnav.domain.use_cases.user.GetServiceForUser | ||
| import org.springframework.beans.factory.annotation.Value | ||
|
|
||
| @UseCase | ||
| class EnableSati( | ||
| private val getServiceForUser: GetServiceForUser, | ||
| @param:Value("\${sati.enabled-services}") private val serviceIds: List<Int> | ||
| ) { | ||
| fun execute(): Boolean { | ||
| val serviceId = getServiceForUser.execute() | ||
| return (serviceIds.contains(serviceId?.id)) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Les champs d'audit, en général, je les remonte pas côté domain. Ils ont pas vraiment de business logic.
Par contre, je les remonte du Model vers le Admin type quand on les gère depuis l'admin panel