using GeoRitmMover.GeoRitm.Data.EntityConfigurations;

using Microsoft.EntityFrameworkCore;

namespace GeoRitmMover.GeoRitm.Data;
public class GeoRitmDbContext(DbContextOptions<GeoRitmDbContext> options) : DbContext(options)
{
	public required DbSet<SourceGroup> Groups { get; set; }
	public required DbSet<SourceObject> Objects { get; set; }
	public required DbSet<SourceMember> ObjectGroupMembers { get; set; }
	public required DbSet<SourceSetting> Settings { get; set; }
	public required DbSet<SourceArea> Areas { get; set; }
	public required DbSet<SourceZone> Zones { get; set; }
	public required DbSet<SourcePhoto> Photos { get; set; }
	public required DbSet<SourceUser> Users { get; set; }

	public required DbSet<SourceAlert> Alerts { get; set; }
	public required DbSet<SourceAlertMessage> AlertMessages { get; set; }
	public required DbSet<SourceAlertTemplate> AlertTemplates { get; set; }
	public required DbSet<SourceLog> Logs { get; set; }
	public required DbSet<SourceAuthMap> AuthMaps { get; set; }

	protected override void OnModelCreating(ModelBuilder modelBuilder)
	{
		_ = modelBuilder.ApplyConfigurationsFromAssembly(typeof(SourceGroupEntityConfiguration).Assembly);
	}
}
