-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor mission crew #1107
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
lwih
wants to merge
1
commit into
main
Choose a base branch
from
refactor-mission-crew
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
Refactor mission crew #1107
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,4 +23,5 @@ out/ | |
| tmp_rapport_patrouille_PAM.docx | ||
| tmp_AEM_PAM.xlsx | ||
|
|
||
| kotlin/ | ||
| .kotlin | ||
40 changes: 40 additions & 0 deletions
40
...in/fr/gouv/dgampa/rapportnav/domain/entities/mission/nav/crew/MissionCrewAbsenceEntity.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,40 @@ | ||
| package fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.crew | ||
|
|
||
| import fr.gouv.dgampa.rapportnav.infrastructure.database.model.mission.crew.MissionCrewAbsenceModel | ||
| import fr.gouv.dgampa.rapportnav.infrastructure.database.model.mission.crew.MissionCrewModel | ||
| import java.time.Instant | ||
| import java.time.LocalDate | ||
|
|
||
|
|
||
| data class MissionCrewAbsenceEntity( | ||
| val id: Int? = null, | ||
| val startDate: LocalDate? = null, | ||
| val endDate: LocalDate? = null, | ||
| val isAbsentFullMission: Boolean? = null, | ||
| val reason: String? = null, | ||
| ) { | ||
|
|
||
| fun toMissionCrewAbsenceModel(crew: MissionCrewModel): MissionCrewAbsenceModel { | ||
| return MissionCrewAbsenceModel( | ||
| id = id, | ||
| startDate = startDate, | ||
| endDate = endDate, | ||
| isAbsentFullMission = isAbsentFullMission, | ||
| reason = reason, | ||
| missionCrew = crew | ||
| ) | ||
| } | ||
|
|
||
| companion object { | ||
| fun fromMissionCrewAbsenceModel(model: MissionCrewAbsenceModel): MissionCrewAbsenceEntity { | ||
| return MissionCrewAbsenceEntity( | ||
| id = model.id, | ||
| startDate = model.startDate, | ||
| endDate = model.endDate, | ||
| isAbsentFullMission = model.isAbsentFullMission, | ||
| reason = model.reason, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
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
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
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
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
35 changes: 35 additions & 0 deletions
35
.../kotlin/fr/gouv/dgampa/rapportnav/infrastructure/api/bff/model/crew/MissionCrewAbsence.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,35 @@ | ||
| package fr.gouv.dgampa.rapportnav.infrastructure.api.bff.model.crew | ||
|
|
||
| import fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.crew.MissionCrewAbsenceEntity | ||
| import java.time.LocalDate | ||
|
|
||
| data class MissionCrewAbsence( | ||
| val id: Int? = null, | ||
| val startDate: LocalDate? = null, | ||
| val endDate: LocalDate? = null, | ||
| val isAbsentFullMission: Boolean? = null, | ||
| val reason: String? = null, | ||
| ) { | ||
|
|
||
| companion object { | ||
| fun fromMissionCrewAbsenceEntity(crew: MissionCrewAbsenceEntity): MissionCrewAbsence { | ||
| return MissionCrewAbsence( | ||
| id = crew.id, | ||
| startDate = crew.startDate, | ||
| endDate = crew.endDate, | ||
| isAbsentFullMission = crew.isAbsentFullMission, | ||
| reason = crew.reason, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| fun toMissionCrewAbsenceEntity(): MissionCrewAbsenceEntity { | ||
| return MissionCrewAbsenceEntity( | ||
| id = if (id == 0 || id == null) null else id, | ||
| startDate = startDate, | ||
| endDate = endDate, | ||
| isAbsentFullMission = isAbsentFullMission, | ||
| reason = reason, | ||
| ) | ||
| } | ||
| } |
55 changes: 55 additions & 0 deletions
55
...v/dgampa/rapportnav/infrastructure/database/model/mission/crew/MissionCrewAbsenceModel.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,55 @@ | ||
| package fr.gouv.dgampa.rapportnav.infrastructure.database.model.mission.crew | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnore | ||
| import jakarta.persistence.* | ||
| import org.springframework.data.annotation.CreatedBy | ||
| import org.springframework.data.annotation.CreatedDate | ||
| import org.springframework.data.annotation.LastModifiedBy | ||
| import org.springframework.data.annotation.LastModifiedDate | ||
| import org.springframework.data.jpa.domain.support.AuditingEntityListener | ||
| import java.time.Instant | ||
| import java.time.LocalDate | ||
|
|
||
| @Entity | ||
| @EntityListeners(AuditingEntityListener::class) | ||
| @Table(name = "mission_crew_absence") | ||
| class MissionCrewAbsenceModel( | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| @Column(name = "id", unique = true, nullable = false) | ||
| var id: Int? = null, | ||
|
|
||
| @Column(name = "start_date", nullable = true) | ||
| var startDate: LocalDate? = null, | ||
|
|
||
| @Column(name = "end_date", nullable = true) | ||
| var endDate: LocalDate? = null, | ||
|
Comment on lines
+24
to
+27
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je me demande si je suis pas un peu trop souple sur les dates |
||
|
|
||
| @Column(name = "is_absent_full_mission", nullable = true) | ||
| var isAbsentFullMission: Boolean? = null, | ||
|
|
||
| @Column(name = "reason", nullable = true) | ||
| var reason: String? = null, | ||
|
|
||
| @CreatedDate | ||
| @Column(name = "created_at", updatable = false) | ||
| var createdAt: Instant? = null, | ||
|
|
||
| @LastModifiedDate | ||
| @Column(name = "updated_at") | ||
| var updatedAt: Instant? = null, | ||
|
|
||
| @CreatedBy | ||
| @Column(name = "created_by", updatable = false) | ||
| var createdBy: Int? = null, | ||
|
|
||
| @LastModifiedBy | ||
| @Column(name = "updated_by") | ||
| var updatedBy: Int? = null, | ||
| // | ||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "mission_crew_id", referencedColumnName = "id", nullable = true) | ||
| @JsonIgnore | ||
| var missionCrew: MissionCrewModel? = null, | ||
| ) | ||
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
1 change: 1 addition & 0 deletions
1
.../infrastructure/database/repositories/interfaces/mission/crew/IDBMissionCrewRepository.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
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.
Uh oh!
There was an error while loading. Please reload this page.