diff --git a/src/WorkFlowCheck.API/Program.cs b/src/WorkFlowCheck.API/Program.cs index 1a337a2..d41357f 100644 --- a/src/WorkFlowCheck.API/Program.cs +++ b/src/WorkFlowCheck.API/Program.cs @@ -74,7 +74,13 @@ builder.Services.AddControllers() options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; }); - +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + { + policy.WithOrigins("*").AllowAnyMethod().AllowAnyHeader(); + }); +}); var app = builder.Build(); @@ -95,11 +101,11 @@ if (app.Environment.IsDevelopment()) } // Routing és endpointok -app.UseHttpsRedirection(); +//app.UseHttpsRedirection(); app.UseRouting(); app.UseMiddleware(); app.MapControllers(); app.UseAuthorization(); - +app.UseCors(); app.Run(); diff --git a/src/WorkFlowCheck.BL/Mappings/MapperProfile.cs b/src/WorkFlowCheck.BL/Mappings/MapperProfile.cs index b8dca27..47a6102 100644 --- a/src/WorkFlowCheck.BL/Mappings/MapperProfile.cs +++ b/src/WorkFlowCheck.BL/Mappings/MapperProfile.cs @@ -18,6 +18,7 @@ namespace WorkFlowCheck.BL.Mappings CreateMap() .ForMember(dest => dest.PasswordHash, opt => opt.MapFrom()); + CreateMap(); } } } diff --git a/src/WorkFlowCheck.Common/DTO/CheckListTemplateHeader.cs b/src/WorkFlowCheck.Common/DTO/CheckListTemplateHeader.cs new file mode 100644 index 0000000..dad0325 --- /dev/null +++ b/src/WorkFlowCheck.Common/DTO/CheckListTemplateHeader.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace WorkFlowCheck.Common.DTO +{ + public class CheckListTemplateHeaderDTO + { + public int Id { get; set; } + public string ShortName { get; set; } = null!; + public string Description { get; set; } = null!; + } +} diff --git a/src/WorkFlowCheck.DL/AppDbContext.cs b/src/WorkFlowCheck.DL/AppDbContext.cs index dd61b02..8f5dfea 100644 --- a/src/WorkFlowCheck.DL/AppDbContext.cs +++ b/src/WorkFlowCheck.DL/AppDbContext.cs @@ -16,6 +16,8 @@ namespace WorkFlowCheck.DL } public DbSet Users { get; set; } = null!; + public DbSet CheckListTemplateHeaders { get; set; } = null!; + public DbSet UsersCheckListTemplateHeaders { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/src/WorkFlowCheck.DL/Configurations/UsersCheckListTemplateHeaderTypeConfiguration - Copy.cs b/src/WorkFlowCheck.DL/Configurations/UsersCheckListTemplateHeaderTypeConfiguration - Copy.cs new file mode 100644 index 0000000..00a3958 --- /dev/null +++ b/src/WorkFlowCheck.DL/Configurations/UsersCheckListTemplateHeaderTypeConfiguration - Copy.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WorkFlowCheck.DL.Configurations +{ + public class UsersCheckListTemplateHeaderTypeConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("UsersCheckListTemplateHeader"); + builder.HasKey(e => e.Id); + builder.Property(e => e.Id).ValueGeneratedOnAdd(); + } + + } +} diff --git a/src/WorkFlowCheck.DL/Entities/CheckListTemplateHeader.cs b/src/WorkFlowCheck.DL/Entities/CheckListTemplateHeader.cs new file mode 100644 index 0000000..350525a --- /dev/null +++ b/src/WorkFlowCheck.DL/Entities/CheckListTemplateHeader.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace WorkFlowCheck.DL.Entities +{ + public class CheckListTemplateHeader + { + public int Id { get; set; } + public string ShortName { get; set; } = null!; + public string Description { get; set; } = null!; + } +} diff --git a/src/WorkFlowCheck.DL/Entities/UsersCheckListTemplateHeader.cs b/src/WorkFlowCheck.DL/Entities/UsersCheckListTemplateHeader.cs new file mode 100644 index 0000000..b401a72 --- /dev/null +++ b/src/WorkFlowCheck.DL/Entities/UsersCheckListTemplateHeader.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace WorkFlowCheck.DL.Entities +{ + public class UsersCheckListTemplateHeader + { + public int Id { get; set; } + public int UsersId { get; set; } + public int CheckListTemplateHeader { get; set; } + public bool Enabled { get; set; } = false; + } +}