diff --git a/client b/client index 70241e22..4df0322e 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit 70241e22c4064bcbc43cd27aa6d54dbf4e226b68 +Subproject commit 4df0322e126d7deecaffd07c2ffe3a837c880cfa diff --git a/client-gui2 b/client-gui2 index 449c5099..a9f6c4ab 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit 449c50994b5e75f6039e5dd7cdfb95342f830686 +Subproject commit a9f6c4ab355d02a97564cb66c8de7e214caa74dc diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 52d2dbb8..95136937 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/prod_data_parse_scripts/parse_uc_osnova.sh b/prod_data_parse_scripts/parse_uc_osnova.sh new file mode 100644 index 00000000..ccb65276 --- /dev/null +++ b/prod_data_parse_scripts/parse_uc_osnova.sh @@ -0,0 +1,104 @@ +#!/bin/sh + +set -eu + +if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then + printf 'Usage: %s INPUT.csv [OUTPUT.csv]\n' "$0" >&2 + exit 2 +fi + +input=$1 +output=${2:--} + +process_csv() { + awk -F ',' ' + function clean_account(value, quoted) { + quoted = substr(value, 1, 1) == "\"" && + substr(value, length(value), 1) == "\"" + + if (quoted) { + value = substr(value, 2, length(value) - 2) + } + + # Remove trailing non-numeric characters. + # Internal hyphens are preserved. + while (length(value) > 0 && + substr(value, length(value), 1) !~ /[0-9]/) { + value = substr(value, 1, length(value) - 1) + } + + if (quoted) { + return "\"" value "\"" + } + + return value + } + + function key_value(value) { + if (substr(value, 1, 1) == "\"" && + substr(value, length(value), 1) == "\"") { + return substr(value, 2, length(value) - 2) + } + + return value + } + + BEGIN { + OFS = "," + } + + { + sub(/\r$/, "", $0) + } + + NR == 1 { + printf "%s,\"deleted\"\n", $0 + next + } + + { + cleaned = clean_account($5) + key = key_value(cleaned) + + $5 = cleaned + + # Deleted: + # "000" -> true + # "000/" -> cleaned to "000" -> true + # "" -> true + # + # Everything else -> false + if (key == "000" || key == "") { + deleted = "\"true\"" + } else { + deleted = "\"false\"" + } + + # Check duplicates only for non-deleted accounts + if (key != "000" && key != "") { + key_count[key]++ + + if (!(key in key_order)) { + key_order[key] = ++key_total + } + } + + printf "%s,%s\n", $0, deleted + } + + END { + for (key in key_order) { + if (key_count[key] > 1) { + printf "Non-unique column 5 key: %s (%d rows)\n", + key, key_count[key] > "/dev/stderr" + } + } + } +' "$input" +} + +if [ "$output" = "-" ]; then + process_csv +else + process_csv > "$output" +fi diff --git a/server b/server index 79fec029..d6f9f92f 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 79fec0298ffb68527e46363c88a2db017f3d4ea6 +Subproject commit d6f9f92fda812de2e12504e97dc35e03134f4dd8