@@ -617,14 +617,14 @@ export default class ProjectsService {
617617 * @param manufacturerName the name of the material's manufacturer
618618 * @param manufacturerPartNumber the manufacturer part number for the material
619619 * @param quantity the quantity of material as a number
620- * @param unitName the name of the Quantity Unit the quantity is measured in
621620 * @param price the price of the material in whole cents
622621 * @param subtotal the subtotal of the price for the material in whole cents
623622 * @param linkUrl the url for the material's link as a string
624623 * @param notes any notes about the material as a string
625624 * @param wbsNumber the WBS number of the project associated with this material
626625 * @param assemblyId the id of the Assembly for the material
627626 * @param pdmFileName the name of the pdm file for the material
627+ * @param unitName the name of the Quantity Unit the quantity is measured in
628628 * @returns the created material
629629 */
630630 static async createMaterial (
@@ -635,14 +635,14 @@ export default class ProjectsService {
635635 manufacturerName : string ,
636636 manufacturerPartNumber : string ,
637637 quantity : number ,
638- unitName : string ,
639638 price : number ,
640639 subtotal : number ,
641640 linkUrl : string ,
642641 notes : string ,
643642 wbsNumber : WbsNumber ,
644643 assemblyId ?: string ,
645- pdmFileName ?: string
644+ pdmFileName ?: string ,
645+ unitName ?: string
646646 ) : Promise < Material > {
647647 const project = await prisma . project . findFirst ( {
648648 where : {
@@ -657,7 +657,7 @@ export default class ProjectsService {
657657
658658 if ( ! project ) throw new NotFoundException ( 'Project' , wbsPipe ( wbsNumber ) ) ;
659659
660- await checkMaterialInputs ( manufacturerName , unitName , assemblyId , materialTypeName ) ;
660+ await checkMaterialInputs ( manufacturerName , materialTypeName , unitName , assemblyId ) ;
661661
662662 const perms = isLeadership ( creator . role ) || isUserPartOfTeams ( project . teams , creator ) ;
663663
@@ -816,19 +816,20 @@ export default class ProjectsService {
816816 /**
817817 * Update a material
818818 * @param submitter the submitter of the request
819- * @param materialId the material id of the new material
820- * @param name the name of the new material
821- * @param status the status of the new material
822- * @param manufacturerName the manufacturerName of the new material
823- * @param manufacturerPartNumber the manufacturerPartNumber of the new material
824- * @param quantity the quantity of the new material
825- * @param price the price of the new material
826- * @param subtotal the subtotal of the new material
827- * @param linkUrl the linkUrl of the new material
828- * @param notes the notes of the new material
829- * @param unitName the unit name of the new material
830- * @param assemblyId the assembly id of the new material
831- * @param pdmFileName the pdm file name of the new material
819+ * @param materialId the material id of the material being edited
820+ * @param name the name of the edited material
821+ * @param status the status of the edited material
822+ * @param materialTypeName the material type of the edited material
823+ * @param manufacturerName the manufacturerName of the edited material
824+ * @param manufacturerPartNumber the manufacturerPartNumber of the edited material
825+ * @param quantity the quantity of the edited material
826+ * @param price the price of the edited material
827+ * @param subtotal the subtotal of the edited material
828+ * @param linkUrl the linkUrl of the edited material
829+ * @param notes the notes of the edited material
830+ * @param unitName the unit name of the edited material
831+ * @param assemblyId the assembly id of the edited material
832+ * @param pdmFileName the pdm file name of the edited material
832833 * @throws if permission denied or material's wbsElement is undefined/deleted
833834 * @returns the updated material
834835 */
@@ -837,6 +838,7 @@ export default class ProjectsService {
837838 materialId : string ,
838839 name : string ,
839840 status : Material_Status ,
841+ materialTypeName : string ,
840842 manufacturerName : string ,
841843 manufacturerPartNumber : string ,
842844 quantity : number ,
@@ -867,7 +869,7 @@ export default class ProjectsService {
867869 if ( ! project ) throw new NotFoundException ( 'Project' , material . wbsElementId ) ;
868870 if ( project . wbsElement . dateDeleted ) throw new DeletedException ( 'Project' , project . projectId ) ;
869871
870- await checkMaterialInputs ( manufacturerName , unitName , assemblyId ) ;
872+ await checkMaterialInputs ( manufacturerName , materialTypeName , unitName , assemblyId ) ;
871873
872874 const perms = isLeadership ( submitter . role ) || isUserPartOfTeams ( project . teams , submitter ) ;
873875
@@ -878,6 +880,7 @@ export default class ProjectsService {
878880 data : {
879881 name,
880882 status,
883+ materialTypeName,
881884 manufacturerName,
882885 manufacturerPartNumber,
883886 quantity,
0 commit comments