ekwo-os 0.12.2 → 0.13.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.
Files changed (191) hide show
  1. package/README.md +4 -2
  2. package/dist/assets/expected-objects.json +181 -6
  3. package/dist/assets/migrations/20261011192741_pack_certification_proven.sql +28 -0
  4. package/dist/assets/migrations/20261012050145_pack_evidence.sql +28 -0
  5. package/dist/assets/migrations/20261014081008_a_bank_line_settles_with_its_fees.sql +608 -0
  6. package/dist/assets/migrations/20261014081038_an_opening_on_the_day_of_the_takeover.sql +699 -0
  7. package/dist/assets/migrations/20261014152111_what_the_accounts_mean_to_an_analysis.sql +378 -0
  8. package/dist/assets/migrations/20261014164531_schema_version_0_13_0.sql +42 -0
  9. package/dist/assets/seed/00_territories.sql +121 -5
  10. package/dist/assets/seed/05_framework_generic.sql +27 -0
  11. package/dist/assets/seed/100_pack_uy.sql +122 -0
  12. package/dist/assets/seed/101_pack_ec.sql +31 -0
  13. package/dist/assets/seed/102_pack_bo.sql +36 -0
  14. package/dist/assets/seed/103_pack_py.sql +35 -0
  15. package/dist/assets/seed/104_pack_do.sql +29 -0
  16. package/dist/assets/seed/105_pack_cr.sql +36 -0
  17. package/dist/assets/seed/106_pack_gt.sql +44 -0
  18. package/dist/assets/seed/107_pack_pa.sql +34 -0
  19. package/dist/assets/seed/108_pack_in.sql +44 -0
  20. package/dist/assets/seed/109_pack_cn.sql +115 -0
  21. package/dist/assets/seed/10_pack_be.sql +223 -9
  22. package/dist/assets/seed/110_pack_ge.sql +29 -0
  23. package/dist/assets/seed/111_pack_md.sql +50 -0
  24. package/dist/assets/seed/112_pack_rs.sql +62 -0
  25. package/dist/assets/seed/113_pack_ba.sql +58 -0
  26. package/dist/assets/seed/114_pack_al.sql +131 -0
  27. package/dist/assets/seed/115_pack_mk.sql +45 -0
  28. package/dist/assets/seed/116_pack_me.sql +44 -0
  29. package/dist/assets/seed/117_pack_bh.sql +35 -0
  30. package/dist/assets/seed/118_pack_om.sql +36 -0
  31. package/dist/assets/seed/119_pack_gh.sql +38 -0
  32. package/dist/assets/seed/11_pack_fr.sql +334 -5
  33. package/dist/assets/seed/120_pack_tz.sql +38 -0
  34. package/dist/assets/seed/121_pack_ug.sql +38 -0
  35. package/dist/assets/seed/122_pack_rw.sql +38 -0
  36. package/dist/assets/seed/123_pack_xk.sql +31 -0
  37. package/dist/assets/seed/124_pack_kz.sql +45 -0
  38. package/dist/assets/seed/125_pack_pk.sql +38 -0
  39. package/dist/assets/seed/126_pack_bd.sql +38 -0
  40. package/dist/assets/seed/127_pack_lk.sql +38 -0
  41. package/dist/assets/seed/128_pack_am.sql +39 -0
  42. package/dist/assets/seed/129_pack_az.sql +64 -0
  43. package/dist/assets/seed/12_pack_lu.sql +752 -0
  44. package/dist/assets/seed/130_pack_hn.sql +44 -0
  45. package/dist/assets/seed/131_pack_sv.sql +36 -0
  46. package/dist/assets/seed/132_pack_ni.sql +44 -0
  47. package/dist/assets/seed/133_pack_et.sql +38 -0
  48. package/dist/assets/seed/134_pack_mu.sql +38 -0
  49. package/dist/assets/seed/135_pack_mz.sql +89 -0
  50. package/dist/assets/seed/136_pack_ao.sql +51 -0
  51. package/dist/assets/seed/137_pack_zm.sql +38 -0
  52. package/dist/assets/seed/138_pack_bm.sql +29 -0
  53. package/dist/assets/seed/139_pack_ky.sql +28 -0
  54. package/dist/assets/seed/13_pack_ee.sql +72 -0
  55. package/dist/assets/seed/140_pack_vg.sql +32 -0
  56. package/dist/assets/seed/141_pack_gg.sql +36 -0
  57. package/dist/assets/seed/142_pack_qa.sql +33 -0
  58. package/dist/assets/seed/143_pack_kw.sql +29 -0
  59. package/dist/assets/seed/144_pack_bn.sql +35 -0
  60. package/dist/assets/seed/145_pack_mo.sql +45 -0
  61. package/dist/assets/seed/146_pack_je.sql +36 -0
  62. package/dist/assets/seed/147_pack_zw.sql +38 -0
  63. package/dist/assets/seed/14_pack_gb.sql +53 -0
  64. package/dist/assets/seed/15_pack_us.sql +48 -0
  65. package/dist/assets/seed/16_pack_ie.sql +83 -0
  66. package/dist/assets/seed/17_pack_nl.sql +70 -0
  67. package/dist/assets/seed/18_pack_de.sql +85 -0
  68. package/dist/assets/seed/19_pack_es.sql +263 -0
  69. package/dist/assets/seed/20_pack_sn.sql +150 -0
  70. package/dist/assets/seed/21_pack_ci.sql +150 -0
  71. package/dist/assets/seed/22_pack_bj.sql +150 -0
  72. package/dist/assets/seed/23_pack_bf.sql +150 -0
  73. package/dist/assets/seed/24_pack_cm.sql +150 -0
  74. package/dist/assets/seed/25_pack_cf.sql +150 -0
  75. package/dist/assets/seed/26_pack_km.sql +150 -0
  76. package/dist/assets/seed/27_pack_cg.sql +150 -0
  77. package/dist/assets/seed/28_pack_ga.sql +150 -0
  78. package/dist/assets/seed/29_pack_gn.sql +150 -0
  79. package/dist/assets/seed/30_pack_gw.sql +150 -0
  80. package/dist/assets/seed/31_pack_gq.sql +150 -0
  81. package/dist/assets/seed/32_pack_ml.sql +150 -0
  82. package/dist/assets/seed/33_pack_ne.sql +150 -0
  83. package/dist/assets/seed/34_pack_cd.sql +150 -0
  84. package/dist/assets/seed/35_pack_td.sql +150 -0
  85. package/dist/assets/seed/36_pack_tg.sql +150 -0
  86. package/dist/assets/seed/37_pack_it.sql +39 -0
  87. package/dist/assets/seed/38_pack_id.sql +21 -0
  88. package/dist/assets/seed/39_pack_my.sql +43 -0
  89. package/dist/assets/seed/40_pack_au.sql +38 -0
  90. package/dist/assets/seed/41_pack_nz.sql +39 -0
  91. package/dist/assets/seed/42_pack_mx.sql +78 -0
  92. package/dist/assets/seed/43_pack_pt.sql +52 -0
  93. package/dist/assets/seed/44_pack_ph.sql +26 -0
  94. package/dist/assets/seed/45_pack_ar.sql +36 -0
  95. package/dist/assets/seed/46_pack_cl.sql +125 -0
  96. package/dist/assets/seed/47_pack_co.sql +32 -0
  97. package/dist/assets/seed/48_pack_pe.sql +46 -0
  98. package/dist/assets/seed/49_pack_ng.sql +31 -0
  99. package/dist/assets/seed/50_pack_sg.sql +38 -0
  100. package/dist/assets/seed/51_pack_jp.sql +71 -0
  101. package/dist/assets/seed/52_pack_hk.sql +29 -0
  102. package/dist/assets/seed/53_pack_tw.sql +18 -0
  103. package/dist/assets/seed/54_pack_kr.sql +66 -0
  104. package/dist/assets/seed/55_pack_vn.sql +27 -0
  105. package/dist/assets/seed/56_pack_th.sql +26 -0
  106. package/dist/assets/seed/57_pack_ua.sql +71 -0
  107. package/dist/assets/seed/58_pack_ca.sql +30 -0
  108. package/dist/assets/seed/60_pack_ae.sql +36 -0
  109. package/dist/assets/seed/61_pack_se.sql +80 -0
  110. package/dist/assets/seed/62_pack_ch.sql +30 -0
  111. package/dist/assets/seed/63_pack_at.sql +43 -0
  112. package/dist/assets/seed/64_pack_pl.sql +45 -0
  113. package/dist/assets/seed/65_pack_dk.sql +33 -0
  114. package/dist/assets/seed/66_pack_no.sql +35 -0
  115. package/dist/assets/seed/67_pack_fi.sql +40 -0
  116. package/dist/assets/seed/68_pack_cz.sql +111 -0
  117. package/dist/assets/seed/69_pack_sk.sql +50 -0
  118. package/dist/assets/seed/70_pack_hu.sql +45 -0
  119. package/dist/assets/seed/71_pack_sa.sql +38 -0
  120. package/dist/assets/seed/72_pack_ro.sql +91 -0
  121. package/dist/assets/seed/73_pack_bg.sql +26 -0
  122. package/dist/assets/seed/74_pack_hr.sql +40 -0
  123. package/dist/assets/seed/75_pack_si.sql +46 -0
  124. package/dist/assets/seed/76_pack_gr.sql +28 -0
  125. package/dist/assets/seed/77_pack_lt.sql +31 -0
  126. package/dist/assets/seed/78_pack_lv.sql +26 -0
  127. package/dist/assets/seed/79_pack_cy.sql +38 -0
  128. package/dist/assets/seed/80_pack_mt.sql +87 -0
  129. package/dist/assets/seed/81_pack_is.sql +31 -0
  130. package/dist/assets/seed/82_pack_tr.sql +50 -0
  131. package/dist/assets/seed/83_pack_eg.sql +36 -0
  132. package/dist/assets/seed/84_pack_ma.sql +66 -0
  133. package/dist/assets/seed/85_pack_tn.sql +51 -0
  134. package/dist/assets/seed/86_pack_dz.sql +113 -0
  135. package/dist/assets/seed/87_pack_il.sql +30 -0
  136. package/dist/assets/seed/88_pack_za.sql +38 -0
  137. package/dist/assets/seed/89_pack_ke.sql +38 -0
  138. package/dist/assets/seed/modules/corporate_tax/10_pack_be.sql +1 -1
  139. package/dist/assets/seed/modules/corporate_tax/11_pack_fr.sql +1 -1
  140. package/dist/assets/seed/modules/fixed_assets/10_pack_be.sql +1 -1
  141. package/dist/assets/seed/modules/fixed_assets/11_pack_fr.sql +1 -1
  142. package/dist/cli.d.ts +3 -2
  143. package/dist/cli.d.ts.map +1 -1
  144. package/dist/cli.js +25 -3
  145. package/dist/cli.js.map +1 -1
  146. package/dist/commands/import.d.ts.map +1 -1
  147. package/dist/commands/import.js +7 -2
  148. package/dist/commands/import.js.map +1 -1
  149. package/dist/commands/pack.js +7 -0
  150. package/dist/commands/pack.js.map +1 -1
  151. package/dist/commands/payment.d.ts +4 -2
  152. package/dist/commands/payment.d.ts.map +1 -1
  153. package/dist/commands/payment.js +48 -9
  154. package/dist/commands/payment.js.map +1 -1
  155. package/dist/commands/peppol.d.ts +29 -0
  156. package/dist/commands/peppol.d.ts.map +1 -0
  157. package/dist/commands/peppol.js +135 -0
  158. package/dist/commands/peppol.js.map +1 -0
  159. package/dist/index.d.ts +3 -2
  160. package/dist/index.d.ts.map +1 -1
  161. package/dist/index.js +2 -1
  162. package/dist/index.js.map +1 -1
  163. package/dist/output.js +1 -1
  164. package/dist/output.js.map +1 -1
  165. package/dist/pack/analysis.d.ts +72 -0
  166. package/dist/pack/analysis.d.ts.map +1 -0
  167. package/dist/pack/analysis.js +198 -0
  168. package/dist/pack/analysis.js.map +1 -0
  169. package/dist/pack/certification.d.ts +23 -6
  170. package/dist/pack/certification.d.ts.map +1 -1
  171. package/dist/pack/certification.js +27 -5
  172. package/dist/pack/certification.js.map +1 -1
  173. package/dist/pack/compile.d.ts.map +1 -1
  174. package/dist/pack/compile.js +50 -2
  175. package/dist/pack/compile.js.map +1 -1
  176. package/dist/pack/describe.d.ts +6 -3
  177. package/dist/pack/describe.d.ts.map +1 -1
  178. package/dist/pack/describe.js +1 -0
  179. package/dist/pack/describe.js.map +1 -1
  180. package/dist/pack/read.d.ts +27 -0
  181. package/dist/pack/read.d.ts.map +1 -1
  182. package/dist/pack/read.js +63 -23
  183. package/dist/pack/read.js.map +1 -1
  184. package/dist/pack/rules.d.ts +24 -0
  185. package/dist/pack/rules.d.ts.map +1 -0
  186. package/dist/pack/rules.js +29 -0
  187. package/dist/pack/rules.js.map +1 -0
  188. package/dist/schema.d.ts +1 -1
  189. package/dist/schema.js +1 -1
  190. package/package.json +3 -3
  191. package/schema/output.1.json +48 -1
