multiwoven-integrations 0.33.3 → 0.33.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcceabc91eee757b5d5d7af2e968d35133415ee1dad963e3bce4191662b55fa2
4
- data.tar.gz: 961c82bdd27327e703d36ab7997b2ccc982d267197932b0184f5375548b4d3bd
3
+ metadata.gz: d146581949eb180b91b87a724b1192069852c20afc83cd067a0b663ec44f5434
4
+ data.tar.gz: 74e443bc300959a714b12d32f6448a3e22c4ae4e24d92429205e9c005c8c7fad
5
5
  SHA512:
6
- metadata.gz: 57b6f0c56efd2657d09bd7ca84bca99f9be0d0d05a14e40f7f86a1dad067241394baf23598e0f7ff364cc2303176ae4723a6e13581c53a06bc1d82d4d5bfc5c6
7
- data.tar.gz: b961f9ad1cad9a9e200d286f0a193976a25add771ad475b743021ec504687b6fd853d4adac63faff28864ede906d39043cfb1c4f9bb60f76f4229320ee4cd128
6
+ metadata.gz: 030b3e9029fadd5d72c30da9921745765af620d4e779ffdfcfa7ebe7d6e2b249c0c02fb0aa5e5cafcfb2eb31c07afe6b576ba512e86aec241f30c3e444bbb7a2
7
+ data.tar.gz: a09739de81f3a9eb107c2582fc97674af702c5bafec3c30bbfce4d5ddc4d9dfa8b0c213d9c621c5038fc557dfd393e1c172a3dfdfd1b55a5e0fd4f3d3f5ef7eb
@@ -40,6 +40,7 @@ module Multiwoven::Integrations::Destination
40
40
  records.each do |record|
41
41
  logger.debug("ODOO:WRITE:#{model} sync_id = #{sync_config.sync_id} sync_run_id = #{sync_config.sync_run_id}")
42
42
  begin
43
+ record = format_record(record, sync_config.stream.json_schema)
43
44
  response = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
44
45
  model, "create", [record])
45
46
  write_success += 1
@@ -67,6 +68,17 @@ module Multiwoven::Integrations::Destination
67
68
 
68
69
  private
69
70
 
71
+ def format_record(record, json_schema)
72
+ json_schema = json_schema.with_indifferent_access
73
+ properties = json_schema["properties"]
74
+ record.each_key do |key|
75
+ data_type = properties[key]["type"]
76
+ record[key] = record[key].to_i if data_type == "many2one"
77
+ record[key] = JSON.parse(record[key]) if data_type == "one2many"
78
+ end
79
+ record
80
+ end
81
+
70
82
  def create_streams(connection_config, models)
71
83
  models.map do |model|
72
84
  fields = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.33.3"
5
+ VERSION = "0.33.5"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
@@ -144,7 +144,7 @@ module Multiwoven::Integrations::Source
144
144
 
145
145
  def select_columns(query)
146
146
  columns = query.match(/SELECT (.*) FROM/)[1]
147
- all_columns = %w[line_items id file_name exception] + TEXTRACT_SUMMARY_FIELDS.keys
147
+ all_columns = %w[line_items id file_name exception results] + TEXTRACT_SUMMARY_FIELDS.keys
148
148
  @options[:fields] = all_columns if @options[:fields].empty?
149
149
 
150
150
  return @options[:fields] if columns.include?("*")
@@ -162,6 +162,7 @@ module Multiwoven::Integrations::Source
162
162
  invoice["id"] = file.id if columns.any?("id")
163
163
  invoice["file_name"] = file.name if columns.any?("file_name")
164
164
  invoice["exception"] = "" if columns.any?("exception")
165
+ invoice["results"] = {} if columns.any?("results")
165
166
  invoice
166
167
  end
167
168
 
@@ -202,6 +203,7 @@ module Multiwoven::Integrations::Source
202
203
  end
203
204
  end
204
205
  invoice["line_items"] = invoice["line_items"].to_json
206
+ invoice["results"] = results.to_json if invoice.key?("results")
205
207
  invoice.transform_keys(&:to_sym)
206
208
  end
207
209
 
@@ -55,6 +55,9 @@
55
55
  }
56
56
  }
57
57
  }
58
+ },
59
+ "results": {
60
+ "type": "object"
58
61
  }
59
62
  }
60
63
  }
@@ -109,7 +109,8 @@
109
109
  { "const": "invoice_total", "title": "Invoice/Receipt Total" },
110
110
  { "const": "purchase_order", "title": "Purchase Order Number" },
111
111
  { "const": "line_items", "title": "Invoice Line Items (Code, Description, Quantity, Unit Price, Total Price)"},
112
- { "const": "vendor_name", "title": "Vendor Name" }
112
+ { "const": "vendor_name", "title": "Vendor Name" },
113
+ { "const": "results", "title": "Parsing Results" }
113
114
  ]
114
115
  },
115
116
  "uniqueItems": true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.3
4
+ version: 0.33.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-12 00:00:00.000000000 Z
11
+ date: 2025-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport