FIXTradingCommunity / fix-orchestra

Machine readable rules of engagement
Apache License 2.0
71 stars 34 forks source link

[repository schema] unionDataType should be an attribute of a code set, not field #161

Closed donmendelson closed 3 months ago

donmendelson commented 2 years ago

The attribute unionDataType is only used on fields that have code sets. It is used to constrain the range of user-defined values that extend the standard code set.

Example

      <fixr:field added="FIX.2.7"
                  id="22"
                  name="SecurityIDSource"
                  type="SecurityIDSourceCodeSet"
                  updated="FIX.5.0SP2"
                  updatedEP="161"
                  abbrName="Src"
                  unionDataType="Reserved100Plus">

The type Reserved100Plus is documented as follows:

Values "100" and above are reserved for bilaterally agreed upon user defined enumerations.

SecurityIDSourceCodeSet is currently shared by 32 fields in FIX Latest. Logically they should all have the same constraint on user-defined code values. Therefore, it would cleaner design and less error-prone to make unionDataType an attribute of <codeSet> rather than <field>. An advantage of that change is that it would make the the base datatype and union datatype properties of the same object.

donmendelson commented 2 years ago

Here's something from the Orchestra repository sample file that uses unionDataType:

<fixr:field type="int" unionDataType="Reserved1000Plus" id="40165" name="ProvisionCashSettlPaymentDateRelativeTo" abbrName="Reltv" added="FIX.5.0SP2" addedEP="161">
    <fixr:annotation>
        <fixr:documentation purpose="SYNOPSIS">
         Specifies the anchor date when the cash settlement payment date is relative to an anchor date.
         See http://www.fixtradingcommunity.org/codelists#Relative_To_Date for values.
      </fixr:documentation>
    </fixr:annotation>
</fixr:field>

The link should be https://www.fixtrading.org/packages/relativetodate/

This should be encoded in Orchestra as an external codeset.

<fixr:codeSet id="99999" name="RelativeToDate" type="int" unionDataType="Reserved1000Plus" specUrl="https://www.fixtrading.org/packages/relativetodate/"/>

<fixr:field type="RelativeToDate" id="40165" name="ProvisionCashSettlPaymentDateRelativeTo" abbrName="Reltv"/>
kleihan commented 2 years ago

External code sets make this a larger issue. The idea was to bring the external code sets back into Orchestra, avoiding the need to use URLs.

FIX Latest needs to use Orchestra v1.0 until extensions are no longer applied to the Basic repository and converted to Unified/Orchestra but to the Orchestra repository directly.

donmendelson commented 2 years ago

It's a business decision whether to edit code sets in FIX Latest and subject them to GTC review versus editing them externally under a different process. Either way, I'm suggesting they should be code sets, and the unionDataType attribute should be on the code set.

kleihan commented 2 years ago

Agree, unionDataType attribute should be on the code set. The change of FIX Latest will just not be as quickly as we may have hoped for.

donmendelson commented 2 years ago

Consider whether to leave unionDataType on <field> as well as adding to <codeSet> for back compatibility.

donmendelson commented 2 years ago

Orchestra working group made a decision on June 15, 2022 to retain the unionDataType attribute on fields for back compatibility while adding it to code sets.

kleihan commented 3 months ago

Implemented in RC1