Files
bartool fb08705883 feat: Implement initial structure for Directus Mayo API extension
- Added main router in src/index.js to register endpoints.
- Implemented GET /mayo-api/products to fetch product list with pagination and filters.
- Implemented GET /mayo-api/dictionaries to fetch various dictionaries for frontend use.
- Created separate files for routes, repositories, serializers, and utilities to maintain clean architecture.
- Added utility functions for async handling, pagination, and order search parsing.
- Introduced serializers for products and dictionaries to format data for frontend consumption.
- Established repository functions for database queries related to products and dictionaries.
- Updated package.json to include license information.
- Created documentation for the API extension detailing current state and future implementation plans.
2026-05-20 22:38:51 +02:00

57 lines
1.6 KiB
HTTP

@baseUrl = https://bartool.ovh/dpm-api
@token = _gEp4JyW6uBY7xyKVDo2vKUtCLfPGr3D
### Health check - Directus server
GET {{baseUrl}}/server/health
### Logowanie
# @name login
POST {{baseUrl}}/auth/login
Content-Type: application/json
{
"email": "bartoolina@gmail.com",
"password": "20madafaka"
}
###
@auth_token = {{login.response.body.data.access_token}}
### Mayo API - products
GET {{baseUrl}}/mayo-api/products
Authorization: Bearer {{auth_token}}
### Mayo API - products with pagination
GET {{baseUrl}}/mayo-api/products?limit=30&offset=0
Authorization: Bearer {{auth_token}}
### Mayo API - products by order search
# orderSearch is a JSON string. This example matches order number 0143/2025/1.
GET {{baseUrl}}/mayo-api/products?search=0143/2025/1&orderSearch=[{"raw":"0143/2025/1","type":"fullOrderId","match":"exact","orderNumber":143,"orderNumberPrefix":null,"orderYear":2025,"orderIndex":1}]
Authorization: Bearer {{auth_token}}
### Mayo API - products by year
GET {{baseUrl}}/mayo-api/products?year=2025
Authorization: Bearer {{auth_token}}
### Mayo API - products by model id
GET {{baseUrl}}/mayo-api/products?model=2
Authorization: Bearer {{auth_token}}
### Mayo API - products by client id
GET {{baseUrl}}/mayo-api/products?client=1
Authorization: Bearer {{auth_token}}
### Mayo API - products by production list id
GET {{baseUrl}}/mayo-api/products?productionList=1
Authorization: Bearer {{auth_token}}
### Mayo API - products by finish
GET {{baseUrl}}/mayo-api/products?finish=MAT
Authorization: Bearer {{auth_token}}
### Mayo API - dictionaries
GET {{baseUrl}}/mayo-api/dictionaries
Authorization: Bearer {{auth_token}}