### GET /events/details/project/order-info Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves key-value order information for a specific project event. ```APIDOC ## GET /events/details/project/order-info ### Description Retrieves key-value order information for a specific project event. ### Method GET ### Endpoint /events/details/project/order-info ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the event to retrieve order information for. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (bool) - Indicates if the request was successful. - **data** (object) - Contains the order information. - **salesOrderNumber** (str) - The sales order number. - **workOrder** (str) - The work order identifier. - **customer** (str) - The customer name. - **productDescription** (str) - The description of the product. - **quantity** (int) - The quantity of the product. - **expectedDeliveryDate** (str) - The expected delivery date in YYYY-MM-DD format. #### Response Example ```json { "success": true, "data": { "salesOrderNumber": "SO-001", "workOrder": "AW-123050.1", "customer": "ABC Corp", "productDescription": "PUMP ASSEMBLY", "quantity": 5, "expectedDeliveryDate": "2025-03-15" } } ``` #### Failure Responses - **400** - event_id empty - **401** - Invalid/missing JWT - **404** - No ERP data found for event_id - **500** - Database failure ``` -------------------------------- ### Start Project Processor API Endpoint Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Starts the project processor background job. Requires a valid JWT. If the job is already running, it returns a 'already running' message idempotently. Otherwise, it starts the job with a 30-minute interval and a short delay between projects, returning the running status. ```HTTP POST /project-processor/start ``` ```JSON { "success": true, "data": { "running": true, "message": "Project processor started" } } ``` -------------------------------- ### GET /events/details/project/note-types Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves a list of delay reasons to populate a dropdown when adding a note. ```APIDOC ## GET /events/details/project/note-types — Delay Reason Dropdown ### Description Populates the delay reason dropdown when adding a note. ### Method GET ### Endpoint /events/details/project/note-types ### Parameters (No query parameters required) ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of delay reason objects, each containing: - **id** (string) - The unique identifier for the delay reason. - **name** (string) - The name of the delay reason. #### Response Example ```json { "success": true, "data": [ { "id": "reason001", "name": "Supplier Delay" }, { "id": "reason002", "name": "Design Change" }, { "id": "reason003", "name": "Material Shortage" } ] } ``` #### Failure Responses - **401**: Invalid/missing JWT - **500**: Database failure ``` -------------------------------- ### GET /events/details/project/schema Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves the dynamic UI structure for a project detail page, including header and tabs. ```APIDOC ## GET /events/details/project/schema ### Description Get the dynamic UI structure (header + tabs) for a project detail page. Call this first when opening a project. ### Method GET ### Endpoint /events/details/project/schema ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the event (project). ### Request Example ```json { "event_id": "AW-123050" } ``` ### Response #### Success Response (200) - **success** (bool) - Indicates if the request was successful. - **data** (object) - The UI structure for the project detail page. - **tabView** (bool) - Whether the view uses tabs. - **header** (object) - Header information for the page. - **title** (str) - Main title (e.g., event ID). - **sub_title** (str) - Subtitle (e.g., customer name). - **status** (str) - Overall status of the project. - **tabs** (array) - Definitions for the tabs available on the page. - **name** (str) - Name of the tab. - **url** (str) - URL path for the tab content. - **type** (str) - Type of content in the tab (e.g., `info`, `table`, `timeline`, `notes`). - **pagination** (bool) - Indicates if the tab content is paginated. #### Response Example ```json { "success": true, "data": { "tabView": true, "header": { "title": "AW-123050", "sub_title": "ABC Corp", "status": "delayed" }, "tabs": [ { "name": "Order Info", "url": "details/project/order-info", "type": "info" }, { "name": "BOM View", "url": "details/project/bom-view", "type": "table", "pagination": true }, { "name": "Work Orders", "url": "details/project/work-orders", "type": "table", "pagination": true }, { "name": "Timeline", "url": "details/project/timeline", "type": "timeline" }, { "name": "Notes", "url": "details/project/notes", "type": "notes", "pagination": true } ] } } ``` #### Failure Responses - **400**: `event_id` is empty. - **401**: Invalid/missing JWT. - **404**: No project found with the given `event_id`. - **500**: Database failure. ``` -------------------------------- ### POST /project-processor/start - Start Background Job Source: https://context7.com/super-nived/industryapps-mps/llms.txt Starts the project processor background job. This job runs every 30 minutes by default. ```APIDOC ## POST /project-processor/start - Start Background Job ### Description Starts the project processor background job that runs every 30 minutes. ### Method POST ### Endpoint /mps-be/api/v1/project-processor/start ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X POST "https://your-domain.com/mps-be/api/v1/project-processor/start" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the status after starting the job. - **running** (boolean) - Whether the job is now running. - **message** (string) - A confirmation message. #### Response Example (Job Started) ```json { "success": true, "data": { "running": true, "message": "Project processor started" } } ``` #### Response Example (Already Running - Idempotent) ```json { "success": true, "data": { "running": true, "message": "already running" } } ``` ``` -------------------------------- ### Start Background Job - Bash Source: https://context7.com/super-nived/industryapps-mps/llms.txt Starts the project processor background job. This job runs automatically every 30 minutes. The endpoint is idempotent, meaning calling it multiple times will have the same effect as calling it once. Requires an Authorization header. ```bash curl -X POST "https://your-domain.com/mps-be/api/v1/project-processor/start" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /events/details/project/notes Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves a paginated list of notes for a specific project event. ```APIDOC ## GET /events/details/project/notes — Notes List ### Description Retrieves a paginated list of notes for a project. ### Method GET ### Endpoint /events/details/project/notes ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the project event. - **page** (int) - Optional - The page number for pagination. Defaults to 1. - **limit** (int) - Optional - The number of notes per page. Defaults to 20 (min 10, max 100). - **workorder_sub_id** (str) - Optional - Filter notes by a specific sub work order ID. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of note objects, each containing: - **id** (string) - The unique identifier for the note. - **username** (string) - The username of the person who added the note. - **note** (string) - The content of the note. - **delayReason** (string) - The name of the delay reason associated with the note. - **delayReasonId** (string) - The ID of the delay reason. - **time** (string) - The timestamp when the note was created (YYYY-MM-DD HH:MM:SS). - **pagination** (object) - Pagination details: - **page** (integer) - Current page number. - **limit** (integer) - Number of items per page. - **total** (integer) - Total number of items. - **pages** (integer) - Total number of pages. #### Response Example ```json { "success": true, "data": [ { "id": "note123", "username": "john.doe", "note": "Supplier delayed due to customs clearance", "delayReason": "Supplier Delay", "delayReasonId": "reason001", "time": "2025-02-15 10:30:00" } ], "pagination": { "page": 1, "limit": 20, "total": 5, "pages": 1 } } ``` #### Failure Responses - **400**: `event_id` empty - **401**: Invalid/missing JWT - **422**: `page`/`limit` violated - **500**: Database failure ``` -------------------------------- ### Get Project Order Info Tab (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Fetches key-value order information for a specific project, including sales order, customer, and delivery details. Requires an event ID and Authorization header. ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/order-info?event_id=AW-123050" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Project Timeline Data Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves the 9-phase production timeline for a given project event, including start dates, end dates, status, and progress percentage for each phase. Requires a valid JWT and event_id. Returns a 404 if no timeline data is found. ```HTTP GET /events/details/project/timeline?event_id=your_event_id_here ``` -------------------------------- ### GET /events/details/project/bom-view Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves a paginated list of Bill of Materials (BOM) with search capabilities for a project event. ```APIDOC ## GET /events/details/project/bom-view ### Description Retrieves a paginated list of Bill of Materials (BOM) with search capabilities for a project event. ### Method GET ### Endpoint /events/details/project/bom-view ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the event to retrieve BOM information for. - **page** (int) - Optional - The page number for pagination. Defaults to 1. Must be >= 1. - **limit** (int) - Optional - The number of items per page. Defaults to 20. Must be between 10 and 100. - **search** (str) - Optional - Free text to search BOM items. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (bool) - Indicates if the request was successful. - **data** (array) - An array of BOM items. - **part_id_description** (str) - Description of the part ID. - **requiredQuantity** (int) - The quantity required for the part. - **inventoryStatus** (str) - The current inventory status ('Available' or 'Not Available'). - **workOrder** (str) - The work order associated with the BOM item. - **poNumber** (str) - The purchase order number, if applicable. - **estimatedArrival** (str) - The estimated arrival date (YYYY-MM-DD), if applicable. - **actualArrival** (str) - The actual arrival date (YYYY-MM-DD), if applicable. - **pagination** (object) - Pagination details. - **page** (int) - The current page number. - **limit** (int) - The number of items per page. - **total** (int) - The total number of items. - **pages** (int) - The total number of pages. #### Response Example ```json { "success": true, "data": [ { "part_id_description": "BOLT-M10", "requiredQuantity": 50, "inventoryStatus": "Available", "workOrder": "AW-123050.1-1", "poNumber": "PO-9988", "estimatedArrival": "2025-02-10", "actualArrival": "2025-02-12" } ], "pagination": { "page": 1, "limit": 20, "total": 85, "pages": 5 } } ``` #### Failure Responses - **400** - event_id empty - **401** - Invalid/missing JWT - **404** - No BOM data found - **422** - page/limit constraint violated - **500** - Database failure ``` -------------------------------- ### Get Project Timeline Tab (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves the 9-phase production timeline for a project, including status and progress percentage for each phase. Requires an event ID and Authorization header. ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/timeline?event_id=AW-123050" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /events/details/project/timeline Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves the 9-phase project production timeline with status and progress per phase for a given event. ```APIDOC ## GET /events/details/project/timeline — Timeline Tab ### Description Retrieves the 9-phase project production timeline with status and progress per phase. ### Method GET ### Endpoint /events/details/project/timeline ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the project event. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of phase objects, each containing: - **phase** (string) - The name of the project phase. - **startDate** (string) - The planned start date of the phase (YYYY-MM-DD). - **endDate** (string) - The planned end date of the phase (YYYY-MM-DD). - **actualEndDate** (string) - The actual end date of the phase (YYYY-MM-DD), or empty string if not completed. - **status** (string) - The status of the phase ('Delayed' or 'On Track'). - **progressPercent** (integer) - The completion percentage of the phase. #### Response Example ```json { "success": true, "data": [ { "phase": "Sales Order Creation", "startDate": "2025-01-01", "endDate": "2025-01-03", "actualEndDate": "2025-01-02", "status": "On Track", "progressPercent": 100 }, { "phase": "Release of BOM & Work Order", "startDate": "2025-01-03", "endDate": "2025-01-13", "actualEndDate": "", "status": "Delayed", "progressPercent": 40 } ] } ``` #### Failure Responses - **400**: `event_id` empty - **401**: Invalid/missing JWT - **404**: No timeline data found - **500**: Database failure ``` -------------------------------- ### GET /events/details/project/work-orders Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves a paginated list of work orders for a project event, with search functionality. ```APIDOC ## GET /events/details/project/work-orders ### Description Retrieves a paginated list of work orders for a project event, with search functionality. ### Method GET ### Endpoint /events/details/project/work-orders ### Parameters #### Query Parameters - **event_id** (str) - Required - The ID of the event to retrieve work orders for. - **page** (int) - Optional - The page number for pagination. Defaults to 1. Must be >= 1. - **limit** (int) - Optional - The number of items per page. Defaults to 20. Must be between 10 and 100. - **search** (str) - Optional - Free text to search work orders by base_id, quantity, or status. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **success** (bool) - Indicates if the request was successful. - **data** (array) - An array of work orders. - **woNumber** (str) - The work order number. - **product_code_description** (str) - The description of the product code. - **quantity** (int) - The quantity for the work order. - **status** (str) - The current status of the work order. - **productionCommitment** (str) - The production commitment date (YYYY-MM-DD). - **blocker** (str or null) - Information about any blockers, or null if none. - **pagination** (object) - Pagination details. - **page** (int) - The current page number. - **limit** (int) - The number of items per page. - **total** (int) - The total number of items. - **pages** (int) - The total number of pages. #### Response Example ```json { "success": true, "data": [ { "woNumber": "AW-123050-1", "product_code_description": "PUMP ASSEMBLY", "quantity": 5, "status": "In Progress", "productionCommitment": "2025-03-15", "blocker": null } ], "pagination": { "page": 1, "limit": 20, "total": 12, "pages": 1 } } ``` #### Failure Responses - **400** - event_id empty - **401** - Invalid/missing JWT - **404** - No work orders found - **422** - page/limit violated - **500** - Database failure ``` -------------------------------- ### Get Project Detail Page Schema Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves the dynamic UI structure for a project detail page, including header information and tab definitions. Requires a valid JWT and the `event_id` as a query parameter. ```HTTP GET /events/details/project/schema?event_id=AW-123050 ``` -------------------------------- ### GET /events/details/project/order-info - Order Info Tab Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves key-value order information for a specific project, including sales order details, customer information, and delivery dates. ```APIDOC ## GET /events/details/project/order-info - Order Info Tab ### Description Returns key-value order information for a project including sales order, customer, and delivery details. ### Method GET ### Endpoint /events/details/project/order-info ### Parameters #### Query Parameters - **event_id** (string) - Required - The unique identifier of the project event. ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/order-info?event_id=AW-123050" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the order information. - **salesOrderNumber** (string) - The sales order number. - **workOrder** (string) - The associated work order number. - **customer** (string) - The name of the customer. - **productDescription** (string) - Description of the product. - **quantity** (integer) - The quantity ordered. - **expectedDeliveryDate** (string) - The expected delivery date (YYYY-MM-DD). #### Response Example ```json { "success": true, "data": { "salesOrderNumber": "SO-001", "workOrder": "AW-123050.1", "customer": "ABC Corp", "productDescription": "PUMP ASSEMBLY", "quantity": 5, "expectedDeliveryDate": "2025-03-15" } } ``` ``` -------------------------------- ### GET /events/details/project/timeline - Timeline Tab Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves the 9-phase production timeline for a project, including the status and progress percentage for each phase. ```APIDOC ## GET /events/details/project/timeline - Timeline Tab ### Description Returns the 9-phase production timeline with status and progress percentage for each phase. ### Method GET ### Endpoint /events/details/project/timeline ### Parameters #### Query Parameters - **event_id** (string) - Required - The unique identifier of the project event. ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/timeline?event_id=AW-123050" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array representing the production timeline phases. - **phase_name** (string) - The name of the production phase. - **status** (string) - The status of the phase (e.g., 'Completed', 'In Progress'). - **progress_percentage** (integer) - The completion percentage of the phase. - **start_date** (string) - The start date of the phase (YYYY-MM-DD). - **end_date** (string) - The end date of the phase (YYYY-MM-DD). #### Response Example ```json { "success": true, "data": [ { "phase_name": "Phase 1", "status": "Completed", "progress_percentage": 100, "start_date": "2025-01-01", "end_date": "2025-01-10" }, { "phase_name": "Phase 2", "status": "In Progress", "progress_percentage": 50, "start_date": "2025-01-11", "end_date": "2025-01-20" }, ... ] } ``` ``` -------------------------------- ### Get Project BOM View Tab (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves paginated Bill of Materials data for a project, supporting filtering by page, limit, and search queries. Requires an event ID and Authorization header. ```bash # Get BOM with pagination curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/bom-view?event_id=AW-123050&page=1&limit=20" \ -H "Authorization: Bearer " # Search by work order sub ID curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/bom-view?event_id=AW-123050&search=AW-122039.1-5" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /machines/ - List All Machines Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves a list of all registered machines and equipment within the plant. ```APIDOC ## GET /machines/ - List All Machines ### Description Returns all machines/equipment in the plant. ### Method GET ### Endpoint /machines/ ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/machines/" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of machine objects. - **id** (string) - The unique identifier for the machine. - **name** (string) - The name of the machine. #### Response Example ```json { "success": true, "data": [ { "id": "m001", "name": "CNC Machine 1" }, { "id": "m002", "name": "Lathe Machine 2" } ] } ``` ``` -------------------------------- ### GET /project-processor/status Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves the current status of the project processor background job. ```APIDOC ## GET /project-processor/status - Background Job Status ### Description Returns the current status of the project processor background job. ### Method GET ### Endpoint /mps-be/api/v1/project-processor/status ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/project-processor/status" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the job status details. - **job_name** (string) - The name of the job. - **running** (boolean) - Whether the job is currently running. - **is_processing** (boolean) - Whether the job is actively processing. - **last_cycle_time** (string) - The timestamp of the last job cycle in ISO 8601 format. #### Response Example ```json { "success": true, "data": { "job_name": "project_processor", "running": true, "is_processing": false, "last_cycle_time": "2025-03-02T10:00:00Z" } } ``` ``` -------------------------------- ### GET /events/ Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Provides an aggregated view of events, allowing filtering by type and time window for dashboard visualizations. ```APIDOC ## GET /events/ ### Description Main dashboard view — aggregated event data for charting. ### Method GET ### Endpoint /events/ ### Parameters #### Query Parameters - **event_types** (list[str]) - Optional - Filters events by type. Defaults to `["all"]`. Valid values: `all`, `project`, `maintenance`, `training`. - **time_window** (str) - Optional - Specifies the time frame for aggregation. Defaults to `year`. Valid values: `year`, `month`, `week`, `list`. - **year** (int) - Optional - Filters events by year. Defaults to the current year. Required if `time_window` is `month`. - **month** (int) - Optional - Filters events by month (1-12). Required if `time_window` is `month`. - **week_start** (str) - Optional - The start date of the week in ISO format. Required if `time_window` is `week`. - **include_summary** (bool) - Optional - Whether to include a summary of system-wide event statistics. Defaults to `true`. ### Request Example ```json { "example": "GET /events/?time_window=month&year=2025&month=3" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the aggregated event data. - **view** (string) - The type of view returned (`year`, `month`, `week`, `list`). - **year** (int) - The year for which data is aggregated (if applicable). - **summary** (object) - Summary statistics (if `include_summary` is true). - **system_total_events** (integer) - **events_this_month** (integer) - **events_on_track** (integer) - **events_delayed** (integer) - **year_data** (array) - Data aggregated by month for the year view. - **month** (string) - **month_number** (integer) - **on_track** (integer) - **delayed** (integer) - **total_this_month** (integer) - **peak_week** (integer) - **event_breakdown** (object) - **month_data** (array) - List of events for the month view. - **date** (string) - **event_id** (string) - **event_name** (string) - **event_type** (string) - **status** (string) - **description** (string) - **week_data** (array) - Data aggregated by day for the week view. - **day** (string) - **date** (string) - **events** (array) #### Response Example (Year View) ```json { "success": true, "data": { "view": "year", "year": 2025, "summary": { "system_total_events": 1200, "events_this_month": 85, "events_on_track": 60, "events_delayed": 25 }, "year_data": [ { "month": "January", "month_number": 1, "on_track": 45, "delayed": 12, "total_this_month": 57, "peak_week": 18, "event_breakdown": { "project": 30, "maintenance": 15, "training": 12 } } ] } } ``` #### Failure Responses - **400**: Invalid event type value - **400**: `month`/`year` missing for month view - **400**: `week_start` missing for week view - **400**: Any unexpected error (logged server-side) - **401**: Invalid/missing JWT - **500**: Database failure ``` -------------------------------- ### GET /events/details/project/notes - Notes List Source: https://context7.com/super-nived/industryapps-mps/llms.txt Fetches a paginated list of notes associated with a project. Supports filtering by work order sub ID. ```APIDOC ## GET /events/details/project/notes - Notes List ### Description Returns paginated notes for a project with optional filtering by work order sub ID. ### Method GET ### Endpoint /events/details/project/notes ### Parameters #### Query Parameters - **event_id** (string) - Required - The ID of the event or project. - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items per page. - **workorder_sub_id** (string) - Optional - Filters notes by a specific work order sub ID. #### Request Body None ### Request Example ```bash # Get all notes for a project curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/notes?event_id=AW-123050&page=1&limit=20" \ -H "Authorization: Bearer " # Filter by sub work order curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/notes?event_id=AW-123050&workorder_sub_id=1" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of note objects. - **id** (string) - The unique identifier for the note. - **username** (string) - The username of the person who added the note. - **note** (string) - The content of the note. - **delayReason** (string) - The name of the delay reason associated with the note. - **delayReasonId** (string) - The ID of the delay reason. - **time** (string) - The timestamp when the note was added. - **pagination** (object) - Pagination details. - **page** (integer) - Current page number. - **limit** (integer) - Items per page. - **total** (integer) - Total number of items. - **pages** (integer) - Total number of pages. #### Response Example ```json { "success": true, "data": [ { "id": "note123", "username": "john.doe", "note": "Supplier delayed due to customs clearance", "delayReason": "Supplier Delay", "delayReasonId": "reason001", "time": "2025-02-15 10:30:00" } ], "pagination": { "page": 1, "limit": 20, "total": 5, "pages": 1 } } ``` ``` -------------------------------- ### GET /events/details/project/note-types - Delay Reason Dropdown Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves a list of all available delay reason types, which can be used in dropdown menus for notes. ```APIDOC ## GET /events/details/project/note-types - Delay Reason Dropdown ### Description Returns all available delay reason types for the notes dropdown. ### Method GET ### Endpoint /events/details/project/note-types ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/note-types" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of delay reason objects. - **id** (string) - The unique identifier for the delay reason. - **name** (string) - The display name of the delay reason. #### Response Example ```json { "success": true, "data": [ { "id": "reason001", "name": "Supplier Delay" }, { "id": "reason002", "name": "Design Change" }, { "id": "reason003", "name": "Material Shortage" } ] } ``` ``` -------------------------------- ### Get Project Notes List Source: https://context7.com/super-nived/industryapps-mps/llms.txt Fetches a paginated list of notes associated with a specific project. Supports filtering by work order sub ID for more granular retrieval. Requires an event ID to specify the project. ```bash # Get all notes for a project curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/notes?event_id=AW-123050&page=1&limit=20" \ -H "Authorization: Bearer " # Filter by sub work order curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/notes?event_id=AW-123050&workorder_sub_id=1" \ -H "Authorization: Bearer " ``` -------------------------------- ### Success Response - Month View for Aggregated Events Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Example JSON response for the 'month' time window, detailing individual events within the specified month, including their date, ID, name, type, status, and a brief description. ```JSON { "success": true, "data": { "view": "month", "month_data": [ { "date": "2025-03-10", "event_id": "AW-123050", "event_name": "AW-123050", "event_type": "project", "status": "delayed", "description": "SO: SO-001, Qty: 5" } ] } } ``` -------------------------------- ### Success Response - Week View for Aggregated Events Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Example JSON response for the 'week' time window, showing a breakdown by day of the week within the specified week, including the date and a list of events occurring on that day. ```JSON { "success": true, "data": { "view": "week", "week_data": [ { "day": "Monday", "date": "2025-03-03", "events": [ ] } ] } } ``` -------------------------------- ### Get Delay Reason Dropdown Options Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Fetches a list of delay reasons used for populating a dropdown menu when adding notes to a project. Requires a valid JWT. Returns a list of delay reason objects, each with an id and name. ```HTTP GET /events/details/project/note-types ``` -------------------------------- ### GET /events/details/project/work-orders - Work Orders Tab Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves a paginated list of work orders associated with a project, including product codes, quantities, and their current status. Supports searching for specific work orders. ```APIDOC ## GET /events/details/project/work-orders - Work Orders Tab ### Description Returns paginated list of work orders for a project with product codes, quantities, and status. ### Method GET ### Endpoint /events/details/project/work-orders ### Parameters #### Query Parameters - **event_id** (string) - Required - The unique identifier of the project event. - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items per page. - **search** (string) - Optional - A search term to filter work orders. ### Request Example ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/work-orders?event_id=AW-123050&page=1&limit=20" \ -H "Authorization: Bearer " # Search work orders curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/work-orders?event_id=AW-123050&search=AW-2718.1-1" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of work order objects. - **woNumber** (string) - The work order number. - **product_code_description** (string) - Description of the product code. - **quantity** (integer) - The quantity for this work order. - **status** (string) - The current status of the work order. - **productionCommitment** (string) - The production commitment date (YYYY-MM-DD). - **blocker** (string|null) - Information about any blockers for the work order. - **pagination** (object) - Pagination details. - **page** (integer) - The current page number. - **limit** (integer) - The number of items per page. - **total** (integer) - The total number of items available. - **pages** (integer) - The total number of pages. #### Response Example ```json { "success": true, "data": [ { "woNumber": "AW-123050-1", "product_code_description": "PUMP ASSEMBLY", "quantity": 5, "status": "In Progress", "productionCommitment": "2025-03-15", "blocker": null } ], "pagination": { "page": 1, "limit": 20, "total": 12, "pages": 1 } } ``` ``` -------------------------------- ### Success Response - Year View for Aggregated Events Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Example JSON response for the 'year' time window, showing overall summary statistics and monthly event breakdowns including counts, peak weeks, and event type distribution. ```JSON { "success": true, "data": { "view": "year", "year": 2025, "summary": { "system_total_events": 1200, "events_this_month": 85, "events_on_track": 60, "events_delayed": 25 }, "year_data": [ { "month": "January", "month_number": 1, "on_track": 45, "delayed": 12, "total_this_month": 57, "peak_week": 18, "event_breakdown": { "project": 30, "maintenance": 15, "training": 12 } } ] } } ``` -------------------------------- ### Get Single Event by ID (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Fetches a single event record using its unique event ID. Requires an Authorization header with a JWT token. Returns a 200 OK with event data or a 404 Not Found. ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/AW-123050" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Project Processor Status API Endpoint Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Retrieves the current status of the project processor background job. Requires a valid JWT for authentication. Returns the job's state, including whether it's running and processing, and the last cycle time. Defaults to false/null if the job has never started. ```HTTP GET /project-processor/status ``` ```JSON { "success": true, "data": { "job_name": "project_processor", "running": true, "is_processing": false, "last_cycle_time": "2025-03-02T10:00:00Z" } } ``` -------------------------------- ### Run Backend Server Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Command to run the backend server using uvicorn. It enables hot-reloading for development and binds to all network interfaces on port 8000. ```bash uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 ``` -------------------------------- ### GET /events/{event_id} Source: https://github.com/super-nived/industryapps-mps/blob/main/README.md Fetches a single event record by its unique identifier. ```APIDOC ## GET /events/{event_id} ### Description Fetch one event record by its ID. ### Method GET ### Endpoint /events/{event_id} ### Parameters #### Path Parameters - **event_id** (str) - Required - Event identifier. ### Request Example ```json { "event_id": "AW-123050" } ``` ### Response #### Success Response (200) - **success** (bool) - Indicates if the request was successful. - **data** (object) - The event record. #### Response Example ```json { "success": true, "data": { } } ``` #### Failure Responses - **400**: Unexpected fetch error. - **401**: Invalid/missing JWT. - **404**: Event not found. - **503**: PocketBase unreachable. ``` -------------------------------- ### Get Project Work Orders Tab (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Fetches a paginated list of work orders for a project, including product codes, quantities, and status. Supports search functionality. Requires an event ID and Authorization header. ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/work-orders?event_id=AW-123050&page=1&limit=20" \ -H "Authorization: Bearer " # Search work orders curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/work-orders?event_id=AW-123050&search=AW-2718.1-1" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Project Detail Schema (Bash) Source: https://context7.com/super-nived/industryapps-mps/llms.txt Retrieves the dynamic UI structure for a project detail page, including headers and tabs. This should be called before accessing specific project tab data. Requires an event ID and Authorization header. ```bash curl -X GET "https://your-domain.com/mps-be/api/v1/events/details/project/schema?event_id=AW-123050" \ -H "Authorization: Bearer " ```