<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SFA.DAS.Commitments.Api.Client.Interfaces;
using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.EAS.Domain.Models.Commitment;

namespace SFA.DAS.EAS.Infrastructure.Services
{
    public class CommitmentService : ICommitmentService
    {
        private readonly IEmployerCommitmentApi _commitmentApi;

        public CommitmentService(IEmployerCommitmentApi commitmentApi)
        {
            _commitmentApi = commitmentApi;
        }

        public async Task<List<Cohort>> GetEmployerCommitments(long employerAccountId)
        {
            var commitmentItems = await _commitmentApi.GetEmployerCommitments(employerAccountId);

            return commitmentItems.Select(x => new Cohort {Id = x.Id}).ToList();
        }
    }
}
<commit_msg>Fixed issue around cohort that were deleted being counted.<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SFA.DAS.Commitments.Api.Client.Interfaces;
using SFA.DAS.Commitments.Api.Types.Commitment.Types;
using SFA.DAS.EAS.Domain.Interfaces;
using SFA.DAS.EAS.Domain.Models.Commitment;

namespace SFA.DAS.EAS.Infrastructure.Services
{
    public class CommitmentService : ICommitmentService
    {
        private readonly IEmployerCommitmentApi _commitmentApi;

        public CommitmentService(IEmployerCommitmentApi commitmentApi)
        {
            _commitmentApi = commitmentApi;
        }

        public async Task<List<Cohort>> GetEmployerCommitments(long employerAccountId)
        {
            var commitmentItems = await _commitmentApi.GetEmployerCommitments(employerAccountId);

            return commitmentItems.Where(x => x.CommitmentStatus != CommitmentStatus.Deleted)
                                  .Select(x => new Cohort {Id = x.Id}).ToList();
        }
    }
}

{'fraction_non_alphanumeric': 0.08417151932239281, 'fraction_numerical': 0.0, 'mean_word_length': 3.2954545454545454, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6276658', 'n_tokens_mistral': 556, 'n_tokens_neox': 558, 'n_words': 97}