fix products listing

This commit is contained in:
2026-03-27 23:17:21 +01:00
parent ec05101037
commit 9ec329b1d6
429 changed files with 9816 additions and 3774 deletions

View File

@@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "b2b API",
"description": "Authentication, user management, and repository time tracking API\n\n## Filter Operators\nAll filter parameters support the following operators by adding a suffix to the parameter name:\n\n| Suffix | Operator | Example |\n|--------|----------|---------|\n| `_eq` | equals | `product_id_eq=12` |\n| `_neq` | not equals | `active_neq=0` |\n| `_gt` | greater than | `price_gt=100` |\n| `_gte` | greater than or equal | `price_gte=10` |\n| `_lt` | less than | `price_lt=500` |\n| `_lte` | less than or equal | `price_lte=500` |\n| `_in` | IN (comma-separated) | `product_id_in=1,2,3,4` |\n\n## Special Filters\n\n| Parameter | Example | Description |\n|-----------|---------|-------------|\n| `name=~text` | `name=~gold` | LIKE search (case-insensitive partial match) |\n| `price=[min,max]` | `price=[100,500]` | BETWEEN range (inclusive) |\n| `sort=field,direction` | `sort=price,desc` | ORDER BY clause (direction: asc/desc, default: desc) |\n| `p` | `p=1` | Page number (1-based, default: 1) |\n| `elems` | `elems=30` | Elements per page (max: 100, default: 30) |",
"description": "Authentication, user management, and repository time tracking API\n\n## Filtering\nAll filter parameters support the following operators by adding a suffix to the parameter name:\n\n### Comparison Operators\n\n| Suffix | Operator | Example | Description |\n|--------|----------|---------|-------------|\n| `_eq` | = | `product_id_eq=12` | Equals |\n| `_neq` | != | `active_neq=0` | Not equals |\n| `_gt` | > | `price_gt=100` | Greater than |\n| `_gte` | >= | `price_gte=10` | Greater than or equal |\n| `_lt` | < | `price_lt=500` | Less than |\n| `_lte` | <= | `price_lte=500` | Less than or equal |\n| `_in` | IN | `product_id_in=1,2,3,4` | IN clause (comma-separated values) |\n\n### Special Filters\n\n| Filter | Example | Description |\n|--------|---------|-------------|\n| `~` prefix | `name=~gold` | LIKE search - case-insensitive partial match on string values |\n| `[min,max]` | `price=[100,500]` | BETWEEN range - filters values between min and max (inclusive) |\n| `sort` | `sort=price,desc` | ORDER BY clause - field name and direction (asc/desc, default: desc) |\n| `p` | `p=1` | Page number - 1-based pagination (default: 1) |\n| `elems` | `elems=30` | Elements per page - results per page (max: 100, default: 30) |\n\n### Available Fields for Filtering\n\n**Products (`/api/v1/restricted/list-products/get-listing`):**\n\n| Field | Type | Example |\n|-------|------|---------|\n| `product_id` | integer | `product_id_eq=12`, `product_id_in=1,2,3` |\n| `name` | string | `name=~gold` (LIKE search) |\n| `reference` | string | `reference=ABC123` |\n| `category_name` | string | `category_name=~electronics` |\n| `id_category` | integer | `id_category_eq=5`, `id_category_in=1,2,3` |\n| `quantity` | integer | `quantity_gt=0` |\n| `variants_number` | integer | `variants_number_gte=1` |",
"version": "1.0.0",
"contact": {
"name": "API Support",
@@ -42,7 +42,7 @@
},
{
"name": "Search",
"description": "MeiliSearch endpoints (under /api/v1/restricted/meili-search, requires authentication)"
"description": "MeiliSearch endpoints (under /api/v1/restricted/search, requires authentication)"
},
{
"name": "Locale",
@@ -585,27 +585,21 @@
}
}
},
"/api/v1/restricted/meili-search/settings": {
"get": {
"/api/v1/restricted/search/settings": {
"post": {
"tags": ["Search"],
"summary": "Get MeiliSearch settings",
"description": "Returns MeiliSearch configuration and settings. Requires authentication.",
"description": "Returns MeiliSearch index configuration and settings. Requires authentication.",
"operationId": "getMeiliSearchSettings",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "Settings retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
"description": "Settings retrieved successfully"
},
"401": {
"description": "Not authenticated",
@@ -628,7 +622,8 @@
"operationId": "getMe",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -668,7 +663,8 @@
"operationId": "updateChoice",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -823,18 +819,19 @@
"get": {
"tags": ["Products"],
"summary": "Get product listing",
"description": "Returns a paginated list of products with their basic information. Supports filtering via query parameters with operators (e.g., product_id_eq=12, name=~wałek). Use sort parameter for ordering. Requires authentication.",
"description": "Returns a paginated list of products with their basic information. Supports filtering via query parameters with operators (e.g., product_id_eq=12, name=~wałek, quantity_gt=0). Use sort parameter for ordering. Requires authentication.\n\n### Filterable Fields\n- `product_id` - Product ID (integer)\n- `name` - Product name (string, supports LIKE with ~ prefix)\n- `reference` - Product reference (string)\n- `category_name` - Category name (string, supports LIKE with ~ prefix)\n- `id_category` - Category ID (integer)\n- `quantity` - Stock quantity (integer)\n- `variants_number` - Number of variants (integer)\n\n### Example Requests\n```\nGET /api/v1/restricted/list-products/get-listing?product_id_eq=12\nGET /api/v1/restricted/list-products/get-listing?name=~wałek&sort=price,asc\nGET /api/v1/restricted/list-products/get-listing?quantity_gt=0&elems=50&p=2\n```",
"operationId": "getProductListing",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
{
"name": "p",
"in": "query",
"description": "Page number (1-based)",
"description": "Page number (1-based, default: 1)",
"required": false,
"schema": {
"type": "integer",
@@ -854,66 +851,12 @@
{
"name": "sort",
"in": "query",
"description": "Sort field and direction. Format: field,direction (e.g., 'product_id,desc' or 'name,asc')",
"description": "Sort order: field,direction (direction: asc/desc, default: desc). Sortable fields: product_id, name, reference, category_name, id_category, quantity, variants_number",
"required": false,
"schema": {
"type": "string",
"example": "product_id,desc"
}
},
{
"name": "product_id",
"in": "query",
"description": "Filter by product ID. Use suffix _eq, _gt, _gte, _lt, _lte, _neq, _in for operators.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "name",
"in": "query",
"description": "Filter by product name using LIKE (case-insensitive). Use ~ prefix for partial match (e.g., '~wałek')",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "reference",
"in": "query",
"description": "Filter by product reference using LIKE (case-insensitive)",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "id_category",
"in": "query",
"description": "Filter by category ID. Use suffix _eq, _gt, _gte, _lt, _lte, _neq, _in for operators.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "category_name",
"in": "query",
"description": "Filter by category name using LIKE (case-insensitive)",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "quantity",
"in": "query",
"description": "Filter by quantity. Use suffix _eq, _gt, _gte, _lt, _lte for operators.",
"required": false,
"schema": {
"type": "integer"
}
}
],
"responses": {
@@ -958,7 +901,8 @@
"operationId": "getProductDescription",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
@@ -1025,7 +969,8 @@
"operationId": "saveProductDescription",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
@@ -1102,7 +1047,8 @@
"operationId": "translateProductDescription",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
@@ -1189,7 +1135,8 @@
"operationId": "getMenu",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1264,7 +1211,8 @@
"operationId": "getTopMenu",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1301,81 +1249,35 @@
}
}
},
"/api/v1/restricted/meili-search/search": {
"get": {
"/api/v1/restricted/search/search": {
"post": {
"tags": ["Search"],
"summary": "Search products",
"description": "Searches products using MeiliSearch. Requires authentication.",
"description": "Searches products using MeiliSearch. Requires authentication. Request body should contain MeiliSearch search parameters.",
"operationId": "searchProducts",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
{
"name": "query",
"in": "query",
"description": "Search query string",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Maximum number of results",
"required": true,
"schema": {
"type": "integer",
"format": "uint"
}
},
{
"name": "id_category",
"in": "query",
"description": "Filter by category ID",
"required": false,
"schema": {
"type": "integer",
"format": "uint"
}
},
{
"name": "price_lower_bound",
"in": "query",
"description": "Lower price bound",
"required": false,
"schema": {
"type": "number",
"format": "double"
}
},
{
"name": "price_upper_bound",
"in": "query",
"description": "Upper price bound",
"required": false,
"schema": {
"type": "number",
"format": "double"
}
}
],
"responses": {
"200": {
"description": "Search results retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "MeiliSearch search parameters (query, limit, filter, etc.)"
}
}
}
},
"responses": {
"200": {
"description": "Search results retrieved successfully"
},
"400": {
"description": "Invalid request parameters",
"description": "Invalid request body",
"content": {
"application/json": {
"schema": {
@@ -1397,7 +1299,7 @@
}
}
},
"/api/v1/restricted/meili-search/create-index": {
"/api/v1/restricted/search/create-index": {
"get": {
"tags": ["Search"],
"summary": "Create search index",
@@ -1405,7 +1307,8 @@
"operationId": "createSearchIndex",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1442,51 +1345,6 @@
}
}
},
"/api/v1/restricted/meili-search/test": {
"get": {
"tags": ["Search"],
"summary": "Test MeiliSearch",
"description": "Tests the MeiliSearch search. Must be removed before proper release.",
"operationId": "testMeiliSearch",
"security": [
{
"CookieAuth": []
}
],
"responses": {
"200": {
"description": "MeiliSearch test successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/langs-and-countries/get-languages": {
"get": {
"tags": ["Locale"],
@@ -1495,7 +1353,8 @@
"operationId": "getAvailableLanguages",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1540,7 +1399,8 @@
"operationId": "getCountriesAndCurrencies",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1585,7 +1445,8 @@
"operationId": "addNewCart",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1620,7 +1481,8 @@
"operationId": "changeCartName",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
@@ -1685,7 +1547,8 @@
"operationId": "retrieveCartsInfo",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"responses": {
@@ -1720,7 +1583,8 @@
"operationId": "retrieveCart",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [
@@ -1776,7 +1640,8 @@
"operationId": "addProductToCart",
"security": [
{
"CookieAuth": []
"CookieAuth": [],
"BearerAuth": []
}
],
"parameters": [