Skip to content

Commit f51e9d5

Browse files
committed
Update model for QA pt2
1 parent faf63e9 commit f51e9d5

File tree

4 files changed

+69
-35
lines changed

4 files changed

+69
-35
lines changed

model/equaliq.smithy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ structure GetContractOutput {
103103
sharedWith: UserIdList
104104
}
105105

106-
// Define QA Section format to match existing implementation
107106
list QASectionsList {
108107
member: QASection
109108
}

python/api_model/types/models.py

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.json
3-
# timestamp: 2025-05-19T10:27:09+00:00
3+
# timestamp: 2025-05-24T20:24:25+00:00
44

55
from __future__ import annotations
66

@@ -53,6 +53,19 @@ class DeleteContractResponseContent(BaseModel):
5353
success: bool
5454

5555

56+
class FixedTermValue(BaseModel):
57+
unit: str
58+
value: str
59+
name: Optional[str] = None
60+
numericValue: Optional[float] = None
61+
condition: Optional[str] = None
62+
63+
64+
class FixedValueTermInference(BaseModel):
65+
primary: FixedTermValue
66+
subterms: Optional[List[FixedTermValue]] = None
67+
68+
5669
class GetContractReadURLRequestContent(BaseModel):
5770
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
5871

@@ -98,11 +111,16 @@ class ProcessingIncompleteErrorResponseContent(BaseModel):
98111
message: str
99112

100113

101-
class Question(BaseModel):
114+
class QA(BaseModel):
102115
question: str
103116
answer: str
104117

105118

119+
class QASection(BaseModel):
120+
section: str
121+
qa: List[QA]
122+
123+
106124
class ResourceNotFoundErrorResponseContent(BaseModel):
107125
message: str
108126

@@ -119,6 +137,14 @@ class SharedUserDetails(BaseModel):
119137
sharedTime: float
120138

121139

140+
class Term(BaseModel):
141+
name: str
142+
definition: str
143+
unitType: str
144+
citation: Optional[str] = None
145+
fixedValues: Optional[FixedValueTermInference] = None
146+
147+
122148
class UpdateContractRequestContent(BaseModel):
123149
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
124150
name: str
@@ -181,6 +207,17 @@ class ContractSummaryItem(BaseModel):
181207
sharedEmails: Optional[List[str]] = None
182208

183209

210+
class GetContractResponseContent(BaseModel):
211+
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
212+
name: str
213+
type: ContractType
214+
terms: List[Term]
215+
qa_sections: List[QASection]
216+
isOwner: bool
217+
ownerId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
218+
sharedWith: List[SharedWithItem]
219+
220+
184221
class GetProfileResponseContent(BaseModel):
185222
userId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
186223
profile: UserProfile
@@ -195,30 +232,10 @@ class ListContractsResponseContent(BaseModel):
195232
shared: List[ContractSummaryItem]
196233

197234

198-
class QASection(BaseModel):
199-
title: str
200-
questions: List[Question]
201-
202-
203-
class QASections(BaseModel):
204-
sections: List[QASection]
205-
206-
207235
class ShareContractResponseContent(BaseModel):
208236
success: bool
209237
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
210238
sharedWith: List[SharedUserDetails]
211239
added: Optional[List[str]] = None
212240
removed: Optional[List[str]] = None
213241
invalidRemoves: Optional[List[str]] = None
214-
215-
216-
class GetContractResponseContent(BaseModel):
217-
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
218-
name: str
219-
type: ContractType
220-
terms: Any
221-
iq_qa: QASections
222-
isOwner: bool
223-
ownerId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
224-
sharedWith: List[SharedWithItem]

