Skip to content
forms-raw_singleitemedit-icon
navigation
modification_btn
docs
messages
flatprojectmap.handlebars
Plug-in - Lopap
modificationbutton
docs_htmltables.handlebars

Plug-in - Lopap

docs_html.handlebars
documentation.handlebars

LOPAP Plugin – Life of Physical Asset Plans (Conveyors v1)

Draft specification for Shiftbulk plugin


1. Overview

1.1 Plugin Name

LOPAP – Life of Physical Asset Plans module.

1.2 Purpose

LOPAP provides a Life of Physical Asset Plan Registry and LOPAP Dashboard for the Shiftbulk ecosystem.

Definition:
“An equipment / asset class–specific plan and multi-year forecast of cost, resources, major component replacements, and special considerations for that particular asset. Its time horizon is for the life of that specific asset.”

Key v1 Scope: Focused entirely on conveyor systems and their life-of-asset plans.

LOPAPs are created as standalone conveyor class plans. Later versions will allow:

  • Assigning equipment to a LOPAP
  • Using LOPAPs to generate maintenance plans (Albatross)

LOPAP integrates into existing Shiftbulk structures:

  • Express + Handlebars
  • Tailwind CSS (via global layout – no {{extend}} required)
  • MongoDB + Mongoose
  • Views under plugins/lopap/views

Important: LOPAP screens must render gracefully in low-data and no-data conditions, displaying friendly empty states.

1.3 Mount Point

const lopap = require('./plugins/lopap');
                    app.use('/lopap', lopap);
                    

2. Goals & Non-Goals

2.1 Goals

  • Create a registry of conveyor LOPAPs with full metadata
  • Model multi-year life-of-asset plan lines
  • Provide a dashboard with roll-ups and coverage indicators
  • Full CRUD capability
  • Appropriate empty-state messaging for low/no-data views
  • Future-ready for equipment-to-plan allocation

2.2 Non-Goals

  • No work-order generation (Osprey does this)
  • No scheduling logic
  • No advanced resource planning
  • No cross-plugin deep joins

3. Positioning in Shiftbulk

  • LOPAP – Defines life-of-asset plans for conveyor classes
  • Albatross – Detailed maintenance plans derived later
  • Osprey – Work orders (execution)

4. Data Model

4.1 Mongoose Model: LopapPlan

File: plugins/lopap/models/LopapPlan.js

Collection: lopap_plans

Plan Header

  • title – required
  • description – long text
  • status – draft | active | superseded | archived
  • criticality – low | medium | high | critical
  • lopapType – conveyor_life | conveyor_upgrade | mixed

Conveyor Class Metadata

  • conveyorClassCode
  • conveyorType – Overland / Plant conveyor / Shuttle / etc.
  • nominalCapacityTph
  • lengthM
  • liftM
  • dutyDescription

Time Horizon

  • designLifeYears
  • startYear
  • endYear

Revision

  • planCode
  • revision
  • revisionDate
  • approvedBy
  • sourceDocument

LOPAP Lines

{
                      sequence,
                      year,
                      relativeYear,
                      eventType,
                      eventTitle,
                      description,
                      costEstimate,
                      costCurrency,
                      costType,
                      costBand,
                      resourceNotes,
                      riskIfDeferred,
                      riskLevelIfDeferred,
                      references,
                      isMandatory,
                      isActive
                    }
                    

Lifecycle

  • owner
  • tags
  • isActive
  • Timestamps: createdAt, updatedAt

5. Routes

5.1 Dashboard & Browsing

  • GET /lopap – Dashboard
  • GET /lopap/conveyor-type/:conveyorType

5.2 CRUD

  • GET /lopap/plans
  • GET /lopap/plans/new
  • POST /lopap/plans
  • GET /lopap/plans/:id
  • GET /lopap/plans/:id/edit
  • POST /lopap/plans/:id
  • POST /lopap/plans/:id/delete

5.3 Optional Lifecycle

  • POST /lopap/plans/:id/activate
  • POST /lopap/plans/:id/supersede

6. Controllers

File: plugins/lopap/controllers/lopapController.js

6.1 summarizePlans()

Returns counts + health classification.

6.2 computeCoverageStats()

Optional helper for conveyor-class coverage.

6.3 Methods

  • dashboard()
  • conveyorTypeDetail()
  • listPlans()
  • newPlanForm()
  • createPlan()
  • showPlan()
  • editPlanForm()
  • updatePlan()
  • deletePlan()

7. Views & Tailwind Layout

No {{extend}} should be used – the global Express layout applies automatically.

7.1 Dashboard

  • Show summary cards
  • Conveyor type grid
  • Low/no-data friendly states

7.2 Conveyor Type View

Lists plans for each conveyor type with coverage indicators.

7.3 Plans List View

  • Filter bar
  • Table of LOPAPs
  • Actions
  • Empty-state message

7.4 New / Edit

Full header, metadata and LOPAP line table with add/remove rows.

7.5 Show View

Displays header, horizon, metadata and LOPAP line table/cards.


8. Integration

8.1 Views Root

path.join(__dirname, 'plugins/lopap/views')

8.2 Partials

{
                      dir: path.join(__dirname, 'plugins/lopap/views/lopap/partials'),
                      namespace: 'lopap'
                    }
                    

8.3 Future Atlas Integration

V1 is purely standalone.

8.4 Tailwind

No extra CSS required.


9. Validation & Error Handling

9.1 Validation

  • Title required
  • Status, criticality enums required
  • At least minimal horizon metadata
  • LOPAP line validation

9.2 Error Handling

Re-render form with messages and user-entered values.

9.3 404 Handling

Redirect to list or main 404 page.


10. LLM Implementation Instructions

10.1 File Structure

plugins/
                      lopap/
                        index.js
                        models/
                          LopapPlan.js
                        controllers/
                          lopapController.js
                        views/
                          lopap/
                            dashboard.handlebars
                            conveyorType.handlebars
                            plans/
                              index.handlebars
                              new.handlebars
                              edit.handlebars
                              show.handlebars
                            partials/
                              status_badge.handlebars
                              criticality_badge.handlebars
                              risk_badge.handlebars
                    

10.2 Requirements

  • CommonJS
  • No diffs – produce full file outputs
  • Views use Tailwind only
  • Empty-state handling required everywhere
modal1
modal2
modal3
docs_javascript
new_issue_button.handlebars
shortcut_edit