Compare commits
2 Commits
48275ea5d3
...
d1d37d058a
| Author | SHA1 | Date |
|---|---|---|
|
|
d1d37d058a | |
|
|
cb91051749 |
|
|
@ -413,6 +413,26 @@ namespace Nop.Plugin.Misc.FruitBankPlugin.Controllers
|
|||
return await ctx.EkaerHistories.GetByIdAsync(ekaerHistory.Id, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Egy legenerált (Generated/GeneratedWithWarning) EkaerHistory TÁROLT tradeCard XML-jét beküldi a NAV-nak (create).
|
||||
/// A service tölti a rekordot (Sent/SentWithMissingData + EkaerNumber + SentDate, vagy SendError + ErrorText),
|
||||
/// itt csak perzisztáljuk. User-vezérelt (grid „Beküldés" gomb), a kliens megerősítő dialógus után hívja.
|
||||
/// </summary>
|
||||
[SignalR(SignalRTags.SendEkaerToNav)]
|
||||
public async Task<EkaerHistory> SendEkaerToNav(int ekaerHistoryId)
|
||||
{
|
||||
_logger.Detail($"SendEkaerToNav invoked; ekaerHistoryId: {ekaerHistoryId}");
|
||||
|
||||
var ekaerHistory = await ctx.EkaerHistories.GetByIdAsync(ekaerHistoryId, true)
|
||||
?? throw new ArgumentException($"EkaerHistory not found; id: {ekaerHistoryId}", nameof(ekaerHistoryId));
|
||||
|
||||
ekaerHistory = await fruitBankEkaerService.SendEkaerAsync(ekaerHistory);
|
||||
|
||||
await ctx.EkaerHistories.UpdateAsync(ekaerHistory);
|
||||
_logger.Info($"SendEkaerToNav; id: {ekaerHistoryId}; status: {ekaerHistory.Status}; ekaerNumber: {ekaerHistory.EkaerNumber}");
|
||||
return await ctx.EkaerHistories.GetByIdAsync(ekaerHistory.Id, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Idempotens rekord-létrehozás: ha a forrás-rekordra (foreignKey + isOutgoing) már van mapping → a hozzá tartozó
|
||||
/// EkaerHistory-t adja vissza érintetlenül; különben új Pending rekordot + EGY mapping sort hoz létre (atomikusan).
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue