GithubHelp home page GithubHelp logo

nanny-nina-assessment's Introduction

Nanny Nina Assessment

According to assessment's description, the system is designed in such a way that it can filter any field with any condition.

Filtering

URL parameters is the most flexible and simple way to add basic/complicated filtering to REST APIs.
Using query string array for conditions benefits:

  • Flexibility to implement any type of conditions.
  • Ease of use for clients.
  • Simple to parse on server side.

Examples:

  • GET /api/users Retrieve all users' data
  • GET /api/users?filters[]=name like ja% Retrieve users names starts with 'ja'
  • GET /api/users?filters[]=name like ja%&filters[]=age <= 25 Retrieve users names starts with 'ja' and age less than or equal to 25
  • GET /api/users?filters[]=age > 10&filters[]=age <= 25 Retrieve users with age greater than 10 and age less than or equal to 25
  • GET /api/users?filters[]=name like %a%&filters[]=age>25&filters[]=relationship=Engaged Retrieve users names contains 'a' and age greater than 25 that has Engaged relationship

Condition Operators

Operator Description
LIKE Filter for a specified string pattern
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to
!= Not equal to

Database Diagram

Database Diagram

Tasks

  • Update User Model (migration, factory, seeder, unit test)
  • Create Extra Models (migration, factory, seeder, unit test)
  • Create Relation (unit test, diagram)
  • Migrate and Seed the Database
  • Implement Filterable Mechanism
  • Add Controller and Route
  • Manual Testing (outputs)
  • Write Documentation (readme)

nanny-nina-assessment's People

Contributors

hamidrdn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.