-
Notifications
You must be signed in to change notification settings - Fork 14
/
2-create-and-inline-txn-property.sql
51 lines (37 loc) · 1.31 KB
/
2-create-and-inline-txn-property.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
---------------
Create Transaction property
---------------
Description:
- In this query, we create a new transaction property called strategy and inline this property to Luminesce
More details:
- https://support.lusid.com/knowledgebase/category/?id=CAT-01099
*/
@@scope = select 'luminesce-examples';
-- Step 1: Define the property definitions
@newProperties =
values
('Transaction', @@scope, 'strategy', 'string');
@propertyDefinitions =
select
Column1 as [Domain],
Column2 as [PropertyScope],
Column3 as [PropertyCode],
Column3 as [DisplayName],
'Property' as [ConstraintStyle],
'system' as [DataTypeScope],
column4 as [DataTypeCode]
from @newProperties;
-- Step 2: Load property definitions
select *
from Lusid.Property.Definition.Writer
where ToWrite = @propertyDefinitions;
-- Step 3: Configure an entity provider pair to inline properties
-- in order to interact with them the same way as standard entity data fields
@keysToCatalog = values
('Transaction/luminesce-examples/strategy', 'strategy', True, 'A property representing SHK');
@config = select column1 as [Key], column2 as Name, column3 as IsMain, column4 as Description from @keysToCatalog;
select * from Sys.Admin.Lusid.Provider.Configure
where Provider = 'Lusid.Portfolio.Holding.Writer'
and Configuration = @config
and WriteAction = 'Modify';