Skip to content

Development#3

Open
Sathika-J wants to merge 55 commits intomainfrom
development
Open

Development#3
Sathika-J wants to merge 55 commits intomainfrom
development

Conversation

@Sathika-J
Copy link
Copy Markdown
Owner

@Sathika-J Sathika-J commented May 19, 2023

Title: Online Food Ordering Web API

Description:
This PR introduces the Online Food Ordering Web API, which allows users to order food from various restaurants. The API provides endpoints for retrieving menus, placing orders, changing order status, and includes search, filtering, updating, deleting, and tracking order functionalities.

Key Features:
- Added RESTful endpoints for retrieving menus, placing orders, and managing order status.
- Provision for adding menu items for a particular restaurant.
- Implemented search functionality to allow users to search for specific menu items or restaurants.
- Integrated filtering options to enable users to filter restaurants.
- Implemented update endpoints to modify existing order delivery status.
- Functionality for deleting Menu item and updating the Discount for the particular menu.
- Added order tracking functionality, allowing users to monitor the status of their orders in real-time.

Testing:
- Conducted unit tests to ensure the correctness and robustness of the API endpoints.
- Performed integration tests to verify the seamless integration with the database and other dependencies.
- Manually tested various scenarios including placing orders, updating order status, and retrieving menus to validate
the API's behavior.

Dependencies:
-Utilizes a database system for storing menus, orders and restaurant details.

Known Issues:
-None at the moment.

Request for Review:
-Please review the implementation of the Online Food Ordering Web API.
-Pay particular attention to the architecture, endpoint design, data validation and adherence to best practices.
-Any feedback or suggestions for improvements are highly appreciated.

Mentioning:
@Vasantha-Kumar-J
@vigkre

API Credits:
@Sathika-J
@Aravindhan-soliton
@arun1412-dev

@vigkre vigkre self-requested a review June 22, 2023 03:28
Copy link
Copy Markdown
Collaborator

@Vasantha-Kumar-J Vasantha-Kumar-J left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add proper description to the PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the Final Name with proper casing. For Instance, Test should be capitalized.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same is the case for the containing folder.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes done in naming the project files and the respective folders.

<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the need for the Usage of Coverlet?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets added automatically while creating an xunit project, used for code coverage.


namespace Controllers.test
{
public class CustomerController_UnitTesting
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class names generally should not contains _.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and checked the class names.

mapper = _mapper;
_sut = new CustomerController(_serviceMock.Object, mapper, logger);
}
[Fact]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave Space between constructor and method.

results.Should().NotBeNull();
results.Value.Should().BeAssignableTo<IEnumerable<OrderDTO>>();
results.Should().BeAssignableTo<OkObjectResult>();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave one line space between methods.

{
public class TestRestaurantServices : IDisposable
{
protected readonly FakeFoodApiDbContext _context;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why protected?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is generate with the help of Intellisense while creating the constructor.

}

[HttpPost("PlaceOrder")]
[ValidateModel]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use this attribute for other actions also?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we are receiving it as list of object, So, we have used ValidateModel attribute.
For other actions, either Guid or string is validated while receiving (using [Required]).

{
public class DbDataProvider : Controller, IDataProvider
{
private readonly IDbProvider foodApiDbContext;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All private variables should start with _. Please check all the other locations and update the same,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked and updated all the private fields


app.Run();

public static class MyExtensions
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this class with the proper Name.

MockData.cs Outdated
@@ -0,0 +1,8 @@
using System;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use of this class? Remove this class if not used.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed the class. It was created by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants