forstok_trigger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/forstok_trigger/configuration/{validity_configuration.rb → valid_configuration.rb} +1 -1
- data/lib/forstok_trigger/export/repository/export_repository.rb +9 -4
- data/lib/forstok_trigger/qc/repository/qc_repository.rb +9 -4
- data/lib/forstok_trigger/validity.rb +3 -3
- data/lib/forstok_trigger/validity/repository/validity_repository.rb +11 -6
- data/lib/forstok_trigger/version.rb +1 -1
- data/lib/forstok_trigger/webhook/repository/webhook_repository.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d9ffb48c10fd3801e0b7d06fd0e55e6f783b78aa617db48373f1b8e0500d23d
|
4
|
+
data.tar.gz: f84ea0196b70800c65baa971c977b9fa1bb28a70529981b126fe8b413b419c52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1503933060dfb1400cb468e70a5dd796023c416c947f27cb7c4ab509e6096f1fee9ae7b08b3e94419aabd8a5ed687ff7e5848b2903b4593ddf2517c089400de0
|
7
|
+
data.tar.gz: 0e2efc82a3692676480a0f9b78c75192fbc1a1351ea2607447316e2ecddef4caa6ab1e9628c8d9e88ef99dbf5ff4500356a40291ff0889b6cab4c6367baea5dc
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'Time'
|
3
4
|
module ForstokTrigger
|
4
5
|
module Export
|
5
6
|
module Repository
|
@@ -8,14 +9,14 @@ module ForstokTrigger
|
|
8
9
|
def self.export_insert_query
|
9
10
|
sql = 'INSERT INTO ' + configuration.db + '.'
|
10
11
|
sql += configuration.buffer_table
|
11
|
-
sql += '(listing_id, account_id, channel_id, mode
|
12
|
+
sql += '(listing_id, account_id, channel_id, mode, created_at'
|
13
|
+
sql += ', updated_at) VALUES '
|
12
14
|
sql
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.export_insert_value(listing_id, account_id, channel_id, mode)
|
16
|
-
|
17
|
-
|
18
|
-
sql
|
18
|
+
"(#{listing_id}, #{account_id}, #{channel_id}, " \
|
19
|
+
"'#{mode}', '#{now}', '#{now}')"
|
19
20
|
end
|
20
21
|
|
21
22
|
def self.export_insert_pending(listing_id, account_id, channel_id, mode)
|
@@ -24,6 +25,10 @@ module ForstokTrigger
|
|
24
25
|
ForstokTrigger::Export::Repository.client.query(sql)
|
25
26
|
end
|
26
27
|
|
28
|
+
def self.now
|
29
|
+
@now = Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
30
|
+
end
|
31
|
+
|
27
32
|
def self.configuration
|
28
33
|
@configuration ||= ForstokTrigger::Export.configuration
|
29
34
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'Time'
|
3
4
|
module ForstokTrigger
|
4
5
|
module Qc
|
5
6
|
module Repository
|
@@ -8,14 +9,14 @@ module ForstokTrigger
|
|
8
9
|
def self.qc_insert_query
|
9
10
|
sql = 'INSERT INTO ' + configuration.db + '.'
|
10
11
|
sql += configuration.buffer_table
|
11
|
-
sql += '(listing_id, account_id, channel_id, mode
|
12
|
+
sql += '(listing_id, account_id, channel_id, mode, created_at'
|
13
|
+
sql += ', updated_at) VALUES '
|
12
14
|
sql
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.qc_insert_value(listing_id, account_id, channel_id, mode)
|
16
|
-
|
17
|
-
|
18
|
-
sql
|
18
|
+
"(#{listing_id}, #{account_id}, #{channel_id}, " \
|
19
|
+
"'#{mode}', '#{now}', '#{now}')"
|
19
20
|
end
|
20
21
|
|
21
22
|
def self.qc_insert_pending(listing_id, account_id, channel_id, mode)
|
@@ -24,6 +25,10 @@ module ForstokTrigger
|
|
24
25
|
ForstokTrigger::Qc::Repository.client.query(sql)
|
25
26
|
end
|
26
27
|
|
28
|
+
def self.now
|
29
|
+
@now = Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
30
|
+
end
|
31
|
+
|
27
32
|
def self.configuration
|
28
33
|
@configuration ||= ForstokTrigger::Qc.configuration
|
29
34
|
end
|
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
require 'forstok_trigger/validity/trigger.rb'
|
4
4
|
require 'forstok_trigger/validity/repository/validity_repository.rb'
|
5
|
-
require 'forstok_trigger/configuration/
|
5
|
+
require 'forstok_trigger/configuration/valid_configuration.rb'
|
6
6
|
module ForstokTrigger
|
7
7
|
# Class Trigger is main class for run perform
|
8
8
|
module Validity
|
9
9
|
def self.configuration
|
10
|
-
@configuration ||= ForstokTrigger::Configuration::
|
10
|
+
@configuration ||= ForstokTrigger::Configuration::ValidConfiguration.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.reset
|
14
|
-
@configuration = ForstokTrigger::Configuration::
|
14
|
+
@configuration = ForstokTrigger::Configuration::ValidConfiguration.new
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.configure
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'Time'
|
3
4
|
module ForstokTrigger
|
4
5
|
module Validity
|
5
6
|
module Repository
|
@@ -8,22 +9,26 @@ module ForstokTrigger
|
|
8
9
|
def self.validity_insert_query
|
9
10
|
sql = 'INSERT INTO ' + configuration.db + '.'
|
10
11
|
sql += configuration.buffer_table
|
11
|
-
sql += '(listing_id, account_id, channel_id, mode
|
12
|
+
sql += '(listing_id, account_id, channel_id, mode, created_at'
|
13
|
+
sql += ', updated_at) VALUES '
|
12
14
|
sql
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.validity_insert_value(listing_id, account_id, channel_id, mode)
|
16
|
-
|
17
|
-
|
18
|
-
sql
|
18
|
+
"(#{listing_id}, #{account_id}, #{channel_id}, " \
|
19
|
+
"'#{mode}', '#{now}', '#{now}')"
|
19
20
|
end
|
20
21
|
|
21
|
-
def self.validity_insert_pending(
|
22
|
+
def self.validity_insert_pending(l_id, a_id, c_id, mode)
|
22
23
|
sql = validity_insert_query
|
23
|
-
sql += validity_insert_value(
|
24
|
+
sql += validity_insert_value(l_id, a_id, c_id, mode)
|
24
25
|
ForstokTrigger::Validity::Repository.client.query(sql)
|
25
26
|
end
|
26
27
|
|
28
|
+
def self.now
|
29
|
+
@now = Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
30
|
+
end
|
31
|
+
|
27
32
|
def self.configuration
|
28
33
|
@configuration ||= ForstokTrigger::Validity.configuration
|
29
34
|
end
|
@@ -45,7 +45,7 @@ module ForstokTrigger
|
|
45
45
|
|
46
46
|
def self.webhook_insert_value(event, url, event_payload, channel_id)
|
47
47
|
sql = "('" + url.to_s + "', '" + event.to_s + "', \""
|
48
|
-
sql += Mysql2::Client.escape(event_payload.to_s) +
|
48
|
+
sql += Mysql2::Client.escape(event_payload.to_s) + '\", '
|
49
49
|
sql += channel_id.to_s + ')'
|
50
50
|
sql
|
51
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forstok_trigger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Ivander
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,7 +105,7 @@ files:
|
|
105
105
|
- lib/forstok_trigger/configuration.rb
|
106
106
|
- lib/forstok_trigger/configuration/export_configuration.rb
|
107
107
|
- lib/forstok_trigger/configuration/qc_configuration.rb
|
108
|
-
- lib/forstok_trigger/configuration/
|
108
|
+
- lib/forstok_trigger/configuration/valid_configuration.rb
|
109
109
|
- lib/forstok_trigger/configuration/webhook_configuration.rb
|
110
110
|
- lib/forstok_trigger/export.rb
|
111
111
|
- lib/forstok_trigger/export/repository.rb
|