|
|
@@ -17,6 +17,7 @@ import Parsing (ParseError, runParser)
|
|
|
data WorkExperience = WorkExperience {
|
|
|
position :: String,
|
|
|
company :: Maybe String,
|
|
|
+ contractType :: Maybe String,
|
|
|
timeSpan :: Maybe TimeSpan,
|
|
|
duration :: Maybe Duration,
|
|
|
description :: Maybe String
|
|
|
@@ -44,6 +45,7 @@ fromUI (ArtDecoCardElement {
|
|
|
WorkExperience {
|
|
|
position,
|
|
|
company: hush $ extractCompany normal',
|
|
|
+ contractType: hush $ extractContractType normal',
|
|
|
timeSpan: hush $ extractTimeSpan light',
|
|
|
duration: hush $ extractDuration light',
|
|
|
description: hush $ extractDescription content'
|
|
|
@@ -70,6 +72,11 @@ extractCompany normal = case normal of
|
|
|
Just (Right (UIDotSeparated (UIPlainText str) _)) -> Right str
|
|
|
_ -> Left "No company"
|
|
|
|
|
|
+extractContractType ∷ Maybe (Either ParseError UIElement) → Either String String
|
|
|
+extractContractType normal = case normal of
|
|
|
+ Just (Right (UIDotSeparated _ (UIPlainText str))) -> Right str
|
|
|
+ _ -> Left "No company"
|
|
|
+
|
|
|
extractTimeSpan ∷ Maybe (NonEmptyList (Either ParseError UIElement)) → Either String TimeSpan
|
|
|
extractTimeSpan light = case light of
|
|
|
Just l -> note "No timespan" $ NEL.findMap getTimeSpan l
|