Skip to content

Commit d367efb

Browse files
committed
Add migration for IntangibleHeritage table
- Introduced the `IntangibleHeritage` table with columns `Name`, `DepartmentId`, `Scope`, and `InclusionYear`. - Set up a foreign key relationship between `IntangibleHeritage` and `Department` with `onDelete: SetNull`. - Included an index for `DepartmentId` in the new table.
1 parent 3e7c310 commit d367efb

15 files changed

+1354
-14
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning].
99

1010
- /
1111

12+
## [1.0.8] - 2026-01-25
13+
14+
### Added
15+
16+
- New IntangibleHeritage model and endpoints to manage Colombia's intangible cultural heritage information.
17+
- IntangibleHeritage table with fields: Id, Name, DepartmentId, Scope, and InclusionYear.
18+
- Complete REST API endpoints for IntangibleHeritage including list, get by id, get by department, get by name, search, and paginated list.
19+
1220
## [1.0.7] - 2026-01-07
1321

1422
### Added
@@ -67,7 +75,8 @@ and this project adheres to [Semantic Versioning].
6775
[semantic versioning]: https://semver.org/spec/v2.0.0.html
6876

6977
<!-- Versions -->
70-
[unreleased]: https://github.com/Author/Repository/compare/v1.0.7...HEAD
78+
[unreleased]: https://github.com/Author/Repository/compare/v1.0.8...HEAD
79+
[1.0.8]: https://github.com/Author/Repository/compare/v1.0.7...v1.0.8
7180
[1.0.7]: https://github.com/Author/Repository/compare/v1.0.6...v1.0.7
7281
[1.0.6]: https://github.com/Author/Repository/compare/v1.0.5...v1.0.6
7382
[1.0.5]: https://github.com/Author/Repository/compare/v1.0.4...v1.0.5

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Read this document in [Español](/README_es.md)
2727
- Radio stations.
2828
- Typical dishes.
2929
- Traditional fairs and festivals.
30+
- Intangible heritage.
3031
- Indigenous reservations.
3132
- Native communities.
3233
- Invasive species.
@@ -230,6 +231,16 @@ The public page [api-colombia.com](https://api-colombia.com/) has useful informa
230231
| GET | /api/{version}/TraditionalFairAndFestival/search/{keyword} | Get the information of a traditional fair and festival searching by keyword |
231232
| GET | /api/{version}/TraditionalFairAndFestival/pagedList | Get the list of all traditional fairs and festivals paginated |
232233

234+
### Intangible Heritage
235+
| HTTP Verbs | Endpoints | Action |
236+
| ---------- | ------------------------------------- | -------------------------------------------------------------------- |
237+
| GET | /api/{version}/IntangibleHeritage | Get the list of all intangible heritages in Colombia |
238+
| GET | /api/{version}/IntangibleHeritage/{id} | Get the information of an intangible heritage by it is id |
239+
| GET | /api/{version}/IntangibleHeritage/{id}/department | Get the list of intangible heritages by department id |
240+
| GET | /api/{version}/IntangibleHeritage/name/{name} | Get the information of an intangible heritage by it is name |
241+
| GET | /api/{version}/IntangibleHeritage/search/{keyword} | Get the information of an intangible heritage searching by keyword |
242+
| GET | /api/{version}/IntangibleHeritage/pagedList | Get the list of all intangible heritages paginated |
243+
233244
### Indigenous Reservations
234245
| HTTP Verbs | Endpoints | Action |
235246
| ---------- | ------------------------------------- | -------------------------------------------------------------------- |

api/Const/Version.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ namespace api.Const;
22

33
public static class VersionInfo
44
{
5-
public const string CurrentVersion = "1.0.7";
5+
public const string CurrentVersion = "1.0.8";
66
}

api/DBContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class DBContext : DbContext
2323
public DbSet<ConstitutionArticle> ConstitutionArticles { get; set; }
2424
public DbSet<Radio> Radios { get; set; }
2525
public DbSet<Holiday> Holidays {get; set; }
26+
public DbSet<IntangibleHeritage> IntangibleHeritages {get; set; }
2627

2728
public DBContext(DbContextOptions<DBContext> options) : base(options)
2829
{
@@ -49,6 +50,7 @@ protected override void OnModelCreating(ModelBuilder builder)
4950
builder.ApplyConfiguration(new HolidayConfig());
5051
builder.ApplyConfiguration(new TypicalDishConfig());
5152
builder.ApplyConfiguration(new TraditionalFairAndFestivalConfig());
53+
builder.ApplyConfiguration(new IntangibleHeritageConfig());
5254

5355
base.OnModelCreating(builder);
5456
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using api.Models;
2+
using Microsoft.EntityFrameworkCore;
3+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
4+
5+
public class IntangibleHeritageConfig : IEntityTypeConfiguration<IntangibleHeritage>
6+
{
7+
public void Configure(EntityTypeBuilder<IntangibleHeritage> intangibleHeritage)
8+
{
9+
intangibleHeritage.ToTable("IntangibleHeritage");
10+
intangibleHeritage.HasKey(t => t.Id);
11+
intangibleHeritage.Property(t => t.Id).ValueGeneratedOnAdd();
12+
intangibleHeritage.Property(t => t.Name).IsRequired().HasMaxLength(200);
13+
intangibleHeritage.Property(t => t.Scope).IsRequired(false).HasMaxLength(500);
14+
intangibleHeritage.Property(t => t.InclusionYear).IsRequired(false);
15+
intangibleHeritage.Property(t => t.DepartmentId).IsRequired(false);
16+
intangibleHeritage.HasOne(t => t.Department).WithMany().HasForeignKey(t => t.DepartmentId).OnDelete(DeleteBehavior.SetNull);
17+
}
18+
}

0 commit comments

Comments
 (0)