* Added EmailAddresses and WzNumbers to WzHeader

* Changed approach to send email to addresses added to WzHeader
This commit is contained in:
2025-05-25 11:01:18 +02:00
parent 1a4ff2ef6d
commit ad641560ea
10 changed files with 160 additions and 54 deletions

View File

@@ -37,4 +37,18 @@ public class WzHeaderService(SytelineSaAppDbContext context, IMapper mapper) : I
return wzHeader;
}
public async Task AddEmailsToWzHeader(Guid id, string emailAddresses)
{
var entity = await context.WzHeaders.FindAsync(id);
if (entity == null)
{
throw new KeyNotFoundException($"WzHeader with ID {id} not found.");
}
entity.EmailAddresses = emailAddresses;
context.WzHeaders.Update(entity);
await context.SaveChangesAsync();
}
}