0% found this document useful (0 votes)
57 views33 pages

Shivam Datkhile Sem V

Uploaded by

dalvi6373
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views33 pages

Shivam Datkhile Sem V

Uploaded by

dalvi6373
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

PERFORMA FOR THE APPROVAL PROJECT PROPOSAL

PNR NO: ROLL NO:

1. Name of the student

2. Title of the project

3. Name of the guide

4. Teaching experience of the guide

5. Is your first submission? Yes No

Signature of student Signature of guide


Date Date

Signature of the Co-ordinator


Date

1
E-Commerce
A Project Report
Submitted is partial fulfilment of the
Requirement for the award of the Degree
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY)
By
Shivam Vasant Datkhile

Roll No 07

Under the esteemed guidance of


Mr. Mahesh dhaygude

DEPARTMENT OF INFORMATION TECHNOLOGY


RAMSHETH THAKUR COLLEGE OF COMMERCE AND SCIENCE
(Affiliated to University of Mumbai)
PLOT NO. 1, SECTOR 33, KHARGHAR 410210
MAHARASHTRA 2022-2023

2
Janardan Bhagat Shikshan Prasarak Sanstha’s
RAMSHETH THAKUR COLLEGE OF COMMERCE AND SCIENCE
(Affiliated to University of Mumbai)
PLOT NO. 1, SECTOR 33, KHARGHAR 410210
MAHARASHTRA 2022-2023

DEPARMENT OF INFORMATION
TECHNOLOGY

CERTIFICATE
This is to certify that the project entitled, “E-Commerce” is Bonafede Work of
Shivam Vasant Datkhile bearing Roll No 07 submitted in partial fulfilment of the
requirement for the award of degree of BACHELOR OF SCIENCE in
INFORMATION TECHNOLOGY from University of Mumbai.

Internal Guide Co-ordinator

External Examiner

Date College Seal

3
ABSTRACT

The E-Commerce website built for clothing offers a user-friendly interface that allows users
to access a new world of fashion from their smartphones, laptops, or desktops, all from the
comfort of their homes or anywhere in the world. This intuitive design ensures that even those
who may not be tech-savvy can easily navigate through the platform and find what they’re
looking for.

Developed on the ASP.NET framework, the website utilizes C# as its core programming
language, providing a robust and scalable solution for modern e-commerce needs. The choice
of SQL Server for backend operations enhances the application’s performance and reliability,
enabling efficient data management and storage. This combination allows for real-time data
binding, ensuring that customers always see the latest product information, stock availability,
and pricing updates seamlessly.

Moreover, the website is designed with responsiveness in mind, ensuring optimal performance
across various devices and screen sizes. Advanced features such as secure payment gateways,
personalized recommendations, and a streamlined checkout process further enhance the user
experience. With a commitment to delivering a dynamic and engaging shopping environment,
this e-commerce platform is poised to meet the evolving needs of consumers in the digital age.

4
ACKNOWLEDGEMENT

It is indeed a matter of great pleasure and proud to be able to present this project on
“E-Commerce”.
The completion of the project work is a milestone in student life and its execution is
inevitable in the hand of guide. I am highly indebted the project guide Mr. Mahesh
dhaygude. His/her invaluable guidance and appreciation for giving from and
substance to this report. It is due to her enduring efforts; patience and enthusiasm,
which has given a sense of direction and purposefulness to this project and
ultimately made it a success.
I would like to tender our sincere thanks to the H.O.D Mrs. Rajshree Mhatre and all
teacher for their co-operation. I would also like to express our deep regards and
gratitude to the principal Principal Dr. Rupendra Gaikwad. I will wish to thank the
non-teaching staff and my friends who have helped me all time in way or other way.
Really it I highly impossible to reply the department of all the people who have
directly or indirectly helped me for performing the project.

