-
-
Notifications
You must be signed in to change notification settings - Fork 58
Add a Delete order lambda #940
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
base: main
Are you sure you want to change the base?
Conversation
Implements DELETE endpoint for orders with full observability, validation and error handling
Resolves #938 |
To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
✅ I finished the code review, and didn't find any security or code quality issues.. |
add missing tests- unit, integration and e2e, use current standards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add missing tests- unit, integration and e2e, use current standards
✅ I updated this pull request based on the feedback. To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
Add delete order functionality with error handling, including integration and e2e tests. Returns order details upon successful deletion and appropriate error responses for not found cases.
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
✅ I finished the code review, and didn't find any security or code quality issues.. |
@@ -18,4 +20,4 @@ def check_order_item_count(cls, v): | |||
|
|||
|
|||
class DeleteOrderRequest(BaseModel): | |||
order_id: Annotated[str, Field(min_length=36, max_length=36, description='Order ID as UUID')] | |||
order_id: OrderId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add unit test for pydantic schema
class InternalServerErrorOutput(BaseModel): | ||
error: Annotated[str, Field(description='Error description')] = 'internal server error' | ||
|
||
|
||
class DeleteOrderOutput(Order): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add unit test for pydantic schema
✅ I updated this pull request based on the feedback. To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
Simplifies delete order implementation by removing OrderNotFoundException and adding comprehensive test coverage. Updates API endpoint to use DELETE HTTP method and path parameters.
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
✅ I finished the code review, and didn't find any security or code quality issues.. |
@@ -16,3 +16,6 @@ def __call__(cls, *args, **kwargs): | |||
class DalHandler(ABC, metaclass=_SingletonMeta): | |||
@abstractmethod | |||
def create_order_in_db(self, customer_name: str, order_item_count: int) -> Order: ... # pragma: no cover | |||
|
|||
@abstractmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add cdk code that generates all the required resources, make sure to add at the correct place
✅ I updated this pull request based on the feedback. To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
This commit refactors the delete order functionality to handle errors better and adds CDK infrastructure code for API Gateway, Lambda and DynamoDB setup.
The code implemented in this pull request was partially adopted from third-party source material to address the original issue. See below for the reference to the source material. Code ReferencesLicenses: - MIT Details: Repository: aws-lambda-handler-cookbook URL: https://github.com/analect-io/aws-lambda-handler-cookbook Owner: analect-io Filename: cdk/my_service/api_construct.py Reference Lines: Start 27, End 28 |
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
✅ I finished the code review, and didn't find any security or code quality issues.. |
This pull request adds functionality to delete orders from the system. The changes include:
The implementation follows the existing architectural patterns and best practices established in the codebase, including proper input validation, error handling, and observability.