Make ActionId a required field across DTOs and entities

Updated the `RecActionDto`, `RecAction`, and `InvokeRecActionCommandHandler` to enforce `ActionId` as a required field. This change improves data integrity by removing nullable `ActionId` properties and eliminates the need for null checks or null-forgiveness operators.
This commit is contained in:
tekh 2025-12-01 12:27:47 +01:00
parent 211d369509
commit 9c028c5e66
3 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
public record RecActionDto
{
public long? ActionId { get; init; }
public required long ActionId { get; init; }
public long? ProfileId { get; init; }

View File

@ -61,7 +61,7 @@ public class InvokeRecActionCommandHandler(
await sender.Send(new CreateOutResCommand
{
ActionId = (long) request.ActionId!,
ActionId = request.ActionId,
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
Body = resBody,
AddedWho = config?["AddedWho"]

View File

@ -15,7 +15,7 @@ namespace ReC.Domain.Entities;
public class RecAction
{
[Column("ACTION_ID")]
public long? ActionId { get; set; }
public required long ActionId { get; set; }
[Column("PROFILE_ID")]
public long? ProfileId { get; set; }