Files
citrus-cms/resources/views/guide/request-ndt-calculation.md
T
2026-04-28 21:15:09 +03:00

70 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NDT Request Calculation Guide / NDT Talebi Hesaplama Kılavuzu
## English / İngilizce
This document describes the logic for identifying and displaying pending NDT (Non-Destructive Testing) requests as implemented in `request-ndt-no-cache.blade.php`.
### 1. Data Source
The primary data source is the `weld_logs` table.
### 2. Open Request Criteria
A weld is considered to have an **Open NDT Request** if it meets the following criteria for a specific test type (RT, UT, MT, PT, VT, etc.):
* **Request Date Exists**: The `[test_type]_request_date` column must contain a valid date.
* *Invalid values:* null, empty string, `0000-00-00`, `1970-01-01`.
* **No Test Date**: The `[test_type]_test_date` column must be empty.
* **No Result**: The `[test_type]_result` column must be empty.
### 3. Data Flow and Enrichment
1. **Initial Fetch**: Records are fetched from `weld_logs`, optionally filtered by date ranges (`d1`/`d2` for test date, `rd1`/`rd2` for request date).
2. **Test Metadata**: Standard controls and error types are loaded from specific test tables (RT, UT, etc.) using `iso_number` and `joint_number` as keys.
3. **Filtration**: The criteria mentioned in section 2 are applied to each test type for every record.
4. **Enrichment**: Meeting records are mapped with additional fields like `test_laboratory`, `control_standart`, and `scope`.
### 4. Logic Flowchart
```mermaid
graph TD
A[Start: Fetch Weld Logs] --> B{Filter by Date Params?}
B -- Yes --> C[Apply test_date or request_date filters]
B -- No --> D[Fetch all active records]
C --> E[Load Test Type Metadata (RT, UT, MT...)]
D --> E
E --> F[Iterate each Weld Log & Test Type]
F --> G{Valid Request Date?}
G -- No --> H[Skip]
G -- Yes --> I{Is Test Date Empty?}
I -- No --> H
I -- Yes --> J{Is Result Empty?}
J -- No --> H
J -- Yes --> K[ADD TO PENDING REQUESTS]
K --> L[Map: Laboratory, Standart, Scope, etc.]
L --> M[Output JSON]
```
---
## Türkçe / Turkish
Bu belge, `request-ndt-no-cache.blade.php` dosyasında uygulanan bekleyen NDT (Tahribatsız Muayene) taleplerinin belirlenmesi ve görüntülenmesi mantığını açıklar.
### 1. Veri Kaynağı
Temel veri kaynağı `weld_logs` tablosudur.
### 2. Açık Talep Kriterleri
Bir kaynak dikişi, belirli bir test türü (RT, UT, MT, PT, VT vb.) için aşağıdaki kriterleri karşılıyorsa **Bekleyen NDT Talebi** olarak kabul edilir:
* **Talep Tarihi Mevcut**: `[test_type]_request_date` sütunu geçerli bir tarih içermelidir.
* *Geçersiz değerler:* null, boş metin, `0000-00-00`, `1970-01-01`.
* **Test Tarihi Boş**: `[test_type]_test_date` sütunu boş olmalıdır.
* **Sonuç Boş**: `[test_type]_result` sütunu boş olmalıdır.
### 3. Veri Akışı ve Zenginleştirme
1. **İlk Çekim**: Kayıtlar `weld_logs` tablosundan çekilir, isteğe bağlı olarak tarih aralıklarına göre filtrelenir.
2. **Test Meta Verileri**: Standart kontroller ve hata türleri, `iso_number` ve `joint_number` anahtarları kullanılarak özel test tablolarından (RT, UT vb.) yüklenir.
3. **Filtreleme**: Bölüm 2'de belirtilen kriterler, her kayıt için her test türüne uygulanır.
4. **Zenginleştirme**: Kriterlere uyan kayıtlar; `test_laboratory`, `control_standart` ve `scope` gibi ek alanlarla eşleştirilir.
### 4. Mantıksal Akış Şeması
(Yukarıdaki Mermaid şeması her iki dil için de geçerlidir.)