5
DECLARATION
I hereby declare that the project entitled, “E-Commerce” done at Ramsheth
Thakur College of Commerce & Science has not been in any case duplicated to
submit to any other university for the award of any degree. To the best of my
knowledge other than me, no one has submitted to any other university.

The project is done in partial fulfilment of the requirements for the award of
degree of BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY) to be
submitted as a final semester project as a part of our curriculum.

Shivam Vasant Datkhile

6
INDEX

CHAPTER NO TITLE PAGE NO

CHAPTER 1 INTRODUCTION
1.1 Background 1
1.2 Objective 1
1.3 Purpose and scope 2
1.3.1 Purpose 2
1.3.2 Scope 2

CHAPTER 2 SYSTEM ANALYSIS


2.1 Existing System 3
2.2 Proposed System 3
2.3 Requirement Analysis 3
2.4 Hardware Requirements 4
2.5 Software Requirements 4
2.6 Justification of software 4

CHAPTER 3 SYSTEM DESIGN


3.1 Data Flow Diagram 14
3.4 Class Diagram 15
CHAPTER 4 IMPLEMENTATION AND TESTING
4.1 Code 16
4.2 Testing 26
4.3 Test Cases 26
CHAPTER 5 RESULTS AND OBSERVATIONS 27

CHAPTER 6 CONCLUSION AND FUTURE WORK 30

CHAPTER 7 REFERENCES 33

7
INTRODUCTION

1.1 Background:
Shopping with Traditional way by visiting a shop physically makes it little difficult in todays busy world.
With only limited collection in clothing a particular shop makes it narrow for customer to select and
purchase the Clothing for themselves.
The “E-Commerce” system aims to address this gap by developing an application that can gives a user
there easy accessible and user friendly for its visitor to come and check the clothing of all design in all size
and color From all around the world. Which gives the user a wide range of collection from different brand
and designer to choose from. An easy process from visiting to our online shop then selecting your favorite
cloth and placing home delivery order With multiple option of payment it’s make that simple to complete a
shopping journey.
This real-time recognition system is essential for increasing accessibility in various contexts .The
application’s intuitive design allows users to engage with the system through user friendly interface and
wide collection of clothing

1.2 Objectives:

The primary objective of this project is to develop a website which allows their user and
customer to access our clothing collection with few clicks and make some orders for
themselves with some very easy end to end process. Specific objectives include:
 Real-time available collection : by implementing sql server as a database for backend we
can achieve some real time data binding so user can access the real time data on website
 User-Friendly Interface: Design a simple, intuitive interface that allows users to
navigate between pages to page to complete their journey of shopping.
 Cross-Platform Compatibility: Ensure the application works seamlessly on both desktop
and mobile platforms (Windows, Android, iOS).
 Promote Accessibility : Bridge the communication gap between customer and shop by
giving the perfect user friendly interface to access all collection .

8
Purpose ,Scope and Applicability
Purpose
The purpose of creating the E-Commerce Clothing website is to revolutionize the shopping
experience by providing a convenient, user-friendly platform that connects customers with
a diverse range of clothing options from around the world. By addressing the limitations of
traditional shopping—such as limited selection, time constraints, and physical store
challenges—our website aims to empower consumers to easily find and purchase clothing
that fits their unique style and needs. Ultimately, we seek to enhance accessibility,
streamline the shopping process, and create a more enjoyable experience for everyone.

Scope

1. User-Friendly Website: The website is designed with an intuitive interface that makes
navigation easy for users of all ages. Clear categories and search functions allow customers to
find their desired items quickly and efficiently.
2. Used in Shopping Sector: The platform specifically targets the clothing retail market,
offering a comprehensive range of apparel for diverse consumer needs. By focusing on this
sector, the website aims to enhance the online shopping experience for fashion enthusiasts.
3. Simple Shopping Process: The shopping process is streamlined, guiding users from product
selection to checkout with minimal steps. This simplicity helps reduce cart abandonment and
ensures a smooth experience for every customer.
4. Online Payment System: The website features a secure online payment system that supports
various payment methods, including credit cards and digital wallets. This ensures that
transactions are not only safe but also convenient, allowing users to complete their purchases
with confidence.

