-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from GeneriekPublicatiePlatformWoo/34-mock-op-…
…backend chore: mock maken voor publicaties op backend
- Loading branch information
Showing
8 changed files
with
101 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace ODPC.Features.Publicaties | ||
{ | ||
public class Publicatie | ||
{ | ||
public Guid Uuid { get; set; } | ||
public string? OfficieleTitel { get; set; } | ||
public string? VerkorteTitel { get; set; } | ||
public string? Omschrijving { get; set; } | ||
public DateOnly Creatiedatum { get; set; } | ||
public string? Status { get; set; } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
ODPC.Server/Features/Publicaties/PublicatieBijwerken/PublicatieBijwerkenController.cs
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,15 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace ODPC.Features.Publicaties.PublicatieBijwerken | ||
{ | ||
[ApiController] | ||
public class PublicatieBijwerkenController : ControllerBase | ||
{ | ||
[HttpPut("api/v1/publicaties/{uuid}")] | ||
public IActionResult Put(Guid uuid, Publicatie publicatie) | ||
{ | ||
PublicatiesMock.Publicaties[uuid] = publicatie; | ||
return Ok(publicatie); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
ODPC.Server/Features/Publicaties/PublicatieDetails/PublicatieDetailsController.cs
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,16 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace ODPC.Features.Publicaties.PublicatieDetails | ||
{ | ||
[ApiController] | ||
public class PublicatieDetailsController : ControllerBase | ||
{ | ||
[HttpGet("api/v1/publicaties/{uuid}")] | ||
public IActionResult Get(Guid uuid) | ||
{ | ||
return PublicatiesMock.Publicaties.TryGetValue(uuid, out var publicatie) | ||
? Ok(publicatie) | ||
: NotFound(); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
ODPC.Server/Features/Publicaties/PublicatieRegistreren/PublicatieRegistrerenController.cs
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,17 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace ODPC.Features.Publicaties.PublicatieRegistreren | ||
{ | ||
[ApiController] | ||
public class PublicatieRegistrerenController : ControllerBase | ||
{ | ||
[HttpPost("api/v1/publicaties")] | ||
public IActionResult Post(Publicatie publicatie) | ||
{ | ||
publicatie.Uuid = Guid.NewGuid(); | ||
publicatie.Creatiedatum = DateOnly.FromDateTime(DateTime.Now); | ||
PublicatiesMock.Publicaties[publicatie.Uuid] = publicatie; | ||
return Ok(publicatie); | ||
} | ||
} | ||
} |
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,25 @@ | ||
namespace ODPC.Features.Publicaties | ||
{ | ||
public static class PublicatiesMock | ||
{ | ||
public static readonly Dictionary<Guid, Publicatie> Publicaties = new Publicatie[] | ||
{ | ||
new() | ||
{ | ||
Uuid = Guid.NewGuid(), | ||
OfficieleTitel = "Openbaarheid en Verantwoording: De Impact van de Wet open overheid op Bestuurlijke Transparantie", | ||
VerkorteTitel = "Openbaarheid en Verantwoording", | ||
Omschrijving = "", | ||
Creatiedatum = new DateOnly(2024, 08, 24) | ||
}, | ||
new() | ||
{ | ||
Uuid = Guid.NewGuid(), | ||
OfficieleTitel = "Inzicht voor Iedereen: Toepassing en Resultaten van de Wet open overheid", | ||
VerkorteTitel = "Inzicht voor Iedereen", | ||
Omschrijving = "", | ||
Creatiedatum = new DateOnly(2024, 05, 02) | ||
} | ||
}.ToDictionary(x => x.Uuid); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
ODPC.Server/Features/Publicaties/PublicatiesOverzicht/PublicatiesOverzichtController.cs
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,14 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace ODPC.Features.Publicaties.PublicatiesOverzicht | ||
{ | ||
[ApiController] | ||
public class PublicatiesOverzichtController : ControllerBase | ||
{ | ||
[HttpGet("api/v1/publicaties")] | ||
public IActionResult Get() | ||
{ | ||
return Ok(PublicatiesMock.Publicaties.Values.OrderByDescending(x => x.Creatiedatum)); | ||
} | ||
} | ||
} |
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