feat(bulk): mode, submode and RST are repair fields, so allow them

They were excluded as "per-QSO", alongside callsign and date. That rule confused
two different things: bulk edit is not for describing QSOs, it is for REPAIRING
a batch of them — an import that mapped every contact to SSB, an ADIF that
carried no MODE at all. Refusing because a hundred rows should not normally
share a value left the operator editing a hundred rows by hand.

Setting the mode CLEARS the submode. A submode belongs to the mode it was
recorded under; left behind it contradicts the new one, and "FT8 with a submode
of USB" is not a thing — worse, the submode is what most ADIF readers believe.

Band is still refused on its own, and that half of the rule stands. It travels
with the frequency through BulkSetFrequency, which writes the pair: a band
contradicting its own frequency is invalid ADIF, and every export would carry
the contradiction out into the world. Callsign and date stay out too — they
identify the contact rather than describe it.
This commit is contained in:
2026-08-11 19:36:56 +02:00
parent 3b90ef6b7a
commit 102097c5c4
5 changed files with 82 additions and 12 deletions
+26
View File
@@ -0,0 +1,26 @@
package qso
import "testing"
// Mode, submode and RST are repair fields: an import that mapped every contact
// to SSB, or an ADIF that carried no MODE, is fixed in one pass instead of one
// row at a time. They were excluded as "per-QSO", which confused describing a
// QSO with repairing a batch of them.
func TestModeAndRSTAreBulkEditable(t *testing.T) {
for _, col := range []string{"mode", "submode", "rst_sent", "rst_rcvd"} {
if !bulkEditableCols[col] {
t.Errorf("%s should be bulk-editable", col)
}
}
}
// Band must NOT be bulk-editable on its own: it travels with the frequency
// through BulkSetFrequency. A band contradicting its own frequency is invalid
// ADIF, and every export would carry the contradiction out into the world.
func TestBandIsNotBulkEditableAlone(t *testing.T) {
for _, col := range []string{"band", "freq_hz", "callsign", "qso_date"} {
if bulkEditableCols[col] {
t.Errorf("%s must not be bulk-editable on its own", col)
}
}
}