@@ -14,7 +14,7 @@ class SupportedLanguage(str, Enum):
1414 en : str = "en"
1515
1616
17- class ContractType (str , Enum ):
17+ class ContractFieldType (str , Enum ):
1818 Text : str = "text"
1919 Number : str = "number"
2020 Tuple : str = "tuple"
@@ -32,6 +32,14 @@ class ContractType(str, Enum):
3232 Payload : str = "payload"
3333
3434
35+ class ContractOutputType (str , Enum ):
36+ Text : str = "text"
37+ Number : str = "number"
38+ Port : str = "port"
39+ IPv4 : str = "ipv4"
40+ IPv6 : str = "ipv6"
41+
42+
3543class ExpectationType (str , Enum ):
3644 text : str = "TEXT"
3745 document : str = "DOCUMENT"
@@ -53,7 +61,7 @@ class Expectation:
5361@dataclass
5462class LinkedFieldModel :
5563 key : str
56- type : ContractType
64+ type : ContractFieldType
5765
5866
5967@dataclass
@@ -82,6 +90,14 @@ class ContractCardinalityElement(ContractElement, ABC):
8290 defaultValue : List [str ] = field (default_factory = list )
8391
8492
93+ @dataclass
94+ class ContractOutputElement (ABC ):
95+ type : str
96+ field : str
97+ labels : List [str ]
98+ isMultiple : bool
99+
100+
85101@dataclass
86102class ContractConfig :
87103 type : str
@@ -96,6 +112,7 @@ class Contract:
96112 contract_id : str
97113 label : dict [SupportedLanguage , str ]
98114 fields : List [ContractElement ]
115+ outputs : List [ContractOutputElement ]
99116 config : ContractConfig
100117 manual : bool
101118 variables : List [ContractVariable ] = field (
@@ -121,7 +138,7 @@ def add_variable(self, var: ContractVariable):
121138class ContractTeam (ContractCardinalityElement ):
122139 @property
123140 def get_type (self ) -> str :
124- return ContractType .Team .value
141+ return ContractFieldType .Team .value
125142
126143
127144@dataclass
@@ -131,7 +148,7 @@ class ContractText(ContractCardinalityElement):
131148
132149 @property
133150 def get_type (self ) -> str :
134- return ContractType .Text .value
151+ return ContractFieldType .Text .value
135152
136153
137154def prepare_contracts (contracts ):
@@ -161,7 +178,7 @@ def __post_init__(self):
161178
162179 @property
163180 def get_type (self ) -> str :
164- return ContractType .Tuple .value
181+ return ContractFieldType .Tuple .value
165182
166183
167184@dataclass
@@ -172,7 +189,7 @@ class ContractTextArea(ContractCardinalityElement):
172189
173190 @property
174191 def get_type (self ) -> str :
175- return ContractType .Textarea .value
192+ return ContractFieldType .Textarea .value
176193
177194
178195@dataclass
@@ -182,15 +199,15 @@ class ContractCheckbox(ContractElement):
182199
183200 @property
184201 def get_type (self ) -> str :
185- return ContractType .Checkbox .value
202+ return ContractFieldType .Checkbox .value
186203
187204
188205@dataclass
189206class ContractAttachment (ContractCardinalityElement ):
190207
191208 @property
192209 def get_type (self ) -> str :
193- return ContractType .Attachment .value
210+ return ContractFieldType .Attachment .value
194211
195212
196213@dataclass
@@ -200,7 +217,7 @@ class ContractExpectations(ContractCardinalityElement):
200217
201218 @property
202219 def get_type (self ) -> str :
203- return ContractType .Expectation .value
220+ return ContractFieldType .Expectation .value
204221
205222
206223@dataclass
@@ -210,28 +227,28 @@ class ContractSelect(ContractCardinalityElement):
210227
211228 @property
212229 def get_type (self ) -> str :
213- return ContractType .Select .value
230+ return ContractFieldType .Select .value
214231
215232
216233@dataclass
217234class ContractAsset (ContractCardinalityElement ):
218235
219236 @property
220237 def get_type (self ) -> str :
221- return ContractType .Asset .value
238+ return ContractFieldType .Asset .value
222239
223240
224241@dataclass
225242class ContractAssetGroup (ContractCardinalityElement ):
226243
227244 @property
228245 def get_type (self ) -> str :
229- return ContractType .AssetGroup .value
246+ return ContractFieldType .AssetGroup .value
230247
231248
232249@dataclass
233250class ContractPayload (ContractCardinalityElement ):
234251
235252 @property
236253 def get_type (self ) -> str :
237- return ContractType .Payload .value
254+ return ContractFieldType .Payload .value
0 commit comments