Quellcode durchsuchen

Have two distinct types for job offers before and after storage

jherve vor 1 Jahr
Ursprung
Commit
5409240667
2 geänderte Dateien mit 17 neuen und 7 gelöschten Zeilen
  1. 1 6
      src/Background.purs
  2. 16 1
      src/NativeMessage.purs

+ 1 - 6
src/Background.purs

@@ -58,17 +58,12 @@ contentScriptMessageHandler
         origin: "linked_in",
         title: jo.title,
         url,
-        alternate_url: Nothing,
         company: jo.companyName,
         location: jo.location,
-        comment: Nothing,
         company_domain: jo.companyDomain,
         company_url: Just jo.companyLink,
         flexibility: jo.flexibility,
-        application_process: Just $ if jo.hasSimplifiedApplicationProcess then ApplicationProcessLinkedInSimplified else ApplicationProcessRegular,
-        application_date: Nothing,
-        application_rejection_date: Nothing,
-        application_considered: Nothing
+        application_process: Just $ if jo.hasSimplifiedApplicationProcess then ApplicationProcessLinkedInSimplified else ApplicationProcessRegular
       }
 
 contentScriptMessageHandler

+ 16 - 1
src/NativeMessage.purs

@@ -27,7 +27,7 @@ data NativeMessage =
   | NativeMessageInitialConfiguration {jobsPath :: String}
   | NativeMessageStorageReady
   | NativeMessageStorageUpdated
-  | NativeMessageAddJob NativePythonJobOffer
+  | NativeMessageAddJob NewJobOffer
   | NativeMessageListJobsRequest
   | NativeMessageJobAlreadyExists {job_id :: String}
   | NativeMessageJobAdded {job_id :: String}
@@ -71,6 +71,7 @@ instance DecodeJson BooleanStr where
           Right "false" -> Right (BooleanStr false)
           _ -> Left $ UnexpectedValue json
 
+-- Offers as they are sent by native, after having been stored
 type NativePythonJobOffer = {
   id :: String,
   origin :: String,
@@ -89,6 +90,20 @@ type NativePythonJobOffer = {
   application_rejection_date :: Maybe String
 }
 
+-- Offers as they are sent by background to native
+type NewJobOffer = {
+  id :: String,
+  origin :: String,
+  title :: String,
+  url :: String,
+  company :: String,
+  location :: Maybe String,
+  company_domain :: Maybe String,
+  company_url :: Maybe String,
+  flexibility :: Maybe JobFlexibility,
+  application_process :: Maybe ApplicationProcess
+}
+
 derive instance Generic NativeMessage _
 instance Show NativeMessage where show a = genericShow a
 instance EncodeJson NativeMessage where encodeJson a = genericEncodeJson a