repository migration
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WhiteLagoon.Domain.Entities
|
||||
{
|
||||
public class Amenity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
|
||||
[ForeignKey("Villa")]
|
||||
public int VillaId { get; set; }
|
||||
[ValidateNever]
|
||||
public Villa Villa { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WhiteLagoon.Domain.Entities
|
||||
{
|
||||
public class ApplicationUser : IdentityUser
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WhiteLagoon.Domain.Entities
|
||||
{
|
||||
public class Booking
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
[ForeignKey("UserId")]
|
||||
public ApplicationUser User { get; set; }
|
||||
|
||||
[Required]
|
||||
public int VillaId { get; set; }
|
||||
[ForeignKey("VillaId")]
|
||||
public Villa Villa { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public string Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
|
||||
[Required]
|
||||
public double TotalCost { get; set; }
|
||||
public int Nights { get; set; }
|
||||
public string? Status { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime BookingDate { get; set; }
|
||||
[Required]
|
||||
public DateOnly CheckInDate { get; set; }
|
||||
[Required]
|
||||
public DateOnly CheckOutDate { get; set; }
|
||||
|
||||
public bool IsPaymentSuccessful { get; set; } = false;
|
||||
public DateTime PaymentDate { get; set; }
|
||||
|
||||
public string? StripeSessionId { get; set; }
|
||||
public string? StripePaymentIntentId { get; set; }
|
||||
|
||||
public DateTime ActualCheckInDate { get; set; }
|
||||
public DateTime ActualCheckOutDate { get; set; }
|
||||
|
||||
public int VillaNumber { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<VillaNumber> VillaNumbers { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WhiteLagoon.Domain.Entities
|
||||
{
|
||||
public class Villa
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[MaxLength(50)]
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
[Display(Name = "Price per night")]
|
||||
[Range(10, 10000)]
|
||||
public double Price { get; set; }
|
||||
public int Sqft { get; set; }
|
||||
[Range(1, 10)]
|
||||
public int Occupancy { get; set; }
|
||||
[NotMapped]
|
||||
public IFormFile? Image { get; set; }
|
||||
[Display(Name = "Image Url")]
|
||||
public string? ImageUrl { get; set; }
|
||||
public DateTime? Created_Date { get; set; }
|
||||
public DateTime? Updated_Date { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
public IEnumerable<Amenity> VillaAmenity { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool IsAvailable { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
|
||||
namespace WhiteLagoon.Domain.Entities
|
||||
{
|
||||
public class VillaNumber
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Display(Name = "Villa Number")]
|
||||
public int Villa_Number { get; set; }
|
||||
|
||||
[ForeignKey("Villa")]
|
||||
public int VillaId { get; set; }
|
||||
[ValidateNever]
|
||||
public Villa Villa { get; set; }
|
||||
public string? SpecialDetails { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user