<commit_before>package backend.view.sponsoring

import backend.model.payment.SponsoringInvoice
import backend.model.sponsoring.ISponsor
import backend.view.challenge.ChallengeView
import backend.view.user.UserView

open class SponsoringInvoiceView {

    var id: Long? = null
    var amount: Double? = null
    var payed: Double? = null
    var sponsor: SponsorView? = null
    var purposeOfTransfer: String? = null

    constructor()

    constructor(invoice: SponsoringInvoice) {
        this.id = invoice.id
        this.amount = invoice.amount.numberStripped.toDouble()
        this.payed = invoice.amountOfCurrentPayments().numberStripped.toDouble()
        this.sponsor = SponsorView(invoice.sponsor)
        this.purposeOfTransfer = invoice.purposeOfTransfer
    }
}

class DetailedSponsoringInvoiceView : SponsoringInvoiceView {

    var challenges: List<ChallengeView>? = null
    var sponsorings: List<SponsoringView>? = null
    var type: String? = null
    var contactEmails: List<String> = listOf()

    constructor() : super()

    constructor(invoice: SponsoringInvoice) : super(invoice) {
        this.challenges = invoice.challenges.map { ChallengeView(it) }
        this.sponsorings = invoice.sponsorings.map { SponsoringView(it) }
        this.type = invoice.sponsor.supporterType.toString()
        this.contactEmails = invoice.getContactEmails().map { email -> email.toString() }
    }
}<commit_msg>Adding event view to sponsoringinvoice view<commit_after>package backend.view.sponsoring

import backend.model.payment.SponsoringInvoice
import backend.model.sponsoring.ISponsor
import backend.view.EventView
import backend.view.challenge.ChallengeView
import backend.view.user.UserView

open class SponsoringInvoiceView {

    var id: Long? = null
    var amount: Double? = null
    var payed: Double? = null
    var sponsor: SponsorView? = null
    var purposeOfTransfer: String? = null

    constructor()

    constructor(invoice: SponsoringInvoice) {
        this.id = invoice.id
        this.amount = invoice.amount.numberStripped.toDouble()
        this.payed = invoice.amountOfCurrentPayments().numberStripped.toDouble()
        this.sponsor = SponsorView(invoice.sponsor)
        this.purposeOfTransfer = invoice.purposeOfTransfer
    }
}

class DetailedSponsoringInvoiceView : SponsoringInvoiceView {

    var challenges: List<ChallengeView>? = null
    var sponsorings: List<SponsoringView>? = null
    var type: String? = null
    var contactEmails: List<String> = listOf()
    var event: EventView? = null

    constructor() : super()

    constructor(invoice: SponsoringInvoice) : super(invoice) {
        this.challenges = invoice.challenges.map { ChallengeView(it) }
        this.sponsorings = invoice.sponsorings.map { SponsoringView(it) }
        this.type = invoice.sponsor.supporterType.toString()
        this.contactEmails = invoice.getContactEmails().map { email -> email.toString() }
        this.event = invoice.event?.let(::EventView)
    }
}
{'fraction_non_alphanumeric': 0.09778968519758875, 'fraction_numerical': 0.0, 'mean_word_length': 3.703937007874016, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3521502', 'n_tokens_mistral': 943, 'n_tokens_neox': 863, 'n_words': 177}