package/README.md CHANGED
@@ -173,12 +173,13 @@ project reports what was already there and creates nothing a second time.
173
173
  | `ekwo cancel <document>` | Undoes a posted invoice, and says how. Back to draft, through `unpost_document()`, where its country allows it and nothing about it has left; otherwise through `cancel_document()`: the credit note that names it, posted and matched against it, and the invoice cancelled. `--date` books the credit note on another day than the invoice's, which is how a locked period is stepped over; `--credit` asks for the note where a draft was possible. |
174
174
  | `ekwo reverse <entry>` | Undoes a posted entry keyed by hand, through `reverse_entry()`: its mirror, posted and matched against it. By id or by number; `--date` as for `cancel`. |
175
175
  | `ekwo payment record` | Money in or out, booked and matched. With `--doc`, against that document. |
176
- | `ekwo match <transaction> <document>` | A bank statement line pays a document, through `settle_from_statement()`. |
176
+ | `ekwo match <transaction> <document>… [--amount <amount>]… [--extra "account=<code>,amount=<amount>,tax=<code>"]…` | A bank statement line pays documents, through `settle_from_statement()`: `--amount`, once per document, says how much settles each; `--extra` books the fee or the charges the line is net of in the same entry, and alone settles a bank charge. The line balances to the cent or is refused. |
177
177
  | `ekwo import <source> <file>…` | Books kept elsewhere — `trial-balance`, `fec`, `journal-items`, `journal-report`, `transaction-journal`, `xaf` — whole or not at all, through `import_books()`, with a correspondence of accounts and journals you save and give back; or a bank statement — `camt.053`, `coda`, `cfonb120` — as pending lines. `--dry-run` rehearses. See [taking over books](#taking-over-books-ekwo-import). |
178
178
  | `ekwo doc list` / `show` | What exists, and with `--unpaid` what is posted and still owed. See [keeping books](#keeping-books). |
179
179
  | `ekwo doc pdf <document>` | The PDF of a sale invoice or credit note, rendered from the books by [`@ekwo-ai/invoice-pdf`](../formats/invoice-pdf/README.md), with the logo the company names by URL (fetched by this command, from a public http(s) address only). Written to `--out`, or under its own name in the current directory. `--factur-x` embeds the CII of a posted sale and makes it a Factur-X PDF/A-3 (the rules it breaks end on exit 1); `--page-size Letter`; `--labels <file.json>` gives the words of the layout in the document's language. `ekwo document` is the whole word of `ekwo doc`. Records nothing. |
180
180
  | `ekwo proof stamp` / `upgrade` / `verify` | The sha256 of a filed file — a declaration, the annual accounts of a financial year, a document — committed to Bitcoin through the public OpenTimestamps calendars; only the hash leaves. `upgrade` completes the pending proofs of the company and is made to run on a schedule; `verify` checks a file against its proof and the block it names, and `--out` writes the `.ots` file any verifier reads. See [`docs/filing-proofs.md`](../../docs/filing-proofs.md). |
181
181
  | `ekwo einvoice validate` / `issue` / `status` / `list` | The electronic invoice of a posted sale, in the format its country pack declares, through the `einvoicing` module: `validate` writes it and names the rules it breaks (exit 1 if any), `issue` keeps it and with `--send --to <directory>` writes it to that folder, `status --refresh` follows it. See [`modules/einvoicing`](../../modules/einvoicing/README.md). |
182
+ | `ekwo peppol validate <file>` / `lookup <participant>` | The Peppol network, with no installation and no sign-in. `validate` reads a UBL invoice or credit note as it arrived and names the rules it breaks — the arithmetic of EN 16931 and the electronic addresses of both parties — with exit 1 if any; nothing is booked. `lookup` checks a participant identifier (`0208:0999999922`, `iso6523-actorid-upis::…` or a symbolic scheme) and asks the DNS of the Service Metadata Locator whether it is registered, and with which Service Metadata Publisher; `--test` asks the acceptance network. Exit 0 only for a registered participant. See [`@ekwo-ai/peppol-ubl`](../formats/peppol-ubl/README.md#participant-identifiers-and-the-sml). |
182
183
 
183
184
  There is no `eject`, because there is nothing to eject from. The schema is in
184
185
  your database, the migrations are in the repository under AGPL-3.0, and
@@ -262,6 +263,7 @@ ekwo post job-7
262
263
  ekwo cancel job-7 # back to draft where the country allows it, else the credit note
263
264
  ekwo payment record --doc job-7 --amount 1750.00 --date 2026-06-30 --bank-account <id> --ref bank-1
264
265
  ekwo match <bank transaction id> job-9
266
+ ekwo match <payout id> job-9 --extra "account=<fee account>,amount=3.00,tax=<tax code>"
265
267
  ekwo doc list --unpaid --since 2026-06-01 --json
266
268
  ```
267
269
 
@@ -517,7 +519,7 @@ exactly six fields:
517
519
  "organization": "My Organisation",
518
520
  "country": "<cc>",
519
521
  "edition": "community",
520
- "schema_version": "0.12.2",
522
+ "schema_version": "0.13.0",
521
523
  "contact_email": "you@example.com"
522
524
  }
523
525
  ```
@@ -1,6 +1,6 @@
1
1
  {
2
- "schemaVersion": "0.12.2",
3
- "migration": "20261011163457",
2
+ "schemaVersion": "0.13.0",
3
+ "migration": "20261014164531",
4
4
  "socle": {
5
5
  "schema": "public",
6
6
  "tables": [
@@ -126,6 +126,101 @@
126
126
  }
127
127
  ]
128
128
  },
129
+ {
130
+ "name": "analysis_aggregates",
131
+ "columns": [
132
+ {
133
+ "name": "adds_unclosed_result",
134
+ "type": "boolean"
135
+ },
136
+ {
137
+ "name": "code",
138
+ "type": "text"
139
+ },
140
+ {
141
+ "name": "description",
142
+ "type": "text"
143
+ },
144
+ {
145
+ "name": "reading",
146
+ "type": "text"
147
+ },
148
+ {
149
+ "name": "sequence",
150
+ "type": "integer"
151
+ },
152
+ {
153
+ "name": "sign",
154
+ "type": "smallint"
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "name": "analysis_rules",
160
+ "columns": [
161
+ {
162
+ "name": "account_type",
163
+ "type": "account_type"
164
+ },
165
+ {
166
+ "name": "aggregate",
167
+ "type": "text"
168
+ },
169
+ {
170
+ "name": "balance_side",
171
+ "type": "text"
172
+ },
173
+ {
174
+ "name": "chart_code",
175
+ "type": "text"
176
+ },
177
+ {
178
+ "name": "code_from",
179
+ "type": "text"
180
+ },
181
+ {
182
+ "name": "code_to",
183
+ "type": "text"
184
+ },
185
+ {
186
+ "name": "country",
187
+ "type": "character(2)"
188
+ },
189
+ {
190
+ "name": "rule_kind",
191
+ "type": "text"
192
+ },
193
+ {
194
+ "name": "sequence",
195
+ "type": "integer"
196
+ }
197
+ ]
198
+ },
199
+ {
200
+ "name": "analysis_templates",
201
+ "columns": [
202
+ {
203
+ "name": "aggregate",
204
+ "type": "text"
205
+ },
206
+ {
207
+ "name": "chart_code",
208
+ "type": "text"
209
+ },
210
+ {
211
+ "name": "country",
212
+ "type": "character(2)"
213
+ },
214
+ {
215
+ "name": "legal_reference",
216
+ "type": "text"
217
+ },
218
+ {
219
+ "name": "source_key",
220
+ "type": "text"
221
+ }
222
+ ]
223
+ },
129
224
  {
130
225
  "name": "analytic_axes",
131
226
  "columns": [
@@ -1599,6 +1694,10 @@
1599
1694
  "name": "country",
1600
1695
  "type": "character(2)"
1601
1696
  },
1697
+ {
1698
+ "name": "evidence",
1699
+ "type": "jsonb"
1700
+ },
1602
1701
  {
1603
1702
  "name": "installed_at",
1604
1703
  "type": "timestamp with time zone"
@@ -3877,6 +3976,10 @@
3877
3976
  "name": "account_id_by_code",
3878
3977
  "arguments": "p_company_id uuid, p_code text"
3879
3978
  },
3979
+ {
3980
+ "name": "account_rule_catches",
3981
+ "arguments": "p_rule_kind text, p_code_from text, p_code_to text, p_rule_type account_type, p_side text, p_code text, p_account_type account_type, p_balance numeric"
3982
+ },
3880
3983
  {
3881
3984
  "name": "accounts_guard_frozen",
3882
3985
  "arguments": ""
@@ -4365,6 +4468,10 @@
4365
4468
  "name": "filings_touched_since",
4366
4469
  "arguments": "p_company_id uuid, p_from date, p_to date"
4367
4470
  },
4471
+ {
4472
+ "name": "financial_analysis",
4473
+ "arguments": "p_company_id uuid, p_from date, p_to date"
4474
+ },
4368
4475
  {
4369
4476
  "name": "financial_statement",
4370
4477
  "arguments": "p_company_id uuid, p_statement_code text, p_from date, p_to date"
@@ -4563,7 +4670,7 @@
4563
4670
  },
4564
4671
  {
4565
4672
  "name": "opening_balance",
4566
- "arguments": "p_company_id uuid, p_fiscal_year_id uuid, p_lines jsonb, p_allow_result_accounts boolean"
4673
+ "arguments": "p_company_id uuid, p_fiscal_year_id uuid, p_lines jsonb, p_allow_result_accounts boolean, p_opening_date date, p_items jsonb"
4567
4674
  },
4568
4675
  {
4569
4676
  "name": "opening_journal_id",
@@ -4739,7 +4846,7 @@
4739
4846
  },
4740
4847
  {
4741
4848
  "name": "settle_from_statement",
4742
- "arguments": "p_transaction_id uuid, p_line_ids uuid[]"
4849
+ "arguments": "p_transaction_id uuid, p_line_ids uuid[], p_amounts numeric[], p_extra_lines jsonb"
4743
4850
  },
4744
4851
  {
4745
4852
  "name": "share_document",
@@ -4910,6 +5017,21 @@
4910
5017
  "name": "accounts_write",
4911
5018
  "command": "all"
4912
5019
  },
5020
+ {
5021
+ "table": "analysis_aggregates",
5022
+ "name": "analysis_aggregates_select",
5023
+ "command": "select"
5024
+ },
5025
+ {
5026
+ "table": "analysis_rules",
5027
+ "name": "analysis_rules_select",
5028
+ "command": "select"
5029
+ },
5030
+ {
5031
+ "table": "analysis_templates",
5032
+ "name": "analysis_templates_select",
5033
+ "command": "select"
5034
+ },
4913
5035
  {
4914
5036
  "table": "analytic_axes",
4915
5037
  "name": "analytic_axes_select",
@@ -6129,6 +6251,7 @@
6129
6251
  "labels": [
6130
6252
  "community",
6131
6253
  "maintained",
6254
+ "proven",
6132
6255
  "reviewed",
6133
6256
  "ekwo"
6134
6257
  ]
@@ -6350,6 +6473,36 @@
6350
6473
  "update"
6351
6474
  ]
6352
6475
  },
6476
+ {
6477
+ "name": "analysis_aggregates",
6478
+ "anon": [],
6479
+ "authenticated": [
6480
+ "select"
6481
+ ],
6482
+ "service_role": [
6483
+ "select"
6484
+ ]
6485
+ },
6486
+ {
6487
+ "name": "analysis_rules",
6488
+ "anon": [],
6489
+ "authenticated": [
6490
+ "select"
6491
+ ],
6492
+ "service_role": [
6493
+ "select"
6494
+ ]
6495
+ },
6496
+ {
6497
+ "name": "analysis_templates",
6498
+ "anon": [],
6499
+ "authenticated": [
6500
+ "select"
6501
+ ],
6502
+ "service_role": [
6503
+ "select"
6504
+ ]
6505
+ },
6353
6506
  {
6354
6507
  "name": "analytic_axes",
6355
6508
  "anon": [],
@@ -7248,6 +7401,17 @@
7248
7401
  "execute"
7249
7402
  ]
7250
7403
  },
7404
+ {
7405
+ "name": "account_rule_catches",
7406
+ "arguments": "p_rule_kind text, p_code_from text, p_code_to text, p_rule_type account_type, p_side text, p_code text, p_account_type account_type, p_balance numeric",
7407
+ "anon": [],
7408
+ "authenticated": [
7409
+ "execute"
7410
+ ],
7411
+ "service_role": [
7412
+ "execute"
7413
+ ]
7414
+ },
7251
7415
  {
7252
7416
  "name": "accounts_guard_frozen",
7253
7417
  "arguments": "",
@@ -8449,6 +8613,17 @@
8449
8613
  "execute"
8450
8614
  ]
8451
8615
  },
8616
+ {
8617
+ "name": "financial_analysis",
8618
+ "arguments": "p_company_id uuid, p_from date, p_to date",
8619
+ "anon": [],
8620
+ "authenticated": [
8621
+ "execute"
8622
+ ],
8623
+ "service_role": [
8624
+ "execute"
8625
+ ]
8626
+ },
8452
8627
  {
8453
8628
  "name": "financial_statement",
8454
8629
  "arguments": "p_company_id uuid, p_statement_code text, p_from date, p_to date",
@@ -8996,7 +9171,7 @@
8996
9171
  },
8997
9172
  {
8998
9173
  "name": "opening_balance",
8999
- "arguments": "p_company_id uuid, p_fiscal_year_id uuid, p_lines jsonb, p_allow_result_accounts boolean",
9174
+ "arguments": "p_company_id uuid, p_fiscal_year_id uuid, p_lines jsonb, p_allow_result_accounts boolean, p_opening_date date, p_items jsonb",
9000
9175
  "anon": [],
9001
9176
  "authenticated": [
9002
9177
  "execute"
@@ -9464,7 +9639,7 @@
9464
9639
  },
9465
9640
  {
9466
9641
  "name": "settle_from_statement",
9467
- "arguments": "p_transaction_id uuid, p_line_ids uuid[]",
9642
+ "arguments": "p_transaction_id uuid, p_line_ids uuid[], p_amounts numeric[], p_extra_lines jsonb",
9468
9643
  "anon": [],
9469
9644
  "authenticated": [
9470
9645
  "execute"
@@ -0,0 +1,28 @@
1
+ -- Ekwo OS — a pack can be proven on the real books of a company.
2
+ --
3
+ -- Between `maintained` and `reviewed` there was a step the scale could not
4
+ -- say. A pack can reproduce, to the unit they were filed in, the statements a
5
+ -- real company filed and the administration accepted, once that company's
6
+ -- books are imported. That is more than the maintainers testing that the pack
7
+ -- holds together, and it is less than a professional reading the pack against
8
+ -- the law: it proves the cases that one company uses, and no other regime of
9
+ -- the country. So the scale becomes:
10
+ --
11
+ -- community contributed, not read by an accountant
12
+ -- maintained maintained by Ekwo, not yet reviewed by an accountant
13
+ -- proven maintained, and it reproduced a real company's accepted
14
+ -- filing; the manifest of the pack says, per scope, what was
15
+ -- reproduced and what was not tested
16
+ -- reviewed read by a named professional, with `certified_by`,
17
+ -- `certified_at` and the sources they worked from
18
+ --
19
+ -- Nothing here moves a row: a pack becomes proven when its seed says so, and
20
+ -- a new enum value cannot be used in the transaction that adds it anyway.
21
+
22
+ alter type pack_certification add value if not exists 'proven' after 'maintained';
23
+
24
+ comment on type pack_certification is
25
+ 'How much a pack has been read: community (contributed, unread), maintained (by Ekwo, not yet reviewed), proven (maintained, and it reproduced the accepted filing of a real company whose books were imported; it proves the cases that company uses), reviewed (by a named professional). The value `ekwo` is deprecated and nothing writes it.';
26
+
27
+ comment on column country_packs.certification_status is
28
+ 'How much a pack has been read, printed by `ekwo init`: community (contributed, unread), maintained (by Ekwo, not yet reviewed), proven (it reproduced the accepted filing of a real company; the pack manifest carries the evidence), reviewed (by the professional named in certified_by).';
@@ -0,0 +1,28 @@
1
+ -- Ekwo OS — what a proven pack was proven on, in the database that applies it.
2
+ --
3
+ -- `20261011192741` let a pack say it is `proven`, and `certification.evidence`
4
+ -- in its manifest says on what: one entry per scope, with the kind of filing,
5
+ -- the financial year, the result and one plain sentence. The status reached
6
+ -- `country_packs`; the evidence stopped at the seed header and at
7
+ -- `ekwo pack describe`, which reads a clone of the repository. An application
8
+ -- or an agent that reads the installation saw the word `proven` and nothing
9
+ -- that said which statements were reproduced and which were not tested — and
10
+ -- what a proof did not cover is half of what it says.
11
+ --
12
+ -- `country_packs.evidence` brings it here, in the order the pack declares it.
13
+ --
14
+ -- Additive: one column, defaulting to an empty list, no backfill. The value is
15
+ -- the pack's, and only the seed of a pack that carries evidence writes it, so
16
+ -- the seeds of every other country keep running on a schema from before this
17
+ -- file. Writing the evidence of a country in a migration would put a country
18
+ -- back into the core.
19
+
20
+ alter table country_packs
21
+ add column if not exists evidence jsonb not null default '[]'::jsonb;
22
+
23
+ comment on column country_packs.evidence is
24
+ 'What a proven pack was proven on, in the pack''s own order: [{scope, result, fiscal_year, filing, summary, checked_on}]. `result` is one of reproduced, partly_reproduced, not_tested. An entry names the kind of filing and never the company. Written by the generated seed of a pack that carries evidence; empty otherwise.';
25
+
26
+ -- No object is created and no function is added, so there is nothing to grant
27
+ -- and nothing to revoke: a column added to a table is reachable by whoever
28
+ -- could already select that table, under the policies it already has.