[#316] ir/netmap: Rename LOCODE attribute key

Rename key to LOCODE node attribute from `Locode` to `UN-LOCODE`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-10 13:13:42 +03:00 committed by Leonard Lyubich
parent c384fbbf4e
commit 0a87fec6c6
2 changed files with 4 additions and 4 deletions

View file

@ -10,10 +10,10 @@ var errMissingLocode = errors.New("missing locode attribute")
var errMissingRequiredAttr = errors.New("missing required attribute in DB record")
// VerifyAndUpdate validates LOCODE attribute of n
// VerifyAndUpdate validates UN-LOCODE attribute of n
// and adds a group of related attributes.
//
// If n does not contain LOCODE attribute or its value does not
// If n does not contain UN-LOCODE attribute or its value does not
// match the UN/LOCODE format, an error returns.
//
// New attributes are formed from the record of DB instance (Prm).
@ -26,7 +26,7 @@ var errMissingRequiredAttr = errors.New("missing required attribute in DB record
// * SubDiv: R.SubDivName();
// * Continent: R.Continent().String().
//
// LOCODE attribute remains untouched.
// UN-LOCODE attribute remains untouched.
func (v *Validator) VerifyAndUpdate(n *netmap.NodeInfo) error {
mAttr := uniqueAttributes(n.Attributes())

View file

@ -28,7 +28,7 @@ type Validator struct {
// TODO: define constants in API lib.
const (
attrKeyLocode = "Locode"
attrKeyLocode = "UN-LOCODE"
attrKeyCountryCode = "CountryCode"
attrKeyCountry = "Country"