class ActivePunishmentService {

    public PunishResult punish(PunishmentParameters punishmentParameters, ActivePunishmentType activePunishmentType) {
        return playerProfileRepository.find(new PlayerNameSpecification(punishmentParameters.getTargetName()))
                .map(playerProfile -> {
                    PunishmentData punishmentData = punishmentDataProvider.getPunishmentsFor(playerProfile.getUuid());
                    ActivePunishmentRecord activePunishmentRecord = this.newPunishmentRecord(punishmentParameters, playerProfile, activePunishmentType);
                    this.addActiveRecord(punishmentData, activePunishmentRecord, activePunishmentType);
                    return new PunishResult(activePunishmentRecord, PunishResultType.OK);
                })
                .orElse(PunishResult.NOT_FOUND);
    }

}