From 69c49ab0119324f170eb8189ca8be23bce0a3ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Andr=C3=A9?= Date: Wed, 21 Apr 2021 15:16:10 +0200 Subject: [PATCH] Add a information on the jump that is a special jump Add the "update" feature on the jump. --- Back/skydiveLogs-api.Domain/Jump.cs | 4 +++- Back/skydiveLogs-api.DomainBusiness/JumpService.cs | 9 +++++++-- Back/skydiveLogs-api.Infrastructure/JumpRepository.cs | 2 +- Back/skydiveLogs-api/DataContract/JumpReq.cs | 4 +++- Back/skydiveLogs-api/DataContract/JumpResp.cs | 2 ++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Back/skydiveLogs-api.Domain/Jump.cs b/Back/skydiveLogs-api.Domain/Jump.cs index 6d76752..d5e421a 100644 --- a/Back/skydiveLogs-api.Domain/Jump.cs +++ b/Back/skydiveLogs-api.Domain/Jump.cs @@ -25,5 +25,7 @@ namespace skydiveLogs_api.Domain public string Notes { get; set; } public DateTime JumpDate { get; set; } + + public bool IsSpecial { get; set; } } -} +} \ No newline at end of file diff --git a/Back/skydiveLogs-api.DomainBusiness/JumpService.cs b/Back/skydiveLogs-api.DomainBusiness/JumpService.cs index 653ffeb..6cc89dc 100644 --- a/Back/skydiveLogs-api.DomainBusiness/JumpService.cs +++ b/Back/skydiveLogs-api.DomainBusiness/JumpService.cs @@ -64,9 +64,14 @@ namespace skydiveLogs_api.DomainBusiness return _jumpRepository.GetById(id); } - public void UpdateJump(int id, Jump jump) + public void UpdateJump(int id, Jump updatedJump) { - throw new NotImplementedException(); + var myJump = GetJumpById(id); + myJump.IsSpecial = updatedJump.IsSpecial; + myJump.WithCutaway = updatedJump.WithCutaway; + myJump.Notes = updatedJump.Notes; + + _jumpRepository.Update(myJump); } #endregion Public Methods diff --git a/Back/skydiveLogs-api.Infrastructure/JumpRepository.cs b/Back/skydiveLogs-api.Infrastructure/JumpRepository.cs index f75137b..0757e8c 100644 --- a/Back/skydiveLogs-api.Infrastructure/JumpRepository.cs +++ b/Back/skydiveLogs-api.Infrastructure/JumpRepository.cs @@ -60,7 +60,7 @@ namespace skydiveLogs_api.Infrastructure public bool Update(Jump updatedJump) { - throw new System.NotImplementedException(); + return _col.Update(updatedJump); } public bool DeleteById(int id) diff --git a/Back/skydiveLogs-api/DataContract/JumpReq.cs b/Back/skydiveLogs-api/DataContract/JumpReq.cs index c50216e..be68a0f 100644 --- a/Back/skydiveLogs-api/DataContract/JumpReq.cs +++ b/Back/skydiveLogs-api/DataContract/JumpReq.cs @@ -23,5 +23,7 @@ namespace skydiveLogs_api.DataContract public string Notes { get; set; } public DateTime JumpDate { get; set; } + + public bool IsSpecial { get; set; } } -} +} \ No newline at end of file diff --git a/Back/skydiveLogs-api/DataContract/JumpResp.cs b/Back/skydiveLogs-api/DataContract/JumpResp.cs index 81f0345..e27a653 100644 --- a/Back/skydiveLogs-api/DataContract/JumpResp.cs +++ b/Back/skydiveLogs-api/DataContract/JumpResp.cs @@ -23,5 +23,7 @@ namespace skydiveLogs_api.DataContract public string Notes { get; set; } public DateTime JumpDate { get; set; } + + public bool IsSpecial { get; set; } } } \ No newline at end of file