typescript/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export type ContractSummaryItem = ExtractSchema<'ContractSummaryItem'>
1818
export type ContractType = ExtractSchema<'ContractType'>
1919
export type DeleteContractRequestContent = ExtractSchema<'DeleteContractRequestContent'>
2020
export type DeleteContractResponseContent = ExtractSchema<'DeleteContractResponseContent'>
21+
export type FixedTermValue = ExtractSchema<'FixedTermValue'>
22+
export type FixedValueTermInference = ExtractSchema<'FixedValueTermInference'>
2123
export type GetContractReadURLRequestContent = ExtractSchema<'GetContractReadURLRequestContent'>
2224
export type GetContractReadURLResponseContent = ExtractSchema<'GetContractReadURLResponseContent'>
2325
export type GetContractRequestContent = ExtractSchema<'GetContractRequestContent'>
@@ -33,13 +35,13 @@ export type ListContractsResponseContent = ExtractSchema<'ListContractsResponseC
3335
export type PingResponseContent = ExtractSchema<'PingResponseContent'>
3436
export type PresignedPostData = ExtractSchema<'PresignedPostData'>
3537
export type ProcessingIncompleteErrorResponseContent = ExtractSchema<'ProcessingIncompleteErrorResponseContent'>
38+
export type QA = ExtractSchema<'QA'>
3639
export type QASection = ExtractSchema<'QASection'>
37-
export type QASections = ExtractSchema<'QASections'>
38-
export type Question = ExtractSchema<'Question'>
3940
export type ResourceNotFoundErrorResponseContent = ExtractSchema<'ResourceNotFoundErrorResponseContent'>
4041
export type ShareContractRequestContent = ExtractSchema<'ShareContractRequestContent'>
4142
export type ShareContractResponseContent = ExtractSchema<'ShareContractResponseContent'>
4243
export type SharedUserDetails = ExtractSchema<'SharedUserDetails'>
44+
export type Term = ExtractSchema<'Term'>
4345
export type UpdateContractRequestContent = ExtractSchema<'UpdateContractRequestContent'>
4446
export type UpdateContractResponseContent = ExtractSchema<'UpdateContractResponseContent'>
4547
export type UpdateProfileRequestContent = ExtractSchema<'UpdateProfileRequestContent'>

typescript/src/models.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ export interface components {
228228
DeleteContractResponseContent: {
229229
success: boolean;
230230
};
231+
FixedTermValue: {
232+
unit: string;
233+
value: string;
234+
name?: string;
235+
/** Format: float */
236+
numericValue?: number;
237+
condition?: string;
238+
};
239+
FixedValueTermInference: {
240+
primary: components["schemas"]["FixedTermValue"];
241+
subterms?: components["schemas"]["FixedTermValue"][];
242+
};
231243
GetContractReadURLRequestContent: {
232244
contractId: string;
233245
};
@@ -241,8 +253,8 @@ export interface components {
241253
contractId: string;
242254
name: string;
243255
type: components["schemas"]["ContractType"];
244-
terms: unknown;
245-
iq_qa: components["schemas"]["QASections"];
256+
terms: components["schemas"]["Term"][];
257+
qa_sections: components["schemas"]["QASection"][];
246258
isOwner: boolean;
247259
ownerId: string;
248260
sharedWith: string[];
@@ -283,17 +295,14 @@ export interface components {
283295
ProcessingIncompleteErrorResponseContent: {
284296
message: string;
285297
};
286-
QASection: {
287-
title: string;
288-
questions: components["schemas"]["Question"][];
289-
};
290-
QASections: {
291-
sections: components["schemas"]["QASection"][];
292-
};
293-
Question: {
298+
QA: {
294299
question: string;
295300
answer: string;
296301
};
302+
QASection: {
303+
section: string;
304+
qa: components["schemas"]["QA"][];
305+
};
297306
ResourceNotFoundErrorResponseContent: {
298307
message: string;
299308
};
@@ -316,6 +325,13 @@ export interface components {
316325
/** Format: double */
317326
sharedTime: number;
318327
};
328+
Term: {
329+
name: string;
330+
definition: string;
331+
unitType: string;
332+
citation?: string;
333+
fixedValues?: components["schemas"]["FixedValueTermInference"];
334+
};
319335
UpdateContractRequestContent: {
320336
contractId: string;
321337
name: string;

0 commit comments

Comments
 (0)