Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
- ACCESS_MODE removed from ApiItemPayload swagger schema
- Fix wrong class mapping with ApiCreateOrderPayload
- Remove status from example
  • Loading branch information
anotheroneofthese committed Dec 19, 2024
1 parent ffb348d commit 4bdfb7f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ data class ApiCreateItemPayload(
packaging = packaging,
callbackUrl = callbackUrl,
location = null,
quantity = null
quantity = 0
)

fun toItemMetadata(): ItemMetadata =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.nb.mlt.wls.application.hostapi.item

import io.swagger.v3.oas.annotations.media.Schema
import io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY
import no.nb.mlt.wls.domain.model.Environment
import no.nb.mlt.wls.domain.model.HostName
import no.nb.mlt.wls.domain.model.Item
Expand Down Expand Up @@ -73,15 +72,13 @@ data class ApiItemPayload(
@Schema(
description = """Where the item is located, can be used for tracking item movement through storage systems.""",
examples = ["SYNQ_WAREHOUSE", "AUTOSTORE", "KARDEX"],
accessMode = READ_ONLY,
required = false
)
val location: String?,
@Schema(
description = """Quantity on hand of the item, this easily denotes if the item is in the storage or not.
If the item is in storage then quantity is 1, if it's not in storage then quantity is 0.""",
examples = [ "0", "1"],
accessMode = READ_ONLY,
required = false
)
val quantity: Int?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.apache.commons.validator.routines.UrlValidator
{
"hostName": "AXIELL",
"hostOrderId": "mlt-12345-order",
"status": "NOT_STARTED",
"orderLine": [
{
"hostId": "mlt-12345",
Expand Down Expand Up @@ -124,10 +123,9 @@ data class ApiCreateOrderPayload(
}

fun Order.toCreateApiOrderPayload() =
ApiOrderPayload(
ApiCreateOrderPayload(
hostName = hostName,
hostOrderId = hostOrderId,
status = status,
orderLine = orderLine.map { it.toApiOrderLine() },
orderType = orderType,
contactPerson = contactPerson,
Expand Down

0 comments on commit 4bdfb7f

Please sign in to comment.