Files
BeWoPlaner/Service/ServiceUtils/AiFunctionContextLoader.cs
2026-01-23 16:28:47 +01:00

36 lines
1.0 KiB
C#

using AICore.Context.Summary;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AICore.Context.Core;
namespace BeWo.Service.ServiceUtils
{
public class AiFunctionContextLoader
{
public static BaseContextSummary LoadServiceRecordDocumentationContext(AiFunctionDocRequest request)
{
var srs = request.ServiceRecords;
var srs_loaded = DataContractLoader.LoadServiceRecordDCs(srs);
var sc_ref = request.SupportConcept;
var sc_loaded = DataContractLoader.LoadSupportConceptDC(sc_ref);
var customer_loaded = sc_loaded.Customer;
var costbearer_loaded = sc_loaded.CostBearerList.First(x => request.CostBearer.Oid == x.Oid);
var doku = request.Dokumentation;
var context = AiContextSummaryFactory.CreateServiceRecordDocumentationFunction(srs_loaded, customer_loaded, costbearer_loaded, sc_loaded, doku);
return context;
}
}
}