ソースを参照

Add contract type, just because it's easy

jherve 1 年間 前
コミット
21ebf18d89
1 ファイル変更7 行追加0 行削除
  1. 7 0
      src/LinkedIn/Profile/WorkExperience.purs

+ 7 - 0
src/LinkedIn/Profile/WorkExperience.purs

@@ -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