Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

roman-bilyak/Upwork.TaskService

Repository files navigation

Upwork TaskService

Yet another test project for UpWork client. Stored just for history.

Requirements

Candidate should have the appropriate IDE installed. Visual Studio 2019 or later (Windows), Visual Studio for Mac 2019 or later (MacOS)

Assignment - 1 Develop a very simple RESTful application that demonstrates the ability to

  • Add a new Task

  • Update Tasks that already exist. 

Overall Requirements

  • Visual Studio 2019 or Visual Studio 2022 should be used to build the application

  • The application should be written as an ASP.Net Core Web API application (ASP.Net Core 6)

  • If a database is used, please use SQL Server 2017 or 2019

  • Use stored procedures not an ORM such as entity framework.

  • Unit tests should be used to run the application (create or update)

Task Requirements

  • When creating a Task, the Due Date cannot be in the past

  • The due date cannot be on a Holiday or weekend.

  • The system should not have more than 100 High Priority tasks which have the same due date and are not finished

  • The domain should include the following:

    • Id

    • Name

    • Description

    • Due Date

    • Start Date

    • End Date

    • Priority (High, Medium, Low)

    • Status (New, In Progress, Finished)

Concepts to Consider

  • Test Driven Development (TDD)

  • Dependency Injection (DI)

  • Domain Driven Design (DDD)

Submitting the Application

  • Please include a README file with the application that explains how to compile, configure, and run the application – including how to initialize the DB with SQL scripts if used.

  • Once we receive the zip file and unzip, we should be able to open the solution with Visual Studio, compile and run the unit tests.

How to run

Database initialization

Use Upwork.TaskService.Database/Upwork.TaskService.Database.publish.sql script to create and initialize database.

The script will create database, tables, stored procedures and functions. Also it will automatically populate missed data (ex.: list of holidays, dictionaries of priorities and statuses).

Note: This script was generated by Visual Studio and can be easly apply to database using SQL Server Management Studio and enabled SQLCMD mode. To enable this mode click the 'SQLCMD Mode' option under the 'Query' menu. If you have trouble running this script using SQLCMD, simply create the database manually and apply all sql commands bellow of command 'USE [$(DatabaseName)]' on it.

Database configuration

Check and correct the connection strings in the following configuration files:

  • Upwork.TaskService.Api/appsettings.json
  • Upwork.TaskService.Tests/appsettings.Test.json

Set values for ConnectionStrings.TaskServiceDb key:

"ConnectionStrings": {
    "TaskServiceDb": "Server=(LocalDb)\\MSSQLLocalDB;Database=TaskServiceDb;Trusted_Connection=True;MultipleActiveResultSets=true"
}

Run of web API application

  1. Open Upwork.TaskService.sln using Visual Studio.
  2. Select Upwork.TaskService.Api project.
  3. Click Build | Build Solution to build the project.
  4. Press F5 to run the project.
  5. Visual Studio will open url https://localhost:7097/swagger/index.html in browser.
  6. Run API requests manually using Swagger UI.

Run unit tests

  1. Open Upwork.TaskService.sln using Visual Studio.
  2. Select Upwork.TaskService.Tests project.
  3. Click 'Run Tests' option from context menu.
  4. Open 'Test Explorer' to see the tests running progress (Visual Studio: menu Test → Test Explorer).

Note: I used NUnit framework for writing unit tests.

Tools and libraries

  1. Visual Studio Community 2022 v17.4.4
  2. SQL Server Management Studio v15.0.18206.0
  3. SQL Server 2019 v15.0.4153.1
  4. Asp.Net Core 6
  5. .NET 6
  6. NUnit v3.13.3
  7. FluentValidation v11.4.0
  8. AutoMapper v12.0.1

To Do

  1. Optimaze population of tblHoliday table.

Note: Folder Upwork.TaskService.Screens contain explanation screens

About

Demo project for Upwork client

Resources

Stars

Watchers

Forks