@@ -22,7 +22,7 @@ import ChangeRequestsService from '../services/change-requests.services';
2222import projectQueryArgs from '../prisma-query-args/projects.query-args' ;
2323import TeamsService from '../services/teams.services' ;
2424import WorkPackagesService from '../services/work-packages.services' ;
25- import { ClubAccount , validateWBS , WbsElementStatus , WorkPackageStage } from 'shared' ;
25+ import { ChangeRequest , ClubAccount , StandardChangeRequest , validateWBS , WbsElementStatus , WorkPackageStage } from 'shared' ;
2626import TasksService from '../services/tasks.services' ;
2727import DescriptionBulletsService from '../services/description-bullets.services' ;
2828import { seedProject } from './seed-data/projects.seed' ;
@@ -129,7 +129,7 @@ const performSeed: () => Promise<void> = async () => {
129129 /**
130130 * Make an initial change request for car 1 using the wbs of the genesis project
131131 */
132- const changeRequest1Id : number = await ChangeRequestsService . createStandardChangeRequest (
132+ const changeRequest1 : StandardChangeRequest = await ChangeRequestsService . createStandardChangeRequest (
133133 cyborg ,
134134 genesisProject . wbsElement . carNumber ,
135135 genesisProject . wbsElement . projectNumber ,
@@ -141,21 +141,25 @@ const performSeed: () => Promise<void> = async () => {
141141 type : Scope_CR_Why_Type . INITIALIZATION ,
142142 explain : 'need this to initialize all the seed data'
143143 }
144+ ] ,
145+ [
146+ {
147+ description : 'Initialize seed data' ,
148+ scopeImpact : 'no scope impact' ,
149+ timelineImpact : 0 ,
150+ budgetImpact : 0
151+ }
144152 ]
145153 ) ;
146154
147- // make a proposed solution for it
148- const proposedSolution1Id : string = await ChangeRequestsService . addProposedSolution (
149- cyborg ,
150- changeRequest1Id ,
151- 0 ,
152- 'Initializing seed data' ,
153- 0 ,
154- 'no scope impact'
155- ) ;
156-
157155 // approve the change request
158- await ChangeRequestsService . reviewChangeRequest ( batman , changeRequest1Id , 'LGTM' , true , proposedSolution1Id ) ;
156+ await ChangeRequestsService . reviewChangeRequest (
157+ batman ,
158+ changeRequest1 . crId ,
159+ 'LGTM' ,
160+ true ,
161+ changeRequest1 . proposedSolutions [ 0 ] . id
162+ ) ;
159163
160164 /**
161165 * TEAMS
@@ -262,7 +266,7 @@ const performSeed: () => Promise<void> = async () => {
262266 /** Project 1 */
263267 const { projectWbsNumber : project1WbsNumber , projectId : project1Id } = await seedProject (
264268 thomasEmrax ,
265- changeRequest1Id ,
269+ changeRequest1 . crId ,
266270 1 ,
267271 'Impact Attenuator' ,
268272 'Develop rules-compliant impact attenuator' ,
@@ -292,7 +296,7 @@ const performSeed: () => Promise<void> = async () => {
292296 /** Project 2 */
293297 const { projectWbsNumber : project2WbsNumber , projectId : project2Id } = await seedProject (
294298 thomasEmrax ,
295- changeRequest1Id ,
299+ changeRequest1 . crId ,
296300 1 ,
297301 'Bodywork' ,
298302 'Develop rules-compliant bodywork' ,
@@ -322,7 +326,7 @@ const performSeed: () => Promise<void> = async () => {
322326 /** Project 3 */
323327 const { projectWbsNumber : project3WbsNumber , projectId : project3Id } = await seedProject (
324328 thomasEmrax ,
325- changeRequest1Id ,
329+ changeRequest1 . crId ,
326330 1 ,
327331 'Battery Box' ,
328332 'Develop rules-compliant battery box.' ,
@@ -352,7 +356,7 @@ const performSeed: () => Promise<void> = async () => {
352356 /** Project 4 */
353357 const { projectWbsNumber : project4WbsNumber , projectId : project4Id } = await seedProject (
354358 thomasEmrax ,
355- changeRequest1Id ,
359+ changeRequest1 . crId ,
356360 1 ,
357361 'Motor Controller Integration' ,
358362 'Develop rules-compliant motor controller integration.' ,
@@ -382,7 +386,7 @@ const performSeed: () => Promise<void> = async () => {
382386 /** Project 5 */
383387 const { projectWbsNumber : project5WbsNumber , projectId : project5Id } = await seedProject (
384388 thomasEmrax ,
385- changeRequest1Id ,
389+ changeRequest1 . crId ,
386390 1 ,
387391 'Wiring Harness' ,
388392 'Develop rules-compliant wiring harness.' ,
@@ -417,7 +421,7 @@ const performSeed: () => Promise<void> = async () => {
417421 joeShmoe ,
418422 project1WbsNumber ,
419423 'Bodywork Concept of Design' ,
420- changeRequest1Id ,
424+ changeRequest1 . crId ,
421425 WorkPackageStage . Design ,
422426 '01/01/2023' ,
423427 3 ,
@@ -458,7 +462,7 @@ const performSeed: () => Promise<void> = async () => {
458462 thomasEmrax ,
459463 project1WbsNumber ,
460464 'Adhesive Shear Strength Test' ,
461- changeRequest1Id ,
465+ changeRequest1 . crId ,
462466 WorkPackageStage . Research ,
463467 '01/22/2023' ,
464468 5 ,
@@ -482,7 +486,7 @@ const performSeed: () => Promise<void> = async () => {
482486 thomasEmrax ,
483487 project5WbsNumber ,
484488 'Manufacture Wiring Harness' ,
485- changeRequest1Id ,
489+ changeRequest1 . crId ,
486490 WorkPackageStage . Manufacturing ,
487491 '02/01/2023' ,
488492 3 ,
@@ -502,7 +506,7 @@ const performSeed: () => Promise<void> = async () => {
502506 thomasEmrax ,
503507 project5WbsNumber ,
504508 'Install Wiring Harness' ,
505- changeRequest1Id ,
509+ changeRequest1 . crId ,
506510 WorkPackageStage . Install ,
507511 '04/01/2023' ,
508512 7 ,
@@ -527,7 +531,7 @@ const performSeed: () => Promise<void> = async () => {
527531 true
528532 ) ;
529533
530- const changeRequest2Id = await ChangeRequestsService . createStandardChangeRequest (
534+ const changeRequest2 = await ChangeRequestsService . createStandardChangeRequest (
531535 thomasEmrax ,
532536 project2WbsNumber . carNumber ,
533537 project2WbsNumber . projectNumber ,
@@ -537,18 +541,23 @@ const performSeed: () => Promise<void> = async () => {
537541 [
538542 { type : Scope_CR_Why_Type . DESIGN , explain : 'It would be really pretty' } ,
539543 { type : Scope_CR_Why_Type . ESTIMATION , explain : 'I estimate that it would be really pretty' }
544+ ] ,
545+ [
546+ {
547+ description : 'Buy hot pink paint' ,
548+ scopeImpact : 'n/a' ,
549+ timelineImpact : 1 ,
550+ budgetImpact : 50
551+ } ,
552+ {
553+ description : 'Buy slightly cheaper but lower quality hot pink paint' ,
554+ scopeImpact : 'n/a' ,
555+ timelineImpact : 1 ,
556+ budgetImpact : 40
557+ }
540558 ]
541559 ) ;
542- await ChangeRequestsService . addProposedSolution ( thomasEmrax , changeRequest2Id , 50 , 'Buy hot pink paint' , 1 , 'n/a' ) ;
543- await ChangeRequestsService . addProposedSolution (
544- thomasEmrax ,
545- changeRequest2Id ,
546- 40 ,
547- 'Buy slightly cheaper but lower quality hot pink paint' ,
548- 1 ,
549- 'n/a'
550- ) ;
551- await ChangeRequestsService . reviewChangeRequest ( joeShmoe , changeRequest2Id , 'What the hell Thomas' , false , null ) ;
560+ await ChangeRequestsService . reviewChangeRequest ( joeShmoe , changeRequest2 . crId , 'What the hell Thomas' , false , null ) ;
552561
553562 await ChangeRequestsService . createActivationChangeRequest (
554563 thomasEmrax ,
0 commit comments