Refactored `EmployeeUploadPicture.cshtml.cs` to improve readability, maintainability, and modularity. Introduced `_httpClientFactory` for HTTP requests and added `SendEmbeddingsToApi` for Python API integration. Enhanced employee-related operations, including activation, image handling, and settings management. Added `IFaceEmbeddingService` interface and implemented it in `FaceEmbeddingService` to manage face embeddings. Integrated with a Python API for generating, refining, deleting, and retrieving embeddings. Included robust error handling and detailed logging. Improved code structure, reduced duplication, and added comments for better debugging and future development. Add face embedding integration for employee management Introduced `IFaceEmbeddingService` and its implementation to manage face embeddings via a Python API. Integrated embedding generation into `EmployeeApplication` and `EmployeeUploadPictureModel`, enabling image uploads, embedding creation, and validation. Refactored `EmployeeUploadPictureModel` for clarity, adding methods to handle image processing, API interactions, and employee activation/deactivation with embedding checks. Enhanced error handling, logging, and user feedback. Removed legacy code and updated dependencies to include `IHttpClientFactory` and `IFaceEmbeddingService`. Added localized error messages and improved maintainability by streamlining code.
10 KiB
10 KiB