-
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.
* First draft * get activity area * Add activityArea migration * Add fix for fetching activityArea * Fix some tests * Fix last test * fix tests build * ajust tolerance * remove whiteline * fix organizer return
- Loading branch information
1 parent
3c3f8c2
commit c0a416f
Showing
34 changed files
with
1,079 additions
and
100 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,32 @@ | ||
using api.core.Data; | ||
using api.core.Data.Responses; | ||
using api.core.Services.Abstractions; | ||
|
||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace api.core.Controllers; | ||
|
||
[ApiController] | ||
[Route("api/activity-areas")] | ||
public class ActivityAreaController(IActivityAreaService activityAreaService) : ControllerBase | ||
{ | ||
[HttpGet] | ||
public IActionResult GetAllActivityAreas([FromQuery] string? search) | ||
{ | ||
var activityAreas = activityAreaService.GetAllActivityAreas(search); | ||
return Ok(new Response<IEnumerable<ActivityAreaResponseDTO>> | ||
{ | ||
Data = activityAreas | ||
}); | ||
} | ||
|
||
[HttpGet("{id}")] | ||
public IActionResult GetAllActivityAreas(Guid id) | ||
{ | ||
var activityArea = activityAreaService.GetActivityArea(id); | ||
return Ok(new Response<ActivityAreaResponseDTO> | ||
{ | ||
Data = activityArea | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
using api.core.Data.Entities; | ||
|
||
|
||
namespace api.core.data.entities; | ||
|
||
[Table("ActivityArea")] | ||
public partial class ActivityArea : BaseEntity | ||
{ | ||
public string NameFr { get; set; } = null!; | ||
|
||
public string NameEn { get; set; } = null!; | ||
|
||
[InverseProperty("ActivityArea")] | ||
public virtual ICollection<Organizer> Organizers { get; set; } = new List<Organizer>(); | ||
|
||
[InverseProperty("ActivityArea")] | ||
public virtual ICollection<Moderator> Moderators { get; set; } = new List<Moderator>(); | ||
} |
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
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,28 @@ | ||
using api.core.data.entities; | ||
|
||
namespace api.core.Data.Responses; | ||
|
||
public class ActivityAreaResponseDTO | ||
{ | ||
public Guid Id { get; set; } | ||
|
||
public string? NameFr { get; set; } = null!; | ||
|
||
public string? NameEn { get; set; } = null!; | ||
|
||
public DateTime CreatedAt { get; set; } | ||
|
||
public DateTime UpdatedAt { get; set; } | ||
|
||
public static ActivityAreaResponseDTO Map(ActivityArea aArea) | ||
{ | ||
return new ActivityAreaResponseDTO | ||
{ | ||
Id = aArea.Id, | ||
NameFr = aArea.NameFr, | ||
NameEn = aArea.NameEn, | ||
CreatedAt = aArea.CreatedAt, | ||
UpdatedAt = aArea.UpdatedAt, | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.