-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor into separate domain directories
- Loading branch information
Showing
7 changed files
with
194 additions
and
181 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,34 +1,3 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class ProductResponse(BaseModel): | ||
id: str | ||
name: str | ||
stores: list[str] | ||
images: list[str] | ||
image_urls: dict[str, str] = {} | ||
categories: list[str] | ||
header_image: str = None | ||
|
||
|
||
class CreatePayload(BaseModel): | ||
name: str | ||
stores: list[str] | ||
categories: list[str] | ||
|
||
|
||
class UpdatePayload(BaseModel): | ||
name: Optional[str] | ||
stores: Optional[list[str]] | ||
categories: Optional[list[str]] | ||
|
||
|
||
class ProductsListResponse(BaseModel): | ||
products: list[ProductResponse] | ||
next_token: str = None | ||
|
||
|
||
class ProductsBulkUploadRequest(BaseModel): | ||
products: list[CreatePayload] |
This file contains 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,2 @@ | ||
class ProductNotFoundError(Exception): | ||
pass |
This file contains 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,34 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class ProductResponse(BaseModel): | ||
id: str | ||
name: str | ||
stores: list[str] | ||
images: list[str] | ||
image_urls: dict[str, str] = {} | ||
categories: list[str] | ||
header_image: str = None | ||
|
||
|
||
class ProductsListResponse(BaseModel): | ||
products: list[ProductResponse] | ||
next_token: str = None | ||
|
||
|
||
class CreatePayload(BaseModel): | ||
name: str | ||
stores: list[str] | ||
categories: list[str] | ||
|
||
|
||
class UpdatePayload(BaseModel): | ||
name: Optional[str] | ||
stores: Optional[list[str]] | ||
categories: Optional[list[str]] | ||
|
||
|
||
class ProductsBulkUploadRequest(BaseModel): | ||
products: list[CreatePayload] |
This file contains 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
Oops, something went wrong.