diff --git a/smithy/model/stand/stand-apis.smithy b/smithy/model/stand/stand-apis.smithy new file mode 100644 index 0000000..fe15f42 --- /dev/null +++ b/smithy/model/stand/stand-apis.smithy @@ -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 + ] +} diff --git a/smithy/model/stand/stand-io.smithy b/smithy/model/stand/stand-io.smithy new file mode 100644 index 0000000..4c07e1d --- /dev/null +++ b/smithy/model/stand/stand-io.smithy @@ -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 +} diff --git a/smithy/model/stand/stand-types.smithy b/smithy/model/stand/stand-types.smithy new file mode 100644 index 0000000..99d841c --- /dev/null +++ b/smithy/model/stand/stand-types.smithy @@ -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 +} diff --git a/smithy/model/store/store-apis.smithy b/smithy/model/store/store-apis.smithy index 9f25ceb..a628b8b 100644 --- a/smithy/model/store/store-apis.smithy +++ b/smithy/model/store/store-apis.smithy @@ -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: { @@ -28,6 +29,9 @@ resource Store { createdAt: Timestamp updatedAt: Timestamp } + resources: [ + Stand + ] create: CreateStore read: GetStore list: ListStores