3.4 KiB
3.4 KiB
Non-Welded Joint Types – Final Roadmap
Branch: feature/weldlog-non-welded-joints
Scope: Mechanical joints (BJ, FJ, TH, CJ) must be editable in grids but excluded from every welding-related calculation, report and sync path.
1. Foundation (Database + Helpers)
joint_typestable now hasis_welded,is_mechanical,has_ndt(see migrations2025_11_14_181113_*,2025_11_14_181220_*).MechanicalJointTypesSeederguarantees the core mechanical joints exist in every environment.JointTypeService+app/Functions/joint_type_helpers.phpcache joint-type lists and expose helpers:apply_welded_filter()/apply_mechanical_filter()wrap any Builder or table name and add the correctwhereIn.is_welded_joint,is_mechanical_joint,requires_ndt, cache clear helpers.
2. DevExtreme Grid Behaviour
resources/views/components/table/datagrid*.blade.phphandles everything:- Greys out mechanical rows, disables welder/WPS/NDT fields, keeps
fitter_name+ fit-up dates editable. - Footer SUM/AVG now send
excludeMechanicalSummary=1; backend (SummaryContext+AggregateHelper) runsCASE WHENfilters so totals only consider welded joints. type_of_weldsdropdown restored for Weldlog/Weldmap (joint_types + fallback list).
- Greys out mechanical rows, disables welder/WPS/NDT fields, keeps
3. Application Surfaces Updated
| Area | Files | Result |
|---|---|---|
| Dashboards & reports | resources/views/admin-ajax/*, resources/views/admin/dashboard/chart/monthly-progress.blade.php |
Every weld log query wraps apply_welded_filter, so mechanical rows never inflate KPIs. |
| Cron & sync jobs | resources/views/cron/*.blade.php, app/Http/Controllers/SaveTrigger/test_pack_base_statuses.php |
Spool, paint, NDE and test-package syncs skip mechanical joints automatically. |
| Register Creator & PDFs | app/Services/RegisterCreator/..., resources/views/admin-ajax/pdf/*, generate-pdf-* |
Register exports and PDF builders read only welded joints; mechanical rows do not trigger file searches. |
| Page modules | resources/views/admin/type/weldlog.blade.php, weldmap*.blade.php, nde-matrix.blade.php, manage-ndt.blade.php, spool-release* |
All modules share the same helper-based filtering and the DevExtreme UI behaviour. |
4. Testing & Tooling
php artisan mechanical:verify-summaries --columns=nps_1,...validates SUM/AVG output; CLI table prints welded vs mechanical totals for audit.- Guide and roadmap (this file +
mechanical-overview.md) explain the architecture and test plan.
5. Commands & References
# Seed mechanical joints (first-time environments)
php artisan db:seed --class=MechanicalJointTypesSeeder
# Rebuild helper cache if joint_types table changes
php artisan tinker --execute="clear_joint_types_cache();"
# Run SUM/AVG regression
php artisan mechanical:verify-summaries --columns=nps_1,nps_2,outside_diameter_1,outside_diameter_2,wall_thickness_1,wall_thickness_2
6. Key Principles
- Never query
weld_logswithoutapply_welded_filter()unless the screen explicitly needs mechanical rows. - Mechanical rows can exist in listings (for fit-up tracking) but should not trigger welding KPIs, NDT scopes, spool or paint logic.
- DevExtreme grids are the single source of UI logic; avoid duplicating mechanical detection per module.
- Register/PDF builders must only read welded joints to keep QA documentation aligned with real weld data.
Last Updated: 2025-11-21
Owner: AI Assistant + Team