9
2. REQUIREMENT
AND ANALYSIS

10
Problem Definition
Existing System:

Traditional shopping can often be a frustrating experience in today’s busy world. Limited
store hours and the need to travel can make it challenging to find time for shopping. Once at
the store, customers may encounter a narrow selection of clothing, with sizes and styles that
don’t meet their needs. The crowded aisles and long checkout lines can add to the stress,
leaving shoppers feeling rushed and overwhelmed. Additionally, the lack of variety means
that finding the perfect outfit may require visiting multiple stores, consuming valuable time
and energy. As a result, many consumers find that traditional shopping simply doesn’t fit
their fast-paced lifestyles.

Requirement specification for Proposed System:


The **E-Commerce ** platform addresses the challenges of traditional shopping by offering
a convenient online experience accessible 24/7. Customers can browse a vast selection of
styles, sizes, and colors from the comfort of their homes, eliminating the need for travel and
reducing stress.
With advanced filtering options and personalized recommendations, finding the perfect outfit
is quick and easy. Secure payment methods and fast shipping ensure a seamless transaction
process, making shopping enjoyable and efficient—perfect for today’s busy lifestyles.

Advantage of proposed system:


Here are three key advantages of the E-Commerce Clothing system:

1. Vast Selection: Customers can access a wide variety of clothing options from
different brands and designers worldwide, ensuring they can find exactly what
they're looking for in terms of style, size, and color.
2. Convenience: Shopping can be done anytime and anywhere, eliminating the
need to travel to physical stores. This flexibility allows users to shop at their own
pace without the pressures of crowds or limited store hours.
3. Personalized Experience: The platform can offer tailored recommendations
based on individual preferences and browsing history, making it easier for
customers to discover new styles and find items that match their tastes.

11
Hardware Requirement:
Processor Intel i5 or equivalent
Ram 8 GB minimum
Hard Disk At least 500 GB HDD or SSD
Input Device Keyboard , mouse
Output Device monitor

Software requirement:
Operating system Windows
Programing language C#
Web-technology Asp.net web api
Front End C#
Back End SQL server
Web server IIS web server

12
4. SYSTEM DESIGN

13
Chapter 3
System Design

3.1 DATA FLOW


DIAGRAM(DFD)
DFD, Data flow diagrams are used to graphically represent the flow of data in a business
information system. DFD describes the processes that are involved in a system to transfer
data from the input to the file storage and reports generation. Data flow diagrams can be
divided into logical and physical. The logical data flow diagram describes flow of data
through a system to perform certain functionality of a business. The physical data flow
diagram describes the implementation of the logical data flow. The Data Flow Diagram
outlines the interaction between

14
Class Diagram:

Class diagrams are one of the most useful types of diagrams in UML as they clearly
map out the structure of system by modelling its classes, attributes, operations, and
relationship between objects. With our UML diagramming software, creating these
diagram is not as overwhelming as it might appear. This guide will show you how to
understand, plane and create your own class diagrams.

15
4. IMPLEMENTATION
AND TESTING

16
CatalogApi.cs
using Microsoft.AspNetCore.Http.HttpResults;
using Pgvector.EntityFrameworkCore;

namespace eShop.Catalog.API;

public static class CatalogApi


