lockstep_rails 0.3.79 → 0.3.81

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0fe73a5f2c5f253cacccf071634a2b1e7ac9bed8a3dee4cff7ae2c9be272fed
4
- data.tar.gz: b4377a0458f8a422ab3b67514ba21359309b464383c4f5fc2a7db1cb9f3f32ba
3
+ metadata.gz: e4a0a8fcfeb52dc83211161d2fe71d5ce53561390768b31c67b2abf08cb8e0df
4
+ data.tar.gz: fd36e3e0141fbbdedc6af98c3ffe2d4458bdb0a20d464588248a9fc8f19debdb
5
5
  SHA512:
6
- metadata.gz: d70576f4cf0602c65fe7d1ef155cd302307d0dd6db75ad7977eb0089436a1db9af2332ed0d8b655ac149b5b55b7bf553a434029e4190fdf3f1f3aafbe604f10f
7
- data.tar.gz: 0b0dadad816724abae003b828b89ef7de57ce8f2f04d825786faf9f16f7c03911bd8a0e7100e42f89bafcf1cc79bcaa4677a7820055fdabc18fa718cdcde9a57
6
+ metadata.gz: d7f2ca3ba51099fa9af80990bd466fd972a32c121bcfec419b4e2646c7a66e39197a9a863783b86647e1a536f4045144b84cbaf831c178e3bdd9992f15d0deab
7
+ data.tar.gz: f9954834dd6626637f7f8de5ca50cff82d39a17b4e7116d16004bcf8b9879d490fe7011323dacd008ceb14ac4281f974a88b83a14ade15b7302a519027171051
@@ -37,6 +37,20 @@ module Lockstep
37
37
  RequestStore.store[:internal_service_key]
38
38
  end
39
39
 
40
+ def self.set_x_group_key(x_group_key)
41
+ RequestStore.store[:lockstep_x_group_key] = x_group_key
42
+ true
43
+ end
44
+
45
+ def self.x_group_key
46
+ RequestStore.store[:lockstep_x_group_key]
47
+ end
48
+
49
+ def self.set_m2m_token(token)
50
+ # this method can be ommitted and we can use directly `set_bearer_token`
51
+ set_bearer_token(token)
52
+ end
53
+
40
54
  ##
41
55
  # Construct a new Lockstep API client targeting the specified server.
42
56
  #
@@ -81,6 +95,10 @@ module Lockstep
81
95
  self.class.api_key
82
96
  end
83
97
 
98
+ def x_group_key
99
+ self.class.x_group_key
100
+ end
101
+
84
102
  ##
85
103
  # Configure this API to use an application name
86
104
  #
@@ -139,6 +157,10 @@ module Lockstep
139
157
  request["Authorization"] = 'Bearer ' + bearer_token
140
158
  end
141
159
 
160
+ if x_group_key != nil
161
+ request["X-Group-Key"] = x_group_key
162
+ end
163
+
142
164
  # Send the request
143
165
  http.request(request)
144
166
  end
@@ -6,6 +6,7 @@ class Lockstep::Invoice < Lockstep::ApiRecord
6
6
  load_schema(Schema::Invoice)
7
7
 
8
8
  belongs_to :connection, class_name: 'Lockstep::Connection', foreign_key: :customer_id
9
+ belongs_to :customer_primary_contact, {:class_name=>"Lockstep::Contact", :included=>true}
9
10
 
10
11
  scope :einvoices, -> { where(is_e_invoice: true).include_object(:customer, :lines, :attachments) }
11
12
  scope :received_einvoices, -> { einvoices.where(invoice_type_code: 'AP Invoice') }
@@ -5,17 +5,17 @@ def self.id_ref
5
5
  nil
6
6
  end
7
7
 
8
- # The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
9
- # account will share the same GroupKey value. GroupKey values cannot be changed once created.
10
- #
8
+ # The GroupKey uniquely identifies a single Lockstep Platform account. All records for this
9
+ # account will share the same GroupKey value. GroupKey values cannot be changed once created.
10
+ #
11
11
  # For more information, see [Accounts and GroupKeys](https://developer.lockstep.io/docs/accounts-and-groupkeys).
12
12
  # @type: string
13
13
  # @format: uuid
14
14
  field :group_key
15
15
 
16
- # The unique ID of this record, automatically assigned by Lockstep when this record is
17
- # added to the Lockstep platform.
18
- #
16
+ # The unique ID of this record, automatically assigned by Lockstep when this record is
17
+ # added to the Lockstep platform.
18
+ #
19
19
  # For the ID of this record in its originating financial system, see `ErpKey`.
20
20
  # @type: string
21
21
  # @format: uuid
@@ -31,23 +31,23 @@ end
31
31
  # @format: uuid
32
32
  field :customer_id
33
33
 
34
- # The unique ID of this record as it was known in its originating financial system.
35
- #
36
- # If this company record was imported from a financial system, it will have the value `ErpKey`
37
- # set to the original primary key number of the record as it was known in the originating financial
38
- # system. If this record was not imported, this value will be `null`.
39
- #
34
+ # The unique ID of this record as it was known in its originating financial system.
35
+ #
36
+ # If this company record was imported from a financial system, it will have the value `ErpKey`
37
+ # set to the original primary key number of the record as it was known in the originating financial
38
+ # system. If this record was not imported, this value will be `null`.
39
+ #
40
40
  # For more information, see [Identity Columns](https://developer.lockstep.io/docs/identity-columns).
41
41
  # @type: string
42
42
  field :erp_key
