using System.IO; using System.Threading; using System.Threading.Tasks; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.GOP; namespace FrameworkBLL.GOP { /// Generic "AI identifies the document, GOP picks the flow" pipeline — the reusable /// core behind Recruitment's resume-to-Candidate conversion, scoped generically (Recruitment /// is its first consumer, not a special case baked into it). See the approved plan's /// "Generic Document Intake pipeline" section. /// /// Flow: call EAIAdmin's IDENTIFY_DOCUMENT capability with the file → match its classification /// against MGOPDOCUMENTTYPE.AiClassificationLabel → call PARSE_VALIDATE_DOCUMENT with the same /// file → submit the parsed JSON as a normal GOP execution via IGopQueueBLL.SubmitExecution, /// SourceCode = the resolved DocumentType's EntityCode (the existing GopSourceBinding /// resolution mechanism, unchanged). No GOP schema/engine change for binary attachments was /// needed — the file is fully consumed here, before SubmitExecution is ever called; by the /// time a flow starts its payload is already JSON, exactly like every other GOP source. public interface IGopDocumentIntakeBLL { Task SubmitDocumentAsync( Stream fileStream, string fileName, string contentType, LoginDTO login, CancellationToken ct = default); /// Human-in-the-loop variant: skips IDENTIFY_DOCUMENT (the caller already knows /// what the document is — e.g. a "Extract from Resume" button on the Candidate form) and /// skips DocumentType resolution — is supplied directly by /// the caller instead of looked up. Submits to a Mapper-only GOP flow (no ApiCall/save /// step) so LastOutputPayloadJson is the mapped, form-shaped JSON for the caller to patch /// into an editable form — nothing is persisted until the user reviews and saves it /// themselves through the entity's own normal Save endpoint. Task SubmitDocumentForPrefillAsync( Stream fileStream, string fileName, string contentType, string sourceCode, LoginDTO login, CancellationToken ct = default); } }