Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions smithy/model/stand/stand-apis.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
$version: "2"

namespace com.shopping.inandout.stand

use com.shopping.inandout#InternalServerError
use com.shopping.inandout#InvalidInputError
use com.shopping.inandout#PositiveDouble
use com.shopping.inandout#ResourceAlreadyExistsError
use com.shopping.inandout#ResourceNotFoundError
use com.shopping.inandout#UUID

resource Stand {
identifiers: {
storeId: UUID
standId: UUID
}
properties: {
articleId: UUID
edgeId: UUID
sourceNodeDistance: PositiveDouble
createdAt: Timestamp
updatedAt: Timestamp
}
create: CreateStand
read: GetStand
list: ListStands
update: UpdateStand
delete: DeleteStand
}

@http(method: "POST", uri: "/stores/{storeId}/stands")
operation CreateStand {
input: CreateStandInput
output: StandSummary
errors: [
InvalidInputError
ResourceAlreadyExistsError
InternalServerError
]
}

@readonly
@http(method: "GET", uri: "/stores/{storeId}/stands/{standId}")
operation GetStand {
input: GetStandInput
output: StandSummary
errors: [
InvalidInputError
ResourceNotFoundError
InternalServerError
]
}

@readonly
@paginated
@http(method: "GET", uri: "/stores/{storeId}/stands")
operation ListStands {
input: ListStandsInput
output: StandSummaries
errors: [
InvalidInputError
InternalServerError
]
}

@http(method: "PATCH", uri: "/stores/{storeId}/stands/{standId}")
operation UpdateStand {
input: UpdateStandInput
output: StandSummary
errors: [
InvalidInputError
ResourceNotFoundError
InternalServerError
]
}

@idempotent
@http(method: "DELETE", uri: "/stores/{storeId}/stands/{standId}")
operation DeleteStand {
input: DeleteStandInput
output: StandSummary
errors: [
InvalidInputError
ResourceNotFoundError
InternalServerError
]
}
67 changes: 67 additions & 0 deletions smithy/model/stand/stand-io.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
$version: "2"

namespace com.shopping.inandout.stand

use com.shopping.inandout#InputPagination
use com.shopping.inandout#PositiveDouble
use com.shopping.inandout#UUID

structure CreateStandInput {
@required
@httpLabel
storeId: UUID

@required
articleId: UUID

@required
edgeId: UUID

sourceNodeDistance: PositiveDouble
}

structure GetStandInput {
@required
@httpLabel
storeId: UUID

@required
@httpLabel
standId: UUID
}

structure ListStandsInput with [InputPagination] {
@required
@httpLabel
storeId: UUID

@httpQuery("edgeId")
edgeId: UUID

@httpQuery("articleId")
articleId: UUID
}

structure UpdateStandInput {
@required
@httpLabel
storeId: UUID

@required
@httpLabel
standId: UUID

edgeId: UUID

sourceNodeDistance: PositiveDouble
}

structure DeleteStandInput {
@required
@httpLabel
storeId: UUID

@required
@httpLabel
standId: UUID
}
37 changes: 37 additions & 0 deletions smithy/model/stand/stand-types.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$version: "2"

namespace com.shopping.inandout.stand

use com.shopping.inandout#OutputPagination
use com.shopping.inandout#PositiveDouble
use com.shopping.inandout#UUID

structure StandSummary {
@required
storeId: UUID

@required
standId: UUID

@required
articleId: UUID

@required
edgeId: UUID

sourceNodeDistance: PositiveDouble

@required
createdAt: Timestamp

@required
updatedAt: Timestamp
}

list StandSummaryList {
member: StandSummary
}

structure StandSummaries with [OutputPagination] {
tokens: StandSummaryList
}
4 changes: 4 additions & 0 deletions smithy/model/store/store-apis.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use com.shopping.inandout#ResourceName
use com.shopping.inandout#ResourceNotFoundError
use com.shopping.inandout#Timezone
use com.shopping.inandout#UUID
use com.shopping.inandout.stand#Stand

resource Store {
identifiers: {
Expand All @@ -28,6 +29,9 @@ resource Store {
createdAt: Timestamp
updatedAt: Timestamp
}
resources: [
Stand
]
create: CreateStore
read: GetStore
list: ListStores
Expand Down