Skip to content

Commit 21508a4

Browse files
committed
refactor: convert classification from string to object
1 parent b157f8c commit 21508a4

File tree

3 files changed

+113
-35
lines changed

3 files changed

+113
-35
lines changed

packages/fdc3-context/generated/context/ContextTypes.ts

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,10 @@ export interface Chart {
241241
*/
242242
export interface InstrumentElement {
243243
/**
244-
* @experimental classification of the instrument by type or category. SHOULD be one of the
245-
* following values, although other string values are permitted: '`commodity`',
246-
* '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`',
247-
* '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`',
248-
* '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`',
249-
* '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`',
250-
* '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`',
251-
* '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
244+
* @experimental The `classification` map can be used to specify the categorization of the
245+
* instrument and help achieve interoperability between disparate data sources.
252246
*/
253-
classification?: string;
247+
classification?: OrganizationClassification;
254248
/**
255249
* Any combination of instrument identifiers can be used together to resolve ambiguity, or
256250
* for a better match. Not all applications will use the same instrument identifiers, which
@@ -281,6 +275,29 @@ export interface InstrumentElement {
281275
[property: string]: any;
282276
}
283277

278+
/**
279+
* @experimental The `classification` map can be used to specify the categorization of the
280+
* instrument and help achieve interoperability between disparate data sources.
281+
*/
282+
export interface OrganizationClassification {
283+
/**
284+
* classification of the instrument by type or category. SHOULD be one of the following
285+
* values, although other string values are permitted: '`commodity`', '`commodityIndex`',
286+
* '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`',
287+
* '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`',
288+
* '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`',
289+
* '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`',
290+
* '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`',
291+
* '`structuredProduct`', '`unknown`'
292+
*/
293+
fdc3?: string;
294+
/**
295+
* FactSet classification for the instrument.
296+
*/
297+
FDS_TYPE?: string;
298+
[property: string]: any;
299+
}
300+
284301
/**
285302
* Any combination of instrument identifiers can be used together to resolve ambiguity, or
286303
* for a better match. Not all applications will use the same instrument identifiers, which
@@ -757,16 +774,10 @@ export interface ChatSearchCriteria {
757774
*/
758775
export interface OrganizationObject {
759776
/**
760-
* @experimental classification of the instrument by type or category. SHOULD be one of the
761-
* following values, although other string values are permitted: '`commodity`',
762-
* '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`',
763-
* '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`',
764-
* '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`',
765-
* '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`',
766-
* '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`',
767-
* '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
777+
* @experimental The `classification` map can be used to specify the categorization of the
778+
* instrument and help achieve interoperability between disparate data sources.
768779
*/
769-
classification?: string;
780+
classification?: OrganizationClassification;
770781
/**
771782
* Any combination of instrument identifiers can be used together to resolve ambiguity, or
772783
* for a better match. Not all applications will use the same instrument identifiers, which
@@ -1173,16 +1184,10 @@ export interface FileAttachmentData {
11731184
*/
11741185
export interface Instrument {
11751186
/**
1176-
* @experimental classification of the instrument by type or category. SHOULD be one of the
1177-
* following values, although other string values are permitted: '`commodity`',
1178-
* '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`',
1179-
* '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`',
1180-
* '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`',
1181-
* '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`',
1182-
* '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`',
1183-
* '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
1187+
* @experimental The `classification` map can be used to specify the categorization of the
1188+
* instrument and help achieve interoperability between disparate data sources.
11841189
*/
1185-
classification?: string;
1190+
classification?: PurpleInstrumentClassification;
11861191
/**
11871192
* Any combination of instrument identifiers can be used together to resolve ambiguity, or
11881193
* for a better match. Not all applications will use the same instrument identifiers, which
@@ -1213,6 +1218,29 @@ export interface Instrument {
12131218
[property: string]: any;
12141219
}
12151220

1221+
/**
1222+
* @experimental The `classification` map can be used to specify the categorization of the
1223+
* instrument and help achieve interoperability between disparate data sources.
1224+
*/
1225+
export interface PurpleInstrumentClassification {
1226+
/**
1227+
* classification of the instrument by type or category. SHOULD be one of the following
1228+
* values, although other string values are permitted: '`commodity`', '`commodityIndex`',
1229+
* '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`',
1230+
* '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`',
1231+
* '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`',
1232+
* '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`',
1233+
* '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`',
1234+
* '`structuredProduct`', '`unknown`'
1235+
*/
1236+
fdc3?: string;
1237+
/**
1238+
* FactSet classification for the instrument.
1239+
*/
1240+
FDS_TYPE?: string;
1241+
[property: string]: any;
1242+
}
1243+
12161244
/**
12171245
* Any combination of instrument identifiers can be used together to resolve ambiguity, or
12181246
* for a better match. Not all applications will use the same instrument identifiers, which
@@ -2426,14 +2454,21 @@ const typeMap: any = {
24262454
),
24272455
InstrumentElement: o(
24282456
[
2429-
{ json: 'classification', js: 'classification', typ: u(undefined, '') },
2457+
{ json: 'classification', js: 'classification', typ: u(undefined, r('OrganizationClassification')) },
24302458
{ json: 'id', js: 'id', typ: r('PurpleInstrumentIdentifiers') },
24312459
{ json: 'market', js: 'market', typ: u(undefined, r('OrganizationMarket')) },
24322460
{ json: 'name', js: 'name', typ: u(undefined, '') },
24332461
{ json: 'type', js: 'type', typ: r('PurpleAppID') },
24342462
],
24352463
'any'
24362464
),
2465+
OrganizationClassification: o(
2466+
[
2467+
{ json: 'fdc3', js: 'fdc3', typ: u(undefined, '') },
2468+
{ json: 'FDS_TYPE', js: 'FDS_TYPE', typ: u(undefined, '') },
2469+
],
2470+
'any'
2471+
),
24372472
PurpleInstrumentIdentifiers: o(
24382473
[
24392474
{ json: 'BBG', js: 'BBG', typ: u(undefined, '') },
@@ -2593,7 +2628,7 @@ const typeMap: any = {
25932628
),
25942629
OrganizationObject: o(
25952630
[
2596-
{ json: 'classification', js: 'classification', typ: u(undefined, '') },
2631+
{ json: 'classification', js: 'classification', typ: u(undefined, r('OrganizationClassification')) },
25972632
{ json: 'id', js: 'id', typ: r('Identifiers') },
25982633
{ json: 'market', js: 'market', typ: u(undefined, r('OrganizationMarket')) },
25992634
{ json: 'name', js: 'name', typ: u(undefined, '') },
@@ -2720,14 +2755,21 @@ const typeMap: any = {
27202755
),
27212756
Instrument: o(
27222757
[
2723-
{ json: 'classification', js: 'classification', typ: u(undefined, '') },
2758+
{ json: 'classification', js: 'classification', typ: u(undefined, r('PurpleInstrumentClassification')) },
27242759
{ json: 'id', js: 'id', typ: r('FluffyInstrumentIdentifiers') },
27252760
{ json: 'market', js: 'market', typ: u(undefined, r('PurpleMarket')) },
27262761
{ json: 'name', js: 'name', typ: u(undefined, '') },
27272762
{ json: 'type', js: 'type', typ: r('PurpleAppID') },
27282763
],
27292764
'any'
27302765
),
2766+
PurpleInstrumentClassification: o(
2767+
[
2768+
{ json: 'fdc3', js: 'fdc3', typ: u(undefined, '') },
2769+
{ json: 'FDS_TYPE', js: 'FDS_TYPE', typ: u(undefined, '') },
2770+
],
2771+
'any'
2772+
),
27312773
FluffyInstrumentIdentifiers: o(
27322774
[
27332775
{ json: 'BBG', js: 'BBG', typ: u(undefined, '') },

packages/fdc3-context/schemas/context/instrument.schema.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,20 @@
9999
},
100100
"classification": {
101101
"title": "Instrument Classification",
102-
"description": "@experimental classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'",
103-
"type": "string"
102+
"description": "@experimental The `classification` map can be used to specify the categorization of the instrument and help achieve interoperability between disparate data sources.",
103+
"type": "object",
104+
"properties": {
105+
"fdc3": {
106+
"type": "string",
107+
"title": "FDC3 Instrument Classification Name",
108+
"description": "classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'"
109+
},
110+
"FDS_TYPE": {
111+
"type": "string",
112+
"title": "FactSet Type",
113+
"description": "FactSet classification for the instrument."
114+
}
115+
}
104116
}
105117
},
106118
"required": [
@@ -121,7 +133,9 @@
121133
"market": {
122134
"MIC": "XNAS"
123135
},
124-
"classification": "publicCompany"
136+
"classification": {
137+
"fdc3": "publicCompany"
138+
}
125139
}
126140
]
127141
}

website/docs/context/ref/Instrument.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,29 @@ The `market` map can be used to further specify the instrument and help achieve
174174
<details>
175175
<summary><code>classification</code></summary>
176176

177+
**type**: `object`
178+
179+
**Subproperties:**
180+
181+
<details>
182+
<summary><code>fdc3</code></summary>
183+
184+
**type**: `string`
185+
186+
classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
187+
188+
</details>
189+
190+
<details>
191+
<summary><code>FDS_TYPE</code></summary>
192+
177193
**type**: `string`
178194

179-
[@experimental](/docs/fdc3-compliance#experimental-features) classification of the instrument by type or category. SHOULD be one of the following values, although other string values are permitted: '`commodity`', '`commodityIndex`', '`corporateDebt`', '`creditDefaultSwapIndex`', '`deal`', '`debt`', '`debtIndex`', '`etf`', '`fixedIncome`', '`future`', '`governmentBenchmarkDebt`', '`loan`', '`mortgageBackedSecurity`', '`municipalDebt`', '`mutualFund`', '`mutualFundIndex`', '`option`', '`otherDebt`', '`ownershipPrivateCompany`', '`pevcFirm`', '`pevcFund`', '`privateCompany`', '`publicCompany`', '`publicCompanyIndex`', '`sovereignDebt`', '`structuredProduct`', '`unknown`'
195+
FactSet classification for the instrument.
196+
197+
</details>
198+
199+
[@experimental](/docs/fdc3-compliance#experimental-features) The `classification` map can be used to specify the categorization of the instrument and help achieve interoperability between disparate data sources.
180200

181201
</details>
182202

@@ -194,7 +214,9 @@ The `market` map can be used to further specify the instrument and help achieve
194214
"market": {
195215
"MIC": "XNAS"
196216
},
197-
"classification": "publicCompany"
217+
"classification": {
218+
"fdc3": "publicCompany"
219+
}
198220
}
199221
```
200222

0 commit comments

Comments
 (0)