Files
citrus-cms/resources/views/guide/weld-logs-trigger-reference-guide.md
T
2026-04-28 21:15:09 +03:00

248 lines
7.7 KiB
Markdown

# Weld Logs Trigger Reference Guide
## Overview
When you update fields in a Weld Log record, the system automatically runs specific background processes (triggers) based on what you changed. This guide shows you exactly which triggers will run for each field change.
## Field-to-Trigger Mapping
### Test Package Related Fields
**Fields:** `test_package_no`, `iso_number`
**Triggers that will run:**
- ✅ Test Package Update
- ✅ Test Pack Base Status Changer
- ✅ NDE Calculation Updates
- ✅ Support Statistics Calculation
- ✅ Punch List Processing
- ✅ Golden Joints Tracking
**What gets updated:**
- Test package records and statistics
- Test package status (Waiting/On Going/Completed)
- ISO quantity calculations
- Welding progress tracking
- Support progress calculations
- Punch list quantities (A/B/C categories)
---
### Spool Related Fields
**Fields:** `spool_number`, `iso_number`, `type_of_joint`
**Triggers that will run:**
- ✅ Spool Status Changer
**What gets updated:**
- Spool status across the system
- Spool completion tracking
- Related ISO spool references
- Old and new spool status updates
---
### Line Engineering Fields
**Fields:** `line_number` (triggers on ANY field change)
**Triggers that will run:**
- ✅ Line Lists Update (runs on every change)
- ✅ Line-to-WeldLog Synchronization
**What gets updated:**
- Line list timestamps (for cron triggers)
- Engineering data sync from Line Lists
- Piping specifications and pressures
- Design parameters
- All weld logs with same line number
---
### NDE Matrix Fields
**Fields:** `type_of_welds`, `fluid_code`, `type_of_joint`
**Triggers that will run:**
- ✅ NDE Matrix Update
- ✅ NDE Requirements Calculation
- ✅ NDE Matrix to WeldLog Sync
**What gets updated:**
- NDE matrix records
- Joint type classifications
- NDE testing requirements (RT, UT, MT, PT, PMI, HT, Ferrite)
- Fluid-specific NDE rules
- Operating temperature and pressure
- Piping class and fluid group
---
### Material Classification Fields
**Fields:** `material_no_1`, `material_no_2`
**Triggers that will run:**
- ✅ Material Group Update
**What gets updated:**
- Russian material group classifications
- Material compatibility checks
- Steel grade mapping (80% similarity threshold)
- RU material group assignments
---
### Test Request Date Fields
**Fields:** `vt_request_date`, `ht_request_date`, `ut_request_date`, `mt_request_date`, `pmi_request_date`, `pt_request_date`, `rt_request_date`, `ferrite_request_date`
**Triggers that will run:**
- ✅ Request Number Generation
- ✅ Test Laboratory Synchronization
- ✅ Test Table Updates
**What gets updated:**
- Auto-generated request numbers
- Laboratory assignments
- Test scheduling
- Request tracking
- Test table records (radiographic_tests, ultrasonic_tests, etc.)
---
### Paint & Construction Fields
**Fields:** `line_number`, `fluid_code`, `spool_number`, `no_of_the_joint_as_per_as_built_survey`
**Triggers that will run:**
- ✅ Paint Follow Up Update
- ✅ Construction Paint Logs Sync
**What gets updated:**
- Paint follow-up records (SHOP/FIELD)
- Construction paint log entries
- Paint system specifications
- Coating schedules
- Brand names, RAL codes, thickness values
- Paint cycle information
---
### Handover Fields
**Fields:** `line_number`, `project`, `design_area`, `piping_type`
**Triggers that will run:**
- ✅ Handovers Sync
**What gets updated:**
- Handover records
- Project completion tracking
- Area-specific handover status
- Work type assignments
- Location mappings
---
## Always Running Processes
These processes run regardless of which field you change:
-**Repair Logs Update** - Updates repair status and dates
-**NDE Project Name Sync** - Syncs project names to NDE matrices
-**Line Lists Update** - Updates line list timestamps for cron triggers
## Quick Reference Table
| Field Changed | Test Package | Spool | Line | NDE | Material | Request | Paint | Handover |
|---------------|:------------:|:-----:|:----:|:---:|:--------:|:-------:|:-----:|:--------:|
| `test_package_no` | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `iso_number` | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `spool_number` | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
| `line_number` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
| `type_of_welds` | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| `fluid_code` | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
| `type_of_joint` | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| `material_no_1` | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
| `material_no_2` | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
| `vt_request_date` | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
| `project` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| `design_area` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| `piping_type` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| `no_of_the_joint_as_per_as_built_survey` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
## Common Scenarios
### Scenario 1: Changing Test Package
```
Fields: test_package_no = "TP-002"
Triggers: Test Package Update + Test Pack Base Status Changer + Line Lists Update
Processing Time: ~3-4 seconds
```
### Scenario 2: Changing Spool Number
```
Fields: spool_number = "SP-123-A"
Triggers: Spool Status Changer + Line Lists Update + Paint Follow Up
Processing Time: ~2-3 seconds
```
### Scenario 3: Changing Material
```
Fields: material_no_1 = "A106 Gr.B"
Triggers: Material Group Update + Line Lists Update
Processing Time: ~1-2 seconds
```
### Scenario 4: Changing Multiple Related Fields
```
Fields: test_package_no = "TP-002" + iso_number = "ISO-456"
Triggers: Test Package + Spool Status Changer + Line Lists Update
Processing Time: ~4-5 seconds
```
### Scenario 5: Changing Paint-Related Fields
```
Fields: line_number = "L-001" + fluid_code = "HW"
Triggers: Line Lists + NDE Matrix + Paint Follow Up + Handovers
Processing Time: ~5-6 seconds
```
### Scenario 6: Changing NDE Fields
```
Fields: type_of_welds = "BW" + fluid_code = "HW"
Triggers: NDE Matrix Update + Line Lists Update
Processing Time: ~3-4 seconds
```
## Performance Tips
- **Single Field Changes:** Fastest processing, only relevant triggers run
- **Related Field Changes:** Moderate processing, multiple related triggers may run
- **Cross-System Changes:** Slower processing when changes affect multiple modules
- **Bulk Updates:** Consider the cumulative effect of multiple field changes
- **Line Lists Update:** Runs on every change to keep data fresh
## Troubleshooting
### If Expected Data Doesn't Update
1. Check if the field you changed has an associated trigger
2. Verify the field value actually changed from its previous value
3. Look at system logs for trigger execution confirmation
4. Check if Line Lists Update ran (it runs on every change)
### If Processing Seems Slow
1. Identify which fields you changed
2. Count how many trigger categories are affected
3. Multiple triggers running simultaneously is normal for related fields
4. Line Lists Update runs on every change for data freshness
### If Data Appears Inconsistent
1. Ensure related fields are updated together (e.g., test_package_no + iso_number)
2. Check that all required fields have values
3. Verify the sequence of your changes
4. Check if NDE Matrix sync completed properly
### Common Issues
- **Material Group Not Updated:** Check if steel grade similarity is above 80%
- **Paint Follow Up Missing:** Ensure line has S-type joints for SHOP records
- **Test Package Status Wrong:** Verify welding completion percentages
- **NDE Requirements Missing:** Check if joint type and fluid code match matrix
---
*This guide reflects the current optimized trigger system that runs necessary processes based on field changes, with Line Lists Update running on every change to maintain data freshness.*