diff --git a/Vpassbackend/Migrations/20250721131245_InitialCreate.Designer.cs b/Vpassbackend/Migrations/20250721131245_InitialCreate.Designer.cs deleted file mode 100644 index d69702b..0000000 --- a/Vpassbackend/Migrations/20250721131245_InitialCreate.Designer.cs +++ /dev/null @@ -1,1242 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Vpassbackend.Data; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250721131245_InitialCreate")] - partial class InitialCreate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.18") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Property("AppointmentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("AppointmentId")); - - b.Property("AppointmentDate") - .HasColumnType("datetime2"); - - b.Property("AppointmentPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Type") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("Station_id"); - - b.HasIndex("VehicleId"); - - b.ToTable("Appointments"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("ServicePrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("AppointmentId", "ServiceId"); - - b.HasIndex("ServiceId"); - - b.ToTable("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.Property("PointId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PointId")); - - b.Property("CheckDate") - .HasColumnType("datetime2"); - - b.Property("CheckPoint") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EntryPoint") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("PointId"); - - b.HasIndex("VehicleId"); - - b.ToTable("BorderPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ClosureSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ClosureSchedules"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Customer", b => - { - b.Property("CustomerId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CustomerId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("DeviceToken") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsEmailVerified") - .HasColumnType("bit"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastTokenUpdate") - .HasColumnType("datetime2"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("NIC") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("OtpCode") - .HasColumnType("nvarchar(max)"); - - b.Property("OtpExpiry") - .HasColumnType("datetime2"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Platform") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PushNotificationsEnabled") - .HasColumnType("bit"); - - b.HasKey("CustomerId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.Property("DocumentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DocumentId")); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("DocumentType") - .HasColumnType("int"); - - b.Property("ExpirationDate") - .HasColumnType("datetime2"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileUrl") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UploadedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("DocumentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Documents"); - }); - - modelBuilder.Entity("Vpassbackend.Models.EmergencyCallCenter", b => - { - b.Property("CenterId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CenterId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("CenterId"); - - b.ToTable("EmergencyCallCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.Property("FeedbackId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FeedbackId")); - - b.Property("Comments") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("FeedbackDate") - .HasColumnType("datetime2"); - - b.Property("Rating") - .HasColumnType("int"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FeedbackId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Feedbacks"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.Property("FuelEfficiencyId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FuelEfficiencyId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("FuelAmount") - .HasColumnType("decimal(10,2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FuelEfficiencyId"); - - b.HasIndex("VehicleId"); - - b.ToTable("FuelEfficiencies"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Property("InvoiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("InvoiceId")); - - b.Property("InvoiceDate") - .HasColumnType("datetime2"); - - b.Property("TotalCost") - .HasColumnType("decimal(10, 2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("InvoiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.Property("NotificationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("NotificationId")); - - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("CustomerName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsRead") - .HasColumnType("bit"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PriorityColor") - .IsRequired() - .HasMaxLength(7) - .HasColumnType("nvarchar(7)"); - - b.Property("ReadAt") - .HasColumnType("datetime2"); - - b.Property("ScheduledFor") - .HasColumnType("datetime2"); - - b.Property("SentAt") - .HasColumnType("datetime2"); - - b.Property("ServiceName") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("ServiceReminderId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleBrand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.Property("VehicleModel") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleRegistrationNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("NotificationId"); - - b.HasIndex("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceReminderId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Property("PackageId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PackageId")); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("PackageName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Percentage") - .HasColumnType("decimal(5, 2)"); - - b.HasKey("PackageId"); - - b.ToTable("Packages"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.Property("LogId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LogId")); - - b.Property("InvoiceId") - .HasColumnType("int"); - - b.Property("PaymentDate") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("LogId"); - - b.HasIndex("InvoiceId"); - - b.ToTable("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Property("ServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("Category") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("ServiceId"); - - b.ToTable("Services"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ServiceAvailabilities"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Property("Station_id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Station_id")); - - b.Property("Address") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Email") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("OwnerName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegisterationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Station_name") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Station_status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Telephone") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VATNumber") - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.HasKey("Station_id"); - - b.ToTable("ServiceCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.Property("StationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StationId")); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("StationId"); - - b.HasIndex("Station_id"); - - b.ToTable("ServiceCenterCheckInPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.Property("ServiceCenterServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceCenterServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("PackageId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("ServiceCenterServiceId"); - - b.HasIndex("PackageId"); - - b.HasIndex("Station_id"); - - b.HasIndex("ServiceId", "Station_id") - .IsUnique(); - - b.ToTable("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.Property("ServiceReminderId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceReminderId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("IntervalMonths") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("NotifyBeforeDays") - .HasColumnType("int"); - - b.Property("ReminderDate") - .HasColumnType("datetime2"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceReminderId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserRoleId") - .HasColumnType("int"); - - b.HasKey("UserId"); - - b.HasIndex("UserRoleId"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Vpassbackend.Models.UserRole", b => - { - b.Property("UserRoleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserRoleId")); - - b.Property("UserRoleName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserRoleId"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Property("VehicleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("VehicleId")); - - b.Property("Brand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ChassisNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Fuel") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("Model") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("VehicleId"); - - b.HasIndex("CustomerId"); - - b.ToTable("Vehicles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.Property("ServiceHistoryId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceHistoryId")); - - b.Property("Cost") - .HasColumnType("decimal(10, 2)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ExternalServiceCenterName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsVerified") - .HasColumnType("bit"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("ReceiptDocumentPath") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasColumnType("datetime2"); - - b.Property("ServiceType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ServicedByUserId") - .HasColumnType("int"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceHistoryId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("ServicedByUserId"); - - b.HasIndex("VehicleId"); - - b.ToTable("VehicleServiceHistories"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", null) - .WithMany("Appointments") - .HasForeignKey("ServiceId"); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Appointments") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany("AppointmentServices") - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany() - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Appointment"); - - b.Navigation("Service"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("BorderPoints") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Documents") - .HasForeignKey("VehicleId"); - - b.Navigation("Customer"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("FuelEfficiencies") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Invoices") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany() - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceReminder", "ServiceReminder") - .WithMany() - .HasForeignKey("ServiceReminderId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Appointment"); - - b.Navigation("Customer"); - - b.Navigation("ServiceReminder"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.HasOne("Vpassbackend.Models.Invoice", "Invoice") - .WithMany("PaymentLogs") - .HasForeignKey("InvoiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Invoice"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("CheckInPoints") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.HasOne("Vpassbackend.Models.Package", "Package") - .WithMany("ServiceCenterServices") - .HasForeignKey("PackageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceCenterServices") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("ServiceCenterServices") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Package"); - - b.Navigation("Service"); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceReminders") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceReminders") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Service"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.HasOne("Vpassbackend.Models.UserRole", "UserRole") - .WithMany() - .HasForeignKey("UserRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserRole"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.User", "ServicedByUser") - .WithMany() - .HasForeignKey("ServicedByUserId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceHistory") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - - b.Navigation("ServicedByUser"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Navigation("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Navigation("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Navigation("Appointments"); - - b.Navigation("ServiceCenterServices"); - - b.Navigation("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Navigation("CheckInPoints"); - - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Navigation("Appointments"); - - b.Navigation("BorderPoints"); - - b.Navigation("Documents"); - - b.Navigation("FuelEfficiencies"); - - b.Navigation("Invoices"); - - b.Navigation("ServiceHistory"); - - b.Navigation("ServiceReminders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Vpassbackend/Migrations/20250721131245_InitialCreate.cs b/Vpassbackend/Migrations/20250721131245_InitialCreate.cs deleted file mode 100644 index 8307fad..0000000 --- a/Vpassbackend/Migrations/20250721131245_InitialCreate.cs +++ /dev/null @@ -1,826 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - /// - public partial class InitialCreate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ClosureSchedules", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ServiceCenterId = table.Column(type: "int", nullable: false), - WeekNumber = table.Column(type: "int", nullable: false), - Day = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ClosureSchedules", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Customers", - columns: table => new - { - CustomerId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), - Address = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - PhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - Password = table.Column(type: "nvarchar(max)", nullable: false), - NIC = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - LoyaltyPoints = table.Column(type: "int", nullable: false), - IsEmailVerified = table.Column(type: "bit", nullable: false), - OtpCode = table.Column(type: "nvarchar(max)", nullable: true), - OtpExpiry = table.Column(type: "datetime2", nullable: true), - DeviceToken = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), - LastTokenUpdate = table.Column(type: "datetime2", nullable: true), - Platform = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - PushNotificationsEnabled = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Customers", x => x.CustomerId); - }); - - migrationBuilder.CreateTable( - name: "EmergencyCallCenters", - columns: table => new - { - CenterId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Address = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), - RegistrationNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - PhoneNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_EmergencyCallCenters", x => x.CenterId); - }); - - migrationBuilder.CreateTable( - name: "Packages", - columns: table => new - { - PackageId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - PackageName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Percentage = table.Column(type: "decimal(5,2)", nullable: false), - Description = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), - IsActive = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Packages", x => x.PackageId); - }); - - migrationBuilder.CreateTable( - name: "ServiceAvailabilities", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ServiceCenterId = table.Column(type: "int", nullable: false), - ServiceId = table.Column(type: "int", nullable: false), - WeekNumber = table.Column(type: "int", nullable: false), - Day = table.Column(type: "nvarchar(max)", nullable: true), - IsAvailable = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceAvailabilities", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ServiceCenters", - columns: table => new - { - Station_id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - OwnerName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - VATNumber = table.Column(type: "nvarchar(15)", maxLength: 15, nullable: true), - RegisterationNumber = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Station_name = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), - Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Telephone = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - Address = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), - Station_status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceCenters", x => x.Station_id); - }); - - migrationBuilder.CreateTable( - name: "Services", - columns: table => new - { - ServiceId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ServiceName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Description = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), - BasePrice = table.Column(type: "decimal(10,2)", nullable: true), - Category = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Services", x => x.ServiceId); - }); - - migrationBuilder.CreateTable( - name: "UserRoles", - columns: table => new - { - UserRoleId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserRoleName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserRoles", x => x.UserRoleId); - }); - - migrationBuilder.CreateTable( - name: "Vehicles", - columns: table => new - { - VehicleId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RegistrationNumber = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - CustomerId = table.Column(type: "int", nullable: false), - Brand = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - Model = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - ChassisNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - Mileage = table.Column(type: "int", nullable: true), - Fuel = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Year = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Vehicles", x => x.VehicleId); - table.ForeignKey( - name: "FK_Vehicles_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "CustomerId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ServiceCenterCheckInPoints", - columns: table => new - { - StationId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Station_id = table.Column(type: "int", nullable: false), - Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceCenterCheckInPoints", x => x.StationId); - table.ForeignKey( - name: "FK_ServiceCenterCheckInPoints_ServiceCenters_Station_id", - column: x => x.Station_id, - principalTable: "ServiceCenters", - principalColumn: "Station_id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ServiceCenterServices", - columns: table => new - { - ServiceCenterServiceId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Station_id = table.Column(type: "int", nullable: false), - ServiceId = table.Column(type: "int", nullable: false), - PackageId = table.Column(type: "int", nullable: true), - CustomPrice = table.Column(type: "decimal(10,2)", nullable: true), - BasePrice = table.Column(type: "decimal(10,2)", nullable: true), - LoyaltyPoints = table.Column(type: "int", nullable: true), - IsAvailable = table.Column(type: "bit", nullable: false), - Notes = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceCenterServices", x => x.ServiceCenterServiceId); - table.ForeignKey( - name: "FK_ServiceCenterServices_Packages_PackageId", - column: x => x.PackageId, - principalTable: "Packages", - principalColumn: "PackageId", - onDelete: ReferentialAction.SetNull); - table.ForeignKey( - name: "FK_ServiceCenterServices_ServiceCenters_Station_id", - column: x => x.Station_id, - principalTable: "ServiceCenters", - principalColumn: "Station_id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ServiceCenterServices_Services_ServiceId", - column: x => x.ServiceId, - principalTable: "Services", - principalColumn: "ServiceId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - UserId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FirstName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - LastName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Email = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), - Password = table.Column(type: "nvarchar(max)", nullable: false), - UserRoleId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.UserId); - table.ForeignKey( - name: "FK_Users_UserRoles_UserRoleId", - column: x => x.UserRoleId, - principalTable: "UserRoles", - principalColumn: "UserRoleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Appointments", - columns: table => new - { - AppointmentId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - Station_id = table.Column(type: "int", nullable: false), - CustomerId = table.Column(type: "int", nullable: false), - AppointmentDate = table.Column(type: "datetime2", nullable: true), - Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - Type = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - Description = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), - AppointmentPrice = table.Column(type: "decimal(10,2)", nullable: true), - ServiceId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Appointments", x => x.AppointmentId); - table.ForeignKey( - name: "FK_Appointments_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "CustomerId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Appointments_ServiceCenters_Station_id", - column: x => x.Station_id, - principalTable: "ServiceCenters", - principalColumn: "Station_id"); - table.ForeignKey( - name: "FK_Appointments_Services_ServiceId", - column: x => x.ServiceId, - principalTable: "Services", - principalColumn: "ServiceId"); - table.ForeignKey( - name: "FK_Appointments_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId"); - }); - - migrationBuilder.CreateTable( - name: "BorderPoints", - columns: table => new - { - PointId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - CheckPoint = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - CheckDate = table.Column(type: "datetime2", nullable: true), - EntryPoint = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BorderPoints", x => x.PointId); - table.ForeignKey( - name: "FK_BorderPoints_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Documents", - columns: table => new - { - DocumentId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FileName = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false), - FileUrl = table.Column(type: "nvarchar(max)", nullable: false), - DocumentType = table.Column(type: "int", nullable: false), - ContentType = table.Column(type: "nvarchar(max)", nullable: false), - DisplayName = table.Column(type: "nvarchar(max)", nullable: true), - FileSize = table.Column(type: "bigint", nullable: false), - UploadedAt = table.Column(type: "datetime2", nullable: false), - ExpirationDate = table.Column(type: "datetime2", nullable: true), - CustomerId = table.Column(type: "int", nullable: false), - VehicleId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Documents", x => x.DocumentId); - table.ForeignKey( - name: "FK_Documents_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "CustomerId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Documents_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId"); - }); - - migrationBuilder.CreateTable( - name: "Feedbacks", - columns: table => new - { - FeedbackId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CustomerId = table.Column(type: "int", nullable: false), - ServiceCenterId = table.Column(type: "int", nullable: false), - VehicleId = table.Column(type: "int", nullable: false), - Rating = table.Column(type: "int", nullable: false), - Comments = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - FeedbackDate = table.Column(type: "datetime2", nullable: false), - ServiceDate = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Feedbacks", x => x.FeedbackId); - table.ForeignKey( - name: "FK_Feedbacks_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "CustomerId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Feedbacks_ServiceCenters_ServiceCenterId", - column: x => x.ServiceCenterId, - principalTable: "ServiceCenters", - principalColumn: "Station_id"); - table.ForeignKey( - name: "FK_Feedbacks_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId"); - }); - - migrationBuilder.CreateTable( - name: "FuelEfficiencies", - columns: table => new - { - FuelEfficiencyId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - FuelAmount = table.Column(type: "decimal(10,2)", nullable: false), - Date = table.Column(type: "datetime2", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FuelEfficiencies", x => x.FuelEfficiencyId); - table.ForeignKey( - name: "FK_FuelEfficiencies_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Invoices", - columns: table => new - { - InvoiceId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - TotalCost = table.Column(type: "decimal(10,2)", nullable: true), - InvoiceDate = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Invoices", x => x.InvoiceId); - table.ForeignKey( - name: "FK_Invoices_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ServiceReminders", - columns: table => new - { - ServiceReminderId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - ServiceId = table.Column(type: "int", nullable: false), - ReminderDate = table.Column(type: "datetime2", nullable: false), - IntervalMonths = table.Column(type: "int", nullable: false), - NotifyBeforeDays = table.Column(type: "int", nullable: false), - Notes = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true), - IsActive = table.Column(type: "bit", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceReminders", x => x.ServiceReminderId); - table.ForeignKey( - name: "FK_ServiceReminders_Services_ServiceId", - column: x => x.ServiceId, - principalTable: "Services", - principalColumn: "ServiceId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ServiceReminders_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "VehicleServiceHistories", - columns: table => new - { - ServiceHistoryId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - VehicleId = table.Column(type: "int", nullable: false), - ServiceType = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), - Cost = table.Column(type: "decimal(10,2)", nullable: false), - ServiceCenterId = table.Column(type: "int", nullable: true), - ServicedByUserId = table.Column(type: "int", nullable: true), - ServiceDate = table.Column(type: "datetime2", nullable: false), - Mileage = table.Column(type: "int", nullable: true), - IsVerified = table.Column(type: "bit", nullable: false), - ExternalServiceCenterName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), - ReceiptDocumentPath = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_VehicleServiceHistories", x => x.ServiceHistoryId); - table.ForeignKey( - name: "FK_VehicleServiceHistories_ServiceCenters_ServiceCenterId", - column: x => x.ServiceCenterId, - principalTable: "ServiceCenters", - principalColumn: "Station_id"); - table.ForeignKey( - name: "FK_VehicleServiceHistories_Users_ServicedByUserId", - column: x => x.ServicedByUserId, - principalTable: "Users", - principalColumn: "UserId"); - table.ForeignKey( - name: "FK_VehicleServiceHistories_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AppointmentServices", - columns: table => new - { - AppointmentId = table.Column(type: "int", nullable: false), - ServiceId = table.Column(type: "int", nullable: false), - ServicePrice = table.Column(type: "decimal(18,2)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AppointmentServices", x => new { x.AppointmentId, x.ServiceId }); - table.ForeignKey( - name: "FK_AppointmentServices_Appointments_AppointmentId", - column: x => x.AppointmentId, - principalTable: "Appointments", - principalColumn: "AppointmentId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AppointmentServices_Services_ServiceId", - column: x => x.ServiceId, - principalTable: "Services", - principalColumn: "ServiceId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PaymentLogs", - columns: table => new - { - LogId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - InvoiceId = table.Column(type: "int", nullable: false), - PaymentDate = table.Column(type: "datetime2", nullable: true), - Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PaymentLogs", x => x.LogId); - table.ForeignKey( - name: "FK_PaymentLogs_Invoices_InvoiceId", - column: x => x.InvoiceId, - principalTable: "Invoices", - principalColumn: "InvoiceId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Notifications", - columns: table => new - { - NotificationId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CustomerId = table.Column(type: "int", nullable: false), - Title = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Message = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: false), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), - Priority = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - PriorityColor = table.Column(type: "nvarchar(7)", maxLength: 7, nullable: false), - IsRead = table.Column(type: "bit", nullable: false), - ReadAt = table.Column(type: "datetime2", nullable: true), - SentAt = table.Column(type: "datetime2", nullable: true), - ScheduledFor = table.Column(type: "datetime2", nullable: true), - CreatedAt = table.Column(type: "datetime2", nullable: false), - UpdatedAt = table.Column(type: "datetime2", nullable: true), - ServiceReminderId = table.Column(type: "int", nullable: true), - VehicleId = table.Column(type: "int", nullable: true), - AppointmentId = table.Column(type: "int", nullable: true), - VehicleRegistrationNumber = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), - VehicleBrand = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - VehicleModel = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - ServiceName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - CustomerName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Notifications", x => x.NotificationId); - table.ForeignKey( - name: "FK_Notifications_Appointments_AppointmentId", - column: x => x.AppointmentId, - principalTable: "Appointments", - principalColumn: "AppointmentId"); - table.ForeignKey( - name: "FK_Notifications_Customers_CustomerId", - column: x => x.CustomerId, - principalTable: "Customers", - principalColumn: "CustomerId"); - table.ForeignKey( - name: "FK_Notifications_ServiceReminders_ServiceReminderId", - column: x => x.ServiceReminderId, - principalTable: "ServiceReminders", - principalColumn: "ServiceReminderId"); - table.ForeignKey( - name: "FK_Notifications_Vehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "Vehicles", - principalColumn: "VehicleId"); - }); - - migrationBuilder.CreateIndex( - name: "IX_Appointments_CustomerId", - table: "Appointments", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Appointments_ServiceId", - table: "Appointments", - column: "ServiceId"); - - migrationBuilder.CreateIndex( - name: "IX_Appointments_Station_id", - table: "Appointments", - column: "Station_id"); - - migrationBuilder.CreateIndex( - name: "IX_Appointments_VehicleId", - table: "Appointments", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_AppointmentServices_ServiceId", - table: "AppointmentServices", - column: "ServiceId"); - - migrationBuilder.CreateIndex( - name: "IX_BorderPoints_VehicleId", - table: "BorderPoints", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_Documents_CustomerId", - table: "Documents", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Documents_VehicleId", - table: "Documents", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_Feedbacks_CustomerId", - table: "Feedbacks", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Feedbacks_ServiceCenterId", - table: "Feedbacks", - column: "ServiceCenterId"); - - migrationBuilder.CreateIndex( - name: "IX_Feedbacks_VehicleId", - table: "Feedbacks", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_FuelEfficiencies_VehicleId", - table: "FuelEfficiencies", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_Invoices_VehicleId", - table: "Invoices", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_Notifications_AppointmentId", - table: "Notifications", - column: "AppointmentId"); - - migrationBuilder.CreateIndex( - name: "IX_Notifications_CustomerId", - table: "Notifications", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Notifications_ServiceReminderId", - table: "Notifications", - column: "ServiceReminderId"); - - migrationBuilder.CreateIndex( - name: "IX_Notifications_VehicleId", - table: "Notifications", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_PaymentLogs_InvoiceId", - table: "PaymentLogs", - column: "InvoiceId"); - - migrationBuilder.CreateIndex( - name: "IX_ServiceCenterCheckInPoints_Station_id", - table: "ServiceCenterCheckInPoints", - column: "Station_id"); - - migrationBuilder.CreateIndex( - name: "IX_ServiceCenterServices_PackageId", - table: "ServiceCenterServices", - column: "PackageId"); - - migrationBuilder.CreateIndex( - name: "IX_ServiceCenterServices_ServiceId_Station_id", - table: "ServiceCenterServices", - columns: new[] { "ServiceId", "Station_id" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ServiceCenterServices_Station_id", - table: "ServiceCenterServices", - column: "Station_id"); - - migrationBuilder.CreateIndex( - name: "IX_ServiceReminders_ServiceId", - table: "ServiceReminders", - column: "ServiceId"); - - migrationBuilder.CreateIndex( - name: "IX_ServiceReminders_VehicleId", - table: "ServiceReminders", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_UserRoleId", - table: "Users", - column: "UserRoleId"); - - migrationBuilder.CreateIndex( - name: "IX_Vehicles_CustomerId", - table: "Vehicles", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_VehicleServiceHistories_ServiceCenterId", - table: "VehicleServiceHistories", - column: "ServiceCenterId"); - - migrationBuilder.CreateIndex( - name: "IX_VehicleServiceHistories_ServicedByUserId", - table: "VehicleServiceHistories", - column: "ServicedByUserId"); - - migrationBuilder.CreateIndex( - name: "IX_VehicleServiceHistories_VehicleId", - table: "VehicleServiceHistories", - column: "VehicleId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AppointmentServices"); - - migrationBuilder.DropTable( - name: "BorderPoints"); - - migrationBuilder.DropTable( - name: "ClosureSchedules"); - - migrationBuilder.DropTable( - name: "Documents"); - - migrationBuilder.DropTable( - name: "EmergencyCallCenters"); - - migrationBuilder.DropTable( - name: "Feedbacks"); - - migrationBuilder.DropTable( - name: "FuelEfficiencies"); - - migrationBuilder.DropTable( - name: "Notifications"); - - migrationBuilder.DropTable( - name: "PaymentLogs"); - - migrationBuilder.DropTable( - name: "ServiceAvailabilities"); - - migrationBuilder.DropTable( - name: "ServiceCenterCheckInPoints"); - - migrationBuilder.DropTable( - name: "ServiceCenterServices"); - - migrationBuilder.DropTable( - name: "VehicleServiceHistories"); - - migrationBuilder.DropTable( - name: "Appointments"); - - migrationBuilder.DropTable( - name: "ServiceReminders"); - - migrationBuilder.DropTable( - name: "Invoices"); - - migrationBuilder.DropTable( - name: "Packages"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "ServiceCenters"); - - migrationBuilder.DropTable( - name: "Services"); - - migrationBuilder.DropTable( - name: "Vehicles"); - - migrationBuilder.DropTable( - name: "UserRoles"); - - migrationBuilder.DropTable( - name: "Customers"); - } - } -} diff --git a/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.Designer.cs b/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.Designer.cs deleted file mode 100644 index 9d1dfed..0000000 --- a/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.Designer.cs +++ /dev/null @@ -1,1288 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Vpassbackend.Data; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250722102707_AddServiceCenterSlotsAndSlotsProperty")] - partial class AddServiceCenterSlotsAndSlotsProperty - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.18") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Property("AppointmentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("AppointmentId")); - - b.Property("AppointmentDate") - .HasColumnType("datetime2"); - - b.Property("AppointmentPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Type") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("Station_id"); - - b.HasIndex("VehicleId"); - - b.ToTable("Appointments"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("ServicePrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("AppointmentId", "ServiceId"); - - b.HasIndex("ServiceId"); - - b.ToTable("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.Property("PointId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PointId")); - - b.Property("CheckDate") - .HasColumnType("datetime2"); - - b.Property("CheckPoint") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EntryPoint") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("PointId"); - - b.HasIndex("VehicleId"); - - b.ToTable("BorderPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ClosureSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ClosureSchedules"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Customer", b => - { - b.Property("CustomerId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CustomerId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("DeviceToken") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsEmailVerified") - .HasColumnType("bit"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastTokenUpdate") - .HasColumnType("datetime2"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("NIC") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("OtpCode") - .HasColumnType("nvarchar(max)"); - - b.Property("OtpExpiry") - .HasColumnType("datetime2"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Platform") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PushNotificationsEnabled") - .HasColumnType("bit"); - - b.HasKey("CustomerId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.Property("DocumentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DocumentId")); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("DocumentType") - .HasColumnType("int"); - - b.Property("ExpirationDate") - .HasColumnType("datetime2"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileUrl") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UploadedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("DocumentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Documents"); - }); - - modelBuilder.Entity("Vpassbackend.Models.EmergencyCallCenter", b => - { - b.Property("CenterId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CenterId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("CenterId"); - - b.ToTable("EmergencyCallCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.Property("FeedbackId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FeedbackId")); - - b.Property("Comments") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("FeedbackDate") - .HasColumnType("datetime2"); - - b.Property("Rating") - .HasColumnType("int"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FeedbackId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Feedbacks"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.Property("FuelEfficiencyId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FuelEfficiencyId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("FuelAmount") - .HasColumnType("decimal(10,2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FuelEfficiencyId"); - - b.HasIndex("VehicleId"); - - b.ToTable("FuelEfficiencies"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Property("InvoiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("InvoiceId")); - - b.Property("InvoiceDate") - .HasColumnType("datetime2"); - - b.Property("TotalCost") - .HasColumnType("decimal(10, 2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("InvoiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.Property("NotificationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("NotificationId")); - - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("CustomerName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsRead") - .HasColumnType("bit"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PriorityColor") - .IsRequired() - .HasMaxLength(7) - .HasColumnType("nvarchar(7)"); - - b.Property("ReadAt") - .HasColumnType("datetime2"); - - b.Property("ScheduledFor") - .HasColumnType("datetime2"); - - b.Property("SentAt") - .HasColumnType("datetime2"); - - b.Property("ServiceName") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("ServiceReminderId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleBrand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.Property("VehicleModel") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleRegistrationNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("NotificationId"); - - b.HasIndex("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceReminderId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Property("PackageId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PackageId")); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("PackageName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Percentage") - .HasColumnType("decimal(5, 2)"); - - b.HasKey("PackageId"); - - b.ToTable("Packages"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.Property("LogId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LogId")); - - b.Property("InvoiceId") - .HasColumnType("int"); - - b.Property("PaymentDate") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("LogId"); - - b.HasIndex("InvoiceId"); - - b.ToTable("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Property("ServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("Category") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("ServiceId"); - - b.ToTable("Services"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ServiceAvailabilities"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Property("Station_id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Station_id")); - - b.Property("Address") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Email") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("OwnerName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegisterationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Station_name") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Station_status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Telephone") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VATNumber") - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.Property("slots") - .HasColumnType("int"); - - b.HasKey("Station_id"); - - b.ToTable("ServiceCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.Property("StationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StationId")); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("StationId"); - - b.HasIndex("Station_id"); - - b.ToTable("ServiceCenterCheckInPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.Property("ServiceCenterServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceCenterServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("PackageId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("ServiceCenterServiceId"); - - b.HasIndex("PackageId"); - - b.HasIndex("Station_id"); - - b.HasIndex("ServiceId", "Station_id") - .IsUnique(); - - b.ToTable("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterSlots", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.Property("UsedSlots") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Station_id"); - - b.ToTable("ServiceCenterSlots"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.Property("ServiceReminderId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceReminderId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("IntervalMonths") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("NotifyBeforeDays") - .HasColumnType("int"); - - b.Property("ReminderDate") - .HasColumnType("datetime2"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceReminderId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserRoleId") - .HasColumnType("int"); - - b.HasKey("UserId"); - - b.HasIndex("UserRoleId"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Vpassbackend.Models.UserRole", b => - { - b.Property("UserRoleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserRoleId")); - - b.Property("UserRoleName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserRoleId"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Property("VehicleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("VehicleId")); - - b.Property("Brand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ChassisNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Fuel") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("Model") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("VehicleId"); - - b.HasIndex("CustomerId"); - - b.ToTable("Vehicles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.Property("ServiceHistoryId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceHistoryId")); - - b.Property("Cost") - .HasColumnType("decimal(10, 2)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ExternalServiceCenterName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsVerified") - .HasColumnType("bit"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("ReceiptDocumentPath") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasColumnType("datetime2"); - - b.Property("ServiceType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ServicedByUserId") - .HasColumnType("int"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceHistoryId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("ServicedByUserId"); - - b.HasIndex("VehicleId"); - - b.ToTable("VehicleServiceHistories"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", null) - .WithMany("Appointments") - .HasForeignKey("ServiceId"); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Appointments") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany("AppointmentServices") - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany() - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Appointment"); - - b.Navigation("Service"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("BorderPoints") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Documents") - .HasForeignKey("VehicleId"); - - b.Navigation("Customer"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("FuelEfficiencies") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Invoices") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany() - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceReminder", "ServiceReminder") - .WithMany() - .HasForeignKey("ServiceReminderId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Appointment"); - - b.Navigation("Customer"); - - b.Navigation("ServiceReminder"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.HasOne("Vpassbackend.Models.Invoice", "Invoice") - .WithMany("PaymentLogs") - .HasForeignKey("InvoiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Invoice"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("CheckInPoints") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.HasOne("Vpassbackend.Models.Package", "Package") - .WithMany("ServiceCenterServices") - .HasForeignKey("PackageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceCenterServices") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("ServiceCenterServices") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Package"); - - b.Navigation("Service"); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterSlots", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("DailySlots") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceReminders") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceReminders") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Service"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.HasOne("Vpassbackend.Models.UserRole", "UserRole") - .WithMany() - .HasForeignKey("UserRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserRole"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.User", "ServicedByUser") - .WithMany() - .HasForeignKey("ServicedByUserId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceHistory") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - - b.Navigation("ServicedByUser"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Navigation("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Navigation("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Navigation("Appointments"); - - b.Navigation("ServiceCenterServices"); - - b.Navigation("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Navigation("CheckInPoints"); - - b.Navigation("DailySlots"); - - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Navigation("Appointments"); - - b.Navigation("BorderPoints"); - - b.Navigation("Documents"); - - b.Navigation("FuelEfficiencies"); - - b.Navigation("Invoices"); - - b.Navigation("ServiceHistory"); - - b.Navigation("ServiceReminders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.cs b/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.cs deleted file mode 100644 index 77b29d4..0000000 --- a/Vpassbackend/Migrations/20250722102707_AddServiceCenterSlotsAndSlotsProperty.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - /// - public partial class AddServiceCenterSlotsAndSlotsProperty : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "slots", - table: "ServiceCenters", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "ServiceCenterSlots", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Station_id = table.Column(type: "int", nullable: false), - Date = table.Column(type: "date", nullable: false), - UsedSlots = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ServiceCenterSlots", x => x.Id); - table.ForeignKey( - name: "FK_ServiceCenterSlots_ServiceCenters_Station_id", - column: x => x.Station_id, - principalTable: "ServiceCenters", - principalColumn: "Station_id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_ServiceCenterSlots_Station_id", - table: "ServiceCenterSlots", - column: "Station_id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ServiceCenterSlots"); - - migrationBuilder.DropColumn( - name: "slots", - table: "ServiceCenters"); - } - } -} diff --git a/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.Designer.cs b/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.Designer.cs deleted file mode 100644 index 8f7e494..0000000 --- a/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.Designer.cs +++ /dev/null @@ -1,1288 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Vpassbackend.Data; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250722114429_AddServiceCenterSlots")] - partial class AddServiceCenterSlots - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.18") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Property("AppointmentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("AppointmentId")); - - b.Property("AppointmentDate") - .HasColumnType("datetime2"); - - b.Property("AppointmentPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Type") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("Station_id"); - - b.HasIndex("VehicleId"); - - b.ToTable("Appointments"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("ServicePrice") - .HasColumnType("decimal(18,2)"); - - b.HasKey("AppointmentId", "ServiceId"); - - b.HasIndex("ServiceId"); - - b.ToTable("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.Property("PointId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PointId")); - - b.Property("CheckDate") - .HasColumnType("datetime2"); - - b.Property("CheckPoint") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("EntryPoint") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("PointId"); - - b.HasIndex("VehicleId"); - - b.ToTable("BorderPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ClosureSchedule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ClosureSchedules"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Customer", b => - { - b.Property("CustomerId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CustomerId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("DeviceToken") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("IsEmailVerified") - .HasColumnType("bit"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastTokenUpdate") - .HasColumnType("datetime2"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("NIC") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("OtpCode") - .HasColumnType("nvarchar(max)"); - - b.Property("OtpExpiry") - .HasColumnType("datetime2"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Platform") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("PushNotificationsEnabled") - .HasColumnType("bit"); - - b.HasKey("CustomerId"); - - b.ToTable("Customers"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.Property("DocumentId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("DocumentId")); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("DocumentType") - .HasColumnType("int"); - - b.Property("ExpirationDate") - .HasColumnType("datetime2"); - - b.Property("FileName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("FileUrl") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UploadedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("DocumentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Documents"); - }); - - modelBuilder.Entity("Vpassbackend.Models.EmergencyCallCenter", b => - { - b.Property("CenterId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("CenterId")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("PhoneNumber") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("CenterId"); - - b.ToTable("EmergencyCallCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.Property("FeedbackId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FeedbackId")); - - b.Property("Comments") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("FeedbackDate") - .HasColumnType("datetime2"); - - b.Property("Rating") - .HasColumnType("int"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FeedbackId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Feedbacks"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.Property("FuelEfficiencyId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FuelEfficiencyId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("FuelAmount") - .HasColumnType("decimal(10,2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("FuelEfficiencyId"); - - b.HasIndex("VehicleId"); - - b.ToTable("FuelEfficiencies"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Property("InvoiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("InvoiceId")); - - b.Property("InvoiceDate") - .HasColumnType("datetime2"); - - b.Property("TotalCost") - .HasColumnType("decimal(10, 2)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("InvoiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.Property("NotificationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("NotificationId")); - - b.Property("AppointmentId") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("CustomerName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsRead") - .HasColumnType("bit"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Priority") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PriorityColor") - .IsRequired() - .HasMaxLength(7) - .HasColumnType("nvarchar(7)"); - - b.Property("ReadAt") - .HasColumnType("datetime2"); - - b.Property("ScheduledFor") - .HasColumnType("datetime2"); - - b.Property("SentAt") - .HasColumnType("datetime2"); - - b.Property("ServiceName") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("ServiceReminderId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleBrand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.Property("VehicleModel") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("VehicleRegistrationNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("NotificationId"); - - b.HasIndex("AppointmentId"); - - b.HasIndex("CustomerId"); - - b.HasIndex("ServiceReminderId"); - - b.HasIndex("VehicleId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Property("PackageId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("PackageId")); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("PackageName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Percentage") - .HasColumnType("decimal(5, 2)"); - - b.HasKey("PackageId"); - - b.ToTable("Packages"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.Property("LogId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("LogId")); - - b.Property("InvoiceId") - .HasColumnType("int"); - - b.Property("PaymentDate") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("LogId"); - - b.HasIndex("InvoiceId"); - - b.ToTable("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Property("ServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("Category") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Description") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("ServiceId"); - - b.ToTable("Services"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceAvailability", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Day") - .HasColumnType("nvarchar(max)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ServiceAvailabilities"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Property("Station_id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Station_id")); - - b.Property("Address") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Email") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("OwnerName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegisterationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Station_name") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Station_status") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Telephone") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("VATNumber") - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.Property("slots") - .HasColumnType("int"); - - b.HasKey("Station_id"); - - b.ToTable("ServiceCenters"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.Property("StationId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("StationId")); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("StationId"); - - b.HasIndex("Station_id"); - - b.ToTable("ServiceCenterCheckInPoints"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.Property("ServiceCenterServiceId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceCenterServiceId")); - - b.Property("BasePrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("CustomPrice") - .HasColumnType("decimal(10, 2)"); - - b.Property("IsAvailable") - .HasColumnType("bit"); - - b.Property("LoyaltyPoints") - .HasColumnType("int"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("PackageId") - .HasColumnType("int"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.HasKey("ServiceCenterServiceId"); - - b.HasIndex("PackageId"); - - b.HasIndex("Station_id"); - - b.HasIndex("ServiceId", "Station_id") - .IsUnique(); - - b.ToTable("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterSlots", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Date") - .HasColumnType("date"); - - b.Property("Station_id") - .HasColumnType("int"); - - b.Property("UsedSlots") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("Station_id"); - - b.ToTable("ServiceCenterSlots"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.Property("ServiceReminderId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceReminderId")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("IntervalMonths") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("Notes") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("NotifyBeforeDays") - .HasColumnType("int"); - - b.Property("ReminderDate") - .HasColumnType("datetime2"); - - b.Property("ServiceId") - .HasColumnType("int"); - - b.Property("UpdatedAt") - .HasColumnType("datetime2"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceReminderId"); - - b.HasIndex("ServiceId"); - - b.HasIndex("VehicleId"); - - b.ToTable("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserId")); - - b.Property("Email") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Password") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserRoleId") - .HasColumnType("int"); - - b.HasKey("UserId"); - - b.HasIndex("UserRoleId"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Vpassbackend.Models.UserRole", b => - { - b.Property("UserRoleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("UserRoleId")); - - b.Property("UserRoleName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("UserRoleId"); - - b.ToTable("UserRoles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Property("VehicleId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("VehicleId")); - - b.Property("Brand") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ChassisNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("CustomerId") - .HasColumnType("int"); - - b.Property("Fuel") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("Model") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegistrationNumber") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("VehicleId"); - - b.HasIndex("CustomerId"); - - b.ToTable("Vehicles"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.Property("ServiceHistoryId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ServiceHistoryId")); - - b.Property("Cost") - .HasColumnType("decimal(10, 2)"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ExternalServiceCenterName") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("IsVerified") - .HasColumnType("bit"); - - b.Property("Mileage") - .HasColumnType("int"); - - b.Property("ReceiptDocumentPath") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("ServiceCenterId") - .HasColumnType("int"); - - b.Property("ServiceDate") - .HasColumnType("datetime2"); - - b.Property("ServiceType") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("ServicedByUserId") - .HasColumnType("int"); - - b.Property("VehicleId") - .HasColumnType("int"); - - b.HasKey("ServiceHistoryId"); - - b.HasIndex("ServiceCenterId"); - - b.HasIndex("ServicedByUserId"); - - b.HasIndex("VehicleId"); - - b.ToTable("VehicleServiceHistories"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", null) - .WithMany("Appointments") - .HasForeignKey("ServiceId"); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Appointments") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.AppointmentService", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany("AppointmentServices") - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany() - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Appointment"); - - b.Navigation("Service"); - }); - - modelBuilder.Entity("Vpassbackend.Models.BorderPoint", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("BorderPoints") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Document", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Documents") - .HasForeignKey("VehicleId"); - - b.Navigation("Customer"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Feedback", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Customer"); - - b.Navigation("ServiceCenter"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.FuelEfficiency", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("FuelEfficiencies") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("Invoices") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Notification", b => - { - b.HasOne("Vpassbackend.Models.Appointment", "Appointment") - .WithMany() - .HasForeignKey("AppointmentId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceReminder", "ServiceReminder") - .WithMany() - .HasForeignKey("ServiceReminderId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany() - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Appointment"); - - b.Navigation("Customer"); - - b.Navigation("ServiceReminder"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.PaymentLog", b => - { - b.HasOne("Vpassbackend.Models.Invoice", "Invoice") - .WithMany("PaymentLogs") - .HasForeignKey("InvoiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Invoice"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterCheckInPoint", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("CheckInPoints") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterService", b => - { - b.HasOne("Vpassbackend.Models.Package", "Package") - .WithMany("ServiceCenterServices") - .HasForeignKey("PackageId") - .OnDelete(DeleteBehavior.SetNull); - - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceCenterServices") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("ServiceCenterServices") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Package"); - - b.Navigation("Service"); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenterSlots", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany("DailySlots") - .HasForeignKey("Station_id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceReminder", b => - { - b.HasOne("Vpassbackend.Models.Service", "Service") - .WithMany("ServiceReminders") - .HasForeignKey("ServiceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceReminders") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Service"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.User", b => - { - b.HasOne("Vpassbackend.Models.UserRole", "UserRole") - .WithMany() - .HasForeignKey("UserRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("UserRole"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.HasOne("Vpassbackend.Models.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - }); - - modelBuilder.Entity("Vpassbackend.Models.VehicleServiceHistory", b => - { - b.HasOne("Vpassbackend.Models.ServiceCenter", "ServiceCenter") - .WithMany() - .HasForeignKey("ServiceCenterId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.User", "ServicedByUser") - .WithMany() - .HasForeignKey("ServicedByUserId") - .OnDelete(DeleteBehavior.NoAction); - - b.HasOne("Vpassbackend.Models.Vehicle", "Vehicle") - .WithMany("ServiceHistory") - .HasForeignKey("VehicleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ServiceCenter"); - - b.Navigation("ServicedByUser"); - - b.Navigation("Vehicle"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Appointment", b => - { - b.Navigation("AppointmentServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Invoice", b => - { - b.Navigation("PaymentLogs"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Package", b => - { - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Service", b => - { - b.Navigation("Appointments"); - - b.Navigation("ServiceCenterServices"); - - b.Navigation("ServiceReminders"); - }); - - modelBuilder.Entity("Vpassbackend.Models.ServiceCenter", b => - { - b.Navigation("CheckInPoints"); - - b.Navigation("DailySlots"); - - b.Navigation("ServiceCenterServices"); - }); - - modelBuilder.Entity("Vpassbackend.Models.Vehicle", b => - { - b.Navigation("Appointments"); - - b.Navigation("BorderPoints"); - - b.Navigation("Documents"); - - b.Navigation("FuelEfficiencies"); - - b.Navigation("Invoices"); - - b.Navigation("ServiceHistory"); - - b.Navigation("ServiceReminders"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.cs b/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.cs deleted file mode 100644 index b188cd8..0000000 --- a/Vpassbackend/Migrations/20250722114429_AddServiceCenterSlots.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Vpassbackend.Migrations -{ - /// - public partial class AddServiceCenterSlots : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Vpassbackend/Migrations/20250721171803_InitialCreate.Designer.cs b/Vpassbackend/Migrations/20250722203154_InitialCreate.Designer.cs similarity index 99% rename from Vpassbackend/Migrations/20250721171803_InitialCreate.Designer.cs rename to Vpassbackend/Migrations/20250722203154_InitialCreate.Designer.cs index 1992bdf..3cfd93a 100644 --- a/Vpassbackend/Migrations/20250721171803_InitialCreate.Designer.cs +++ b/Vpassbackend/Migrations/20250722203154_InitialCreate.Designer.cs @@ -12,7 +12,7 @@ namespace Vpassbackend.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250721171803_InitialCreate")] + [Migration("20250722203154_InitialCreate")] partial class InitialCreate { /// diff --git a/Vpassbackend/Migrations/20250721171803_InitialCreate.cs b/Vpassbackend/Migrations/20250722203154_InitialCreate.cs similarity index 100% rename from Vpassbackend/Migrations/20250721171803_InitialCreate.cs rename to Vpassbackend/Migrations/20250722203154_InitialCreate.cs diff --git a/Vpassbackend/Properties/launchSettings.json b/Vpassbackend/Properties/launchSettings.json index e355ae6..0d81947 100644 --- a/Vpassbackend/Properties/launchSettings.json +++ b/Vpassbackend/Properties/launchSettings.json @@ -4,7 +4,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:5039, https://localhost:5039", + "applicationUrl": "http://192.168.1.11:5039", "sslPort": 44384 } }, diff --git a/Vpassbackend/appsettings.json b/Vpassbackend/appsettings.json index 8ceaf47..bf491a5 100644 --- a/Vpassbackend/appsettings.json +++ b/Vpassbackend/appsettings.json @@ -6,7 +6,7 @@ "ConnectionStrings": { - "DefaultConnection": "Server=DESKTOP-F8C2NUA\\SQLEXPRESS;Connect Timeout=30;Database=VehiclePassportAppNew21;Trusted_Connection=True;TrustServerCertificate=True;" + "DefaultConnection": "Server=localhost;Connect Timeout=30;Database=VehiclePassportApp;Trusted_Connection=True;TrustServerCertificate=True;" }, "Jwt": {