43
43
 
44
- # The "Purchase Order Code" is a code that is sometimes used by companies to refer to the original PO
45
- # that was sent that caused this invoice to be written. If a customer sends a purchase order to a vendor,
44
+ # The "Purchase Order Code" is a code that is sometimes used by companies to refer to the original PO
45
+ # that was sent that caused this invoice to be written. If a customer sends a purchase order to a vendor,
46
46
  # the vendor can then create an invoice and refer back to the originating purchase order using this field.
47
47
  # @type: string
48
48
  field :purchase_order_code
49
49
 
50
- # An additional reference code that is sometimes used to identify this invoice.
50
+ # An additional reference code that is sometimes used to identify this invoice.
51
51
  # The meaning of this field is specific to the ERP or accounting system used by the user.
52
52
  # @type: string
53
53
  field :reference_code
@@ -60,20 +60,20 @@ end
60
60
  # @type: string
61
61
  field :salesperson_name
62
62
 
63
- # A code identifying the type of this invoice.
64
- #
65
- # Recognized Invoice types are:
66
- # * `AR Invoice` - Represents an invoice sent by Company to the Customer
67
- # * `AP Invoice` - Represents an invoice sent by Vendor to the Company
68
- # * `AR Credit Memo` - Represents a credit memo generated by Company given to Customer
63
+ # A code identifying the type of this invoice.
64
+ #
65
+ # Recognized Invoice types are:
66
+ # * `AR Invoice` - Represents an invoice sent by Company to the Customer
67
+ # * `AP Invoice` - Represents an invoice sent by Vendor to the Company
68
+ # * `AR Credit Memo` - Represents a credit memo generated by Company given to Customer
69
69
  # * `AP Credit Memo` - Represents a credit memo generated by Vendor given to Company
70
70
  # @type: string
71
71
  field :invoice_type_code
72
72
 
73
- # A code identifying the status of this invoice.
74
- #
75
- # Recognized Invoice status codes are:
76
- # * `Open` - Represents an invoice that is considered open and needs more work to complete
73
+ # A code identifying the status of this invoice.
74
+ #
75
+ # Recognized Invoice status codes are:
76
+ # * `Open` - Represents an invoice that is considered open and needs more work to complete
77
77
  # * `Closed` - Represents an invoice that is considered closed and resolved
78
78
  # @type: string
79
79
  field :invoice_status_code
@@ -87,7 +87,7 @@ end
87
87
  # @type: string
88
88
  field :workflow_status_notes
89
89
 
90
- # A code identifying the terms given to the purchaser. This field is imported directly from the originating
90
+ # A code identifying the terms given to the purchaser. This field is imported directly from the originating
91
91
  # financial system and does not follow a specified format.
92
92
  # @type: string
93
93
  field :terms_code
@@ -135,7 +135,7 @@ end
135
135
  # @format: date
136
136
  field :posted_date
137
137
 
138
- # The date when the invoice was closed and finalized after completion of all payments and delivery of all products and
138
+ # The date when the invoice was closed and finalized after completion of all payments and delivery of all products and
139
139
  # services.
140
140
  # @type: string
141
141
  # @format: date
@@ -186,9 +186,9 @@ end
186
186
  # @format: uuid
187
187
  field :modified_user_id
188
188
 
189
- # The AppEnrollmentId of the application that imported this record. For accounts
190
- # with more than one financial system connected, this field identifies the originating
191
- # financial system that produced this record. This value is null if this record
189
+ # The AppEnrollmentId of the application that imported this record. For accounts
190
+ # with more than one financial system connected, this field identifies the originating
191
+ # financial system that produced this record. This value is null if this record
192
192
  # was not loaded from an external ERP or financial system.
193
193
  # @type: string
194
194
  # @format: uuid
@@ -254,15 +254,15 @@ end
254
254
  # @format: date-time
255
255
  field :source_modified_date, Types::Params::DateTime
256
256
 
257
- # The Company associated to this invoice.
257
+ # The Company associated to this invoice.
258
258
  # To retrieve this item, specify `Company` in the "Include" parameter for your query.
259
259
  field :company
260
260
 
261
- # The Customer associated to the invoice customer
261
+ # The Customer associated to the invoice customer
262
262
  # To retrieve this item, specify `Customer` in the "Include" parameter for your query.
263
263
  field :customer
264
264
 
265
- # The Contact associated to the invoice customer
265
+ # The Contact associated to the invoice customer
266
266
  # To retrieve this item, specify `Customer` in the "Include" parameter for your query.
267
267
  field :customer_primary_contact
268
268
 
@@ -280,6 +280,7 @@ end
280
280
  belongs_to :connection, {:class_name=>"Lockstep::Connection", :primary_key=>:company_id, :foreign_key=>"customer_id"}
281
281
  belongs_to :created_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"created_user_id"}
282
282
  belongs_to :modified_user, {:class_name=>"Lockstep::User", :primary_key=>:user_id, :foreign_key=>"modified_user_id"}
283
+ belongs_to :customer_primary_contact, {:class_name=>"Lockstep::Contact", :included=>true}
283
284
 
284
285
  has_many :workflow_statuses, {:class_name=>"Schema::InvoiceWorkflowStatusHistory", :included=>true}
285
286
  has_many :addresses, {:class_name=>"Schema::InvoiceAddress", :included=>true}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LockstepRails
4
- VERSION = '0.3.79'
4
+ VERSION = '0.3.81'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockstep_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.79
4
+ version: 0.3.81
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-09 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails