@@ -61,7 +61,6 @@ export default class BillOfMaterialsService {
6161 * @param assemblyId the id of the Assembly for the material (optional)
6262 * @param pdmFileName the name of the pdm file for the material (optional)
6363 * @param unitName the name of the Quantity Unit the quantity is measured in (optional)
64- * @param reimbursementRequestId the id of the Reimbursement Request for the material (optional)
6564 * @returns the created material
6665 */
6766 static async createMaterial (
@@ -80,8 +79,7 @@ export default class BillOfMaterialsService {
8079 notes ?: string ,
8180 assemblyId ?: string ,
8281 pdmFileName ?: string ,
83- unitName ?: string ,
84- reimbursementRequestId ?: string
82+ unitName ?: string
8583 ) : Promise < Material > {
8684 const project = await ProjectsService . getSingleProjectWithQueryArgs ( wbsNumber , organization ) ;
8785
@@ -115,16 +113,6 @@ export default class BillOfMaterialsService {
115113 if ( ! unit ) throw new NotFoundException ( 'Unit' , unitName ) ;
116114 }
117115
118- if ( reimbursementRequestId ) {
119- const reimbursementRequest = await prisma . reimbursement_Request . findUnique ( {
120- where : { reimbursementRequestId, dateDeleted : null }
121- } ) ;
122-
123- if ( ! reimbursementRequest ) {
124- throw new NotFoundException ( 'Reimbursement Request' , reimbursementRequestId ) ;
125- }
126- }
127-
128116 const perms =
129117 ( await userHasPermission ( creator . userId , organization . organizationId , isLeadership ) ) ||
130118 isUserPartOfTeams ( project . teams , creator ) ;
@@ -148,8 +136,7 @@ export default class BillOfMaterialsService {
148136 linkUrl,
149137 notes,
150138 dateCreated : new Date ( ) ,
151- wbsElementId : project . wbsElementId ,
152- reimbursementRequestId
139+ wbsElementId : project . wbsElementId
153140 } ,
154141 ...getMaterialQueryArgs ( organization . organizationId )
155142 } ) ;
@@ -628,7 +615,6 @@ export default class BillOfMaterialsService {
628615 * @param unitName the unit name of the edited material (optional)
629616 * @param assemblyId the assembly id of the edited material (optional)
630617 * @param pdmFileName the pdm file name of the edited material (optional)
631- * @param reimbursementRequestId the id of the Reimbursement Request for the material (optional)
632618 * @throws if permission denied or material's wbsElement is undefined/deleted
633619 * @returns the updated material
634620 */
@@ -648,8 +634,7 @@ export default class BillOfMaterialsService {
648634 notes ?: string ,
649635 unitName ?: string ,
650636 assemblyId ?: string ,
651- pdmFileName ?: string ,
652- reimbursementRequestId ?: string
637+ pdmFileName ?: string
653638 ) : Promise < Material > {
654639 const material = await BillOfMaterialsService . getSingleMaterialWithQueryArgs ( materialId , organization ) ;
655640
@@ -679,16 +664,6 @@ export default class BillOfMaterialsService {
679664 if ( ! unit ) throw new NotFoundException ( 'Unit' , unitName ) ;
680665 }
681666
682- if ( reimbursementRequestId ) {
683- const reimbursementRequest = await prisma . reimbursement_Request . findUnique ( {
684- where : { reimbursementRequestId, dateDeleted : null }
685- } ) ;
686-
687- if ( ! reimbursementRequest ) {
688- throw new NotFoundException ( 'Reimbursement Request' , reimbursementRequestId ) ;
689- }
690- }
691-
692667 let manufacturer = null ;
693668 if ( manufacturerName ) {
694669 manufacturer = await BillOfMaterialsService . getSingleManufacturerWithQueryArgs ( manufacturerName , organization ) ;
@@ -710,8 +685,7 @@ export default class BillOfMaterialsService {
710685 notes,
711686 wbsElementId : project . wbsElementId ,
712687 assemblyId,
713- pdmFileName,
714- reimbursementRequestId
688+ pdmFileName
715689 } ,
716690 ...getMaterialQueryArgs ( organization . organizationId )
717691 } ) ;
0 commit comments