agris 1.0.0 → 1.2.0

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: b7858ee0c5eb1c3058b8af68342f76d1ff70e822d1e4a4fe8f441aaf1dc53483
4
- data.tar.gz: 3d681210bed7df9e36dc5ef613f19b0e946072faef0ab22f2e44a06686de29e3
3
+ metadata.gz: 231dba679b724c0f580b5e1e3efddba19c51b0577dcc1eb8b22e332c61696179
4
+ data.tar.gz: 7141caa9ec3c87ce9af9731f2b26475d8dd0d14c9ed4b2f8531a76b21dfcd604
5
5
  SHA512:
6
- metadata.gz: 58c4086d2afcb13fc9c897c3415a0feed77336cc31bbe3b9817ad808065067f2c424f2907ec2195c6f3173e54ca998830da3ca48d91af9b2e31603343f78f73c
7
- data.tar.gz: 6fec59796e43d413239ca3db3a8f06f40581ab4795cc5fb1b60b755af1cbe55f46a26934931b531aa5d69dbe23d9734fcc347f33c33a75f99af550ae2bb818e5
6
+ metadata.gz: 92e57e1778dea397aced80e99ecb02516e384b5fecb366acf38054833f718e23e83581973bd24094fd10c8ec9cd7fe238fc63943256593ba1a8ec14473dbd19c
7
+ data.tar.gz: 1b6aa537b7598b433e840559eb0472b4cc226e3a6ebd32e2b1e46374ebe0fd6cc91f01d7a8177be0a683478500c0054714f76152089f34ab0fe1707f9ea4c0b6
data/CHANGELOG.md CHANGED
@@ -10,6 +10,25 @@ version number — see [docs/RELEASING.md](docs/RELEASING.md). Raising that floo
10
10
  is a breaking change and takes a major bump; adding support for a newer Ruby
11
11
  takes none.
12
12
 
13
+ ## [Unreleased]
14
+
15
+ ## [1.2.0] - 2026-09-23
16
+
17
+ ### Added
18
+
19
+ - `prepayment_type` and `prepayment_reference` on
20
+ `Api::AccountsReceivables::NewPayment`, the `ACRR0` fields that make a
21
+ prepayment receipt expressible alongside a `P` cash source. A payment
22
+ setting neither serializes exactly as before.
23
+
24
+ ## [1.1.0] - 2026-09-22
25
+
26
+ ### Added
27
+
28
+ - `Api::NewVoucher::FreightTicketReferenceDetail`, the `ACPV3` voucher detail
29
+ that references the grain ticket whose freight an FV voucher pays. AGRIS
30
+ stamps the ticket with the voucher number on import. (#58)
31
+
13
32
  ## [1.0.0] - 2026-09-14
14
33
 
15
34
  First release since `v0.19.0`. The `1.0.0` bump declares the public API stable
@@ -76,4 +95,7 @@ Releases up to and including `v0.19.0` predate this changelog. See the
76
95
  [commit history](https://github.com/westernmilling/agris.rb/commits/master)
77
96
  and [release tags](https://github.com/westernmilling/agris.rb/tags).
78
97
 
98
+ [Unreleased]: https://github.com/westernmilling/agris.rb/compare/v1.2.0...HEAD
99
+ [1.2.0]: https://github.com/westernmilling/agris.rb/compare/v1.1.0...v1.2.0
100
+ [1.1.0]: https://github.com/westernmilling/agris.rb/compare/v1.0.0...v1.1.0
79
101
  [1.0.0]: https://github.com/westernmilling/agris.rb/compare/v0.19.0...v1.0.0
data/agris.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'savon', '~> 2.11'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '>= 2.3'
27
+ spec.add_development_dependency 'factory_bot', '~> 6.4'
27
28
  spec.add_development_dependency 'pry-byebug'
28
29
  spec.add_development_dependency 'rake', '~> 12.3.3'
29
30
  spec.add_development_dependency 'rspec', '~> 3.0'
data/docs/specs/README.md CHANGED
@@ -1,26 +1,24 @@
1
1
  # Specs
2
2
 
3
- Source of truth for behavior in the `agris` gem. Implementation, tests, and PRs trace back to spec IDs (R#, E#, AC-#, AT#).
3
+ Specs in this repo are **build prompts**: short, point-in-time briefs for one PR. The code is
4
+ the source of truth; a prompt records what a slice was asked to deliver and is not updated
5
+ after review. Divergence between prompt and merged code is an expected record of what review
6
+ corrected.
4
7
 
5
- ## How to add a spec
6
- 1. Copy `spec-template.md` into the appropriate area folder (see below).
7
- 2. Name the file by feature, kebab-case (e.g., `import-grain-ticket.md`).
8
- 3. Fill in Goal → Rules → Acceptance Criteria → Acceptance Tests.
9
- 4. Reference spec IDs in commits, tests, and PR descriptions.
8
+ Standing facts (Agris behaviour, business rules, spike results) live in Jira and Confluence and
9
+ are cited, not repeated. A prompt states only what is specific to its slice.
10
10
 
11
- ## Layout
11
+ ## Writing one
12
+ 1. Name the file for the Jira task the PR delivers: `docs/specs/<key>-<slug>.md`
13
+ (e.g. `ot3-257-freight-ticket-reference.md`).
14
+ 2. Keep it to roughly 25–45 lines: **Goal** (2–3 sentences), **Scope** stated positively
15
+ ("Exactly: …" plus one "Later: …" line), **Rules** (R#, MUST / MUST NOT), **Acceptance
16
+ criteria** (AC#, the complete test list), and **Slice-specific notes** for gotchas.
17
+ 3. Note the diff budget (≤200 lines) and split before dispatch if the estimate is over.
18
+ 4. Commit it with the PR as a `docs(specs):` commit and paste it into the PR description
19
+ in a collapsed `<details>` block titled "Build prompt (frozen — not updated after review)".
20
+ 5. Cite R# and AC# in commit bodies and the PR's test checklist. Do not put spec IDs or
21
+ paths in code or test comments.
12
22
 
13
- Specs are grouped by Agris API area, mirroring `lib/agris/api/`:
14
-
15
- - `grain/` — tickets, contracts (purchase/sales), commodity codes, grade factors, rates
16
- - `inventory/` — delivery tickets, orders
17
- - `accounts-payables/` — voucher posting
18
- - `accounts-receivables/` — invoice posting
19
- - `messages/` — document-tracking and "changed since" queries
20
- - `support/` — support / utility messages
21
-
22
- Cross-cutting specs (config, transport, error model) can live at the top level of `docs/specs/`.
23
-
24
- ## Templates
25
- - `spec-template.md` — blank template, copy this.
26
- - `rename-folder.example.md` — completed example showing the expected level of detail.
23
+ `spec-template.md` and `rename-folder.example.md` are the retired long-form house format,
24
+ kept for reference only. The area folders (`grain/`, `inventory/`, …) are unused by prompts.
@@ -0,0 +1,48 @@
1
+ # Build Prompt — OT3-257: ACPV3 freight ticket reference detail
2
+
3
+ Jira: OT3-255 task OT3-257 · 2026-09-16 · Budget ≤200.
4
+ Condensed after the build from the house-format spec this PR first carried; rules and ACs
5
+ match the shipped code. Standing facts live in Jira OT3-256 (staging spike, 2026-09-14) and
6
+ the BRD "Freight Voucher via Agris API" (Confluence, SD space) and are not repeated here.
7
+
8
+ ## Goal
9
+ Let a consumer post an AGRIS accounts-payable freight voucher (type FV) that references the
10
+ grain ticket it pays. AGRIS 22.3.0 SU5 or later (AGS-17887) stamps the voucher number on the
11
+ ticket and drops it from the unpaid Freight Expenses population. The gem gains the ACPV3
12
+ detail record; contracto wires it into vouchers in OT3-259.
13
+
14
+ ## Scope
15
+ Exactly: `Agris::Api::NewVoucher::FreightTicketReferenceDetail` in `lib/agris/api/new_voucher.rb`,
16
+ its RSpec file, a `NewVoucher` RSpec file for mixed details, this prompt, and an `Unreleased`
17
+ changelog line. Later: the 1.1.0 bump and dated changelog heading (release PR); consumer-side
18
+ rules in contracto's `docs/specs/freight-conventions.md` (OT3-258).
19
+
20
+ ## Rules
21
+ - R1 — includes `XmlModel`; `ATTRIBUTE_NAMES` is exactly `in_out_code`, `ticket_location`,
22
+ `ticket_number`, `freight_amount`, `record_type`; `attr_reader(*ATTRIBUTE_NAMES)` as on
23
+ `NewVoucher` and `NewDisbursement`.
24
+ - R2 — `record_type` is always `'ACPV3'`; a value passed to the constructor is overwritten.
25
+ - R3 — `to_xml_hash` emits `:@recordtype => 'ACPV3'` plus `:@inoutcode`, `:@ticketlocation`,
26
+ `:@ticketnumber`, `:@freightamount` for whichever attributes were supplied, values untouched.
27
+ An omitted attribute emits no key (existing `XmlModel` behaviour; AGRIS decides validity).
28
+ - R4 — `NewVoucher#add_detail` needs no change: a voucher holding a `GeneralLedgerDetail` and
29
+ this detail serializes both, in insertion order, each under its own record type.
30
+ - R5 — MUST NOT validate AGRIS-side rules (ACPV3 sum equals voucher amount, shipper equals
31
+ remit-to, an ACPV2 line present). AGRIS reports those in-band via `PostResult#reject_reasons`.
32
+
33
+ ## Acceptance criteria (the complete test list)
34
+ - AC-1 — `record_type` defaults to ACPV3; `record_type: 'OTHER'` still reads and serializes ACPV3.
35
+ - AC-2 — all four attributes supplied (I / 051 / 0028786 / 230.85, the spike's ticket): readers
36
+ return the inputs; `to_xml_hash` equals exactly the five-key hash.
37
+ - AC-3 — only `ticket_number` supplied: the other readers return nil; hash keys are exactly
38
+ `:@ticketnumber` and `:@recordtype`.
39
+ - AC-4 — `ATTRIBUTE_NAMES` lists exactly the five names.
40
+ - AC-5 — `NewVoucher` with one GL detail then one ACPV3 detail: `details` in insertion order,
41
+ record types `%w(ACPV2 ACPV3)`, header `to_xml_hash` excludes the details.
42
+
43
+ ## Slice-specific notes
44
+ - The two older detail classes have no readers and are left alone.
45
+ - No spec IDs or paths in code or test comments (Coding Style Rules §2.4); traceability is this
46
+ prompt plus the PR checklist.
47
+ - Wire shape confirmed by rendering the real `create_voucher` payload: the ACPV3 element lands
48
+ flat inside `<details>` beside ACPV0 and ACPV2.
@@ -21,6 +21,8 @@ module Agris
21
21
  name_id
22
22
  payment_amount
23
23
  payment_date
24
+ prepayment_reference
25
+ prepayment_type
24
26
  receipt_location
25
27
  receipt_number
26
28
  record_type
@@ -106,6 +106,26 @@ module Agris
106
106
  @record_type = 'ACPV1'
107
107
  end
108
108
  end
109
+
110
+ class FreightTicketReferenceDetail
111
+ include XmlModel
112
+
113
+ ATTRIBUTE_NAMES = %w(
114
+ in_out_code
115
+ ticket_location
116
+ ticket_number
117
+ freight_amount
118
+ record_type
119
+ ).freeze
120
+
121
+ attr_reader(*ATTRIBUTE_NAMES)
122
+
123
+ def initialize(hash = {})
124
+ super
125
+
126
+ @record_type = 'ACPV3'
127
+ end
128
+ end
109
129
  end
110
130
  end
111
131
  end
data/lib/agris/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Agris
4
- VERSION = '1.0.0'
4
+ VERSION = '1.2.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Gray
8
8
  - Joseph Bridgwater-Rowe
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2026-09-14 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: savon
@@ -39,6 +38,20 @@ dependencies:
39
38
  - - ">="
40
39
  - !ruby/object:Gem::Version
41
40
  version: '2.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: factory_bot
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '6.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '6.4'
42
55
  - !ruby/object:Gem::Dependency
43
56
  name: pry-byebug
44
57
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +150,6 @@ dependencies:
137
150
  - - "~>"
138
151
  - !ruby/object:Gem::Version
139
152
  version: '2.3'
140
- description:
141
153
  email:
142
154
  - wopr42@gmail.com
143
155
  - freakyjoe@gmail.com
@@ -184,6 +196,7 @@ files:
184
196
  - docs/specs/grain/.gitkeep
185
197
  - docs/specs/inventory/.gitkeep
186
198
  - docs/specs/messages/.gitkeep
199
+ - docs/specs/ot3-257-freight-ticket-reference.md
187
200
  - docs/specs/rename-folder.example.md
188
201
  - docs/specs/spec-template.md
189
202
  - docs/specs/support/.gitkeep
@@ -270,7 +283,6 @@ homepage: https://github.com/westernmilling/agris.rb
270
283
  licenses:
271
284
  - MIT
272
285
  metadata: {}
273
- post_install_message:
274
286
  rdoc_options: []
275
287
  require_paths:
276
288
  - lib
@@ -285,8 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
297
  - !ruby/object:Gem::Version
286
298
  version: '0'
287
299
  requirements: []
288
- rubygems_version: 3.3.7
289
- signing_key:
300
+ rubygems_version: 3.6.9
290
301
  specification_version: 4
291
302
  summary: Ruby client library for Agris API
292
303
  test_files: []