@@ -7,28 +7,25 @@ import {
7
7
DateInterval ,
8
8
DateTimeField ,
9
9
DbLabel ,
10
- ID ,
11
10
IntersectTypes ,
12
11
parentIdMiddleware ,
13
12
Resource ,
14
13
ResourceRelationsShape ,
15
14
Secured ,
16
15
SecuredBoolean ,
17
16
SecuredDateNullable ,
18
- SecuredDateTime ,
17
+ SecuredDateTimeNullable ,
19
18
SecuredProps ,
20
19
SecuredRichTextNullable ,
21
- SecuredString ,
20
+ SecuredStringNullable ,
22
21
Sensitivity ,
23
22
SensitivityField ,
24
23
UnsecuredDto ,
25
24
} from '~/common' ;
26
25
import { BaseNode } from '~/core/database/results' ;
27
26
import { e } from '~/core/edgedb' ;
28
27
import { LinkTo , RegisterResource } from '~/core/resources' ;
29
- import { ScopedRole } from '../../authorization/dto' ;
30
28
import { ChangesetAware } from '../../changeset/dto' ;
31
- import { DefinedFile } from '../../file/dto' ;
32
29
import { Product , SecuredMethodologies } from '../../product/dto' ;
33
30
import {
34
31
InternshipProject ,
@@ -80,7 +77,7 @@ class Engagement extends Interfaces {
80
77
@DbLabel ( 'EngagementStatus' )
81
78
readonly status : SecuredEngagementStatus ;
82
79
83
- readonly ceremony : Secured < ID > ;
80
+ readonly ceremony : Secured < LinkTo < 'Ceremony' > > ;
84
81
85
82
@Field ( {
86
83
description : 'Translation / Growth Plan complete date' ,
@@ -119,25 +116,21 @@ class Engagement extends Interfaces {
119
116
120
117
@Field ( )
121
118
// Convert from date to datetime at migration
122
- readonly lastSuspendedAt : SecuredDateTime ;
119
+ readonly lastSuspendedAt : SecuredDateTimeNullable ;
123
120
124
121
@Field ( )
125
122
// Convert from date to datetime at migration
126
- readonly lastReactivatedAt : SecuredDateTime ;
123
+ readonly lastReactivatedAt : SecuredDateTimeNullable ;
127
124
128
125
@Field ( {
129
126
description : 'The last time the engagement status was modified' ,
130
127
} )
131
128
// Convert from last terminated/completed at migration
132
- readonly statusModifiedAt : SecuredDateTime ;
129
+ readonly statusModifiedAt : SecuredDateTimeNullable ;
133
130
134
131
@DateTimeField ( )
135
132
readonly modifiedAt : DateTime ;
136
133
137
- // A list of non-global roles the requesting user has available for this object.
138
- // This is just a cache, to prevent extra db lookups within the same request.
139
- declare readonly scope : ScopedRole [ ] ;
140
-
141
134
@Field ( )
142
135
readonly description : SecuredRichTextNullable ;
143
136
}
@@ -166,7 +159,7 @@ export class LanguageEngagement extends Engagement {
166
159
@Field ( ( ) => TranslationProject )
167
160
declare readonly parent : BaseNode ;
168
161
169
- readonly language : Secured < ID > ;
162
+ readonly language : Secured < LinkTo < 'Language' > > ;
170
163
171
164
@Field ( )
172
165
readonly firstScripture : SecuredBoolean ;
@@ -183,12 +176,12 @@ export class LanguageEngagement extends Engagement {
183
176
readonly sentPrintingDate : SecuredDateNullable ;
184
177
185
178
@Field ( )
186
- readonly paratextRegistryId : SecuredString ;
179
+ readonly paratextRegistryId : SecuredStringNullable ;
187
180
188
- readonly pnp : DefinedFile ;
181
+ readonly pnp : Secured < LinkTo < 'File' > | null > ;
189
182
190
183
@Field ( )
191
- readonly historicGoal : SecuredString ;
184
+ readonly historicGoal : SecuredStringNullable ;
192
185
}
193
186
194
187
@RegisterResource ( { db : e . InternshipEngagement } )
@@ -207,11 +200,11 @@ export class InternshipEngagement extends Engagement {
207
200
@Field ( ( ) => InternshipProject )
208
201
declare readonly parent : BaseNode ;
209
202
210
- readonly countryOfOrigin : Secured < ID | null > ;
203
+ readonly countryOfOrigin : Secured < LinkTo < 'Location' > | null > ;
211
204
212
- readonly intern : Secured < ID > ;
205
+ readonly intern : Secured < LinkTo < 'User' > > ;
213
206
214
- readonly mentor : Secured < ID | null > ;
207
+ readonly mentor : Secured < LinkTo < 'User' > | null > ;
215
208
216
209
@Field ( )
217
210
@DbLabel ( 'InternPosition' )
@@ -221,7 +214,7 @@ export class InternshipEngagement extends Engagement {
221
214
@DbLabel ( 'ProductMethodology' )
222
215
readonly methodologies : SecuredMethodologies ;
223
216
224
- readonly growthPlan : DefinedFile ;
217
+ readonly growthPlan : Secured < LinkTo < 'File' > | null > ;
225
218
}
226
219
227
220
export const engagementRange = ( engagement : UnsecuredDto < Engagement > ) =>
0 commit comments