mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
CreateDatabase
Nic nie działa bo wszystko jest inne XDD
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
{
|
||||
public class Event
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public required string Place { get; set; }
|
||||
public int EventId { get; set; }
|
||||
public int OrganisationId { get; set; }
|
||||
public required string Title { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public required DateTime Date { get; set; }
|
||||
public required string Location { get; set; }
|
||||
public required DateTime EventDate { get; set; }
|
||||
|
||||
public Organisation? Organisation { get; set; }
|
||||
public ICollection<EventSkill> EventSkills { get; set; } = new List<EventSkill>();
|
||||
public ICollection<EventRegistration> EventRegistrations { get; set; } = new List<EventRegistration>();
|
||||
}
|
||||
}
|
||||
|
||||
11
WebApp/Entities/EventRegistration.cs
Normal file
11
WebApp/Entities/EventRegistration.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class EventRegistration
|
||||
{
|
||||
public int EventId { get; set; }
|
||||
public required string UserId { get; set; }
|
||||
public DateTime RegisteredAt { get; set; } = DateTime.UtcNow;
|
||||
public Event? Event { get; set; }
|
||||
public User? User { get; set; }
|
||||
}
|
||||
}
|
||||
11
WebApp/Entities/EventSkill.cs
Normal file
11
WebApp/Entities/EventSkill.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class EventSkill
|
||||
{
|
||||
public int EventId { get; set; }
|
||||
public int SkillId { get; set; }
|
||||
|
||||
public Event? Event { get; set; }
|
||||
public Skill? Skill { get; set; }
|
||||
}
|
||||
}
|
||||
14
WebApp/Entities/Organisation.cs
Normal file
14
WebApp/Entities/Organisation.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class Organisation
|
||||
{
|
||||
public int OrganisationId { get; set; }
|
||||
public required string UserId { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? Website { get; set; }
|
||||
|
||||
public User? User { get; set; }
|
||||
public ICollection<Event> Events { get; set; } = new List<Event>();
|
||||
}
|
||||
}
|
||||
11
WebApp/Entities/Skill.cs
Normal file
11
WebApp/Entities/Skill.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class Skill
|
||||
{
|
||||
public int SkillId { get; set; }
|
||||
public required string Name { get; set; }
|
||||
|
||||
public ICollection<VolunteerSkill> VolunteerSkills { get; set; } = new List<VolunteerSkill>();
|
||||
public ICollection<EventSkill> EventSkills { get; set; } = new List<EventSkill>();
|
||||
}
|
||||
}
|
||||
15
WebApp/Entities/User.cs
Normal file
15
WebApp/Entities/User.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class User : IdentityUser
|
||||
{
|
||||
public required string FirstName { get; set; }
|
||||
public required string LastName { get; set; }
|
||||
public bool IsOrganisation { get; set; } = false;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<VolunteerSkill> VolunteerSkills { get; set; } = new List<VolunteerSkill>();
|
||||
public ICollection<EventRegistration> EventRegistrations { get; set; } = new List<EventRegistration>();
|
||||
}
|
||||
}
|
||||
11
WebApp/Entities/VolunteerSkill.cs
Normal file
11
WebApp/Entities/VolunteerSkill.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace WebApp.Entities
|
||||
{
|
||||
public class VolunteerSkill
|
||||
{
|
||||
public required string UserId { get; set; }
|
||||
public int SkillId { get; set; }
|
||||
|
||||
public User? User { get; set; }
|
||||
public Skill? Skill { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user