update
This commit is contained in:
4768
docs/model.ndm2
4768
docs/model.ndm2
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,8 @@ public class
|
|||||||
if (userWallet == null)
|
if (userWallet == null)
|
||||||
throw new Exception("کیف پول کاربر یافت نشد.");
|
throw new Exception("کیف پول کاربر یافت نشد.");
|
||||||
|
|
||||||
|
if (userWallet.Balance<=0 || userWallet.Balance<request.TotalAmount)
|
||||||
|
throw new Exception("موجودی کیف پول کاربر برای انجام این تراکنش کافی نیست.");
|
||||||
|
|
||||||
var newTransaction = new Transactions()
|
var newTransaction = new Transactions()
|
||||||
{
|
{
|
||||||
@@ -71,24 +73,34 @@ public class
|
|||||||
};
|
};
|
||||||
await _context.UserOrders.AddAsync(newOrder, cancellationToken);
|
await _context.UserOrders.AddAsync(newOrder, cancellationToken);
|
||||||
await _context.SaveChangesAsync(cancellationToken);
|
await _context.SaveChangesAsync(cancellationToken);
|
||||||
|
var factorDetailsList = user.UserCartss.Select(s => new FactorDetails()
|
||||||
await _context.FactorDetailss.AddRangeAsync(user.UserCartss.Select(s => new FactorDetails()
|
|
||||||
{
|
{
|
||||||
ProductId = s.ProductId,
|
ProductId = s.ProductId,
|
||||||
Count = s.Count,
|
Count = s.Count,
|
||||||
UnitPrice = s.Product.Price,
|
UnitPrice = s.Product.Price,
|
||||||
OrderId = newOrder.Id
|
OrderId = newOrder.Id
|
||||||
}), cancellationToken);
|
});
|
||||||
user.UserCartss.Clear();
|
await _context.FactorDetailss.AddRangeAsync(factorDetailsList, cancellationToken);
|
||||||
await _context.SaveChangesAsync(cancellationToken);
|
var finalResult = new SubmitShopBuyOrderResponseDto()
|
||||||
return new SubmitShopBuyOrderResponseDto()
|
|
||||||
{
|
{
|
||||||
Id = newOrder.Id,
|
Id = newOrder.Id,
|
||||||
PaymentMethod = newOrder.PaymentMethod,
|
PaymentMethod = newOrder.PaymentMethod,
|
||||||
PaymentStatus = newOrder.PaymentStatus,
|
PaymentStatus = newOrder.PaymentStatus,
|
||||||
TotalAmount = newOrder.Amount,
|
TotalAmount = newOrder.Amount,
|
||||||
UserAddressText = user.UserAddresss.First(f => f.IsDefault).Address,
|
UserAddressText = user.UserAddresss.First(f => f.IsDefault).Address,
|
||||||
Created = newOrder.PaymentDate
|
Created = newOrder.PaymentDate,
|
||||||
|
FactorDetails = factorDetailsList.Select(s => new SubmitShopBuyOrderFactorDetail()
|
||||||
|
{
|
||||||
|
Count = s.Count,
|
||||||
|
UnitPrice = s.UnitPrice,
|
||||||
|
ProductId = s.ProductId,
|
||||||
|
ProductThumbnailPath = user.UserCartss.First(f => f.ProductId == s.ProductId).Product.ThumbnailPath,
|
||||||
|
ProductTitle = user.UserCartss.First(f => f.ProductId == s.ProductId).Product.Title,
|
||||||
|
UnitDiscountPrice = 0,
|
||||||
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
user.UserCartss.Clear();
|
||||||
|
await _context.SaveChangesAsync(cancellationToken);
|
||||||
|
return finalResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using CMSMicroservice.Domain.Enums;
|
||||||
|
|
||||||
namespace CMSMicroservice.Domain.Entities;
|
namespace CMSMicroservice.Domain.Entities;
|
||||||
//آدرس کاربر
|
//آدرس کاربر
|
||||||
public class Transactions : BaseAuditableEntity
|
public class Transactions : BaseAuditableEntity
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using CMSMicroservice.Domain.Enums;
|
||||||
|
|
||||||
namespace CMSMicroservice.Domain.Entities;
|
namespace CMSMicroservice.Domain.Entities;
|
||||||
//سفارش کاربر
|
//سفارش کاربر
|
||||||
public class UserOrder : BaseAuditableEntity
|
public class UserOrder : BaseAuditableEntity
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class UserOrderConfiguration : IEntityTypeConfiguration<UserOrder>
|
|||||||
.IsRequired(false);
|
.IsRequired(false);
|
||||||
builder
|
builder
|
||||||
.HasOne(entity => entity.Transaction)
|
.HasOne(entity => entity.Transaction)
|
||||||
.WithMany(entity => entity.TransactionUserOrders)
|
.WithMany(entity => entity.UserOrders)
|
||||||
.HasForeignKey(entity => entity.TransactionId)
|
.HasForeignKey(entity => entity.TransactionId)
|
||||||
.IsRequired(false);
|
.IsRequired(false);
|
||||||
builder.Property(entity => entity.PaymentStatus).IsRequired(true);
|
builder.Property(entity => entity.PaymentStatus).IsRequired(true);
|
||||||
@@ -32,7 +32,7 @@ public class UserOrderConfiguration : IEntityTypeConfiguration<UserOrder>
|
|||||||
builder
|
builder
|
||||||
.HasOne(entity => entity.UserAddress)
|
.HasOne(entity => entity.UserAddress)
|
||||||
.WithMany(entity => entity.UserOrders)
|
.WithMany(entity => entity.UserOrders)
|
||||||
.HasForeignKey(entity => entity.UserAddressId)
|
.HasForeignKey(entity => entity.UserAddressId).OnDelete(DeleteBehavior.NoAction)
|
||||||
.IsRequired(true);
|
.IsRequired(true);
|
||||||
builder.Property(entity => entity.PaymentMethod).IsRequired(false);
|
builder.Property(entity => entity.PaymentMethod).IsRequired(false);
|
||||||
|
|
||||||
|
|||||||
1318
src/CMSMicroservice.Infrastructure/Persistence/Migrations/20251124213641_u10.Designer.cs
generated
Normal file
1318
src/CMSMicroservice.Infrastructure/Persistence/Migrations/20251124213641_u10.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,340 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class u10 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Transactionss_UserOrders_OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_UserOrders_Packages_PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_UserOrders_UserAddresss_UserAddressId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Transactionss_OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Authority",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CallbackUrl",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CardHash",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CardPan",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Currency",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Email",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Fee",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "FeeType",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "MerchantId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Mobile",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "RequestStatusCode",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "RequestStatusMessage",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "VerificationStatusCode",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "VerificationStatusMessage",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss");
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "Price",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
newName: "Amount");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<long>(
|
||||||
|
name: "PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
type: "bigint",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(long),
|
||||||
|
oldType: "bigint");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_UserOrders_TransactionId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "TransactionId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserOrders_Packages_PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "PackageId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "Packages",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserOrders_Transactionss_TransactionId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "TransactionId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "Transactionss",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserOrders_UserAddresss_UserAddressId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "UserAddressId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "UserAddresss",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_UserOrders_Packages_PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_UserOrders_Transactionss_TransactionId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_UserOrders_UserAddresss_UserAddressId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_UserOrders_TransactionId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders");
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "Amount",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
newName: "Price");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<long>(
|
||||||
|
name: "PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
type: "bigint",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0L,
|
||||||
|
oldClrType: typeof(long),
|
||||||
|
oldType: "bigint",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Authority",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CallbackUrl",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CardHash",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CardPan",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Currency",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Email",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<long>(
|
||||||
|
name: "Fee",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "bigint",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "FeeType",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "MerchantId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Mobile",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<long>(
|
||||||
|
name: "OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "bigint",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "RequestStatusCode",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "RequestStatusMessage",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "VerificationStatusCode",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "int",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "VerificationStatusMessage",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Transactionss_OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
column: "OrderId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Transactionss_UserOrders_OrderId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "Transactionss",
|
||||||
|
column: "OrderId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "UserOrders",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserOrders_Packages_PackageId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "PackageId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "Packages",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_UserOrders_UserAddresss_UserAddressId",
|
||||||
|
schema: "CMS",
|
||||||
|
table: "UserOrders",
|
||||||
|
column: "UserAddressId",
|
||||||
|
principalSchema: "CMS",
|
||||||
|
principalTable: "UserAddresss",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -580,41 +580,16 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<long>("Amount")
|
b.Property<long>("Amount")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<string>("Authority")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("CallbackUrl")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("CardHash")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("CardPan")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Created")
|
b.Property<DateTime>("Created")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.Property<string>("CreatedBy")
|
b.Property<string>("CreatedBy")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<int?>("Currency")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<long?>("Fee")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("FeeType")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<bool>("IsDeleted")
|
b.Property<bool>("IsDeleted")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
@@ -624,16 +599,6 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<string>("LastModifiedBy")
|
b.Property<string>("LastModifiedBy")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("MerchantId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<string>("Mobile")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<long?>("OrderId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<DateTime?>("PaymentDate")
|
b.Property<DateTime?>("PaymentDate")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
@@ -643,25 +608,11 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<string>("RefId")
|
b.Property<string>("RefId")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<int?>("RequestStatusCode")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("RequestStatusMessage")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.Property<int>("Type")
|
b.Property<int>("Type")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<int?>("VerificationStatusCode")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("VerificationStatusMessage")
|
|
||||||
.HasColumnType("nvarchar(max)");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("OrderId");
|
|
||||||
|
|
||||||
b.ToTable("Transactionss", "CMS");
|
b.ToTable("Transactionss", "CMS");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -891,6 +842,9 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<long>("Amount")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<DateTime>("Created")
|
b.Property<DateTime>("Created")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
@@ -906,7 +860,7 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<string>("LastModifiedBy")
|
b.Property<string>("LastModifiedBy")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<long>("PackageId")
|
b.Property<long?>("PackageId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<DateTime?>("PaymentDate")
|
b.Property<DateTime?>("PaymentDate")
|
||||||
@@ -918,9 +872,6 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<int>("PaymentStatus")
|
b.Property<int>("PaymentStatus")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<long>("Price")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long?>("TransactionId")
|
b.Property<long?>("TransactionId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
@@ -934,6 +885,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
|
|
||||||
b.HasIndex("PackageId");
|
b.HasIndex("PackageId");
|
||||||
|
|
||||||
|
b.HasIndex("TransactionId");
|
||||||
|
|
||||||
b.HasIndex("UserAddressId");
|
b.HasIndex("UserAddressId");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
b.HasIndex("UserId");
|
||||||
@@ -1145,15 +1098,6 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Navigation("Tag");
|
b.Navigation("Tag");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Transactions", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("CMSMicroservice.Domain.Entities.UserOrder", "Order")
|
|
||||||
.WithMany("Transactionss")
|
|
||||||
.HasForeignKey("OrderId");
|
|
||||||
|
|
||||||
b.Navigation("Order");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.User", b =>
|
modelBuilder.Entity("CMSMicroservice.Domain.Entities.User", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("CMSMicroservice.Domain.Entities.User", "Parent")
|
b.HasOne("CMSMicroservice.Domain.Entities.User", "Parent")
|
||||||
@@ -1216,14 +1160,16 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
{
|
{
|
||||||
b.HasOne("CMSMicroservice.Domain.Entities.Package", "Package")
|
b.HasOne("CMSMicroservice.Domain.Entities.Package", "Package")
|
||||||
.WithMany("UserOrders")
|
.WithMany("UserOrders")
|
||||||
.HasForeignKey("PackageId")
|
.HasForeignKey("PackageId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
b.HasOne("CMSMicroservice.Domain.Entities.Transactions", "Transaction")
|
||||||
|
.WithMany("UserOrders")
|
||||||
|
.HasForeignKey("TransactionId");
|
||||||
|
|
||||||
b.HasOne("CMSMicroservice.Domain.Entities.UserAddress", "UserAddress")
|
b.HasOne("CMSMicroservice.Domain.Entities.UserAddress", "UserAddress")
|
||||||
.WithMany("UserOrders")
|
.WithMany("UserOrders")
|
||||||
.HasForeignKey("UserAddressId")
|
.HasForeignKey("UserAddressId")
|
||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.NoAction)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("CMSMicroservice.Domain.Entities.User", "User")
|
b.HasOne("CMSMicroservice.Domain.Entities.User", "User")
|
||||||
@@ -1234,6 +1180,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
|
|
||||||
b.Navigation("Package");
|
b.Navigation("Package");
|
||||||
|
|
||||||
|
b.Navigation("Transaction");
|
||||||
|
|
||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
|
|
||||||
b.Navigation("UserAddress");
|
b.Navigation("UserAddress");
|
||||||
@@ -1325,6 +1273,11 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
b.Navigation("PruductTags");
|
b.Navigation("PruductTags");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Transactions", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("UserOrders");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.User", b =>
|
modelBuilder.Entity("CMSMicroservice.Domain.Entities.User", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("UserAddresss");
|
b.Navigation("UserAddresss");
|
||||||
@@ -1350,8 +1303,6 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
|||||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserOrder", b =>
|
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserOrder", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("FactorDetailss");
|
b.Navigation("FactorDetailss");
|
||||||
|
|
||||||
b.Navigation("Transactionss");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserWallet", b =>
|
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserWallet", b =>
|
||||||
|
|||||||
Reference in New Issue
Block a user