-
Notifications
You must be signed in to change notification settings - Fork 0
All Store APIs #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bffd5a8
feat: store apis
petrubraha cffcbc4
fix: store operation output now returns the store id as well
petrubraha e3c0c51
fix: resourceIdentifier trait value for storeSummary structure
petrubraha d2dee3a
removed useless trait
petrubraha e395320
feat: GeoCoordinates
petrubraha 26d5187
rebasing
petrubraha 4424b87
reorder of shapes
petrubraha 1777719
feat: Brand references
petrubraha 789540d
removed falsy documentation
petrubraha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.store | ||
|
|
||
| use com.shopping.inandout#Description | ||
| use com.shopping.inandout#GeoCoordinates | ||
| use com.shopping.inandout#ImageUrl | ||
| use com.shopping.inandout#InternalServerError | ||
| use com.shopping.inandout#InvalidInputError | ||
| use com.shopping.inandout#ResourceAlreadyExistsError | ||
| use com.shopping.inandout#ResourceName | ||
| use com.shopping.inandout#ResourceNotFoundError | ||
| use com.shopping.inandout#Timezone | ||
| use com.shopping.inandout#UUID | ||
|
|
||
| resource Store { | ||
| identifiers: { | ||
| storeId: UUID | ||
| } | ||
| properties: { | ||
| name: ResourceName | ||
| brandId: UUID | ||
| description: Description | ||
| imageUrl: ImageUrl | ||
| geoCoordinates: GeoCoordinates | ||
| operatingHoursMap: OperatingHoursMap | ||
| timezone: Timezone | ||
| createdAt: Timestamp | ||
| updatedAt: Timestamp | ||
| } | ||
| create: CreateStore | ||
| read: GetStore | ||
| list: ListStores | ||
| update: UpdateStore | ||
| delete: DeleteStore | ||
| } | ||
|
|
||
| @http(method: "POST", uri: "/stores") | ||
| operation CreateStore { | ||
| input: CreateStoreInput | ||
| output: StoreSummary | ||
| errors: [ | ||
| InvalidInputError | ||
| ResourceAlreadyExistsError | ||
| InternalServerError | ||
| ] | ||
| } | ||
|
|
||
| @readonly | ||
| @http(method: "GET", uri: "/stores/{storeId}") | ||
| operation GetStore { | ||
| input: GetStoreInput | ||
| output: StoreSummary | ||
| errors: [ | ||
| InvalidInputError | ||
| ResourceNotFoundError | ||
| InternalServerError | ||
| ] | ||
| } | ||
|
|
||
| @readonly | ||
| @paginated | ||
| @http(method: "GET", uri: "/stores") | ||
| operation ListStores { | ||
| input: ListStoresInput | ||
| output: StoreSummaries | ||
| errors: [ | ||
| InvalidInputError | ||
| InternalServerError | ||
| ] | ||
| } | ||
|
|
||
| @http(method: "PATCH", uri: "/stores/{storeId}") | ||
| operation UpdateStore { | ||
| input: UpdateStoreInput | ||
| output: StoreSummary | ||
| errors: [ | ||
| InvalidInputError | ||
| ResourceNotFoundError | ||
| InternalServerError | ||
| ] | ||
| } | ||
|
|
||
| @idempotent | ||
| @http(method: "DELETE", uri: "/stores/{storeId}") | ||
| @documentation("Not restricted cascading operation, deletes floors, stands, etc.") | ||
| operation DeleteStore { | ||
| input: DeleteStoreInput | ||
| output: StoreSummary | ||
| errors: [ | ||
| InvalidInputError | ||
| ResourceNotFoundError | ||
| InternalServerError | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.store | ||
|
|
||
| use com.shopping.inandout#Description | ||
| use com.shopping.inandout#GeoCoordinates | ||
| use com.shopping.inandout#ImageUrl | ||
| use com.shopping.inandout#InputPagination | ||
| use com.shopping.inandout#Latitude | ||
| use com.shopping.inandout#Longitude | ||
| use com.shopping.inandout#PositiveDouble | ||
| use com.shopping.inandout#ResourceName | ||
| use com.shopping.inandout#Timezone | ||
| use com.shopping.inandout#UUID | ||
| use com.shopping.inandout.brand#Brand | ||
|
|
||
| @references([ | ||
| { | ||
| resource: Brand | ||
| } | ||
| ]) | ||
| structure CreateStoreInput { | ||
| name: ResourceName | ||
|
|
||
| @required | ||
| brandId: UUID | ||
|
|
||
| description: Description | ||
|
|
||
| imageUrl: ImageUrl | ||
|
|
||
| timezone: Timezone | ||
|
|
||
| operatingHoursMap: OperatingHoursMap | ||
|
|
||
| geoCoordinates: GeoCoordinates | ||
| } | ||
|
|
||
| structure GetStoreInput { | ||
| @required | ||
| @httpLabel | ||
| storeId: UUID | ||
| } | ||
|
|
||
| structure ListStoresInput with [InputPagination] { | ||
| @httpQuery("name") | ||
| name: ResourceName | ||
|
|
||
| @httpQuery("isOpen") | ||
| isOpen: Boolean | ||
|
|
||
| @httpQuery("userLongitude") | ||
| userLongitude: Longitude | ||
|
|
||
| @httpQuery("userLatitude") | ||
| userLatitude: Latitude | ||
|
|
||
| // ! User location must be provided in order for the below queries to work. | ||
| @httpQuery("maxDistance") | ||
| @documentation("Distance measured in kilometers") | ||
| maxDistance: PositiveDouble | ||
| } | ||
|
|
||
| @references([ | ||
| { | ||
| resource: Brand | ||
| } | ||
| ]) | ||
| structure UpdateStoreInput { | ||
| @required | ||
| @httpLabel | ||
| storeId: UUID | ||
|
|
||
| name: ResourceName | ||
|
|
||
| brandId: UUID | ||
|
|
||
| description: Description | ||
|
|
||
| imageUrl: ImageUrl | ||
|
|
||
| timezone: Timezone | ||
|
|
||
| operatingHoursMap: OperatingHoursMap | ||
|
|
||
| geoCoordinates: GeoCoordinates | ||
| } | ||
|
|
||
| structure DeleteStoreInput { | ||
| @required | ||
| @httpLabel | ||
| storeId: UUID | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| $version: "2" | ||
|
|
||
| namespace com.shopping.inandout.store | ||
|
|
||
| use com.shopping.inandout#DayType | ||
| use com.shopping.inandout#Description | ||
| use com.shopping.inandout#GeoCoordinates | ||
| use com.shopping.inandout#ImageUrl | ||
| use com.shopping.inandout#OutputPagination | ||
| use com.shopping.inandout#ResourceName | ||
| use com.shopping.inandout#TimeRange | ||
| use com.shopping.inandout#Timezone | ||
| use com.shopping.inandout#UUID | ||
| use com.shopping.inandout.brand#Brand | ||
|
|
||
| map OperatingHoursMap { | ||
| key: DayType | ||
| value: TimeRange | ||
| } | ||
|
|
||
| @references([ | ||
| { | ||
| resource: Brand | ||
| } | ||
| ]) | ||
| structure StoreSummary { | ||
| @required | ||
| storeId: UUID | ||
|
|
||
| name: ResourceName | ||
|
|
||
| @required | ||
| brandId: UUID | ||
|
|
||
| description: Description | ||
|
|
||
| imageUrl: ImageUrl | ||
|
|
||
| geoCoordinates: GeoCoordinates | ||
|
|
||
| operatingHoursMap: OperatingHoursMap | ||
|
|
||
| timezone: Timezone | ||
|
|
||
| @required | ||
| createdAt: Timestamp | ||
|
|
||
| @required | ||
| updatedAt: Timestamp | ||
| } | ||
petrubraha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| list StoreSummaryList { | ||
| member: StoreSummary | ||
| } | ||
|
|
||
| // This is needed since lists or other similar collections can not be used as input/output for operations. | ||
| structure StoreSummaries with [OutputPagination] { | ||
| tokens: StoreSummaryList | ||
petrubraha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.