mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 05:21:57 +00:00
codex/command: migrate egg stocks from kandang to farm
This commit is contained in:
@@ -0,0 +1,286 @@
|
||||
# Runbook Cutover Stok Telur Historis Kandang ke Gudang Farm
|
||||
|
||||
## Tujuan
|
||||
|
||||
Runbook ini dipakai untuk memindahkan **stok telur historis yang masih on-hand di gudang kandang** ke **gudang farm** secara aman, audit-able, dan reversible.
|
||||
|
||||
Cutover dilakukan dengan **transfer stok eksplisit**, bukan dengan mengubah `recording_eggs.product_warehouse_id` historis.
|
||||
|
||||
## Scope
|
||||
|
||||
Runbook ini hanya untuk:
|
||||
- stok telur historis kandang-level yang masih punya saldo on-hand
|
||||
- lokasi yang masuk kategori **clean cutover**
|
||||
- lokasi yang sudah punya gudang farm
|
||||
|
||||
Runbook ini **tidak** dipakai untuk:
|
||||
- lokasi overlap seperti `Cijangkar`
|
||||
- koreksi histori `recording_eggs`
|
||||
- migrasi stok non-telur
|
||||
|
||||
## Kebijakan yang Dikunci
|
||||
|
||||
- Sumber qty yang dipindah adalah **`product_warehouses.qty` saat cutover**
|
||||
- Perintah dijalankan **per lokasi**
|
||||
- Wajib mulai dari `dry-run`
|
||||
- `--apply` hanya boleh dijalankan setelah review dry-run dan SQL checklist
|
||||
- Lokasi overlap tidak ikut otomatis kecuali ada approval khusus dan `--include-overlap`
|
||||
- Rollback hanya boleh dilakukan jika transfer hasil cutover belum dipakai transaksi turunan
|
||||
|
||||
## Lokasi Fase 1
|
||||
|
||||
Lokasi yang boleh dieksekusi pada fase pertama:
|
||||
- `Jamali`
|
||||
- `Cantilan`
|
||||
- `Darawati`
|
||||
- `Tamansari`
|
||||
|
||||
Lokasi yang harus ditahan:
|
||||
- `Cijangkar`
|
||||
|
||||
## Prasyarat
|
||||
|
||||
Sebelum eksekusi, pastikan:
|
||||
- backend sudah ter-deploy dengan command [main.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/cmd/migrate-legacy-egg-stock-to-farm/main.go)
|
||||
- reusable transfer core sudah ikut ter-deploy:
|
||||
- [transfer.service.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/internal/modules/inventory/transfers/services/transfer.service.go)
|
||||
- [system_transfer.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/internal/modules/inventory/transfers/services/system_transfer.go)
|
||||
- migrasi farm stock attribution sebelumnya sudah terpasang
|
||||
- akses database target sudah tersedia
|
||||
- environment target memakai SSL bila RDS mewajibkan, contoh:
|
||||
- `DB_SSLMODE=require`
|
||||
|
||||
## Catatan Output Command
|
||||
|
||||
Mode `--output table` adalah mode operasional yang direkomendasikan.
|
||||
|
||||
Mode `--output json` bisa dipakai, tetapi pada environment saat ini output JSON masih dapat didahului log bootstrap aplikasi atau SQL logger. Untuk review manual gunakan `table`. Untuk parsing otomatis, filter payload mulai dari `{`.
|
||||
|
||||
## Format Command
|
||||
|
||||
### Dry-run
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--location-name Jamali \
|
||||
--output table
|
||||
```
|
||||
|
||||
### Apply
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--location-name Jamali \
|
||||
--cutover-date 2026-04-07 \
|
||||
--apply \
|
||||
--output table
|
||||
```
|
||||
|
||||
### Rollback Preview
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--rollback-run-id <run_id> \
|
||||
--output table
|
||||
```
|
||||
|
||||
### Rollback Apply
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--rollback-run-id <run_id> \
|
||||
--apply \
|
||||
--output table
|
||||
```
|
||||
|
||||
## Arti `run_id`
|
||||
|
||||
Setiap dry-run/apply menghasilkan `run_id`, misalnya:
|
||||
|
||||
```text
|
||||
egg-cutover-20260407T130344.220407000Z
|
||||
```
|
||||
|
||||
`run_id` ini wajib disimpan karena dipakai untuk:
|
||||
- audit hasil cutover
|
||||
- query verifikasi
|
||||
- rollback
|
||||
|
||||
## Prosedur Eksekusi Per Lokasi
|
||||
|
||||
### 1. Persiapan
|
||||
|
||||
Tentukan:
|
||||
- `location_name`
|
||||
- `cutover_date`
|
||||
- operator yang bertanggung jawab
|
||||
|
||||
Contoh:
|
||||
- lokasi: `Jamali`
|
||||
- cutover date: `2026-04-07`
|
||||
|
||||
### 2. Jalankan Dry-run
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--location-name Jamali \
|
||||
--output table
|
||||
```
|
||||
|
||||
Yang harus dicek pada hasil dry-run:
|
||||
- status lokasi `CLEAN_CUTOVER`
|
||||
- semua baris yang akan dipindah punya `status=eligible`
|
||||
- gudang tujuan adalah gudang farm lokasi tersebut
|
||||
- qty yang dipindah masuk akal dan sesuai saldo on-hand aktual
|
||||
- tidak ada `missing_farm_warehouse`
|
||||
- tidak ada `overlap_location`
|
||||
|
||||
### 3. Jalankan Checklist SQL Before
|
||||
|
||||
Gunakan file:
|
||||
- [legacy_egg_cutover_verification_checklist.sql](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/docs/sql/legacy_egg_cutover_verification_checklist.sql)
|
||||
|
||||
Minimal pastikan:
|
||||
- lokasi memang clean cutover
|
||||
- stok telur kandang positif masih ada
|
||||
- gudang farm ada
|
||||
- belum ada transfer `EGG_FARM_CUTOVER` aktif untuk lokasi yang sama pada run yang akan dipakai
|
||||
|
||||
### 4. Simpan Evidence Sebelum Apply
|
||||
|
||||
Simpan:
|
||||
- output dry-run
|
||||
- hasil query before
|
||||
- nama operator
|
||||
- waktu eksekusi
|
||||
|
||||
Disarankan simpan dalam ticket / change record.
|
||||
|
||||
### 5. Jalankan Apply
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--location-name Jamali \
|
||||
--cutover-date 2026-04-07 \
|
||||
--apply \
|
||||
--output table
|
||||
```
|
||||
|
||||
Setelah apply, simpan:
|
||||
- `run_id`
|
||||
- seluruh row dengan `transfer_id`
|
||||
- movement number yang terbentuk
|
||||
|
||||
### 6. Jalankan Checklist SQL After
|
||||
|
||||
Masih menggunakan file:
|
||||
- [legacy_egg_cutover_verification_checklist.sql](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/docs/sql/legacy_egg_cutover_verification_checklist.sql)
|
||||
|
||||
Minimal pastikan:
|
||||
- transfer header/detail tercatat untuk `run_id`
|
||||
- qty source berkurang sesuai transfer
|
||||
- qty farm bertambah sesuai transfer
|
||||
- total gabungan source+dest per produk per lokasi tetap sama
|
||||
- stok eligible tidak lagi tersedia di gudang kandang
|
||||
- stok telur sekarang tersedia di gudang farm
|
||||
|
||||
### 7. Smoke Test UI
|
||||
|
||||
Lakukan minimal:
|
||||
- buka product stock farm untuk lokasi tersebut
|
||||
- pastikan produk telur hasil migrasi muncul
|
||||
- buat SO farm-level dan pastikan opsi produk telur tersedia
|
||||
- pastikan recording telur baru setelah cutover tetap langsung masuk ke gudang farm
|
||||
|
||||
### 8. Tutup Eksekusi
|
||||
|
||||
Catat hasil akhir:
|
||||
- sukses/gagal
|
||||
- `run_id`
|
||||
- lokasi
|
||||
- tanggal cutover
|
||||
- operator
|
||||
- link ke evidence SQL/UI
|
||||
|
||||
## Kriteria Go / No-Go
|
||||
|
||||
### Boleh lanjut apply bila:
|
||||
|
||||
- dry-run menunjukkan hanya row yang memang expected
|
||||
- lokasi `CLEAN_CUTOVER`
|
||||
- gudang farm valid
|
||||
- query before menunjukkan tidak ada anomaly blocking
|
||||
|
||||
### Wajib stop bila:
|
||||
|
||||
- lokasi terdeteksi `OVERLAP`
|
||||
- ada qty aneh atau tidak sesuai data lapangan
|
||||
- gudang farm tidak ada
|
||||
- ada transfer lama serupa yang belum direkonsiliasi
|
||||
- setelah apply terjadi selisih total source+dest
|
||||
|
||||
## Rollback Runbook
|
||||
|
||||
### Kapan rollback boleh dilakukan
|
||||
|
||||
Rollback boleh jika:
|
||||
- transfer hasil cutover belum dipakai transaksi turunan
|
||||
- verifikasi after menunjukkan issue yang membuat hasil cutover tidak dapat diterima
|
||||
|
||||
### Langkah rollback
|
||||
|
||||
1. Preview rollback:
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--rollback-run-id <run_id> \
|
||||
--output table
|
||||
```
|
||||
|
||||
2. Jalankan query rollback readiness pada file audit/helper SQL.
|
||||
3. Jika aman, apply rollback:
|
||||
|
||||
```bash
|
||||
DB_SSLMODE=require go run ./cmd/migrate-legacy-egg-stock-to-farm \
|
||||
--rollback-run-id <run_id> \
|
||||
--apply \
|
||||
--output table
|
||||
```
|
||||
|
||||
4. Jalankan ulang query verifikasi after rollback.
|
||||
|
||||
### Kapan rollback akan gagal by design
|
||||
|
||||
Rollback memang harus gagal jika:
|
||||
- transfer hasil cutover sudah dipakai sales/recording/transaksi turunan
|
||||
- sudah ada `stock_allocations` consume aktif terhadap `STOCK_TRANSFER_IN`
|
||||
|
||||
## Urutan Rollout yang Direkomendasikan
|
||||
|
||||
### Dev
|
||||
|
||||
1. Dry-run per lokasi
|
||||
2. Review SQL before
|
||||
3. Apply per lokasi
|
||||
4. SQL after
|
||||
5. Smoke UI
|
||||
6. Simpan `run_id`
|
||||
|
||||
### Production
|
||||
|
||||
1. Freeze operasional lokasi target bila perlu
|
||||
2. Dry-run
|
||||
3. Review by dev + ops + finance/stock owner
|
||||
4. Apply
|
||||
5. SQL after
|
||||
6. Smoke UI
|
||||
7. Release lokasi berikutnya
|
||||
|
||||
## Referensi
|
||||
|
||||
- Command cutover: [main.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/cmd/migrate-legacy-egg-stock-to-farm/main.go)
|
||||
- Test command: [main_test.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/cmd/migrate-legacy-egg-stock-to-farm/main_test.go)
|
||||
- Core reusable transfer: [system_transfer.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/internal/modules/inventory/transfers/services/system_transfer.go)
|
||||
- Transfer service refactor: [transfer.service.go](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/internal/modules/inventory/transfers/services/transfer.service.go)
|
||||
- Checklist SQL: [legacy_egg_cutover_verification_checklist.sql](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/docs/sql/legacy_egg_cutover_verification_checklist.sql)
|
||||
- Helper query audit: [legacy_egg_cutover_audit_queries.sql](/Users/macbookair/Documents/coding/projects/LTI-ERP/lti-api/docs/sql/legacy_egg_cutover_audit_queries.sql)
|
||||
@@ -0,0 +1,343 @@
|
||||
-- Legacy Egg Cutover Audit Helper Queries
|
||||
-- Ad-hoc query pack for investigation, audit, dry-run review, and rollback readiness.
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-01 All locations classified by kandang/farm egg posting timing
|
||||
-- =====================================================================
|
||||
WITH timing AS (
|
||||
SELECT
|
||||
pf.location_id AS location_id,
|
||||
l.name AS location_name,
|
||||
MIN(CASE WHEN w.type = 'KANDANG' THEN DATE(r.record_datetime) END) AS first_kandang_date,
|
||||
MAX(CASE WHEN w.type = 'KANDANG' THEN DATE(r.record_datetime) END) AS last_kandang_date,
|
||||
MIN(CASE WHEN w.type = 'LOKASI' THEN DATE(r.record_datetime) END) AS first_farm_date,
|
||||
MAX(CASE WHEN w.type = 'LOKASI' THEN DATE(r.record_datetime) END) AS last_farm_date
|
||||
FROM recording_eggs re
|
||||
JOIN recordings r ON r.id = re.recording_id
|
||||
JOIN project_flock_kandangs pk ON pk.id = COALESCE(re.project_flock_kandang_id, r.project_flock_kandangs_id)
|
||||
JOIN project_flocks pf ON pf.id = pk.project_flock_id
|
||||
JOIN locations l ON l.id = pf.location_id
|
||||
JOIN product_warehouses pw ON pw.id = re.product_warehouse_id
|
||||
JOIN warehouses w ON w.id = pw.warehouse_id
|
||||
GROUP BY pf.location_id, l.name
|
||||
)
|
||||
SELECT
|
||||
location_id,
|
||||
location_name,
|
||||
first_kandang_date,
|
||||
last_kandang_date,
|
||||
first_farm_date,
|
||||
last_farm_date,
|
||||
CASE
|
||||
WHEN first_farm_date IS NULL THEN 'KANDANG_ONLY'
|
||||
WHEN last_kandang_date IS NULL OR first_farm_date > last_kandang_date THEN 'CLEAN_CUTOVER'
|
||||
ELSE 'OVERLAP'
|
||||
END AS location_status
|
||||
FROM timing
|
||||
ORDER BY location_name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-02 All legacy kandang egg product warehouses with positive on-hand
|
||||
-- =====================================================================
|
||||
WITH first_farm AS (
|
||||
SELECT location_id, MIN(id) AS farm_warehouse_id
|
||||
FROM warehouses
|
||||
WHERE type = 'LOKASI'
|
||||
AND deleted_at IS NULL
|
||||
GROUP BY location_id
|
||||
)
|
||||
SELECT
|
||||
l.id AS location_id,
|
||||
l.name AS location_name,
|
||||
kw.id AS source_warehouse_id,
|
||||
kw.name AS source_warehouse_name,
|
||||
fw.id AS farm_warehouse_id,
|
||||
fw.name AS farm_warehouse_name,
|
||||
pw.id AS product_warehouse_id,
|
||||
p.id AS product_id,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS on_hand_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses kw
|
||||
ON kw.id = pw.warehouse_id
|
||||
AND kw.type = 'KANDANG'
|
||||
AND kw.deleted_at IS NULL
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
LEFT JOIN first_farm ff ON ff.location_id = kw.location_id
|
||||
LEFT JOIN warehouses fw ON fw.id = ff.farm_warehouse_id
|
||||
WHERE EXISTS (
|
||||
SELECT 1 FROM recording_eggs re WHERE re.product_warehouse_id = pw.id
|
||||
)
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
AND COALESCE(pw.qty, 0) > 0
|
||||
ORDER BY l.name, kw.name, p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-03 Totals per location for phase sizing
|
||||
-- =====================================================================
|
||||
WITH candidates AS (
|
||||
SELECT
|
||||
l.name AS location_name,
|
||||
COALESCE(pw.qty, 0) AS on_hand_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses kw
|
||||
ON kw.id = pw.warehouse_id
|
||||
AND kw.type = 'KANDANG'
|
||||
AND kw.deleted_at IS NULL
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
WHERE EXISTS (
|
||||
SELECT 1 FROM recording_eggs re WHERE re.product_warehouse_id = pw.id
|
||||
)
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
AND COALESCE(pw.qty, 0) > 0
|
||||
)
|
||||
SELECT
|
||||
location_name,
|
||||
COUNT(*) AS positive_rows,
|
||||
SUM(on_hand_qty) AS total_on_hand_qty
|
||||
FROM candidates
|
||||
GROUP BY location_name
|
||||
ORDER BY location_name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-04 Locations missing farm warehouse
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
l.id AS location_id,
|
||||
l.name AS location_name
|
||||
FROM locations l
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM warehouses kw
|
||||
WHERE kw.location_id = l.id
|
||||
AND kw.type = 'KANDANG'
|
||||
AND kw.deleted_at IS NULL
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM warehouses fw
|
||||
WHERE fw.location_id = l.id
|
||||
AND fw.type = 'LOKASI'
|
||||
AND fw.deleted_at IS NULL
|
||||
)
|
||||
ORDER BY l.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-05 Legacy recording_eggs still pointing to kandang warehouse
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
l.name AS location_name,
|
||||
kw.name AS kandang_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COUNT(*) AS recording_rows
|
||||
FROM recording_eggs re
|
||||
JOIN product_warehouses pw ON pw.id = re.product_warehouse_id
|
||||
JOIN warehouses kw ON kw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE kw.type = 'KANDANG'
|
||||
GROUP BY l.name, kw.name, p.name
|
||||
ORDER BY l.name, kw.name, p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-06 Farm-level recording_eggs already present
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
l.name AS location_name,
|
||||
fw.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COUNT(*) AS recording_rows
|
||||
FROM recording_eggs re
|
||||
JOIN product_warehouses pw ON pw.id = re.product_warehouse_id
|
||||
JOIN warehouses fw ON fw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = fw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE fw.type = 'LOKASI'
|
||||
GROUP BY l.name, fw.name, p.name
|
||||
ORDER BY l.name, fw.name, p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-07 Transfers created by cutover reason, grouped by run_id
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
SPLIT_PART(SPLIT_PART(st.reason, '|run_id=', 2), '|', 1) AS run_id,
|
||||
COUNT(DISTINCT st.id) AS transfer_count,
|
||||
COUNT(std.id) AS detail_count,
|
||||
SUM(COALESCE(std.total_qty, std.usage_qty, 0)) AS total_moved_qty,
|
||||
MIN(st.transfer_date) AS first_transfer_date,
|
||||
MAX(st.transfer_date) AS last_transfer_date
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
WHERE st.reason LIKE 'EGG_FARM_CUTOVER|run_id=%'
|
||||
GROUP BY 1
|
||||
ORDER BY first_transfer_date DESC, run_id DESC;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-08 Detailed summary per run_id
|
||||
-- Replace <run_id> before running.
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
st.transfer_date,
|
||||
ws.name AS source_warehouse_name,
|
||||
wd.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(std.total_qty, std.usage_qty, 0) AS moved_qty,
|
||||
st.deleted_at
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
JOIN warehouses ws ON ws.id = st.from_warehouse_id
|
||||
JOIN warehouses wd ON wd.id = st.to_warehouse_id
|
||||
WHERE st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id, p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-09 Downstream consumption check per run_id
|
||||
-- Replace <run_id> before running.
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
p.name AS product_name,
|
||||
sa.usable_type,
|
||||
sa.usable_id,
|
||||
sa.qty,
|
||||
sa.function_code,
|
||||
sa.flag_group_code
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
JOIN stock_allocations sa
|
||||
ON sa.stockable_type = 'STOCK_TRANSFER_IN'
|
||||
AND sa.stockable_id = std.id
|
||||
AND sa.status = 'ACTIVE'
|
||||
AND sa.allocation_purpose = 'CONSUME'
|
||||
AND sa.deleted_at IS NULL
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id, p.name, sa.usable_type, sa.usable_id;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-10 Stock log reconciliation per cutover transfer detail
|
||||
-- Replace <run_id> before running.
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
p.name AS product_name,
|
||||
std.id AS transfer_detail_id,
|
||||
COALESCE(std.total_qty, std.usage_qty, 0) AS moved_qty,
|
||||
SUM(CASE WHEN sl.decrease > 0 THEN sl.decrease ELSE 0 END) AS total_logged_out,
|
||||
SUM(CASE WHEN sl.increase > 0 THEN sl.increase ELSE 0 END) AS total_logged_in
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
LEFT JOIN stock_logs sl
|
||||
ON sl.loggable_type = 'TRANSFER'
|
||||
AND sl.loggable_id = std.id
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
GROUP BY st.id, st.movement_number, p.name, std.id, COALESCE(std.total_qty, std.usage_qty, 0)
|
||||
ORDER BY st.id, p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-11 New recording eggs still posting to kandang after cutoff date
|
||||
-- Replace values before running.
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
DATE(r.record_datetime) AS record_date,
|
||||
l.name AS location_name,
|
||||
kw.name AS kandang_warehouse_name,
|
||||
p.name AS product_name,
|
||||
re.qty
|
||||
FROM recording_eggs re
|
||||
JOIN recordings r ON r.id = re.recording_id
|
||||
JOIN product_warehouses pw ON pw.id = re.product_warehouse_id
|
||||
JOIN warehouses kw ON kw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE kw.type = 'KANDANG'
|
||||
AND LOWER(l.name) = LOWER('<location_name>')
|
||||
AND DATE(r.record_datetime) >= DATE('<cutover_date>')
|
||||
ORDER BY r.record_datetime ASC, kw.name, p.name;
|
||||
|
||||
-- Expectation:
|
||||
-- - after deploy and cutover, this should ideally return 0 rows for the location
|
||||
|
||||
-- =====================================================================
|
||||
-- AUDIT-12 Combined kandang + farm egg stock per location after cutover
|
||||
-- Replace <location_name> before running.
|
||||
-- =====================================================================
|
||||
SELECT
|
||||
l.name AS location_name,
|
||||
w.type AS warehouse_type,
|
||||
p.name AS product_name,
|
||||
SUM(COALESCE(pw.qty, 0)) AS total_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses w ON w.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = w.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
GROUP BY l.name, w.type, p.name
|
||||
ORDER BY w.type, p.name;
|
||||
@@ -0,0 +1,400 @@
|
||||
-- Legacy Egg Cutover Verification Checklist
|
||||
-- Usage:
|
||||
-- 1. Replace the values below before executing.
|
||||
-- 2. Run section BEFORE before --apply.
|
||||
-- 3. Run section AFTER after --apply.
|
||||
-- 4. Run rollback checks if needed.
|
||||
|
||||
-- =====================================================================
|
||||
-- PARAMETERS
|
||||
-- =====================================================================
|
||||
|
||||
-- Replace manually before running.
|
||||
-- Example:
|
||||
-- location_name = Jamali
|
||||
-- cutover_date = 2026-04-07
|
||||
-- run_id = egg-cutover-20260407T130344.220407000Z
|
||||
|
||||
-- =====================================================================
|
||||
-- BEFORE APPLY
|
||||
-- =====================================================================
|
||||
|
||||
-- [BEFORE-01] Identify target location and farm warehouse
|
||||
SELECT
|
||||
l.id AS location_id,
|
||||
l.name AS location_name,
|
||||
fw.id AS farm_warehouse_id,
|
||||
fw.name AS farm_warehouse_name
|
||||
FROM locations l
|
||||
LEFT JOIN warehouses fw
|
||||
ON fw.location_id = l.id
|
||||
AND fw.type = 'LOKASI'
|
||||
AND fw.deleted_at IS NULL
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
ORDER BY fw.id ASC;
|
||||
|
||||
-- Expectation:
|
||||
-- - exactly one target location
|
||||
-- - at least one farm warehouse exists
|
||||
|
||||
-- [BEFORE-02] Verify location timing status (must be CLEAN_CUTOVER for phase 1)
|
||||
WITH timing AS (
|
||||
SELECT
|
||||
pf.location_id AS location_id,
|
||||
l.name AS location_name,
|
||||
MIN(CASE WHEN w.type = 'KANDANG' THEN DATE(r.record_datetime) END) AS first_kandang_date,
|
||||
MAX(CASE WHEN w.type = 'KANDANG' THEN DATE(r.record_datetime) END) AS last_kandang_date,
|
||||
MIN(CASE WHEN w.type = 'LOKASI' THEN DATE(r.record_datetime) END) AS first_farm_date,
|
||||
MAX(CASE WHEN w.type = 'LOKASI' THEN DATE(r.record_datetime) END) AS last_farm_date
|
||||
FROM recording_eggs re
|
||||
JOIN recordings r ON r.id = re.recording_id
|
||||
JOIN project_flock_kandangs pk ON pk.id = COALESCE(re.project_flock_kandang_id, r.project_flock_kandangs_id)
|
||||
JOIN project_flocks pf ON pf.id = pk.project_flock_id
|
||||
JOIN locations l ON l.id = pf.location_id
|
||||
JOIN product_warehouses pw ON pw.id = re.product_warehouse_id
|
||||
JOIN warehouses w ON w.id = pw.warehouse_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
GROUP BY pf.location_id, l.name
|
||||
)
|
||||
SELECT
|
||||
location_id,
|
||||
location_name,
|
||||
first_kandang_date,
|
||||
last_kandang_date,
|
||||
first_farm_date,
|
||||
last_farm_date,
|
||||
CASE
|
||||
WHEN first_farm_date IS NULL THEN 'KANDANG_ONLY'
|
||||
WHEN last_kandang_date IS NULL OR first_farm_date > last_kandang_date THEN 'CLEAN_CUTOVER'
|
||||
ELSE 'OVERLAP'
|
||||
END AS location_status
|
||||
FROM timing;
|
||||
|
||||
-- Expectation:
|
||||
-- - phase 1 location must be CLEAN_CUTOVER
|
||||
|
||||
-- [BEFORE-03] Candidate source rows that should be migrated
|
||||
WITH first_farm AS (
|
||||
SELECT location_id, MIN(id) AS farm_warehouse_id
|
||||
FROM warehouses
|
||||
WHERE type = 'LOKASI'
|
||||
AND deleted_at IS NULL
|
||||
GROUP BY location_id
|
||||
)
|
||||
SELECT
|
||||
l.id AS location_id,
|
||||
l.name AS location_name,
|
||||
kw.id AS source_warehouse_id,
|
||||
kw.name AS source_warehouse_name,
|
||||
fw.id AS farm_warehouse_id,
|
||||
fw.name AS farm_warehouse_name,
|
||||
pw.id AS product_warehouse_id,
|
||||
p.id AS product_id,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS on_hand_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses kw
|
||||
ON kw.id = pw.warehouse_id
|
||||
AND kw.type = 'KANDANG'
|
||||
AND kw.deleted_at IS NULL
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
LEFT JOIN first_farm ff ON ff.location_id = kw.location_id
|
||||
LEFT JOIN warehouses fw ON fw.id = ff.farm_warehouse_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM recording_eggs re
|
||||
WHERE re.product_warehouse_id = pw.id
|
||||
)
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1
|
||||
FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
AND COALESCE(pw.qty, 0) > 0
|
||||
ORDER BY kw.name, p.name;
|
||||
|
||||
-- Expectation:
|
||||
-- - every row here should match dry-run eligible rows
|
||||
|
||||
-- [BEFORE-04] Totals per source warehouse and product
|
||||
WITH candidates AS (
|
||||
SELECT
|
||||
kw.name AS source_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS on_hand_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses kw
|
||||
ON kw.id = pw.warehouse_id
|
||||
AND kw.type = 'KANDANG'
|
||||
AND kw.deleted_at IS NULL
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM recording_eggs re WHERE re.product_warehouse_id = pw.id
|
||||
)
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
AND COALESCE(pw.qty, 0) > 0
|
||||
)
|
||||
SELECT
|
||||
source_warehouse_name,
|
||||
product_name,
|
||||
SUM(on_hand_qty) AS total_qty
|
||||
FROM candidates
|
||||
GROUP BY source_warehouse_name, product_name
|
||||
ORDER BY source_warehouse_name, product_name;
|
||||
|
||||
-- [BEFORE-05] Current farm egg stock before cutover
|
||||
SELECT
|
||||
fw.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS farm_on_hand_qty
|
||||
FROM warehouses fw
|
||||
JOIN locations l ON l.id = fw.location_id
|
||||
JOIN product_warehouses pw ON pw.warehouse_id = fw.id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
LEFT JOIN product_categories pc ON pc.id = p.product_category_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND fw.type = 'LOKASI'
|
||||
AND fw.deleted_at IS NULL
|
||||
AND (
|
||||
EXISTS (
|
||||
SELECT 1 FROM flags f
|
||||
WHERE f.flagable_type = 'products'
|
||||
AND f.flagable_id = p.id
|
||||
AND (UPPER(f.name) = 'TELUR' OR UPPER(f.name) LIKE 'TELUR-%')
|
||||
)
|
||||
OR (
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM flags f_any
|
||||
WHERE f_any.flagable_type = 'products'
|
||||
AND f_any.flagable_id = p.id
|
||||
)
|
||||
AND UPPER(COALESCE(pc.code, '')) = 'EGG'
|
||||
)
|
||||
)
|
||||
ORDER BY p.name;
|
||||
|
||||
-- [BEFORE-06] Existing cutover transfers for this location
|
||||
SELECT
|
||||
st.id,
|
||||
st.movement_number,
|
||||
st.transfer_date,
|
||||
st.reason,
|
||||
ws.name AS source_warehouse_name,
|
||||
wd.name AS farm_warehouse_name,
|
||||
st.deleted_at
|
||||
FROM stock_transfers st
|
||||
JOIN warehouses ws ON ws.id = st.from_warehouse_id
|
||||
JOIN warehouses wd ON wd.id = st.to_warehouse_id
|
||||
LEFT JOIN locations l ON l.id = COALESCE(ws.location_id, wd.location_id)
|
||||
WHERE LOWER(COALESCE(l.name, '')) = LOWER('<location_name>')
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|%'
|
||||
ORDER BY st.id DESC;
|
||||
|
||||
-- Expectation:
|
||||
-- - no unexpected older active cutover transfers for the same location
|
||||
|
||||
-- =====================================================================
|
||||
-- AFTER APPLY
|
||||
-- =====================================================================
|
||||
|
||||
-- [AFTER-01] Transfer headers created by run_id
|
||||
SELECT
|
||||
st.id,
|
||||
st.movement_number,
|
||||
st.transfer_date,
|
||||
st.reason,
|
||||
ws.name AS source_warehouse_name,
|
||||
wd.name AS farm_warehouse_name,
|
||||
st.deleted_at
|
||||
FROM stock_transfers st
|
||||
JOIN warehouses ws ON ws.id = st.from_warehouse_id
|
||||
JOIN warehouses wd ON wd.id = st.to_warehouse_id
|
||||
WHERE st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id ASC;
|
||||
|
||||
-- [AFTER-02] Transfer detail rows created by run_id
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
ws.name AS source_warehouse_name,
|
||||
wd.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(std.total_qty, std.usage_qty, 0) AS moved_qty,
|
||||
std.source_product_warehouse_id,
|
||||
std.dest_product_warehouse_id
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
JOIN warehouses ws ON ws.id = st.from_warehouse_id
|
||||
JOIN warehouses wd ON wd.id = st.to_warehouse_id
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id, p.name;
|
||||
|
||||
-- [AFTER-03] Stock logs created by run_id transfer details
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
p.name AS product_name,
|
||||
sl.product_warehouse_id,
|
||||
sl.increase,
|
||||
sl.decrease,
|
||||
sl.stock,
|
||||
sl.created_at
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
JOIN stock_logs sl
|
||||
ON sl.loggable_type = 'TRANSFER'
|
||||
AND sl.loggable_id = std.id
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id, p.name, sl.id;
|
||||
|
||||
-- Expectation:
|
||||
-- - every detail has one stock log decrease from source and one stock log increase to destination
|
||||
|
||||
-- [AFTER-04] Source rows after cutover
|
||||
SELECT
|
||||
kw.name AS source_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS source_qty_after
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses kw ON kw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = kw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND kw.type = 'KANDANG'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM recording_eggs re WHERE re.product_warehouse_id = pw.id
|
||||
)
|
||||
ORDER BY kw.name, p.name;
|
||||
|
||||
-- Expectation:
|
||||
-- - rows that were transferred should now be 0 or no longer available for use
|
||||
|
||||
-- [AFTER-05] Farm rows after cutover
|
||||
SELECT
|
||||
fw.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS farm_qty_after
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses fw ON fw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = fw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND fw.type = 'LOKASI'
|
||||
ORDER BY fw.name, p.name;
|
||||
|
||||
-- Expectation:
|
||||
-- - farm qty increases by the moved amount
|
||||
|
||||
-- [AFTER-06] Reconciliation: total moved by run
|
||||
SELECT
|
||||
p.name AS product_name,
|
||||
SUM(COALESCE(std.total_qty, std.usage_qty, 0)) AS total_moved_qty
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
GROUP BY p.name
|
||||
ORDER BY p.name;
|
||||
|
||||
-- [AFTER-07] Farm stock available for SO after cutover
|
||||
SELECT
|
||||
fw.name AS farm_warehouse_name,
|
||||
p.name AS product_name,
|
||||
COALESCE(pw.qty, 0) AS available_qty
|
||||
FROM product_warehouses pw
|
||||
JOIN warehouses fw ON fw.id = pw.warehouse_id
|
||||
JOIN locations l ON l.id = fw.location_id
|
||||
JOIN products p ON p.id = pw.product_id
|
||||
WHERE LOWER(l.name) = LOWER('<location_name>')
|
||||
AND fw.type = 'LOKASI'
|
||||
AND COALESCE(pw.qty, 0) > 0
|
||||
ORDER BY p.name;
|
||||
|
||||
-- =====================================================================
|
||||
-- ROLLBACK CHECKS
|
||||
-- =====================================================================
|
||||
|
||||
-- [ROLLBACK-01] Check downstream consumption guard before rollback
|
||||
SELECT
|
||||
st.id AS transfer_id,
|
||||
st.movement_number,
|
||||
p.name AS product_name,
|
||||
sa.usable_type,
|
||||
sa.usable_id,
|
||||
sa.qty,
|
||||
sa.function_code,
|
||||
sa.flag_group_code
|
||||
FROM stock_transfers st
|
||||
JOIN stock_transfer_details std
|
||||
ON std.stock_transfer_id = st.id
|
||||
AND std.deleted_at IS NULL
|
||||
JOIN products p ON p.id = std.product_id
|
||||
JOIN stock_allocations sa
|
||||
ON sa.stockable_type = 'STOCK_TRANSFER_IN'
|
||||
AND sa.stockable_id = std.id
|
||||
AND sa.status = 'ACTIVE'
|
||||
AND sa.allocation_purpose = 'CONSUME'
|
||||
AND sa.deleted_at IS NULL
|
||||
WHERE st.deleted_at IS NULL
|
||||
AND st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id, p.name, sa.usable_type, sa.usable_id;
|
||||
|
||||
-- Expectation:
|
||||
-- - rollback only safe if this query returns 0 rows
|
||||
|
||||
-- [ROLLBACK-02] Verify run is fully rolled back
|
||||
SELECT
|
||||
st.id,
|
||||
st.movement_number,
|
||||
st.deleted_at
|
||||
FROM stock_transfers st
|
||||
WHERE st.reason LIKE 'EGG_FARM_CUTOVER|run_id=<run_id>|%'
|
||||
ORDER BY st.id;
|
||||
|
||||
-- Expectation:
|
||||
-- - after rollback, deleted_at should be filled for all transfers in the run
|
||||
Reference in New Issue
Block a user