Skip to content

Commit b143e7d

Browse files
committed
fix: stand subresource of a store
1 parent fab0f59 commit b143e7d

7 files changed

Lines changed: 61 additions & 37 deletions

File tree

model/route/route-apis.smithy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ resource Route {
1313
routeId: UUID
1414
}
1515
properties: {
16-
storeId: UUID
17-
standIdList: UUIDList
16+
storeId: UID
17+
standIdList: IDList
1818
solutionList: SolutionList
1919
}
2020
create: CreateRoute

model/route/route-io.smithy

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ $version: "2"
22

33
namespace com.shopping.inandout.route
44

5+
use com.shopping.inandout.util#ID
6+
use com.shopping.inandout.util#IDList
57
use com.shopping.inandout.util#UUID
6-
use com.shopping.inandout.util#UUIDList
78

8-
@references([
9-
{
10-
resource: "com.shopping.inandout.store#Store"
11-
}
12-
])
139
structure CreateRouteInput {
1410
@required
15-
storeId: UUID
11+
storeId: UID
1612

1713
@required
18-
standIdList: UUIDList
14+
standIdList: IDList
1915
}
2016

2117
structure GetRouteInput {

model/route/route-types.smithy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ structure RouteSummary {
4848
routeId: UUID
4949

5050
@required
51-
storeId: UUID
51+
storeId: UID
5252

5353
@required
5454
@documentation("The initial input")

model/stand/stand-apis.smithy

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ namespace com.shopping.inandout.stand
44

55
use com.shopping.inandout#ResourceAlreadyExistsError
66
use com.shopping.inandout#ResourceNotFoundError
7+
use com.shopping.inandout.util#ID
78
use com.shopping.inandout.util#PositiveDouble
89
use com.shopping.inandout.util#Price
10+
use com.shopping.inandout.util#Slug
11+
use com.shopping.inandout.util#Timestamp
912
use com.shopping.inandout.util#UUID
1013

1114
resource Stand {
1215
identifiers: {
13-
storeId: UUID
14-
standId: UUID
16+
brandSlug: Slug
17+
storeId: UID
18+
standId: ID
1519
}
1620
properties: {
17-
articleId: UUID
18-
edgeId: UUID
21+
articleSlug: Slug
22+
edgeId: ID
1923
price: Price
2024
sourceNodeDistance: PositiveDouble
2125
createdAt: Timestamp
@@ -28,7 +32,7 @@ resource Stand {
2832
delete: DeleteStand
2933
}
3034

31-
@http(method: "POST", uri: "/api/stores/{storeId}/stands")
35+
@http(method: "POST", uri: "/api/brands/{brandSlug}/stores/{storeId}/stands")
3236
operation CreateStand {
3337
input: CreateStandInput
3438
output: StandSummary
@@ -38,7 +42,7 @@ operation CreateStand {
3842
}
3943

4044
@readonly
41-
@http(method: "GET", uri: "/api/stores/{storeId}/stands/{standId}")
45+
@http(method: "GET", uri: "/api/brands/{brandSlug}/stores/{storeId}/stands/{standId}")
4246
operation GetStand {
4347
input: GetStandInput
4448
output: StandSummary
@@ -49,7 +53,7 @@ operation GetStand {
4953

5054
@readonly
5155
@paginated
52-
@http(method: "GET", uri: "/api/stores/{storeId}/stands")
56+
@http(method: "GET", uri: "/api/brands/{brandSlug}/stores/{storeId}/stands")
5357
operation ListStands {
5458
input: ListStandsInput
5559
output: StandSummaries

model/stand/stand-io.smithy

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ use com.shopping.inandout.util#UUID
1111
structure CreateStandInput {
1212
@required
1313
@httpLabel
14-
storeId: UUID
14+
brandSlug: Slug
1515

1616
@required
17-
articleId: UUID
17+
@httpLabel
18+
storeId: UID
19+
20+
@required
21+
articleSlug: Slug
1822

1923
@required
2024
edgeId: UUID
@@ -27,7 +31,11 @@ structure CreateStandInput {
2731
structure GetStandInput {
2832
@required
2933
@httpLabel
30-
storeId: UUID
34+
brandSlug: Slug
35+
36+
@required
37+
@httpLabel
38+
storeId: UID
3139

3240
@required
3341
@httpLabel
@@ -37,26 +45,30 @@ structure GetStandInput {
3745
structure ListStandsInput with [InputPagination] {
3846
@required
3947
@httpLabel
40-
storeId: UUID
48+
brandSlug: Slug
4149

42-
@httpQuery("edgeId")
43-
edgeId: UUID
50+
@required
51+
@httpLabel
52+
storeId: UID
4453

45-
@httpQuery("articleId")
46-
articleId: UUID
54+
@httpQuery("edgeId")
55+
edgeId: ID
4756

48-
@httpQuery("priceAmount")
49-
priceAmount: PositiveDouble
57+
@httpQuery("name")
58+
productName: ResourceName
5059

51-
@httpQuery("priceCurrency")
52-
@default("RON")
53-
priceCurrency: Currency
60+
@httpQuery("amount")
61+
amount: PositiveDouble
5462
}
5563

5664
structure UpdateStandInput {
5765
@required
5866
@httpLabel
59-
storeId: UUID
67+
brandSlug: Slug
68+
69+
@required
70+
@httpLabel
71+
storeId: UID
6072

6173
@required
6274
@httpLabel
@@ -72,7 +84,11 @@ structure UpdateStandInput {
7284
structure DeleteStandInput {
7385
@required
7486
@httpLabel
75-
storeId: UUID
87+
brandSlug: Slug
88+
89+
@required
90+
@httpLabel
91+
storeId: UID
7692

7793
@required
7894
@httpLabel

model/stand/stand-types.smithy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ namespace com.shopping.inandout.stand
55
use com.shopping.inandout.util#OutputPagination
66
use com.shopping.inandout.util#PositiveDouble
77
use com.shopping.inandout.util#Price
8+
use com.shopping.inandout.util#Timestamp
89
use com.shopping.inandout.util#UUID
910

1011
structure StandSummary {
1112
@required
12-
storeId: UUID
13+
brandSlug: Slug
1314

1415
@required
15-
standId: UUID
16+
storeId: UID
1617

1718
@required
18-
articleId: UUID
19+
standId: ID
1920

2021
@required
21-
edgeId: UUID
22+
articleSlug: Slug
23+
24+
@required
25+
edgeId: ID
2226

2327
price: Price
2428

model/util/util-basic.smithy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ namespace com.shopping.inandout.util
66
@documentation("Simple identifier of a resource.")
77
integer ID
88

9+
list IDList {
10+
member: ID
11+
}
12+
913
@pattern("^[0-9a-fA-F]{8}$")
1014
@length(min: 8, max: 8)
1115
@documentation("Unique identifier of a resource, scoped to a specific domain.")

0 commit comments

Comments
 (0)