{
public static IEndpointRouteBuilder MapCatalogApiV1(this IEndpointRouteBuilder app)
{
var api = app.MapGroup("api/catalog").HasApiVersion(1.0);

// Routes for querying catalog items.


api.MapGet("/items", GetAllItems);
api.MapGet("/items/by", GetItemsByIds);
api.MapGet("/items/{id:int}", GetItemById);
api.MapGet("/items/by/{name:minlength(1)}", GetItemsByName);
api.MapGet("/items/{catalogItemId:int}/pic", GetItemPictureById);

// Routes for resolving catalog items using AI.


api.MapGet("/items/withsemanticrelevance/{text:minlength(1)}", GetItemsBySemanticRelevance);

// Routes for resolving catalog items by type and brand.


api.MapGet("/items/type/{typeId}/brand/{brandId?}", GetItemsByBrandAndTypeId);
api.MapGet("/items/type/all/brand/{brandId:int?}", GetItemsByBrandId);
api.MapGet("/catalogtypes", async (CatalogContext context) => await context.CatalogTypes.OrderBy(x =>
x.Type).ToListAsync());
api.MapGet("/catalogbrands", async (CatalogContext context) => await context.CatalogBrands.OrderBy(x =>
x.Brand).ToListAsync());

// Routes for modifying catalog items.


api.MapPut("/items", UpdateItem);
api.MapPost("/items", CreateItem);
api.MapDelete("/items/{id:int}", DeleteItemById);

return app;
}

public static async Task<Results<Ok<PaginatedItems<CatalogItem>>, BadRequest<string>>> GetAllItems(


[AsParameters] PaginationRequest paginationRequest,
[AsParameters] CatalogServices services)
{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

var totalItems = await services.Context.CatalogItems


.LongCountAsync();

var itemsOnPage = await services.Context.CatalogItems


.OrderBy(c => c.Name)
.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();

return TypedResults.Ok(new PaginatedItems<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage));


}

public static async Task<Ok<List<CatalogItem>>> GetItemsByIds(


[AsParameters] CatalogServices services,

17
int[] ids)
{
var items = await services.Context.CatalogItems.Where(item => ids.Contains(item.Id)).ToListAsync();
return TypedResults.Ok(items);
}

public static async Task<Results<Ok<CatalogItem>, NotFound, BadRequest<string>>> GetItemById(


[AsParameters] CatalogServices services,
int id)
{
if (id <= 0)
{
return TypedResults.BadRequest("Id is not valid.");
}

var item = await services.Context.CatalogItems.Include(ci => ci.CatalogBrand).SingleOrDefaultAsync(ci => ci.Id == id);

if (item == null)
{
return TypedResults.NotFound();
}

return TypedResults.Ok(item);
}

public static async Task<Ok<PaginatedItems<CatalogItem>>> GetItemsByName(


[AsParameters] PaginationRequest paginationRequest,
[AsParameters] CatalogServices services,
string name)
{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

var totalItems = await services.Context.CatalogItems


.Where(c => c.Name.StartsWith(name))
.LongCountAsync();

var itemsOnPage = await services.Context.CatalogItems


.Where(c => c.Name.StartsWith(name))
.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();

return TypedResults.Ok(new PaginatedItems<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage));


}

public static async Task<Results<NotFound, PhysicalFileHttpResult>> GetItemPictureById(CatalogContext context,


IWebHostEnvironment environment, int catalogItemId)
{
var item = await context.CatalogItems.FindAsync(catalogItemId);

if (item is null)
{
return TypedResults.NotFound();
}

var path = GetFullPath(environment.ContentRootPath, item.PictureFileName);

string imageFileExtension = Path.GetExtension(item.PictureFileName);


string mimetype = GetImageMimeTypeFromImageFileExtension(imageFileExtension);
DateTime lastModified = File.GetLastWriteTimeUtc(path);

18
return TypedResults.PhysicalFile(path, mimetype, lastModified: lastModified);
}

public static async Task<Results<BadRequest<string>, RedirectToRouteHttpResult, Ok<PaginatedItems<CatalogItem>>>>


