using GB5Shared.DTO.Framework.Login; using IceImportDAL.DTO.MenuWebServiceDispatcher; namespace IceImportBLL.MenuWebServiceDispatcher; // Resolves EntityId -> Menu.SaveWebServiceId -> URL -> call — the single HTTP dispatch mechanism // required by the plan's decision #1, built on IMenuResolutionDAL + // FrameworkBLL.ActionProcessor.Handlers.IWebhookEndpointResolver + IHttpClientFactory. Import only // ever saves (insert, or an update folded into the same Save call when a natural key already // exists) — there is deliberately no Get/Delete dispatch here; Menu.GetWebServiceId/ // DeleteWebServiceId are out of scope for Import entirely. Returns a WebServiceCallResultDTO (Url + // PayloadJson + ResponseBody/ErrorMessage), not a bare response string — so callers can record a // full audit trail (TICEIMPORTRUNROWRESULT.POSTDATA) as well as pull out ids/rows via // IceImportHttpResponseParser. public interface IMenuWebServiceDispatcher { // entityId must always be the POCO-side entity (MICEMAP.ENTITYID convention — matches // MMENU.ENTITYID directly). Callers with only a row's DestinationMemberEntityId (DTO-side) must // resolve mapDefinition.IceMapEntityId themselves first — see // MenuWebServiceEntityPersistenceAdapter for the pattern. Task InvokeSaveAsync(int entityId, object payload, LoginDTO login, long runId, CancellationToken ct); // Submits every entry in payloads as ONE call — the whole list becomes the JSON request body // — instead of one call per entry. Only called when GetSaveRequestSchemaTypeAsync says the // entity's SaveWebServiceId is configured for it (MWEBSERVICE.REQUESTSCHEMATYPE = 0). Task InvokeSaveBatchAsync(int entityId, List payloads, LoginDTO login, long runId, CancellationToken ct); // MWEBSERVICE.REQUESTSCHEMATYPE for the EntityId's Menu.SaveWebServiceId — 0 means callers // should batch every row into one InvokeSaveBatchAsync call, 1 (the default, including when no // Menu/WebService is configured at all) means keep calling InvokeSaveAsync once per row. Task GetSaveRequestSchemaTypeAsync(int entityId, LoginDTO login, CancellationToken ct); }