11namespace DigitalLearningSolutions . Data . Models . Frameworks . Import
22{
33 using ClosedXML . Excel ;
4- using Org . BouncyCastle . Asn1 . X509 ;
54
65 public enum RowStatus
76 {
@@ -12,7 +11,8 @@ public enum RowStatus
1211 CompetencyUpdated ,
1312 CompetencyGroupInserted ,
1413 CompetencyGroupUpdated ,
15- CompetencyGroupAndCompetencyUpdated
14+ CompetencyGroupAndCompetencyUpdated ,
15+ InvalidAlwaysShowDescription
1616 }
1717 public class CompetencyTableRow : BulkCompetency
1818 {
@@ -30,10 +30,13 @@ public CompetencyTableRow(IXLTable table, IXLRangeRow row)
3030 Competency = FindFieldValue ( "Competency" ) ;
3131 CompetencyDescription = FindFieldValue ( "CompetencyDescription" ) ;
3232 GroupDescription = FindFieldValue ( "GroupDescription" ) ;
33+ AlwaysShowDescriptionRaw = FindFieldValue ( "AlwaysShowDescription" ) ;
34+ AlwaysShowDescription = bool . TryParse ( AlwaysShowDescriptionRaw , out var hasPrn ) ? hasPrn : ( bool ? ) null ;
3335 FlagsCsv = FindFieldValue ( "FlagsCSV" ) ;
3436 RowStatus = RowStatus . NotYetProcessed ;
3537 }
3638 public int RowNumber { get ; set ; }
39+ public string ? AlwaysShowDescriptionRaw { get ; set ; }
3740 public ImportCompetenciesResult . ErrorReason ? Error { get ; set ; }
3841 public RowStatus RowStatus { get ; set ; }
3942 public bool Validate ( )
@@ -50,6 +53,10 @@ public bool Validate()
5053 {
5154 Error = ImportCompetenciesResult . ErrorReason . TooLongCompetencyName ;
5255 }
56+ else if ( ! string . IsNullOrWhiteSpace ( AlwaysShowDescriptionRaw ) && ! bool . TryParse ( AlwaysShowDescriptionRaw , out _ ) )
57+ {
58+ Error = ImportCompetenciesResult . ErrorReason . InvalidAlwaysShowDescription ;
59+ }
5360
5461 return ! Error . HasValue ;
5562 }
0 commit comments