Corrected the migration errors in subscription plan table
This commit is contained in:
parent
4e171e8ca3
commit
5253ed9a39
6783
Marco.Pms.DataAccess/Migrations/20251028052440_Added_PaymentDetails_In_TenantSubscription_Table.Designer.cs
generated
Normal file
6783
Marco.Pms.DataAccess/Migrations/20251028052440_Added_PaymentDetails_In_TenantSubscription_Table.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Marco.Pms.DataAccess.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Added_PaymentDetails_In_TenantSubscription_Table : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "PaymentDetailId",
|
||||
table: "TenantSubscriptions",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TenantSubscriptions_PaymentDetailId",
|
||||
table: "TenantSubscriptions",
|
||||
column: "PaymentDetailId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
|
||||
table: "TenantSubscriptions",
|
||||
column: "PaymentDetailId",
|
||||
principalTable: "PaymentDetails",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_TenantSubscriptions_PaymentDetails_PaymentDetailId",
|
||||
table: "TenantSubscriptions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TenantSubscriptions_PaymentDetailId",
|
||||
table: "TenantSubscriptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaymentDetailId",
|
||||
table: "TenantSubscriptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4706,6 +4706,9 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.Property<DateTime>("NextBillingDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid?>("PaymentDetailId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("PlanId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
@ -4730,6 +4733,8 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
b.HasIndex("CurrencyId");
|
||||
|
||||
b.HasIndex("PaymentDetailId");
|
||||
|
||||
b.HasIndex("PlanId");
|
||||
|
||||
b.HasIndex("StatusId");
|
||||
@ -6657,6 +6662,10 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Marco.Pms.Model.PaymentGetway.PaymentDetail", "PaymentDetail")
|
||||
.WithMany()
|
||||
.HasForeignKey("PaymentDetailId");
|
||||
|
||||
b.HasOne("Marco.Pms.Model.TenantModels.SubscriptionPlanDetails", "Plan")
|
||||
.WithMany()
|
||||
.HasForeignKey("PlanId")
|
||||
@ -6683,6 +6692,8 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
b.Navigation("Currency");
|
||||
|
||||
b.Navigation("PaymentDetail");
|
||||
|
||||
b.Navigation("Plan");
|
||||
|
||||
b.Navigation("Status");
|
||||
|
||||
@ -33,7 +33,7 @@ namespace Marco.Pms.Model.TenantModels
|
||||
public DateTime? CancellationDate { get; set; }
|
||||
public bool AutoRenew { get; set; } = true;
|
||||
public bool IsCancelled { get; set; } = false;
|
||||
public Guid PaymentDetailId { get; set; }
|
||||
public Guid? PaymentDetailId { get; set; }
|
||||
|
||||
[ForeignKey("PaymentDetailId")]
|
||||
[ValidateNever]
|
||||
|
||||
@ -944,7 +944,7 @@ namespace Marco.Pms.Services.Controllers
|
||||
_logger.LogInfo("Tenant enquiry created successfully. ID: {TenantEnquireId}", tenantEnquire.Id);
|
||||
|
||||
// Return success response with proper status code and user information
|
||||
return Ok(ApiResponse<object>.SuccessResponse(model, "Tenant enquiry added successfully.", 201));
|
||||
return Ok(ApiResponse<object>.SuccessResponse(tenantEnquire, "Tenant enquiry added successfully.", 201));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user