<commit_before>package com.maly.domain.order.dto

import com.maly.domain.order.Ticket
import com.maly.domain.room.Seat
import java.math.BigDecimal
import java.time.LocalDateTime

/**
 * @author <NAME>
 */
class TicketDto(
        val seats: List<Seat>,
        val totalPrice: BigDecimal,
        val eventDate: LocalDateTime,
        val expireDate: LocalDateTime?
) {
    companion object {
        fun of(tickets: List<Ticket>): TicketDto {
            val oneHundred = BigDecimal(100)
            val totalPrice = tickets.map { ticket ->
                ticket.discount?.value
                        ?.let { ticket.event.price.multiply(BigDecimal(it)).divide(oneHundred) }
                        ?: ticket.event.price
            }.reduce { price1, price2 -> price1.add(price2) }
<commit_msg>fix: calculating price for event<commit_after>package com.maly.domain.order.dto

import com.maly.domain.order.Ticket
import com.maly.domain.room.Seat
import java.math.BigDecimal
import java.time.LocalDateTime

/**
 * @author <NAME>
 */
class TicketDto(
        val seats: List<Seat>,
        val totalPrice: BigDecimal,
        val eventDate: LocalDateTime,
        val expireDate: LocalDateTime?
) {
    companion object {
        fun of(tickets: List<Ticket>): TicketDto {
            val oneHundred = BigDecimal(100)
            val totalPrice = tickets.map { ticket ->
                ticket.discount?.value
                        ?.let { ticket.event.price.multiply(BigDecimal(100 - it)).divide(oneHundred) }
                        ?: ticket.event.price
            }.reduce { price1, price2 -> price1.add(price2) }

{'fraction_non_alphanumeric': 0.10980876002467613, 'fraction_numerical': 0.010487353485502776, 'mean_word_length': 2.2701612903225805, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6716265', 'n_tokens_mistral': 493, 'n_tokens_neox': 477, 'n_words': 99}