1
0
mirror of https://github.com/elisspace/FxLifeSheet.git synced 2026-08-29 15:44:00 +00:00

Add additional source info

This commit is contained in:
Felix Krause
2021-11-03 15:17:24 +01:00
parent 95b22b75ec
commit a493f16a8b
3 changed files with 6 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ module Importers
# if you provide a `date`, we will look for the closed alcoholIntake entry, and use the same timestamp
# if you provide a `timestamp`, we will use that exact time stamp
def insert_row_for_date(date:, key:, type:, value:, question:)
def insert_row_for_date(date:, key:, type:, value:, question:, source:)
raise "invalid type #{type}" unless ["boolean", "range", "number", "text"].include?(type)
puts "Looking for match on #{date}..."
@@ -58,6 +58,7 @@ module Importers
new_entry[:question] = question
new_entry[:type] = type
new_entry[:value] = value
new_entry[:source] = source
raw_data.insert(new_entry)
puts "--- Successfully backfilled entry for #{key} to #{value} on #{new_entry[:yearmonth]}-#{new_entry[:day]}"
else

View File

@@ -15,7 +15,8 @@ module Importers
key: key,
value: value,
type: type,
question: question
question: question,
source: "add_time_range"
)
end
end

View File

@@ -255,7 +255,8 @@ function insertNewValue(parsedUserValue, ctx, key, type, fakeDate = null) {
Key: key,
Question: questionText,
Type: type,
Value: parsedUserValue
Value: parsedUserValue,
Source: "telegram"
};
postgres.client.query(