Coder Social home page Coder Social logo

bangazon-api-green-monkeys's People

Contributors

aborgra avatar adamsheaffer avatar jamesnitz avatar namitamanohar avatar wggreen avatar

Watchers

 avatar  avatar  avatar

Forkers

jamesnitz wggreen

bangazon-api-green-monkeys's Issues

Allow developers to access the Order resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get orders made by customer api/orders?customerId={customer Id} GET Order Array
Get order by order ID api/orders/{id} GET Order Object
Get customer's shopping cart api/orders?customerId={customerId}&cart=true GET Order Object w/ Product Array
Add a product to shopping cart api/orders POST CustomerProduct Object Order Object
Purchase order in cart** api/orders/{id} PUT Order Object**
Remove product from cart api/orders/{orderId}/products{productId} DELETE

* Order objects that have a payment method that isn't NULL are considered complete and processed. An order that does not have a payment type would be considered a user's shopping cart. A user can have only one shopping cart, and therefore will only have a maximum of one Order record in the database with a NULL payment type at a given time.

** To purchase an order, update the Order object's userPaymentId property

JSON Order Object

{
    "id": 1575559407665,
    "customerId": 1575559407787,
    "userPaymentId": null
}

JSON CustomerProduct Object

{
    "customerId": 1575559407787,
    "productId": 1575501970208
}

Allow developers to access the Product resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all products api/products GET Product Array
Search products by name api/products?q={searchTerm} GET Product Array
Sort products by most recent api/products?sortBy=recent GET Product Array
Sort products by popularity api/products?sortBy=popularity GET Product Array
Add a new product api/products POST Product Object Product Object
Update a product api/products/{id} PUT Product Object Product Object
Remove a product api/products/{id} DELETE

JSON Product Object

{
    "id": 15755594079867,
    "productTypeId": 1575501970045,
    "customerId": 1575559407755,
    "price": 62.54,
    "description": "pede ullamcorper augue a suscipit nulla elit ac nulla sed",
    "title": "Murciélago LP640",
    "dateAdded": "2018-12-25T00:00:00.000Z"
}

NOTES

  • If the query string parameter ?sortBy=recent is provided in the URL when querying a list of products, then all of the products that were most recently created should appear first.
  • If the query string parameter q is provided in the URL when querying a list of products, then all of the products whose Title or Description includes the search parameter should be returned.
    For example: If the query string parameter ?q=tank is provided in the URL when querying a list of products, then all products that have the word "tank" in their title or description should be returned.
  • When a new product gets added, the DateAdded property should be set by the server to the current DateTime

Allow developers to access the Department resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all departments api/departments GET Department Array
Get department by Id api/departments/{id} GET Department Object
Get department with employees api/departments/{id}?include=employees GET Department Array w/ Employees
Add a department api/departments POST Department Object Department Object
Update a department api/departments/{id} PUT Department Object Department Object

JSON Department Object

{
    "id": 1575559403194,
    "name": "Accounting",
    "budget": 1230000
}

Allow developers to access the TrainingProgram resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get upcoming training programs api/trainingPrograms GET TrainingProgram Array
Get training program by Id api/trainingPrograms/{id} GET TrainingProgram Object w/ Employees
Add training program api/trainingPrograms POST TrainingProgram Object Training Program Object
Add employee to training program api/trainingPrograms/{id}/employees POST Employee Object TrainingProgram Object w/ Employees
Update training program api/trainingPrograms/{id} PUT TrainingProgram Object TrainingProgram Object
Remove training program api/trainingPrograms/{id} DELETE
Remove employee from program api/trainingPrograms/{id}/employees/{employeeId} DELETE

JSON TrainingProgram Object

{
    "id": 1575559403194,
    "name": "GIS Application",
    "startDate": "2020-09-25T00:00:00.000Z",
    "endDate": "2020-10-05T00:00:00.000Z",
    "maxAttendees": 45
}

NOTES

  • The api/trainingPrograms route should only include training programs that are upcoming. It should not include any programs in the past
  • When getting a single training program by Id, the json response should always include the list of employees that are currently enrolled in the program.
  • When added a new training program, the start date must be in the future and the end date must be after the start date

Allow developers to access the Customer resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all customers api/customers GET Customer Array
Search for customer api/customers?q={someSearchTerm} GET Customer Array
Get customer by Id api/customers/{id} GET Customer Object
Get customer and include product listings api/customers/{id}?include=products GET Customer Object w/ Products Array
Add a customer api/customers POST Customer Object Customer Object
Update a customer api/customers/{id} PUT Customer Object Customer Object
Make customer inactive api/customer/{id} DELETE***

***This should be a soft delete. Meaning you should not actually delete the customer from the database. There is an Active column on the customer table that should be set to false.

JSON Customer Object

