-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I would like DataApproval to implement references (that is publications and standards) differently which will also change how they are added here. I implemented references more properly in the metabase. There is the class https://github.com/building-envelope-data/metabase/blob/develop/backend/src/Data/Reference.cs and the type declaration https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/References/ReferenceType.cs There is a ReferenceInput class https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/References/ReferenceInput.cs And there are From methods in https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/Publications/PublicationType.cs and https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/Standards/StandardType.cs to reduce some duplication. In DataApproval.cs you can then just use public Reference? Reference { get; private set; }. And you can add a From method to ReferenceType along the lines of https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/DescriptionOrReferences/DescriptionOrReferenceType.cs#L13-L29 (it is gonna be simpler of course because there is no description property to check in your case). Before you invoke the ReferenceType.From method in this mutation (which can be done similar to https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/Components/ComponentMutations.cs#L114 with the name Reference instead of PrimeSurface), you need to check that not both Publication and Standard are given as input as is done for example in https://github.com/building-envelope-data/metabase/blob/develop/backend/src/GraphQl/Components/ComponentMutations.cs#L91-L101 And in *DataApprovalInput you can just use ReferenceInput? Reference. I would also drop the prefixes Create from CreatePublicationInput and CreateStandardInput.
Originally posted by @simon-wacker in #69 (comment)