GetItemsBySemanticRelevance(
[AsParameters] PaginationRequest paginationRequest,
[AsParameters] CatalogServices services,
string text)
{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

if (!services.CatalogAI.IsEnabled)
{
return await GetItemsByName(paginationRequest, services, text);
}

// Create an embedding for the input search


var vector = await services.CatalogAI.GetEmbeddingAsync(text);

// Get the total number of items


var totalItems = await services.Context.CatalogItems
.LongCountAsync();

// Get the next page of items, ordered by most similar (smallest distance) to the input search
List<CatalogItem> itemsOnPage;
if (services.Logger.IsEnabled(LogLevel.Debug))
{
var itemsWithDistance = await services.Context.CatalogItems
.Select(c => new { Item = c, Distance = c.Embedding.CosineDistance(vector) })
.OrderBy(c => c.Distance)
.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();

services.Logger.LogDebug("Results from {text}: {results}", text, string.Join(", ", itemsWithDistance.Select(i =>


$"{i.Item.Name} => {i.Distance}")));

itemsOnPage = itemsWithDistance.Select(i => i.Item).ToList();


}
else
{
itemsOnPage = await services.Context.CatalogItems
.OrderBy(c => c.Embedding.CosineDistance(vector))
.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();
}

return TypedResults.Ok(new PaginatedItems<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage));


}

public static async Task<Ok<PaginatedItems<CatalogItem>>> GetItemsByBrandAndTypeId(


[AsParameters] PaginationRequest paginationRequest,
[AsParameters] CatalogServices services,
int typeId,
int? brandId)
{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

var root = (IQueryable<CatalogItem>)services.Context.CatalogItems;


19
root = root.Where(c => c.CatalogTypeId == typeId);
if (brandId is not null)
{
root = root.Where(c => c.CatalogBrandId == brandId);
}

var totalItems = await root


.LongCountAsync();

var itemsOnPage = await root


.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();

return TypedResults.Ok(new PaginatedItems<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage));


}

public static async Task<Ok<PaginatedItems<CatalogItem>>> GetItemsByBrandId(


[AsParameters] PaginationRequest paginationRequest,
[AsParameters] CatalogServices services,
int? brandId)
{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

var root = (IQueryable<CatalogItem>)services.Context.CatalogItems;

if (brandId is not null)


{
root = root.Where(ci => ci.CatalogBrandId == brandId);
}

var totalItems = await root


.LongCountAsync();

var itemsOnPage = await root


.Skip(pageSize * pageIndex)
.Take(pageSize)
.ToListAsync();

return TypedResults.Ok(new PaginatedItems<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage));


}

public static async Task<Results<Created, NotFound<string>>> UpdateItem(


[AsParameters] CatalogServices services,
CatalogItem productToUpdate)
{
var catalogItem = await services.Context.CatalogItems.SingleOrDefaultAsync(i => i.Id == productToUpdate.Id);

if (catalogItem == null)
{
return TypedResults.NotFound($"Item with id {productToUpdate.Id} not found.");
}

// Update current product


var catalogEntry = services.Context.Entry(catalogItem);
catalogEntry.CurrentValues.SetValues(productToUpdate);

catalogItem.Embedding = await services.CatalogAI.GetEmbeddingAsync(catalogItem);

var priceEntry = catalogEntry.Property(i => i.Price);

20
if (priceEntry.IsModified) // Save product's data and publish integration event through the Event Bus if price has changed
{
//Create Integration Event to be published through the Event Bus
var priceChangedEvent = new ProductPriceChangedIntegrationEvent(catalogItem.Id, productToUpdate.Price,
priceEntry.OriginalValue);

// Achieving atomicity between original Catalog database operation and the IntegrationEventLog thanks to a local transaction
await services.EventService.SaveEventAndCatalogContextChangesAsync(priceChangedEvent);

// Publish through the Event Bus and mark the saved event as published
await services.EventService.PublishThroughEventBusAsync(priceChangedEvent);
}
else // Just save the updated product because the Product's Price hasn't changed.
{
await services.Context.SaveChangesAsync();
}
return TypedResults.Created($"/api/catalog/items/{productToUpdate.Id}");
}

public static async Task<Created> CreateItem(


[AsParameters] CatalogServices services,
CatalogItem product)
{
var item = new CatalogItem
{
Id = product.Id,
CatalogBrandId = product.CatalogBrandId,
CatalogTypeId = product.CatalogTypeId,
Description = product.Description,
Name = product.Name,
PictureFileName = product.PictureFileName,
Price = product.Price,
AvailableStock = product.AvailableStock,
RestockThreshold = product.RestockThreshold,
MaxStockThreshold = product.MaxStockThreshold
};
item.Embedding = await services.CatalogAI.GetEmbeddingAsync(item);

services.Context.CatalogItems.Add(item);
await services.Context.SaveChangesAsync();

return TypedResults.Created($"/api/catalog/items/{item.Id}");
}

public static async Task<Results<NoContent, NotFound>> DeleteItemById(


[AsParameters] CatalogServices services,
int id)
{
var item = services.Context.CatalogItems.SingleOrDefault(x => x.Id == id);

if (item is null)
{
return TypedResults.NotFound();
}

services.Context.CatalogItems.Remove(item);
await services.Context.SaveChangesAsync();
return TypedResults.NoContent();
}

private static string GetImageMimeTypeFromImageFileExtension(string extension) => extension switch


{
21
".png" => "image/png",
".gif" => "image/gif",
".jpg" or ".jpeg" => "image/jpeg",
".bmp" => "image/bmp",
".tiff" => "image/tiff",
".wmf" => "image/wmf",
".jp2" => "image/jp2",
".svg" => "image/svg+xml",
".webp" => "image/webp",
_ => "application/octet-stream",
};

public static string GetFullPath(string contentRootPath, string pictureFileName) =>


Path.Combine(contentRootPath, "Pics", pictureFileName);
}

OrdersApi.cs
using Microsoft.AspNetCore.Http.HttpResults;
using CardType = eShop.Ordering.API.Application.Queries.CardType;
using Order = eShop.Ordering.API.Application.Queries.Order;

public static class OrdersApi


