{ "openapi": "3.0.3", "info": { "title": "API for TEST ENV of peviitor.ro", "description": "API documentation", "version": "1.0" }, "servers": [ { "url": "https://test.peviitor.ro/v1" }, { "url": "http://localhost:8081/api/v1" } ], "paths": { "/firme/qsearch/": { "get": { "tags": [ "Firme" ], "summary": "Search and import companies from CUIscan", "operationId": "searchAndImportCompanies", "description": "Searches the documented CUIscan API and imports missing companies into the existing Solr company core before returning local name matches. This GET writes data. Existing records are preserved by CIF/CUI, including concurrent creates. CUIscan documents 30 results but live searches can return more. All returned valid matches are imported. No pagination is documented; exhaustive imports are not guaranteed. At 30 or more rows, import.possibly_truncated is true and warnings explains the uncertainty. source_limit is the documented warning threshold, not an enforced cap. page and rows paginate the local database response only. No API key is required. Use the isolated sandbox described in firme/qsearch/docs/README.md to test without changing real data.", "security": [], "servers": [ { "url": ".", "description": "Same server and v1 base path as the loaded Swagger document; use a local sandbox or staging for testing." } ], "parameters": [ { "name": "q", "in": "query", "required": true, "description": "Trimmed company-name substring, 2–100 UTF-8 characters. Control characters are rejected.", "schema": { "type": "string", "minLength": 2, "maxLength": 100 }, "example": "test" }, { "name": "page", "in": "query", "description": "Local database page. Zero is treated as 1.", "schema": { "type": "integer", "minimum": 0, "maximum": 9999999, "default": 1 } }, { "name": "rows", "in": "query", "description": "Local page size. Zero is treated as 1; values above 100 are capped at 100. Does not limit imports.", "schema": { "type": "integer", "minimum": 0, "maximum": 9999999, "default": 10 }, "example": 10 } ], "responses": { "200": { "description": "Import completed and local matches returned. With no local or source matches, docs is empty. Sandbox example uses synthetic company data.", "headers": { "Cache-Control": { "schema": { "type": "string", "enum": [ "no-store" ] }, "description": "Import requests must not be cached." } }, "content": { "application/json": { "schema": { "type": "object", "required": [ "pagination", "docs", "import" ], "properties": { "pagination": { "type": "object", "required": [ "page", "rows", "total", "total_pages" ], "properties": { "page": { "type": "integer", "minimum": 1 }, "rows": { "type": "integer", "minimum": 1, "maximum": 100 }, "total": { "type": "integer", "minimum": 0, "description": "Number of matching local companies." }, "total_pages": { "type": "integer", "minimum": 0, "description": "Number of local result pages." } } }, "docs": { "type": "array", "items": { "type": "object", "required": [ "id", "company" ], "properties": { "id": { "type": "string", "description": "Company CIF/CUI, used as the Solr unique ID." }, "company": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "location": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": true } }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } } }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "example": { "pagination": { "page": 1, "rows": 10, "total": 2, "total_pages": 1 }, "docs": [ { "id": "88000002", "company": "ZIRA CUSTOM NAME", "brand": "KEEP ME" }, { "id": "88000001", "company": "ZIRA TEST SRL", "location": [ "Cluj-Napoca, Cluj" ] } ], "import": { "source": "cuiscan.ro", "received": 3, "matched": 2, "imported": 1, "existing": 1, "source_limit": 30, "source_pagination_supported": false, "possibly_truncated": false } } } } }, "400": { "description": "Invalid or missing q, or invalid pagination. No external calls or writes.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "q must contain between 2 and 100 characters" } } } }, "405": { "description": "Only GET is supported.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "Only GET method is allowed" } } }, "headers": { "Allow": { "schema": { "type": "string", "enum": [ "GET" ] } } } }, "500": { "description": "Unexpected internal failure; details logged server-side.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "Company search failed" } } } }, "502": { "description": "CUIscan connection failure, HTTP error, invalid JSON or invalid company data. No companies from this response are imported.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "CUIscan search unavailable" } } } }, "503": { "description": "Local/provider rate limit, limiter/configuration failure, or Solr unavailable. Earlier imports may have succeeded; retries safely skip existing IDs.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "Company storage unavailable; earlier imports may have succeeded" } } } }, "504": { "description": "CUIscan connection/read timeout. No companies from this request are imported.", "content": { "application/json": { "schema": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "string" }, "import": { "type": "object", "required": [ "source", "received", "matched", "imported", "existing", "source_limit", "source_pagination_supported", "possibly_truncated" ], "properties": { "source": { "type": "string", "enum": [ "cuiscan.ro" ] }, "received": { "type": "integer", "minimum": 0, "description": "Number of provider rows before deduplication." }, "matched": { "type": "integer", "minimum": 0, "description": "Unique companies whose names contain q." }, "imported": { "type": "integer", "minimum": 0, "description": "Acknowledged new company creates." }, "existing": { "type": "integer", "minimum": 0, "description": "Already stored companies or concurrent create conflicts." }, "source_limit": { "type": "integer", "enum": [ 30 ] }, "source_pagination_supported": { "type": "boolean", "enum": [ false ] }, "possibly_truncated": { "type": "boolean", "description": "True when the provider returned 30 or more rows; more matches may exist." } }, "nullable": true, "description": "Completed acknowledged import work when available; absent or null for failures before importing. A write timeout may leave an unacknowledged record that is safely detected on retry." } } }, "example": { "error": "CUIscan request timed out" } } } } } } }, "/random/": { "get": { "tags": [ "General" ], "summary": "Get random data", "responses": { "200": { "description": "A random job or a message indicating no jobs found", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "response": { "type": "object", "properties": { "numFound": { "type": "integer" }, "start": { "type": "integer" }, "numFoundExact": { "type": "boolean" }, "docs": { "type": "array", "items": { "type": "object" } } } } } }, { "type": "object", "properties": { "message": { "type": "string", "default": "There are no jobs to display" } } } ] } } } }, "400": { "description": "Container not opened", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Container is not opened" } } } } } }, "403": { "description": "Forbidden - User does not have permission to access PHP code", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "PHP code is not found." } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/suggest/": { "get": { "tags": [ "Search" ], "summary": "Get job title suggestions", "description": "Retrieve suggestions for job titles based on a user's query.", "parameters": [ { "name": "q", "in": "query", "description": "The search query string for which suggestions are needed.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Suggestions retrieval successful", "content": { "application/json": { "schema": { "type": "object", "properties": { "suggestions": { "type": "array", "items": { "type": "object", "properties": { "term": { "type": "string", "description": "Suggested term" }, "weight": { "type": "integer", "description": "Weight or score of the suggestion" }, "payload": { "type": "string", "description": "Additional data associated with the suggestion" } } } } } } } } }, "400": { "description": "Bad request, no query provided or invalid input.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/cleanjobs/": { "delete": { "tags": [ "General" ], "summary": "Delete jobs by company name", "description": "Deletes all job postings for a specified company.", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "company" ], "properties": { "company": { "type": "string", "description": "The name of the company whose jobs should be deleted.", "example": "Example Company" } } } } } }, "responses": { "200": { "description": "Successful deletion", "content": { "application/json": { "schema": { "type": "object", "properties": { "responseHeader": { "type": "object", "properties": { "status": { "type": "integer" }, "QTime": { "type": "integer" } } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/companies/": { "get": { "tags": [ "General" ], "summary": "Get list of companies", "responses": { "200": { "description": "Successfully received the list of companies", "content": { "application/json": { "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "companies": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "jobs": { "type": "integer", "nullable": true } } } } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/getuser/": { "get": { "tags": [ "User" ], "summary": "Get a user by ID", "parameters": [ { "name": "ID", "in": "query", "required": true, "description": "The ID of the user", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successfully retrieved the user", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "url": { "type": "string" }, "company": { "type": "string" }, "apikey": { "type": "string" } } }, { "type": "object", "properties": { "id": { "type": "string" }, "apikey": { "type": "string" } } }, { "type": "object", "properties": { "id": { "type": "string" }, "logo": { "type": "string" } } } ] } } } }, "404": { "description": "No user found", "content": {} }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } }, "400": { "description": "Invalid ID format. Special characters are not allowed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "received": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "/jobs/": { "get": { "tags": [ "Machine Learning" ], "summary": "Get jobs", "operationId": "getJobs", "parameters": [ { "in": "query", "name": "start_page", "required": false, "schema": { "type": "integer", "minimum": 1, "example": 1 }, "description": "Starting page to be returned. Default is 1." }, { "in": "query", "name": "stop_page", "required": false, "schema": { "type": "integer", "minimum": 1, "example": 1 }, "description": "Last page to be returned. Default is 1." } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "response": { "type": "object", "properties": { "numFound": { "type": "integer", "description": "Total number of jobs found" }, "docs": { "type": "array", "description": "List of job records", "items": { "type": "object", "properties": { "job_id": { "type": "integer" }, "job_title": { "type": "string" } } } } } } } } } } }, "400": { "description": "Bad Request. Invalid input parameter.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } }, "401": { "description": "Unauthorized. Authentication failure.", "content": {} }, "500": { "description": "Internal Server Error. Something went wrong on the server side.", "content": {} }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/search/": { "get": { "tags": [ "Search" ], "summary": "Search jobs", "description": "Search for jobs using Solr", "parameters": [ { "name": "q", "in": "query", "required": true, "description": "The search query", "schema": { "type": "string" } }, { "name": "start", "in": "query", "required": false, "description": "Pagination start index", "schema": { "type": "integer" } }, { "name": "rows", "in": "query", "required": false, "description": "Number of results to return", "schema": { "type": "integer" } }, { "name": "sort", "in": "query", "required": false, "description": "Sort order", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Search results", "content": { "application/json": { "schema": { "type": "object" } } } }, "400": { "description": "Bad Request. Invalid input parameter.", "content": {} }, "404": { "description": "Invalid search query", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "This job is not in the Database" }, "code": { "type": "integer", "example": 404 } } } } } }, "500": { "description": "Internal Server Error. Something went wrong on the server side.", "content": {} }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/total/": { "get": { "tags": [ "General" ], "summary": "Get total job count", "description": "Returns the total number of jobs and companies", "responses": { "200": { "description": "Total job count", "content": { "application/json": { "schema": { "type": "object", "properties": { "total": { "type": "object", "properties": { "jobs": { "type": "string" }, "companies": { "type": "string" } }, "required": [ "jobs", "companies" ] } }, "required": [ "total" ] } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/updateuser/": { "patch": { "tags": [ "User" ], "summary": "Update user", "description": "Update user details in Solr using PATCH", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "apikey": { "type": "string", "description": "API key", "example": "abc123xyz" }, "id": { "type": "string", "description": "User ID (optional)", "example": "local-part@domain" }, "url": { "type": "string", "description": "User URL (optional)", "example": "http://example.com" }, "company": { "type": "string", "description": "Company name (optional)", "example": "Company name" }, "logo": { "type": "string", "description": "Logo URL (optional)", "example": "http://example.com" } }, "required": [ "apikey" ] } } } }, "responses": { "200": { "description": "User updated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "url": { "type": "string" }, "company": { "type": "string" }, "logo": { "type": "string" }, "apikey": { "type": "string" } } } } } }, "400": { "description": "Bad Request. Invalid or missing input.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "description": "Details about the error" } } } } } }, "404": { "description": "User with given apikey not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error. Something went wrong on the server.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } }, "503": { "description": "Service Unavailable. SOLR server is down or unreachable.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/empty/": { "delete": { "tags": [ "General" ], "summary": "Delete all jobs from jobs core", "responses": { "200": { "description": "Successfully deleted all jobs", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "jobsDeleted": { "type": "integer" }, "companiesDeleted": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer" } } } } } } } } }, "/update/": { "put": { "tags": [ "General" ], "summary": "Update a job document", "description": "Partially updates a job document in the Solr 'job' core. The 'url' field identifies the document; all other fields are optional and use atomic updates so only provided fields are touched.", "operationId": "updateJob", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "description": "Full URL to the job detail page (unique key)", "example": "https://example.com/job/123" }, "title": { "type": "string", "description": "Job title (max 200 chars, no HTML)", "example": "Senior PHP Developer" }, "company": { "type": "string", "description": "Hiring company name (stored uppercase)", "example": "GOOGLE ROMANIA SRL" }, "cif": { "type": "string", "description": "CIF/CUI of the company", "example": "24415960" }, "location": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "City or array of cities (diacritics accepted, auto-corrected)", "example": ["București", "Cluj-Napoca"] }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Skill tags (lowercase, max 20)", "example": ["php", "laravel", "solr"] }, "workmode": { "type": "string", "enum": ["remote", "on-site", "hybrid"], "description": "Work mode" }, "status": { "type": "string", "enum": ["scraped", "tested", "published", "verified"], "description": "Job status" }, "date": { "type": "string", "description": "ISO8601 UTC timestamp of indexing", "example": "2026-08-19T10:00:00.000Z" }, "vdate": { "type": "string", "description": "ISO8601 UTC timestamp of validation", "example": "2026-08-19T10:00:00.000Z" }, "expirationdate": { "type": "string", "description": "ISO8601 UTC expiration timestamp", "example": "2026-09-19T10:00:00.000Z" }, "salary": { "type": "string", "description": "Salary interval with currency", "example": "5000-8000 RON" } } } } } }, "responses": { "200": { "description": "Job updated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "string", "example": "Data successfully inserted into Solr" } } } } } }, "400": { "description": "Invalid request (bad JSON, missing/invalid fields)", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "code": { "type": "integer", "example": 400 } } } } } }, "405": { "description": "Only PUT method is allowed", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Only PUT method is allowed" }, "code": { "type": "integer", "example": 405 } } } } } }, "415": { "description": "Content-Type is not application/json", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Content-Type must be application/json" }, "code": { "type": "integer", "example": 415 } } } } } }, "503": { "description": "Service unavailable. Solr server is down or environment not configured.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Job core unavailable" }, "details": { "type": "string" } } } } } } } } }, "/firme/company/": { "post": { "tags": [ "Companies" ], "summary": "Update company name in Solr", "description": "Updates the 'denumire' (name) of a company document in the 'firme' Solr core using its ID.", "operationId": "updateCompanyName", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "4546578", "description": "The ID of the company in Solr" }, "company": { "type": "string", "example": "Firma Test SRL", "description": "The new name for the company" } }, "required": [ "id", "company" ] } } } }, "responses": { "200": { "description": "Company name successfully updated", "content": { "application/json": { "example": { "responseHeader": { "status": 0, "QTime": 3 } } } } }, "400": { "description": "Missing id or company parameter", "content": { "application/json": { "example": { "error": "Missing id or company" } } } }, "405": { "description": "Only POST method is allowed", "content": { "application/json": { "example": { "error": "Only POST method is allowed" } } } }, "500": { "description": "Solr request failed or server misconfiguration", "content": { "application/json": { "example": { "error": "Solr request failed" } } } } } } }, "/firme/company/add/": { "put": { "tags": [ "Companies" ], "summary": "Add or update a company in Solr", "description": "Inserts or updates a company document in the 'firme' Solr core. Validates required fields, email, phone, and website formats.", "operationId": "addOrUpdateCompany", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer", "example": 4546578, "description": "Unique integer ID of the company" }, "denumire": { "type": "string", "example": "Firma Test SRL", "description": "Company name" }, "cod_inmatriculare": { "type": "string", "example": "J01/2024/999", "description": "Registration code" }, "euid": { "type": "string", "example": "EUID-RO-12345", "description": "European unique identifier" }, "localitate": { "type": "string", "example": "Cluj-Napoca", "description": "City" }, "adresa_completa": { "type": "string", "example": "Str. Test 10", "description": "Full address" }, "judet": { "type": "string", "example": "Bucharest", "description": "County" }, "cod_stare": { "type": "integer", "example": 1234, "description": "Status code" }, "brands": { "type": "string", "example": "Brand A, Brand B", "description": "Optional brands" }, "scraper": { "type": "string", "example": "scraper_name", "description": "Optional scraper identifier" }, "website": { "type": "string", "example": "https://www.example.com", "description": "Website URL" }, "email": { "type": "string", "example": "contact@example.com", "description": "Company email" }, "phone": { "type": "string", "example": "+40712345678", "description": "Phone number" } }, "required": [ "id", "denumire", "cod_inmatriculare", "euid", "localitate", "adresa_completa", "judet", "cod_stare" ] } } } }, "responses": { "200": { "description": "Data successfully inserted into Solr", "content": { "application/json": { "example": { "success": "Data successfully inserted into Solr" } } } }, "400": { "description": "Validation error or missing required fields", "content": { "application/json": { "example": { "error": "Fields 'id' and 'cod_stare' must be integers.", "code": 400 } } } }, "405": { "description": "Only PUT method is allowed", "content": { "application/json": { "example": { "error": "Only PUT method is allowed" } } } }, "503": { "description": "Solr server in DEV is down", "content": { "application/json": { "example": { "error": "SOLR server in DEV is down", "code": 503 } } } } } } }, "/firme/company/delete/": { "delete": { "tags": [ "Companies" ], "summary": "Delete a company from Solr", "description": "Removes a company document from the 'firme' Solr core using its ID.", "operationId": "deleteCompany", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "4546578", "description": "The ID of the company to delete" } }, "required": [ "id" ] } } } }, "responses": { "200": { "description": "Company successfully deleted", "content": { "application/json": { "example": { "responseHeader": { "status": 0, "QTime": 3 } } } } }, "400": { "description": "Missing ID", "content": { "application/json": { "example": { "error": "Missing id" } } } }, "405": { "description": "Only DELETE method is allowed", "content": { "application/json": { "example": { "error": "Only DELETE method is allowed" } } } }, "500": { "description": "Solr request failed or server misconfiguration", "content": { "application/json": { "example": { "error": "Solr request failed" } } } } } } }, "/firme/brand/": { "get": { "tags": [ "Companies' brands" ], "summary": "Get companies by brand name", "description": "Retrieves all companies from the 'firme' core that match the specified brand name.", "parameters": [ { "name": "brand", "in": "query", "required": true, "description": "Brand name to search for in the 'brands' field of the firme core.", "schema": { "type": "string", "example": "Pepsi" } } ], "responses": { "200": { "description": "Successful operation. Returns a list of companies matching the given brand.", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "denumire": { "type": "string", "description": "Company name" }, "cui": { "type": "string", "description": "Company tax ID" } } } } } } }, "400": { "description": "Bad Request. Missing or invalid 'brand' parameter.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Missing brand parameter" } } } } } }, "500": { "description": "Internal Server Error. Solr request failed or configuration missing.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Solr request failed" } } } } } } } } }, "/firme/brand/add/": { "post": { "tags": [ "Companies' brands" ], "summary": "Add brand(s) to a company document", "description": "Adds one or more brands to the 'brands' field of a company in the 'firme' Solr core.", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Solr document ID of the company.", "example": "123456" }, "brands": { "type": "array", "items": { "type": "string" }, "description": "List of brands to add to the company.", "example": [ "Pepsi", "Lay's" ] } }, "required": [ "id", "brands" ] } }, "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "123456" }, "brands": { "type": "array", "items": { "type": "string" }, "example": [ "Pepsi", "Lay's" ] } }, "required": [ "id", "brands" ] } } } }, "responses": { "200": { "description": "Brand(s) successfully added to the company document.", "content": { "application/json": { "schema": { "type": "object", "properties": { "responseHeader": { "type": "object", "description": "Solr response header" }, "response": { "type": "object", "description": "Solr response details" } } } } } }, "400": { "description": "Bad Request. Missing id or brands parameter.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Missing id or brands" } } } } } }, "500": { "description": "Internal Server Error. Solr request failed or configuration missing.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Solr request failed" } } } } } } } } }, "/firme/brand/delete/": { "delete": { "tags": [ "Companies' brands" ], "summary": "Remove brand(s) from a company document", "description": "Removes one or more brands from the 'brands' field of a company in the 'firme' Solr core.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Solr document ID of the company.", "example": "123456" }, "brands": { "type": "array", "items": { "type": "string" }, "description": "List of brand names to remove from the company.", "example": [ "Pepsi", "Lay's" ] } }, "required": [ "id", "brands" ] } } } }, "responses": { "200": { "description": "Brand(s) successfully removed from the company document.", "content": { "application/json": { "schema": { "type": "object", "properties": { "responseHeader": { "type": "object", "description": "Solr response header" }, "response": { "type": "object", "description": "Solr response details" } } } } } }, "400": { "description": "Bad Request. Missing id or brands parameter.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Missing id or brands" } } } } } }, "500": { "description": "Internal Server Error. Solr request failed or configuration missing.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Solr request failed" } } } } } } } } }, "/firme/scraper/": { "get": { "tags": [ "Companies' scrapers" ], "summary": "Get companies by scraper name", "description": "Retrieves all companies from the 'firme' Solr core that were added or updated by a specific scraper.", "operationId": "getCompaniesByScraper", "parameters": [ { "name": "scraper", "in": "query", "required": true, "schema": { "type": "string", "example": "bestjobs" }, "description": "Name of the scraper used to collect company data." } ], "responses": { "200": { "description": "List of companies that match the scraper name", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "denumire": { "type": "string", "example": "SC EXAMPLE SRL" }, "cui": { "type": "string", "example": "RO12345678" } } } } } } }, "400": { "description": "Missing scraper parameter" }, "405": { "description": "Only GET method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/firme/scraper/add/": { "post": { "tags": [ "Companies' scrapers" ], "summary": "Add a scraper to a company", "description": "Adds a scraper name to the 'scraper' field of a company in the 'firme' Solr core.", "operationId": "addScraperToCompany", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "12345", "description": "Unique identifier of the company document in Solr." }, "scraper": { "type": "string", "example": "bestjobs", "description": "Name of the scraper to add." } }, "required": [ "id", "scraper" ] } } } }, "responses": { "200": { "description": "Scraper successfully added to the company", "content": { "application/json": {} } }, "400": { "description": "Missing id or scraper" }, "405": { "description": "Only POST method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/firme/scraper/delete/": { "delete": { "tags": [ "Companies' scrapers" ], "summary": "Delete a scraper from a company", "description": "Removes a scraper name from the 'scraper' field of a company in the 'firme' Solr core.", "operationId": "deleteScraperFromCompany", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "12345", "description": "Unique identifier of the company document in Solr." }, "scraper": { "type": "string", "example": "bestjobs", "description": "Name of the scraper to remove." } }, "required": [ "id", "scraper" ] } } } }, "responses": { "200": { "description": "Scraper successfully removed from the company", "content": { "application/json": {} } }, "400": { "description": "Missing id or scraper" }, "405": { "description": "Only DELETE method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/firme/website/": { "get": { "tags": [ "Companies' websites" ], "summary": "Get company by website", "description": "Searches the 'firme' Solr core for companies matching the given website.", "operationId": "getCompanyByWebsite", "parameters": [ { "name": "website", "in": "query", "required": true, "schema": { "type": "string", "example": "www.example.com" }, "description": "The website of the company to search for." } ], "responses": { "200": { "description": "Company data successfully retrieved", "content": { "application/json": {} } }, "400": { "description": "Missing website parameter" }, "405": { "description": "Only GET method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/firme/website/add/": { "post": { "tags": [ "Companies' websites" ], "summary": "Add a website to a company", "description": "Adds a website to the 'website' field of a company document in the 'firme' Solr core.", "operationId": "addCompanyWebsite", "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "12345", "description": "The ID of the company in Solr." }, "website": { "type": "string", "example": "www.example.com", "description": "The website to add to the company." } }, "required": [ "id", "website" ] } } } }, "responses": { "200": { "description": "Website successfully added", "content": { "application/json": {} } }, "400": { "description": "Missing id or website parameter" }, "405": { "description": "Only POST method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/firme/website/delete/": { "delete": { "tags": [ "Companies' websites" ], "summary": "Remove a website from a company", "description": "Removes a website from the 'website' field of a company document in the 'firme' Solr core.", "operationId": "deleteCompanyWebsite", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "12345", "description": "The ID of the company in Solr." }, "website": { "type": "string", "example": "www.example.com", "description": "The website to remove from the company." } }, "required": [ "id", "website" ] } } } }, "responses": { "200": { "description": "Website successfully removed", "content": { "application/json": {} } }, "400": { "description": "Missing id or website parameter" }, "405": { "description": "Only DELETE method is allowed" }, "500": { "description": "Solr request failed or server misconfiguration" } } } }, "/validate/": { "get": { "tags": [ "General" ], "summary": "Validate a batch of jobs", "description": "Fetches the oldest jobs that have NOT been validated today from the Solr job core and stamps each one with the current UTC timestamp (vdate). Only documents that carry both url and title are processed.", "operationId": "validateJobs", "parameters": [ { "name": "index", "in": "query", "required": false, "schema": { "type": "integer", "default": 10 }, "description": "Number of jobs to validate per request." } ], "responses": { "200": { "description": "Jobs validated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "remaining": { "type": "integer", "description": "Number of jobs not yet validated today" }, "index": { "type": "integer", "description": "The index value used for this batch" }, "found": { "type": "integer", "description": "Number of jobs validated in this batch" }, "jobs": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "description": "Full URL to the job detail page" } } } } } }, "example": { "remaining": 1233, "index": 10, "found": 10, "jobs": [ { "url": "https://example.com/job/123" }, { "url": "https://example.com/job/456" } ] } } } }, "405": { "description": "Only GET method is allowed", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Only GET method allowed" } } } } } }, "503": { "description": "Service unavailable. SOLR server is down or request failed.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Job core unavailable" }, "details": { "type": "string" } } } } } } } } } } }