这是indexloc提供的服务,不要输入任何密码
Skip to content

Samuel-Jonas/develop-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Getting Ready - Local

⚠️ Warning: The current instructions were executed in a Ubuntu 22.04 Linux OS, so for Windows or MacOS those would be a bit different.

  1. Clone this repository
git clone https://github.com/Samuel-Jonas/develop-store.git
  1. PostgreSQL database must be running correctly and you must have the credentials. Run the command below to create a new database:
docker run -d --name ambev_developer_evaluation_database_dev -e POSTGRES_DB=developer_evaluation -e POSTGRES_USER=developer -e POSTGRES_PASSWORD=ev@luAt10n -p 5432:5432 -v ambev_pg_data:/var/lib/postgresql/data --restart unless-stopped postgis/postgis:13-3.5
  1. Configure your credentials at template/backend/src/Ambev.DeveloperEvaluation.WebApi/appsettings.json. The command above already match the same credentials in the file.
  2. Migrate the current scheme into database running this command from the src folder:
dotnet ef database update --project ./Ambev.DeveloperEvaluation.ORM --startup-project ./Ambev.DeveloperEvaluation.WebApi
  1. Statup Ambev.DeveloperEvaluation.WebApi: http project
  2. Open browser at http://localhost:5119/swagger/index.html
  3. Consume the api scheme provided by Swagger





Developer Evaluation Project

READ CAREFULLY

Instructions

The test below will have up to 7 calendar days to be delivered from the date of receipt of this manual.

  • The code must be versioned in a public Github repository and a link must be sent for evaluation once completed
  • Upload this template to your repository and start working from it
  • Read the instructions carefully and make sure all requirements are being addressed
  • The repository must provide instructions on how to configure, execute and test the project
  • Documentation and overall organization will also be taken into consideration

Use Case

You are a developer on the DeveloperStore team. Now we need to implement the API prototypes.

As we work with DDD, to reference entities from other domains, we use the External Identities pattern with denormalization of entity descriptions.

Therefore, you will write an API (complete CRUD) that handles sales records. The API needs to be able to inform:

  • Sale number
  • Date when the sale was made
  • Customer
  • Total sale amount
  • Branch where the sale was made
  • Products
  • Quantities
  • Unit prices
  • Discounts
  • Total amount for each item
  • Cancelled/Not Cancelled

It's not mandatory, but it would be a differential to build code for publishing events of:

  • SaleCreated
  • SaleModified
  • SaleCancelled
  • ItemCancelled

If you write the code, it's not required to actually publish to any Message Broker. You can log a message in the application log or however you find most convenient.

Business Rules

  • Purchases above 4 identical items have a 10% discount
  • Purchases between 10 and 20 identical items have a 20% discount
  • It's not possible to sell above 20 identical items
  • Purchases below 4 items cannot have a discount

These business rules define quantity-based discounting tiers and limitations:

  1. Discount Tiers:

    • 4+ items: 10% discount
    • 10-20 items: 20% discount
  2. Restrictions:

    • Maximum limit: 20 items per product
    • No discounts allowed for quantities below 4 items

Overview

This section provides a high-level overview of the project and the various skills and competencies it aims to assess for developer candidates.

See Overview

Tech Stack

This section lists the key technologies used in the project, including the backend, testing, frontend, and database components.

See Tech Stack

Frameworks

This section outlines the frameworks and libraries that are leveraged in the project to enhance development productivity and maintainability.

See Frameworks

Project Structure

This section describes the overall structure and organization of the project files and directories.

See Project Structure

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages