Coder Social home page Coder Social logo

customer-manager's People

Contributors

dependabot[bot] avatar radekska avatar

Watchers

 avatar  avatar

customer-manager's Issues

implement REST API for /api/customers*

There will be three models on which the API will be based.
image

Both purchase and repair models have a one-to-many relationship with a customer.

Endpoints:

  • /api/customers

    • GET /api/customers - return list of customers #17
      query parameters: limit TODO
    • POST /api/customers - create new customer #20
      accept json
  • /api/customers/<customer_id>

    • GET /api/customers/<customer_id> - return customer details #24
    • PUT /api/customers/<customer_id> - edit customer details #25
    • DELETE /api/customers/<customer_id> - delete customer and all it's relations #27
  • /api/customers/<customer_id>/purchases

    • GET /api/customers/<customer_id>/purchases return list of purchases - #29
      query parameters: search, limit, filter TODO
    • POST /api/customers/<customer_id>/purchases create new purchase
      accept json - #37
  • /api/customers/<customer_id>/purchases/<purchase_id>
    - GET /api/customers/<customer_id>/purchases/<purchase_id> - return purchase details

    • PUT /api/customers/<customer_id>/purchases/<purchase_id> - edit purchase details - #40
    • DELETE /api/customers/<customer_id>/purchases/<purchase_id> - delete purchase details - #39
  • /api/customers/<customer_id>/repairs

    • GET /api/customers/<customer_id>/repairs return list of repairs
      query parameters: search, limit, filter
    • POST /api/customers/<customer_id>/repairs create new repair
      accept json
  • /api/customers/<customer_id>/repairs/<repair_id>

    • GET /api/customers/<customer_id>/repair/<repair_id> - return repair details
    • PUT /api/customers/<customer_id>/repair/<repair_id> - edit repair details
    • DELETE /api/customers/<customer_id>/repair/<repair_id> - delete repair details

handle duplicated key not allowed in API response

2023/06/18 07:02:45 /home/appuser/app/repositories/customers.go:26 duplicated key not allowed
[8.628ms] [rows:0] INSERT INTO `customers` (`id`,`first_name`,`last_name`,`telephone_number`,`created_at`,`updated_at`) VALUES ('0acac6a1-1db6-46d6-85c5-f3d2a22a5203','Ra
dosław','Skałbania','509648347','2023-06-18 07:02:45.017','2023-06-18 07:02:45.017')
07:02:44 | 500 |     9ms |      172.18.0.2 | POST    | /api/customers                                    | duplicated key not allowed

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.