Moved MustangMapper to package mapper; merged Party.street and .houseNumber into street
This commit is contained in:
parent
3bd3024f11
commit
29650d2660
|
@ -1,6 +1,7 @@
|
||||||
package net.codinux.invoicing.creation
|
package net.codinux.invoicing.mapper
|
||||||
|
|
||||||
import net.codinux.invoicing.model.LineItem
|
import net.codinux.invoicing.model.LineItem
|
||||||
|
import net.codinux.invoicing.model.Party
|
||||||
import org.mustangproject.Invoice
|
import org.mustangproject.Invoice
|
||||||
import org.mustangproject.Item
|
import org.mustangproject.Item
|
||||||
import org.mustangproject.Product
|
import org.mustangproject.Product
|
||||||
|
@ -25,8 +26,8 @@ class MustangMapper {
|
||||||
this.dueDate = map(invoice.dueDate)
|
this.dueDate = map(invoice.dueDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun mapParty(party: net.codinux.invoicing.model.Party): TradeParty = TradeParty(
|
fun mapParty(party: Party): TradeParty = TradeParty(
|
||||||
party.name, "${party.streetName} ${party.houseNumber}", party.postalCode, party.city, party.country
|
party.name, party.street, party.postalCode, party.city, party.country
|
||||||
).apply {
|
).apply {
|
||||||
this.taxID = party.taxNumber
|
this.taxID = party.taxNumber
|
||||||
// TODO: vatID?
|
// TODO: vatID?
|
|
@ -3,8 +3,10 @@ package net.codinux.invoicing.model
|
||||||
class Party(
|
class Party(
|
||||||
val name: String,
|
val name: String,
|
||||||
|
|
||||||
val streetName: String,
|
/**
|
||||||
val houseNumber: String,
|
* Party's street and house number.
|
||||||
|
*/
|
||||||
|
val street: String,
|
||||||
var postalCode: String?,
|
var postalCode: String?,
|
||||||
val city: String,
|
val city: String,
|
||||||
val country: String? = null,
|
val country: String? = null,
|
||||||
|
|
|
@ -44,14 +44,13 @@ class EInvoiceCreatorTest {
|
||||||
|
|
||||||
private fun createParty(
|
private fun createParty(
|
||||||
name: String,
|
name: String,
|
||||||
streetName: String = "Fun Street",
|
streetName: String = "Fun Street 1",
|
||||||
houseNumber: String = "1",
|
|
||||||
postalCode: String = "12345",
|
postalCode: String = "12345",
|
||||||
city: String = "Glückstadt",
|
city: String = "Glückstadt",
|
||||||
country: String? = null,
|
country: String? = null,
|
||||||
taxNumber: String? = "DE12345678",
|
taxNumber: String? = "DE12345678",
|
||||||
email: String? = null,
|
email: String? = null,
|
||||||
) = Party(name, streetName, houseNumber, postalCode, city, country, taxNumber, email)
|
) = Party(name, streetName, postalCode, city, country, taxNumber, email)
|
||||||
|
|
||||||
private fun createItem(
|
private fun createItem(
|
||||||
name: String = "Erbrachte Dienstleistungen",
|
name: String = "Erbrachte Dienstleistungen",
|
||||||
|
|
Loading…
Reference in New Issue