This project is about to managing material,stock, supplier and category with multiple DB relations such as ManyToMany
and OneToMany
which ables you to create and updating material's info
such as stock and whatever like that also creating new Category
and new Suppllier
, note that before creating material you shoould create one supplier and category to get category and supplier ID
Framework: NestJs
DB: Postgres
ORM: Prisma
Endpoint: localhost://3000/material
Method: POST
Sample of body: {
"name": "cucubmber",
"categoryId": "a0211c3e-cfd0-4479-9cb7-f87000950efa", // get category ID from category API
"stock": 1800,
"symbol": "CU",
"supplierId": "fb6ecb7f-421e-49ee-b869-ea774961dfca" // get supplier ID from supplier API
}
Endpoint: localhost://3000/material/{materialID}
Method: PATCH
Sample of body: {
"name": "New name of material",
"stock": 1200
}
Endpoint: localhost://3000/material
Method: GET
Endpoint: localhost://3000/material/{materialID}
Method: GET
Endpoint: localhost://3000/supplier
Method: POST
Sample of bydy {
name: 'Sample Supplier'
}
Endpoint: localhost://3000/category
Method: POST
Sample of bydy {
name: 'Sample Category'
}
Endpoint: localhost://3000/category
Method: GET
Endpoint: localhost://3000/supplier
Method: GET
npx prisma migrate dev {migration name}
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod