From 9b0c96df43bb29249ba86552f5f13b2710db64be Mon Sep 17 00:00:00 2001 From: Jonah Greenthal Date: Wed, 18 Oct 2023 14:52:11 -0500 Subject: [PATCH] standardize packet naming --- src/main/kotlin/com/reinsteinquizbowl/order/entity/Packet.kt | 2 ++ .../kotlin/com/reinsteinquizbowl/order/service/Converter.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/reinsteinquizbowl/order/entity/Packet.kt b/src/main/kotlin/com/reinsteinquizbowl/order/entity/Packet.kt index 7a4e641..091f30c 100644 --- a/src/main/kotlin/com/reinsteinquizbowl/order/entity/Packet.kt +++ b/src/main/kotlin/com/reinsteinquizbowl/order/entity/Packet.kt @@ -15,4 +15,6 @@ data class Packet( var priceAsPracticeMaterial: BigDecimal? = null, ) { fun isAvailableAsPracticeMaterial() = priceAsPracticeMaterial != null + + fun getName() = "$yearCode regular-season packet $number" } diff --git a/src/main/kotlin/com/reinsteinquizbowl/order/service/Converter.kt b/src/main/kotlin/com/reinsteinquizbowl/order/service/Converter.kt index 29a00ec..eed9b8d 100644 --- a/src/main/kotlin/com/reinsteinquizbowl/order/service/Converter.kt +++ b/src/main/kotlin/com/reinsteinquizbowl/order/service/Converter.kt @@ -149,7 +149,7 @@ class Converter { fun toApi(entity: Packet) = ApiPacket( id = entity.id!!, - name = "${entity.yearCode} regular-season packet ${entity.number}", + name = entity.getName(), yearCode = entity.yearCode!!, number = entity.number!!, availableForCompetition = entity.availableForCompetition!!,