feat:补齐商户版本号

This commit is contained in:
2025-12-29 21:55:05 +08:00
parent febef6caaf
commit 7cb5e9a805
2 changed files with 5 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using MediatR;
using Microsoft.Extensions.Logging;
using System.Security.Cryptography;
using TakeoutSaaS.Application.App.Merchants.Commands;
using TakeoutSaaS.Application.App.Merchants.Dto;
using TakeoutSaaS.Domain.Merchants.Entities;
@@ -26,6 +27,7 @@ public sealed class CreateMerchantCommandHandler(IMerchantRepository merchantRep
ContactPhone = request.ContactPhone.Trim(),
ContactEmail = request.ContactEmail?.Trim(),
Status = request.Status,
RowVersion = RandomNumberGenerator.GetBytes(16),
JoinedAt = DateTime.UtcNow
};

View File

@@ -1,4 +1,5 @@
using MediatR;
using System.Security.Cryptography;
using TakeoutSaaS.Application.App.Tenants.Commands;
using TakeoutSaaS.Application.App.Tenants.Dto;
using TakeoutSaaS.Domain.Merchants.Entities;
@@ -130,7 +131,8 @@ public sealed class ReviewTenantCommandHandler(
JoinedAt = now,
LastReviewedAt = now,
LastReviewedBy = currentUserAccessor.UserId == 0 ? null : currentUserAccessor.UserId,
IsFrozen = false
IsFrozen = false,
RowVersion = RandomNumberGenerator.GetBytes(16)
};
await merchantRepository.AddMerchantAsync(merchant, cancellationToken);