@rippling/rippling-sdk 0.2.0-alpha.61 → 0.2.0-alpha.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.mts +18 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -0
- package/client.d.ts.map +1 -1
- package/client.js +18 -0
- package/client.js.map +1 -1
- package/client.mjs +18 -0
- package/client.mjs.map +1 -1
- package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +530 -0
- package/examples/manifest/grant-program-management/grant-program-management.ts +594 -0
- package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +554 -0
- package/lib/manifest/custom-object-page-layout.d.mts +0 -6
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +0 -6
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +16 -5
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +16 -5
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/index.d.mts +1 -1
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +1 -1
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app-users.d.mts +186 -0
- package/resources/app-users.d.mts.map +1 -0
- package/resources/app-users.d.ts +186 -0
- package/resources/app-users.d.ts.map +1 -0
- package/resources/app-users.js +32 -0
- package/resources/app-users.js.map +1 -0
- package/resources/app-users.mjs +28 -0
- package/resources/app-users.mjs.map +1 -0
- package/resources/device-orders.d.mts +147 -0
- package/resources/device-orders.d.mts.map +1 -0
- package/resources/device-orders.d.ts +147 -0
- package/resources/device-orders.d.ts.map +1 -0
- package/resources/device-orders.js +34 -0
- package/resources/device-orders.js.map +1 -0
- package/resources/device-orders.mjs +30 -0
- package/resources/device-orders.mjs.map +1 -0
- package/resources/devices.d.mts +272 -0
- package/resources/devices.d.mts.map +1 -0
- package/resources/devices.d.ts +272 -0
- package/resources/devices.d.ts.map +1 -0
- package/resources/devices.js +32 -0
- package/resources/devices.js.map +1 -0
- package/resources/devices.mjs +28 -0
- package/resources/devices.mjs.map +1 -0
- package/resources/functions/deployments.d.mts +8 -0
- package/resources/functions/deployments.d.mts.map +1 -1
- package/resources/functions/deployments.d.ts +8 -0
- package/resources/functions/deployments.d.ts.map +1 -1
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +8 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/job-assignments.d.mts +12 -12
- package/resources/job-assignments.d.mts.map +1 -1
- package/resources/job-assignments.d.ts +12 -12
- package/resources/job-assignments.d.ts.map +1 -1
- package/resources/workers.d.mts +13 -0
- package/resources/workers.d.mts.map +1 -1
- package/resources/workers.d.ts +13 -0
- package/resources/workers.d.ts.map +1 -1
- package/src/client.ts +66 -0
- package/src/lib/manifest/custom-object-page-layout.ts +14 -9
- package/src/lib/manifest/index.ts +0 -2
- package/src/resources/app-users.ts +270 -0
- package/src/resources/device-orders.ts +200 -0
- package/src/resources/devices.ts +496 -0
- package/src/resources/functions/deployments.ts +10 -0
- package/src/resources/index.ts +24 -0
- package/src/resources/job-assignments.ts +12 -12
- package/src/resources/workers.ts +15 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Grant Program Management - programs, grants, applicants, applications, milestones, and disbursements.
|
|
3
|
+
*
|
|
4
|
+
* gpm_program__c <- funding program and budget
|
|
5
|
+
* gpm_grant__c <- grant cycle under a program
|
|
6
|
+
* gpm_applicant__c <- applicant organization
|
|
7
|
+
* gpm_application__c <- application submitted for a grant
|
|
8
|
+
* gpm_milestone__c <- deliverable or report for an application
|
|
9
|
+
* gpm_disbursement__c <- payment tranche for an application
|
|
10
|
+
*
|
|
11
|
+
* Run:
|
|
12
|
+
* yarn tsn examples/manifest/grant-program-management/grant-program-management.ts \
|
|
13
|
+
* > examples/manifest/grant-program-management/manifest.json
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
Category,
|
|
18
|
+
CustomObject,
|
|
19
|
+
CustomObjectFieldSection,
|
|
20
|
+
CustomObjectPageLayout,
|
|
21
|
+
DateField,
|
|
22
|
+
EmailField,
|
|
23
|
+
FormulaField,
|
|
24
|
+
ListViewDef,
|
|
25
|
+
LongTextField,
|
|
26
|
+
LookupField,
|
|
27
|
+
ManifestBuilder,
|
|
28
|
+
NumberField,
|
|
29
|
+
ParentChildField,
|
|
30
|
+
Rule,
|
|
31
|
+
SelectField,
|
|
32
|
+
SummaryField,
|
|
33
|
+
TextField,
|
|
34
|
+
Validation,
|
|
35
|
+
} from '@rippling/rippling-sdk/lib/manifest';
|
|
36
|
+
|
|
37
|
+
const manifest = new ManifestBuilder({
|
|
38
|
+
key: 'grant_program_management',
|
|
39
|
+
name: 'Grant Program Management',
|
|
40
|
+
description: 'Grant programs, application review, milestones, and disbursement tracking',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const category = new Category(manifest, {
|
|
44
|
+
apiName: 'grants__c',
|
|
45
|
+
name: 'Grants',
|
|
46
|
+
description: 'Grant program and funding records',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const programObj = new CustomObject(manifest, {
|
|
50
|
+
apiName: 'gpm_program__c',
|
|
51
|
+
name: 'Program',
|
|
52
|
+
pluralLabel: 'Programs',
|
|
53
|
+
category,
|
|
54
|
+
description: 'Funding program with annual budget and focus area',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const programSection = new CustomObjectFieldSection(programObj, {
|
|
58
|
+
name: 'Program',
|
|
59
|
+
sectionId: 'sec_gpm_program',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const programFocusField = new SelectField(programObj, {
|
|
63
|
+
apiName: 'focus_area__c',
|
|
64
|
+
displayName: 'Focus area',
|
|
65
|
+
description: 'Program focus area',
|
|
66
|
+
options: ['Education', 'Workforce', 'Climate', 'Health', 'Housing', 'Community safety'],
|
|
67
|
+
required: true,
|
|
68
|
+
section: programSection,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const programBudgetCentsField = new NumberField(programObj, {
|
|
72
|
+
apiName: 'annual_budget_cents__c',
|
|
73
|
+
displayName: 'Annual budget (cents)',
|
|
74
|
+
description: 'Annual funding budget in cents',
|
|
75
|
+
decimalPlaces: 0,
|
|
76
|
+
section: programSection,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const programGuidelinesField = new LongTextField(programObj, {
|
|
80
|
+
apiName: 'guidelines__c',
|
|
81
|
+
displayName: 'Guidelines',
|
|
82
|
+
description: 'Eligibility and operating guidelines',
|
|
83
|
+
maxLength: 8000,
|
|
84
|
+
section: programSection,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const grantObj = new CustomObject(manifest, {
|
|
88
|
+
apiName: 'gpm_grant__c',
|
|
89
|
+
name: 'Grant',
|
|
90
|
+
pluralLabel: 'Grants',
|
|
91
|
+
category,
|
|
92
|
+
description: 'Grant cycle under a funding program',
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const grantSection = new CustomObjectFieldSection(grantObj, {
|
|
96
|
+
name: 'Grant',
|
|
97
|
+
sectionId: 'sec_gpm_grant',
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const grantProgramRef = new ParentChildField(grantObj, {
|
|
101
|
+
apiName: 'program_ref__c',
|
|
102
|
+
displayName: 'Program',
|
|
103
|
+
target: programObj,
|
|
104
|
+
relatedDataLabel: 'Grants',
|
|
105
|
+
parentChildType: 'PRIMARY',
|
|
106
|
+
enableParentOwnerInheritance: false,
|
|
107
|
+
description: 'Program this grant belongs to',
|
|
108
|
+
section: grantSection,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const grantStatusField = new SelectField(grantObj, {
|
|
112
|
+
apiName: 'status__c',
|
|
113
|
+
displayName: 'Status',
|
|
114
|
+
description: 'Grant cycle status',
|
|
115
|
+
options: ['Planning', 'Open', 'Review', 'Awarded', 'Closed'],
|
|
116
|
+
required: true,
|
|
117
|
+
section: grantSection,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const grantOpenDateField = new DateField(grantObj, {
|
|
121
|
+
apiName: 'open_date__c',
|
|
122
|
+
displayName: 'Open date',
|
|
123
|
+
description: 'Application open date',
|
|
124
|
+
section: grantSection,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const grantCloseDateField = new DateField(grantObj, {
|
|
128
|
+
apiName: 'close_date__c',
|
|
129
|
+
displayName: 'Close date',
|
|
130
|
+
description: 'Application close date',
|
|
131
|
+
section: grantSection,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const grantAwardBudgetCentsField = new NumberField(grantObj, {
|
|
135
|
+
apiName: 'award_budget_cents__c',
|
|
136
|
+
displayName: 'Award budget (cents)',
|
|
137
|
+
description: 'Budget allocated to this grant cycle',
|
|
138
|
+
decimalPlaces: 0,
|
|
139
|
+
section: grantSection,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const applicantObj = new CustomObject(manifest, {
|
|
143
|
+
apiName: 'gpm_applicant__c',
|
|
144
|
+
name: 'Applicant',
|
|
145
|
+
pluralLabel: 'Applicants',
|
|
146
|
+
category,
|
|
147
|
+
description: 'Applicant organization and contact details',
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const applicantSection = new CustomObjectFieldSection(applicantObj, {
|
|
151
|
+
name: 'Applicant',
|
|
152
|
+
sectionId: 'sec_gpm_applicant',
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const applicantLegalNameField = new TextField(applicantObj, {
|
|
156
|
+
apiName: 'legal_name__c',
|
|
157
|
+
displayName: 'Legal name',
|
|
158
|
+
description: 'Applicant organization legal name',
|
|
159
|
+
maxLength: 200,
|
|
160
|
+
required: true,
|
|
161
|
+
section: applicantSection,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const applicantTypeField = new SelectField(applicantObj, {
|
|
165
|
+
apiName: 'applicant_type__c',
|
|
166
|
+
displayName: 'Applicant type',
|
|
167
|
+
description: 'Applicant organization type',
|
|
168
|
+
options: ['Nonprofit', 'School', 'Government', 'Small business', 'Community group'],
|
|
169
|
+
required: true,
|
|
170
|
+
section: applicantSection,
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const applicantEmailField = new EmailField(applicantObj, {
|
|
174
|
+
apiName: 'contact_email__c',
|
|
175
|
+
displayName: 'Contact email',
|
|
176
|
+
description: 'Primary applicant contact email',
|
|
177
|
+
section: applicantSection,
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const applicationObj = new CustomObject(manifest, {
|
|
181
|
+
apiName: 'gpm_application__c',
|
|
182
|
+
name: 'Application',
|
|
183
|
+
pluralLabel: 'Applications',
|
|
184
|
+
category,
|
|
185
|
+
description: 'Application submitted by an applicant for a grant',
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
const applicationSection = new CustomObjectFieldSection(applicationObj, {
|
|
189
|
+
name: 'Application',
|
|
190
|
+
sectionId: 'sec_gpm_application',
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const applicationGrantRef = new ParentChildField(applicationObj, {
|
|
194
|
+
apiName: 'grant_ref__c',
|
|
195
|
+
displayName: 'Grant',
|
|
196
|
+
target: grantObj,
|
|
197
|
+
relatedDataLabel: 'Applications',
|
|
198
|
+
parentChildType: 'PRIMARY',
|
|
199
|
+
enableParentOwnerInheritance: false,
|
|
200
|
+
description: 'Grant cycle this application targets',
|
|
201
|
+
section: applicationSection,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
const applicationApplicantRef = new LookupField(applicationObj, {
|
|
205
|
+
apiName: 'applicant_ref__c',
|
|
206
|
+
displayName: 'Applicant',
|
|
207
|
+
target: applicantObj,
|
|
208
|
+
relatedDataLabel: 'Applications',
|
|
209
|
+
description: 'Applicant submitting this request',
|
|
210
|
+
required: true,
|
|
211
|
+
section: applicationSection,
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const applicationStatusField = new SelectField(applicationObj, {
|
|
215
|
+
apiName: 'status__c',
|
|
216
|
+
displayName: 'Status',
|
|
217
|
+
description: 'Application review state',
|
|
218
|
+
options: ['Draft', 'Submitted', 'Eligibility review', 'Panel review', 'Awarded', 'Declined'],
|
|
219
|
+
required: true,
|
|
220
|
+
section: applicationSection,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
const requestedAmountCentsField = new NumberField(applicationObj, {
|
|
224
|
+
apiName: 'requested_amount_cents__c',
|
|
225
|
+
displayName: 'Requested amount (cents)',
|
|
226
|
+
description: 'Requested funding amount in cents',
|
|
227
|
+
decimalPlaces: 0,
|
|
228
|
+
required: true,
|
|
229
|
+
section: applicationSection,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const scoreField = new NumberField(applicationObj, {
|
|
233
|
+
apiName: 'review_score__c',
|
|
234
|
+
displayName: 'Review score',
|
|
235
|
+
description: 'Panel score from 0 to 100',
|
|
236
|
+
decimalPlaces: 2,
|
|
237
|
+
section: applicationSection,
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const proposalSummaryField = new LongTextField(applicationObj, {
|
|
241
|
+
apiName: 'proposal_summary__c',
|
|
242
|
+
displayName: 'Proposal summary',
|
|
243
|
+
description: 'Program plan and impact narrative',
|
|
244
|
+
maxLength: 8000,
|
|
245
|
+
section: applicationSection,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
const milestoneObj = new CustomObject(manifest, {
|
|
249
|
+
apiName: 'gpm_milestone__c',
|
|
250
|
+
name: 'Milestone',
|
|
251
|
+
pluralLabel: 'Milestones',
|
|
252
|
+
category,
|
|
253
|
+
description: 'Deliverable or report due for an awarded application',
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const milestoneSection = new CustomObjectFieldSection(milestoneObj, {
|
|
257
|
+
name: 'Milestone',
|
|
258
|
+
sectionId: 'sec_gpm_milestone',
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const milestoneApplicationRef = new ParentChildField(milestoneObj, {
|
|
262
|
+
apiName: 'application_ref__c',
|
|
263
|
+
displayName: 'Application',
|
|
264
|
+
target: applicationObj,
|
|
265
|
+
relatedDataLabel: 'Milestones',
|
|
266
|
+
parentChildType: 'PRIMARY',
|
|
267
|
+
enableParentOwnerInheritance: true,
|
|
268
|
+
description: 'Application this milestone belongs to',
|
|
269
|
+
section: milestoneSection,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const milestoneDueDateField = new DateField(milestoneObj, {
|
|
273
|
+
apiName: 'due_date__c',
|
|
274
|
+
displayName: 'Due date',
|
|
275
|
+
description: 'Milestone due date',
|
|
276
|
+
required: true,
|
|
277
|
+
section: milestoneSection,
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
const milestoneStatusField = new SelectField(milestoneObj, {
|
|
281
|
+
apiName: 'status__c',
|
|
282
|
+
displayName: 'Status',
|
|
283
|
+
description: 'Milestone status',
|
|
284
|
+
options: ['Not started', 'In progress', 'Submitted', 'Accepted', 'Late'],
|
|
285
|
+
required: true,
|
|
286
|
+
section: milestoneSection,
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
const disbursementObj = new CustomObject(manifest, {
|
|
290
|
+
apiName: 'gpm_disbursement__c',
|
|
291
|
+
name: 'Disbursement',
|
|
292
|
+
pluralLabel: 'Disbursements',
|
|
293
|
+
category,
|
|
294
|
+
description: 'Payment tranche tied to an awarded application',
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
const disbursementSection = new CustomObjectFieldSection(disbursementObj, {
|
|
298
|
+
name: 'Disbursement',
|
|
299
|
+
sectionId: 'sec_gpm_disbursement',
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const disbursementApplicationRef = new ParentChildField(disbursementObj, {
|
|
303
|
+
apiName: 'application_ref__c',
|
|
304
|
+
displayName: 'Application',
|
|
305
|
+
target: applicationObj,
|
|
306
|
+
relatedDataLabel: 'Disbursements',
|
|
307
|
+
parentChildType: 'PRIMARY',
|
|
308
|
+
enableParentOwnerInheritance: true,
|
|
309
|
+
description: 'Application funded by this disbursement',
|
|
310
|
+
section: disbursementSection,
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
const disbursementAmountCentsField = new NumberField(disbursementObj, {
|
|
314
|
+
apiName: 'amount_cents__c',
|
|
315
|
+
displayName: 'Amount (cents)',
|
|
316
|
+
description: 'Disbursement amount in cents',
|
|
317
|
+
decimalPlaces: 0,
|
|
318
|
+
required: true,
|
|
319
|
+
section: disbursementSection,
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
const disbursementStatusField = new SelectField(disbursementObj, {
|
|
323
|
+
apiName: 'status__c',
|
|
324
|
+
displayName: 'Status',
|
|
325
|
+
description: 'Disbursement status',
|
|
326
|
+
options: ['Scheduled', 'Approved', 'Paid', 'Held', 'Cancelled'],
|
|
327
|
+
required: true,
|
|
328
|
+
section: disbursementSection,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
const disbursementDateField = new DateField(disbursementObj, {
|
|
332
|
+
apiName: 'disbursement_date__c',
|
|
333
|
+
displayName: 'Disbursement date',
|
|
334
|
+
description: 'Scheduled or actual payment date',
|
|
335
|
+
section: disbursementSection,
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const grantCountOnProgram = new SummaryField(programObj, {
|
|
339
|
+
apiName: 'grant_count__c',
|
|
340
|
+
displayName: 'Grants',
|
|
341
|
+
aggregates: grantStatusField,
|
|
342
|
+
using: 'COUNT',
|
|
343
|
+
lookup: grantProgramRef,
|
|
344
|
+
description: 'Grant cycles under this program',
|
|
345
|
+
section: programSection,
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
const applicationCountOnGrant = new SummaryField(grantObj, {
|
|
349
|
+
apiName: 'application_count__c',
|
|
350
|
+
displayName: 'Applications',
|
|
351
|
+
aggregates: applicationApplicantRef,
|
|
352
|
+
using: 'COUNT',
|
|
353
|
+
lookup: applicationGrantRef,
|
|
354
|
+
description: 'Applications submitted for this grant',
|
|
355
|
+
section: grantSection,
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const requestedAmountOnGrant = new SummaryField(grantObj, {
|
|
359
|
+
apiName: 'requested_amount_cents_total__c',
|
|
360
|
+
displayName: 'Requested amount total (cents)',
|
|
361
|
+
aggregates: requestedAmountCentsField,
|
|
362
|
+
using: 'SUM',
|
|
363
|
+
lookup: applicationGrantRef,
|
|
364
|
+
description: 'Total requested funding for this grant',
|
|
365
|
+
section: grantSection,
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
const milestoneCountOnApplication = new SummaryField(applicationObj, {
|
|
369
|
+
apiName: 'milestone_count__c',
|
|
370
|
+
displayName: 'Milestones',
|
|
371
|
+
aggregates: milestoneStatusField,
|
|
372
|
+
using: 'COUNT',
|
|
373
|
+
lookup: milestoneApplicationRef,
|
|
374
|
+
description: 'Milestones attached to this application',
|
|
375
|
+
section: applicationSection,
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
const disbursedAmountOnApplication = new SummaryField(applicationObj, {
|
|
379
|
+
apiName: 'disbursed_amount_cents__c',
|
|
380
|
+
displayName: 'Disbursed amount (cents)',
|
|
381
|
+
aggregates: disbursementAmountCentsField,
|
|
382
|
+
using: 'SUM',
|
|
383
|
+
lookup: disbursementApplicationRef,
|
|
384
|
+
description: 'Total disbursements for this application',
|
|
385
|
+
section: applicationSection,
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
const applicationLabelField = new FormulaField(applicationObj, {
|
|
389
|
+
apiName: 'review_label__c',
|
|
390
|
+
displayName: 'Review label',
|
|
391
|
+
description: 'Review queue label',
|
|
392
|
+
fieldType: 'TEXT',
|
|
393
|
+
maxLength: 240,
|
|
394
|
+
formula: "CONCATENATE(status__c, ' - score ', review_score__c)",
|
|
395
|
+
section: applicationSection,
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
new Validation(grantObj, {
|
|
399
|
+
ruleId: 'gpm_grant_close_after_open',
|
|
400
|
+
displayName: 'Close date must be after open date',
|
|
401
|
+
rqlFormula: '(close_date__c <= open_date__c)',
|
|
402
|
+
errorMessage: 'Close date must be after open date.',
|
|
403
|
+
ruleDescription: 'Prevents inverted application windows',
|
|
404
|
+
state: 'ACTIVE',
|
|
405
|
+
level: 'FIELD',
|
|
406
|
+
fieldRef: grantCloseDateField,
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
new Validation(applicationObj, {
|
|
410
|
+
ruleId: 'gpm_requested_amount_positive',
|
|
411
|
+
displayName: 'Requested amount must be positive',
|
|
412
|
+
rqlFormula: '(requested_amount_cents__c <= 0)',
|
|
413
|
+
errorMessage: 'Requested amount must be greater than zero.',
|
|
414
|
+
ruleDescription: 'Blocks zero-value applications',
|
|
415
|
+
state: 'ACTIVE',
|
|
416
|
+
level: 'FIELD',
|
|
417
|
+
fieldRef: requestedAmountCentsField,
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
new Validation(applicationObj, {
|
|
421
|
+
ruleId: 'gpm_review_score_range',
|
|
422
|
+
displayName: 'Review score must be 0-100',
|
|
423
|
+
rqlFormula: '((review_score__c < 0) OR (review_score__c > 100))',
|
|
424
|
+
errorMessage: 'Review score must be between 0 and 100.',
|
|
425
|
+
ruleDescription: 'Keeps panel scores in range',
|
|
426
|
+
state: 'ACTIVE',
|
|
427
|
+
level: 'FIELD',
|
|
428
|
+
fieldRef: scoreField,
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
new Rule(applicationObj, {
|
|
432
|
+
flowId: 'gpm_default_application_status',
|
|
433
|
+
flowName: 'Default application status',
|
|
434
|
+
triggerType: 'CREATE',
|
|
435
|
+
description: 'New applications start as Draft',
|
|
436
|
+
actions: [{ targetField: applicationStatusField, fixedValue: ['Draft'] }],
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
new Rule(milestoneObj, {
|
|
440
|
+
flowId: 'gpm_default_milestone_status',
|
|
441
|
+
flowName: 'Default milestone status',
|
|
442
|
+
triggerType: 'CREATE',
|
|
443
|
+
description: 'New milestones start Not started',
|
|
444
|
+
actions: [{ targetField: milestoneStatusField, fixedValue: ['Not started'] }],
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
new ListViewDef(programObj, {
|
|
448
|
+
viewId: 'view_gpm_programs',
|
|
449
|
+
name: 'Programs',
|
|
450
|
+
description: 'Funding programs with budgets and grant counts',
|
|
451
|
+
fields: ['name', programFocusField, programBudgetCentsField, grantCountOnProgram],
|
|
452
|
+
orderBy: 'name',
|
|
453
|
+
sortOrder: 'ASC',
|
|
454
|
+
isPublic: true,
|
|
455
|
+
objectScope: 'all',
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
new ListViewDef(grantObj, {
|
|
459
|
+
viewId: 'view_gpm_grants',
|
|
460
|
+
name: 'Grants',
|
|
461
|
+
description: 'Grant cycles with application and requested amount rollups',
|
|
462
|
+
fields: [
|
|
463
|
+
'name',
|
|
464
|
+
grantProgramRef,
|
|
465
|
+
grantStatusField,
|
|
466
|
+
grantOpenDateField,
|
|
467
|
+
grantCloseDateField,
|
|
468
|
+
grantAwardBudgetCentsField,
|
|
469
|
+
applicationCountOnGrant,
|
|
470
|
+
requestedAmountOnGrant,
|
|
471
|
+
],
|
|
472
|
+
orderBy: grantCloseDateField,
|
|
473
|
+
sortOrder: 'ASC',
|
|
474
|
+
isPublic: true,
|
|
475
|
+
objectScope: 'all',
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
new ListViewDef(applicantObj, {
|
|
479
|
+
viewId: 'view_gpm_applicants',
|
|
480
|
+
name: 'Applicants',
|
|
481
|
+
description: 'Applicant directory',
|
|
482
|
+
fields: ['name', applicantLegalNameField, applicantTypeField, applicantEmailField],
|
|
483
|
+
orderBy: applicantLegalNameField,
|
|
484
|
+
sortOrder: 'ASC',
|
|
485
|
+
isPublic: true,
|
|
486
|
+
objectScope: 'all',
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
new ListViewDef(applicationObj, {
|
|
490
|
+
viewId: 'view_gpm_applications',
|
|
491
|
+
name: 'Applications',
|
|
492
|
+
description: 'Application review queue',
|
|
493
|
+
fields: [
|
|
494
|
+
'name',
|
|
495
|
+
applicationGrantRef,
|
|
496
|
+
applicationApplicantRef,
|
|
497
|
+
applicationStatusField,
|
|
498
|
+
requestedAmountCentsField,
|
|
499
|
+
scoreField,
|
|
500
|
+
milestoneCountOnApplication,
|
|
501
|
+
disbursedAmountOnApplication,
|
|
502
|
+
applicationLabelField,
|
|
503
|
+
],
|
|
504
|
+
orderBy: scoreField,
|
|
505
|
+
sortOrder: 'DESC',
|
|
506
|
+
isPublic: true,
|
|
507
|
+
objectScope: 'all',
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
new ListViewDef(milestoneObj, {
|
|
511
|
+
viewId: 'view_gpm_milestones',
|
|
512
|
+
name: 'Milestones',
|
|
513
|
+
description: 'Deliverables and report deadlines',
|
|
514
|
+
fields: ['name', milestoneApplicationRef, milestoneDueDateField, milestoneStatusField],
|
|
515
|
+
orderBy: milestoneDueDateField,
|
|
516
|
+
sortOrder: 'ASC',
|
|
517
|
+
isPublic: true,
|
|
518
|
+
objectScope: 'all',
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
new ListViewDef(disbursementObj, {
|
|
522
|
+
viewId: 'view_gpm_disbursements',
|
|
523
|
+
name: 'Disbursements',
|
|
524
|
+
description: 'Payment tranches by application',
|
|
525
|
+
fields: [
|
|
526
|
+
'name',
|
|
527
|
+
disbursementApplicationRef,
|
|
528
|
+
disbursementAmountCentsField,
|
|
529
|
+
disbursementStatusField,
|
|
530
|
+
disbursementDateField,
|
|
531
|
+
],
|
|
532
|
+
orderBy: disbursementDateField,
|
|
533
|
+
sortOrder: 'ASC',
|
|
534
|
+
isPublic: true,
|
|
535
|
+
objectScope: 'all',
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
CustomObjectPageLayout.basic(programObj, {
|
|
539
|
+
section: programSection,
|
|
540
|
+
fields: ['name', programFocusField, programBudgetCentsField, grantCountOnProgram, programGuidelinesField],
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
CustomObjectPageLayout.basic(grantObj, {
|
|
544
|
+
section: grantSection,
|
|
545
|
+
fields: [
|
|
546
|
+
'name',
|
|
547
|
+
grantProgramRef,
|
|
548
|
+
grantStatusField,
|
|
549
|
+
grantOpenDateField,
|
|
550
|
+
grantCloseDateField,
|
|
551
|
+
grantAwardBudgetCentsField,
|
|
552
|
+
applicationCountOnGrant,
|
|
553
|
+
requestedAmountOnGrant,
|
|
554
|
+
],
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
CustomObjectPageLayout.basic(applicantObj, {
|
|
558
|
+
section: applicantSection,
|
|
559
|
+
fields: ['name', applicantLegalNameField, applicantTypeField, applicantEmailField],
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
CustomObjectPageLayout.basic(applicationObj, {
|
|
563
|
+
section: applicationSection,
|
|
564
|
+
fields: [
|
|
565
|
+
'name',
|
|
566
|
+
applicationGrantRef,
|
|
567
|
+
applicationApplicantRef,
|
|
568
|
+
applicationStatusField,
|
|
569
|
+
requestedAmountCentsField,
|
|
570
|
+
scoreField,
|
|
571
|
+
milestoneCountOnApplication,
|
|
572
|
+
disbursedAmountOnApplication,
|
|
573
|
+
applicationLabelField,
|
|
574
|
+
proposalSummaryField,
|
|
575
|
+
],
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
CustomObjectPageLayout.basic(milestoneObj, {
|
|
579
|
+
section: milestoneSection,
|
|
580
|
+
fields: ['name', milestoneApplicationRef, milestoneDueDateField, milestoneStatusField],
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
CustomObjectPageLayout.basic(disbursementObj, {
|
|
584
|
+
section: disbursementSection,
|
|
585
|
+
fields: [
|
|
586
|
+
'name',
|
|
587
|
+
disbursementApplicationRef,
|
|
588
|
+
disbursementAmountCentsField,
|
|
589
|
+
disbursementStatusField,
|
|
590
|
+
disbursementDateField,
|
|
591
|
+
],
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
console.log(manifest.preview());
|