Here is a summary of all the API endpoints needed for the StokFlow application, organized in a table format suitable for use in Notion. The table includes the method, endpoint path, description, and whether the endpoint uses authentication and pagination.
Method | Endpoint | Description | Auth | Pagination | Status |
---|---|---|---|---|---|
POST | /api/auth/login |
Login and receive access token | ❌ No | ❌ No | Done |
GET | /api/products |
Get all products | ✅ Yes | ✅ Yes | Done |
GET | /api/products/:id |
Get product detail by ID | ✅ Yes | ❌ No | Done |
POST | /api/products |
Create a new product | ✅ Yes | ❌ No | Done |
PUT | /api/products/:id |
Update product by ID | ✅ Yes | ❌ No | Done |
DELETE | /api/products/:id |
Delete product by ID | ✅ Yes | ❌ No | Done |
GET | /api/transactions |
Get all transactions | ✅ Yes | ✅ Yes | Done |
GET | /api/transactions/:id |
Get transaction detail by ID | ✅ Yes | ❌ No | Done |
POST | /api/transactions |
Create a transaction (SALE or PURCHASE) | ✅ Yes | ❌ No | Done |
PATCH | /api/transactions/:id |
Update transaction attributes (username and note) | ✅ Yes | ❌ No | Done |
DELETE | /api/transactions/:id |
Delete a transaction by ID (soft delete) | ✅ Yes | ❌ No | Done |
GET | /api/transactions/:id/items |
Get all items in a transaction | ✅ Yes | ❌ No | Done |
POST | /api/transactions/:id/items |
Add items to a transaction | ✅ Yes | ❌ No | Done |
PUT | /api/transactions/:id/items/:itemId |
Update a transaction item by ID | ✅ Yes | ❌ No | Done |
DELETE | /api/transactions/:id/items/:itemId |
Delete a transaction item | ✅ Yes | ❌ No | Done |
GET | /api/stock-movements |
Get all stock movement logs | ✅ Yes | ✅ Yes | Done |
GET | /api/products/:id/history |
Get stock movement history of a product | ✅ Yes | ✅ Yes | Done |
GET | /api/stock-movements/low-stock-alerts |
Get low stock notifications | ✅ Yes | ✅ Yes | Done |
GET | /api/audit-stock |
Audit current stock levels | ✅ Yes | ✅ Yes | Done |
GET | /api/users/profile |
Get logged-in user profile | ✅ Yes | ❌ No | Optional |
Silakan beri tahu jika kamu ingin tambahan untuk fitur filter, sort, atau bulk action.