{
public static RouteGroupBuilder MapOrdersApiV1(this IEndpointRouteBuilder app)
{
var api = app.MapGroup("api/orders").HasApiVersion(1.0);

api.MapPut("/cancel", CancelOrderAsync);
api.MapPut("/ship", ShipOrderAsync);
api.MapGet("{orderId:int}", GetOrderAsync);
api.MapGet("/", GetOrdersByUserAsync);
api.MapGet("/cardtypes", GetCardTypesAsync);
api.MapPost("/draft", CreateOrderDraftAsync);
api.MapPost("/", CreateOrderAsync);

return api;
}

public static async Task<Results<Ok, BadRequest<string>, ProblemHttpResult>>


CancelOrderAsync(
[FromHeader(Name = "x-requestid")] Guid requestId,
CancelOrderCommand command,
[AsParameters] OrderServices services)
{
if (requestId == Guid.Empty)
{
return TypedResults.BadRequest("Empty GUID is not valid for request ID");
}

var requestCancelOrder = new IdentifiedCommand<CancelOrderCommand, bool>(command,


requestId);

services.Logger.LogInformation(
"Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
requestCancelOrder.GetGenericTypeName(),

22
nameof(requestCancelOrder.Command.OrderNumber),
requestCancelOrder.Command.OrderNumber,
requestCancelOrder);

var commandResult = await services.Mediator.Send(requestCancelOrder);

if (!commandResult)
{
return TypedResults.Problem(detail: "Cancel order failed to process.", statusCode:
500);
}

return TypedResults.Ok();
}

public static async Task<Results<Ok, BadRequest<string>, ProblemHttpResult>>


ShipOrderAsync(
[FromHeader(Name = "x-requestid")] Guid requestId,
ShipOrderCommand command,
[AsParameters] OrderServices services)
{
if (requestId == Guid.Empty)
{
return TypedResults.BadRequest("Empty GUID is not valid for request ID");
}

var requestShipOrder = new IdentifiedCommand<ShipOrderCommand, bool>(command,


requestId);

services.Logger.LogInformation(
"Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
requestShipOrder.GetGenericTypeName(),
nameof(requestShipOrder.Command.OrderNumber),
requestShipOrder.Command.OrderNumber,
requestShipOrder);

var commandResult = await services.Mediator.Send(requestShipOrder);

if (!commandResult)
{
return TypedResults.Problem(detail: "Ship order failed to process.", statusCode:
500);
}

return TypedResults.Ok();
}

public static async Task<Results<Ok<Order>, NotFound>> GetOrderAsync(int orderId,


[AsParameters] OrderServices services)
{
try
{
var order = await services.Queries.GetOrderAsync(orderId);
return TypedResults.Ok(order);
}
catch
{
return TypedResults.NotFound();
}
}

public static async Task<Ok<IEnumerable<OrderSummary>>> GetOrdersByUserAsync([AsParameters]


OrderServices services)
{
var userId = services.IdentityService.GetUserIdentity();
23
var orders = await services.Queries.GetOrdersFromUserAsync(userId);
return TypedResults.Ok(orders);
}

public static async Task<Ok<IEnumerable<CardType>>> GetCardTypesAsync(IOrderQueries


orderQueries)
{
var cardTypes = await orderQueries.GetCardTypesAsync();
return TypedResults.Ok(cardTypes);
}

public static async Task<OrderDraftDTO> CreateOrderDraftAsync(CreateOrderDraftCommand


command, [AsParameters] OrderServices services)
{
services.Logger.LogInformation(
"Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
command.GetGenericTypeName(),
nameof(command.BuyerId),
command.BuyerId,
command);

return await services.Mediator.Send(command);


}

public static async Task<Results<Ok, BadRequest<string>>> CreateOrderAsync(


[FromHeader(Name = "x-requestid")] Guid requestId,
CreateOrderRequest request,
[AsParameters] OrderServices services)
{

//mask the credit card number

services.Logger.LogInformation(
"Sending command: {CommandName} - {IdProperty}: {CommandId}",
request.GetGenericTypeName(),
nameof(request.UserId),
request.UserId); //don't log the request as it has CC number

if (requestId == Guid.Empty)
{
services.Logger.LogWarning("Invalid IntegrationEvent - RequestId is missing -
{@IntegrationEvent}", request);
return TypedResults.BadRequest("RequestId is missing.");
}

using (services.Logger.BeginScope(new List<KeyValuePair<string, object>> {


new("IdentifiedCommandId", requestId) }))
{
var maskedCCNumber = request.CardNumber.Substring(request.CardNumber.Length -
4).PadLeft(request.CardNumber.Length, 'X');
var createOrderCommand = new CreateOrderCommand(request.Items, request.UserId,
request.UserName, request.City, request.Street,
request.State, request.Country, request.ZipCode,
maskedCCNumber, request.CardHolderName, request.CardExpiration,
request.CardSecurityNumber, request.CardTypeId);

var requestCreateOrder = new IdentifiedCommand<CreateOrderCommand,


bool>(createOrderCommand, requestId);

services.Logger.LogInformation(
"Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
requestCreateOrder.GetGenericTypeName(),
nameof(requestCreateOrder.Id),
requestCreateOrder.Id,
requestCreateOrder);
24
var result = await services.Mediator.Send(requestCreateOrder);

if (result)
{
services.Logger.LogInformation("CreateOrderCommand succeeded - RequestId:
{RequestId}", requestId);
}
else
{
services.Logger.LogWarning("CreateOrderCommand failed - RequestId:
{RequestId}", requestId);
}

return TypedResults.Ok();
}
}
}

public record CreateOrderRequest(


string UserId,
string UserName,
string City,
string Street,
string State,
string Country,
string ZipCode,
string CardNumber,
string CardHolderName,
DateTime CardExpiration,
string CardSecurityNumber,
int CardTypeId,
string Buyer,
List<BasketItem> Items);

25
4.2 Testing Approach

Testing involves verifying the accuracy of gesture recognition under various conditions. The
following methodologies are employed:

 Unit Testing: Each component, such as the orderApi and user interface modules, is tested
individually.

 Integration Testing: The system is tested as a whole to ensure that all components work
together seamlessly.

 User Testing: Real users engage with the application, providing feedback on usability and
performance.

4.3 Test Cases:

Key test cases include:

 TC_01: Verify the system's ability to complete the journey from visiting the page to making
payment for product .

 TC_02: check for add to cart feature .

 TC_03: Assess the responsiveness of the application when switching between pages to pages.

26
5. DESIGN

27
28
29
6. Conclusion and
future work

Conclusion
In conclusion, the E-Commerce Clothing website represents a significant advancement
in the online shopping landscape, designed with the modern consumer in mind. By
prioritizing user-friendliness and accessibility, the platform offers a vast selection of
clothing that caters to diverse tastes and preferences, ensuring that shoppers can find
exactly what they need.

The streamlined shopping process minimizes the complexities often associated with
online retail, allowing customers to navigate effortlessly from browsing to checkout.
With a secure online payment system in place, users can shop with confidence, knowing
their transactions are safe and protected.

Overall, this innovative platform not only addresses the limitations of traditional retail
but also empowers customers to explore a world of fashion at their fingertips. By
enhancing convenience and providing a personalized shopping experience, the E-
Commerce Clothing website is poised to redefine how people shop for clothing, making
it a more enjoyable and efficient journey for everyone involved.

30
Future Work
Here are some points for improving the E-Commerce Clothing website in future work:

1. **Enhanced Personalization**: Implement advanced algorithms for personalized


recommendations based on user behavior, preferences, and previous purchases, making the
shopping experience more tailored.

2. **Augmented Reality (AR) Features**: Introduce AR technology that allows customers to


virtually try on clothes, helping them visualize how items will look before making a
purchase.

3. **Mobile App Development**: Create a dedicated mobile app to provide a more


optimized shopping experience for mobile users, featuring push notifications for sales and
new arrivals.

4. **Sustainable Options**: Incorporate a dedicated section for sustainable and eco-friendly


clothing brands, appealing to environmentally conscious consumers.

5. **Customer Reviews and Ratings**: Enhance the product pages with more robust
customer reviews and ratings, including images from users to build trust and provide real-life
insights.

6. **Loyalty Programs**: Implement a loyalty rewards program that offers points for
purchases, referrals, and reviews, incentivizing repeat business and customer engagement.

7. **Social Media Integration**: Enhance social media integration for easy sharing of
products, and create social shopping features that allow users to browse based on trends and
influencers.

8. **Live Chat Support**: Introduce a live chat feature for real-time customer support,
addressing inquiries and issues quickly to improve customer satisfaction.

9. **Data Analytics**: Utilize data analytics to track customer behavior and preferences,
enabling continuous improvement of the website's offerings and marketing strategies.

10. **User-Generated Content**: Encourage customers to share their outfits on social media,
showcasing how they style purchased items, which can foster community engagement and
provide inspiration to other shoppers.

31
7. REFERENCES

32
Chapter 7
REFERENCES

Refer 1 https://learn.microsoft.com/en-us/previous-versions/aspnet/mt174857(v=vs.118)

Refer 2 https://learn.microsoft.com/en-us/openspecs/sql_standards/ms-sqlstandlp/89fb00b1-
4b9e-4296-92ce-a2b3f7ca01d2

Refer 3 https://getbootstrap.com/docs/4.3/getting-started/introduction/

Refer 4 https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/

33

You might also like