4. Source Documentation - Gluzberg/cart-api GitHub Wiki
Content
Projects
CartAPI
-
This is an MVC web applications and is the start project of the solution.
-
The project contains two main Controllers:
-
TokenController
- Implements the token issuing API which is specified here: 2. Token API Specification -
CartController
- Implements the cart managing API which is specified here: 3. Cart API Specification
-
-
The services for the DI are registered in the
ConfigureServices
method of theStartup
class.
Interfaces Projects
CartAPI.Data
- Defines interfaces of the data models for the API parameters and responses:
IUser
- Login data parameterIAuthorizartion
- Token data responseICart
- Cart ID and a collection ofIProduct
IProduct
- Product ID and and its amount
CartAPI.Repository
- Defines interfaces for the abstraction of the data storage functionality:
IUserRepository
- Valid user credentialsICartRepository
- Carts with Products
CartAPI.Service
- Defines interfaces of the main services used by the API controllers and their parameters and results data types:
IUserService
- Valid user credentialsICartService
- Carts and Products
Implmentation Projects
CartAPI.Data.Imp
- Simple implementation of the data models from CartAPI.Data
CartAPI.Repository.Imp
- In-memory implementation of repositories from data models from CartAPI.Repository
- For demo purposes the User Repository is initialized with a test user.
CartAPI.Service.Imp
- Implementation of the services in CartAPI.Service using the repositories from CartAPI.Repository:
TokenService
- issues a token for valid credentials that exist in theIUserRepositiry
CartService
- manages the cart actions with the storage inICartRepositiry
Test Projects
CartAPI.Controllers.Tests
- Implements tests for the Controllers from CartAPI and all of their actions:
TokenControllerTests
CartControllerTests