2025-07-27 17:51:50 -05:00
|
|
|
using LANCommander.SDK.Enums;
|
|
|
|
|
using LANCommander.SDK.Models.Manifest;
|
|
|
|
|
using LANCommander.Server.ImportExport.Models;
|
|
|
|
|
using LANCommander.Server.Services;
|
2026-07-02 18:09:14 -05:00
|
|
|
using LANCommander.Server.Services.Mappers;
|
2025-07-27 17:51:50 -05:00
|
|
|
|
|
|
|
|
namespace LANCommander.Server.ImportExport.Exporters;
|
|
|
|
|
|
|
|
|
|
public class DeveloperExporter(
|
2026-07-02 18:09:14 -05:00
|
|
|
ManifestMapper manifestMapper,
|
2025-07-27 17:51:50 -05:00
|
|
|
CompanyService companyService) : BaseExporter<Company, Data.Models.Company>
|
|
|
|
|
{
|
|
|
|
|
public override async Task<ExportItemInfo> GetExportInfoAsync(Data.Models.Company record)
|
|
|
|
|
{
|
|
|
|
|
return new ExportItemInfo
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
2025-08-01 02:27:06 -05:00
|
|
|
Type = ImportExportRecordType.Developer,
|
2025-07-27 17:51:50 -05:00
|
|
|
Name = record.Name,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool CanExport(Company record) => ExportContext.DataRecord is Data.Models.Game;
|
|
|
|
|
|
|
|
|
|
public override async Task<Company> ExportAsync(Guid id)
|
|
|
|
|
{
|
2026-07-02 18:09:14 -05:00
|
|
|
return await companyService.GetAsync(id, manifestMapper.ProjectToManifestCompany);
|
2025-07-27 17:51:50 -05:00
|
|
|
}
|
|
|
|
|
}
|