{
    "id": 1575559407787,
    "active": true,
    "createdDate": "2019-08-25T00:00:00.000Z",
    "firstName": "Nathanael",
    "lastName": "Laverenz",
    "address": "401 Nunya Business Dr",
    "city": "Herman",
    "state": "New York",
    "email": "[email protected]",
    "phone": "6151237584"
}

NOTES

  • Results from GET requests should not include customers that have been soft deleted.
  • If the query string parameter of q is provided when querying the list of customers, then any customer that has a first or last name that matches the pattern should be returned. For example: If /customers?q=mic is requested, then any customer whose first name is Michelle, or Michael, or Domicio should be returned. Any customer whose last name is Michaelangelo, or Omici, Dibromic should be returned.
  • When a new customer is being added, the customer's DateCreated property should be set to the current DateTime

Allow developers to access the ProductType resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all product types api/productTypes GET ProductType Array
Get product type by Id api/productTypes/{id} GET ProductType Object
Get product type with products api/productTypes/{id}?include=products GET ProductType Object w/ Product Array
Add a product type api/productTypes POST ProductType Object ProductType Object
Update a product type api/productTypes/{id} PUT ProductType Object ProductType Object

JSON ProductType Object

{
    "id": 1575501970045,
    "name": "Accessories"
}

Allow developers to access the Employee resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all employees api/employees GET Employee Array
Get employee by Id api/employees/{id} GET Employee Object w/ Computer Object
Search for employee by name api/employees?firstName=John&lastName=Smith GET Employee Array
Add an employee api/employees POST Employee Object Employee Object
Update an employee api/employees/{id} PUT Employee Object Employee Object

JSON Employee Object

{
      "id": 1575501974624,
      "firstName": "Adam",
      "lastName": "Sheaffer",
      "departmentId": 1575559403192,
      "isSupervisor": false,
      "computerId": 1575566566333,
      "email": "[email protected]"
}

JSON Employee Object w/ Computer

{
      "id": 1575501974624,
      "firstName": "Adam",
      "lastName": "Sheaffer",
      "departmentId": 1575559403192,
      "isSupervisor": false,
      "computerId": 1575566566333,
      "computer": {
            "id": 1575566566333,
            "purchaseDate": "2016-01-01T23:28:56.782Z",
            "decomissionDate": null,
            "make": "Apple",
            "model": "Macbook Pro"
      },
      "email": "[email protected]"
}

NOTES

  • When getting a single employee by Id, the employee's computer should always be included in the json response

Allow developers to access the PaymentType resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all payment types api/paymentTypes GET PaymentType Array
Get payment type by id api/paymentTypes/{id} GET PaymentType Object
Add new payment type api/paymentTypes POST PaymentType Object PaymentType Object
Remove a payment type api/paymentTypes/{id} DELETE***

***This should be a soft delete. Instead of deleting a payment type record from the database, the payment type's Active property should be changed to False

JSON PaymentType Object

{
    "id": 1575501974871,
    "name": "Mastercard",
    "active": true
}

NOTES

  • Any payment types that have been soft deleted should not show up when making a GET request.

Allow developers to access the Computer resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get all computers api/computers GET Computer Array
Get available computers api/computers?available=true GET Computer Array
Get unavailable computers api/computers?available=false GET Computer Array
Get computer by Id api/computers/{id} GET Computer Object
Add computer api/computers POST Computer Object Computer Object
Update computer record api/computers/{id} PUT Computer Object Computer Object
Delete a computer record api/computers/{id} DELETE

JSON Computer Object

{
    "id": 1575566566333,
    "purchaseDate": "2016-01-01T23:28:56.782Z",
    "decomissionDate": null,
    "make": "Apple",
    "model": "Macbook Pro"
}

NOTES

  • A computer is considered available if it is not currently assigned to an employee and it does not have a DecomissionDate
  • A computer cannot be deleted if it is currently assigned to an employee. If a user tries to delete a computer that is assigned to an employee, the API should return a 403 Forbidden status code

Allow developers to access the UserPaymentType Resource

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get a customer's payment options api/userPaymentTypes?customerId={customer id} GET UserPaymentType Array
Add a payment option for customer api/userPaymentTypes POST UserPaymentType Object UserPaymentType Object
Update customer payment option api/userPaymentTypes/{id} PUT UserPaymentType Object UserPaymentType Object
Remove customer payment option api/userPaymentTypes/{id} DELETE***

***This should be a soft delete. Meaning you should not actually delete the customer from the database. There is an Active column on the UserPaymentType table that should be set to False.

JSON UserPaymentType Object

{
    "id": 1575501978463,
    "customerId": 1575559407787,
    "paymentTypeId": 1575501974871,
    "acctNumber": "2234 56789 0123",
    "active": true
}

NOTES

  • Records that have been soft deleted should not be included in results when making GET requests

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.