ekwo-os 0.5.0 → 0.7.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.
- package/README.md +195 -17
- package/dist/assets/expected-objects.json +107 -2
- package/dist/assets/migrations/20260922081645_books_taken_over_from_an_export.sql +410 -0
- package/dist/assets/migrations/20260922091348_schema_version_0_6_0.sql +37 -0
- package/dist/assets/migrations/20260922115309_an_installation_without_a_country.sql +24 -0
- package/dist/assets/migrations/20260922120418_import_already_done_says_what.sql +284 -0
- package/dist/assets/migrations/20260922124012_schema_version_0_7_0.sql +40 -0
- package/dist/assets/seed/00_currencies.sql +2 -1
- package/dist/assets/seed/00_territories.sql +44 -0
- package/dist/assets/seed/62_pack_ch.sql +595 -0
- package/dist/assets/seed/63_pack_at.sql +644 -0
- package/dist/assets/seed/64_pack_pl.sql +698 -0
- package/dist/assets/seed/71_pack_sa.sql +620 -0
- package/dist/auth.d.ts +17 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +24 -6
- package/dist/auth.js.map +1 -1
- package/dist/bootstrap.d.ts +17 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +29 -8
- package/dist/bootstrap.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +61 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/company.d.ts +14 -2
- package/dist/commands/company.d.ts.map +1 -1
- package/dist/commands/company.js +185 -8
- package/dist/commands/company.js.map +1 -1
- package/dist/commands/import.d.ts +34 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +247 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +132 -123
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/company-choices.d.ts +66 -0
- package/dist/company-choices.d.ts.map +1 -0
- package/dist/company-choices.js +165 -0
- package/dist/company-choices.js.map +1 -0
- package/dist/config.d.ts +11 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/registry.d.ts +3 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js.map +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/package.json +3 -3
- package/schema/output.1.json +110 -22
package/README.md
CHANGED
|
@@ -6,13 +6,17 @@ books: the schema, the chart of accounts, the VAT codes, the first
|
|
|
6
6
|
administrator, the first company and its first financial year.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npx ekwo-os init
|
|
9
|
+
npx -y ekwo-os@latest init
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
The package is `ekwo-os` and the command it installs is `ekwo`:
|
|
13
|
-
<command>` runs it without installing anything, and
|
|
14
|
-
`npm install -g ekwo-os` every example below that starts with `ekwo `
|
|
15
|
-
written.
|
|
12
|
+
The package is `ekwo-os` and the command it installs is `ekwo`:
|
|
13
|
+
`npx -y ekwo-os@latest <command>` runs it without installing anything, and
|
|
14
|
+
after `npm install -g ekwo-os` every example below that starts with `ekwo `
|
|
15
|
+
works as written. Keep the version in the command: run from inside a clone of
|
|
16
|
+
the Ekwo repository, a bare `npx ekwo-os` finds the workspace package of the
|
|
17
|
+
same name, which links no command, and answers `ekwo: command not found`. With
|
|
18
|
+
`@latest`, `npx` fetches the published CLI wherever it is started; the clone's
|
|
19
|
+
own is `node packages/cli/dist/bin.js`, after `npm run build`.
|
|
16
20
|
|
|
17
21
|
You need Node 20 or later. That is the whole list. The Supabase CLI is not
|
|
18
22
|
required — this talks to Postgres directly — and Docker is not required
|
|
@@ -26,9 +30,11 @@ either.
|
|
|
26
30
|
2. **Copy two things** from the dashboard:
|
|
27
31
|
- Project Settings → Database → **Connection string** (URI). It contains
|
|
28
32
|
your database password.
|
|
29
|
-
- Project Settings → API →
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
- Project Settings → API Keys → the **secret key** (`sb_secret_…`), and the
|
|
34
|
+
**Project URL**. A project created before the new keys has the legacy
|
|
35
|
+
**`service_role` key** instead, and it works the same. These are used
|
|
36
|
+
once, to create the first administrator in your own Supabase Auth, and
|
|
37
|
+
are never written to disk.
|
|
32
38
|
|
|
33
39
|
**Take the pooler string, not the direct one, unless you know you have
|
|
34
40
|
IPv6.** The direct host `db.<ref>.supabase.co` resolves to an IPv6 address
|
|
@@ -48,7 +54,7 @@ either.
|
|
|
48
54
|
3. **Run the installer.**
|
|
49
55
|
|
|
50
56
|
```sh
|
|
51
|
-
npx ekwo-os init
|
|
57
|
+
npx -y ekwo-os@latest init
|
|
52
58
|
```
|
|
53
59
|
|
|
54
60
|
It asks for the connection string, the country, the chart of accounts and
|
|
@@ -71,7 +77,7 @@ either.
|
|
|
71
77
|
Everything above in one non-interactive line:
|
|
72
78
|
|
|
73
79
|
```sh
|
|
74
|
-
npx ekwo-os init \
|
|
80
|
+
npx -y ekwo-os@latest init \
|
|
75
81
|
--db-url "postgresql://postgres.YOURREF:PASSWORD@aws-1-eu-west-3.pooler.supabase.com:5432/postgres" \
|
|
76
82
|
--supabase-url "https://YOURREF.supabase.co" \
|
|
77
83
|
--service-role-key "$SUPABASE_SERVICE_ROLE_KEY" \
|
|
@@ -117,6 +123,52 @@ in `defaults.fiscal_year_default`; one that names none — the United Kingdom's,
|
|
|
117
123
|
where a company's year ends on the accounting reference date it chose — asks
|
|
118
124
|
for the day.
|
|
119
125
|
|
|
126
|
+
`ekwo company new` asks the same questions about every other company, and
|
|
127
|
+
refuses the same way.
|
|
128
|
+
|
|
129
|
+
## Several countries in one installation: `init --no-company`
|
|
130
|
+
|
|
131
|
+
An installation is not in a country; its companies are. `ekwo init` loads every
|
|
132
|
+
pack of the release whatever `--country` says, so one installation keeps the
|
|
133
|
+
books of companies in as many countries as it holds packs. When there is no
|
|
134
|
+
"first company" to name — a group, a firm, a holding with subsidiaries abroad —
|
|
135
|
+
install without one, then create each company in its own country:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
npx -y ekwo-os@latest init --no-company \
|
|
139
|
+
--db-url "$EKWO_DB_URL" --supabase-url "https://YOURREF.supabase.co" \
|
|
140
|
+
--service-role-key "$SUPABASE_SERVICE_ROLE_KEY" \
|
|
141
|
+
--org "My Group" --admin-email "you@example.com" --yes
|
|
142
|
+
|
|
143
|
+
ekwo company new "My Company Belgium" --country BE --chart default --language nl --yes
|
|
144
|
+
ekwo company new "My Company France" --country FR --language fr --yes
|
|
145
|
+
ekwo company list
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`--no-company` runs the migrations, the seeds of every pack, the modules, the
|
|
149
|
+
first administrator, `init_instance()` and `claim_instance_admin()`, and
|
|
150
|
+
nothing else. The instance row records no country. A flag that only describes
|
|
151
|
+
a company — `--country`, `--company`, `--chart`, `--language`, `--currency`,
|
|
152
|
+
`--fiscal-year`, `--fiscal-year-start`, `--vat-period`, `--filing-period`,
|
|
153
|
+
`--iban`, `--bic`, `--bank-name` — is refused with it, exit code 2, before the
|
|
154
|
+
database is touched: it would describe nothing.
|
|
155
|
+
|
|
156
|
+
**`ekwo company new` is `create_company()`**, the function the `create_company`
|
|
157
|
+
tool of the MCP server calls: the country pack copied in, the first financial
|
|
158
|
+
year opened, the administrator its first owner. It is called as an
|
|
159
|
+
administrator of the installation — `--as-user`, or the only one when there is
|
|
160
|
+
exactly one — so the database judges that person exactly as it judges the tool:
|
|
161
|
+
anybody else is refused, `not_instance_admin`, exit code 3. Before the call,
|
|
162
|
+
the CLI asks what `ekwo init` asks about its first company, from the packs the
|
|
163
|
+
installation holds, and refuses the same way off a terminal: no country without
|
|
164
|
+
`--country`, and `--chart`, `--language` and `--fiscal-year-start` wherever the
|
|
165
|
+
pack offers a choice. `--currency` and `--fiscal-year` override the pack and
|
|
166
|
+
this year.
|
|
167
|
+
|
|
168
|
+
Without `--no-company`, `ekwo init` does what it always did, and the installation
|
|
169
|
+
takes more companies later the same way. Neither writes a country into
|
|
170
|
+
`ekwo.json`: see below.
|
|
171
|
+
|
|
120
172
|
## Where table access comes from
|
|
121
173
|
|
|
122
174
|
**The schema grants its own rights.** Every table, view and function of Ekwo
|
|
@@ -222,7 +274,7 @@ and read by a person.
|
|
|
222
274
|
| 2 | Applies every reference seed of `supabase/seed/`, in file-name order: `00_currencies.sql`, `00_territories.sql`, `05_framework_generic.sql`, then one `<n>_pack_<cc>.sql` per country pack, in the order of the number each pack declares | The currencies, the territories the tax rules name, the country-less financial statements every chart falls back on, and every country pack of the release — so a company in any of them can be created later without installing anything. They are exactly the seeds `supabase/config.toml` lists (a list `ekwo pack build` writes from `packs/`), so `supabase db push` installs the same set; a test compares both paths row by row. `90_demo_company.sql` is sample data and is never applied here |
|
|
223
275
|
| 3 | Creates the first administrator through the Supabase Auth admin API | See below: a database connection cannot be a signed-in user |
|
|
224
276
|
| 4 | `init_instance()`, `claim_instance_admin()`, the company, `company_members` as owner, `install_country_template()`, the first financial year, and the bank account when an IBAN was given | The six steps of the root README, in the same order, plus the one thing nobody can derive |
|
|
225
|
-
| 5 | Writes `ekwo.json` |
|
|
277
|
+
| 5 | Writes `ekwo.json` | The installation: project URL and schema version. Nothing else, ever — no country, since each company carries its own. A file written by 0.6 or earlier also names a country; it is still read, and the key is taken for nothing |
|
|
226
278
|
| 6 | Asks whether to register with Ekwo | The default answer is no, and no is a supported answer forever |
|
|
227
279
|
|
|
228
280
|
Every step checks before it acts. Running `ekwo init` twice on the same
|
|
@@ -250,7 +302,7 @@ instead if the account already exists, and no key is needed.
|
|
|
250
302
|
|
|
251
303
|
| Command | What it does |
|
|
252
304
|
|---|---|
|
|
253
|
-
| `ekwo init` | The whole installation, interactive or not: the socle's migrations, the reference seeds, then the modules', as `ekwo migrate` applies them. |
|
|
305
|
+
| `ekwo init` | The whole installation, interactive or not: the socle's migrations, the reference seeds, then the modules', as `ekwo migrate` applies them. `--no-company` stops before the first company: see [several countries](#several-countries-in-one-installation-init---no-company). |
|
|
254
306
|
| `ekwo migrate` | Applies the migrations this release adds, after showing the gap — the socle's, then the modules'. Re-applies the reference seeds, which are idempotent. `--no-modules` leaves the modules alone. |
|
|
255
307
|
| `ekwo status` | Schema version installed against available, pending migrations, the instance, its administrators, the country packs it holds and, per company, the pack version it copied. Exits 1 when something is pending. |
|
|
256
308
|
| `ekwo doctor` | Every object this release defines and every privilege it grants, against what the database holds; row level security on every table, a policy on every protected table, no pending migration, no membership pointing at a deleted user, every company with a bank account, statements that tie to their lines, posted entries that balance. Exits 1 on a problem, 0 on warnings. |
|
|
@@ -258,7 +310,7 @@ instead if the account already exists, and no key is needed.
|
|
|
258
310
|
| `ekwo unregister` | Opt back out. Clears the address and the date on the instance row. |
|
|
259
311
|
| `ekwo demo` | Loads the sample company. Fictional data, explicit request only. |
|
|
260
312
|
| `ekwo module` | What is installed beside the socle, applies a module's migrations and its country seeds, and turns one on or off for a company. |
|
|
261
|
-
| `ekwo company` | One company leaves an installation with its books — `export` writes an archive anybody can read, as a member under row level security — and arrives in another one alive: `import` takes it in whole or not at all. |
|
|
313
|
+
| `ekwo company` | `new` creates a company in its own country, through `create_company()`, and `list` shows the companies held here. One company leaves an installation with its books — `export` writes an archive anybody can read, as a member under row level security — and arrives in another one alive: `import` takes it in whole or not at all. |
|
|
262
314
|
| `ekwo pack` | Compiles a country pack into its seed, and refuses a seed that is no longer the output of its pack. Runs in a checkout of the repository only. |
|
|
263
315
|
| `ekwo login` | Signs in to an instance as yourself and keeps the session, in your own configuration directory. See [acting as a person](#acting-as-a-person-login-use-whoami). |
|
|
264
316
|
| `ekwo logout` | Ends that session, here and on the instance. |
|
|
@@ -271,6 +323,7 @@ instead if the account already exists, and no key is needed.
|
|
|
271
323
|
| `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`. |
|
|
272
324
|
| `ekwo payment record` | Money in or out, booked and matched. With `--doc`, against that document. |
|
|
273
325
|
| `ekwo match <transaction> <document>` | A bank statement line pays a document, through `settle_from_statement()`. |
|
|
326
|
+
| `ekwo import <source> <file>…` | Books kept elsewhere — `trial-balance`, `fec`, `journal-items`, `journal-report` — 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). |
|
|
274
327
|
| `ekwo doc list` / `show` | What exists, and with `--unpaid` what is posted and still owed. See [keeping books](#keeping-books). |
|
|
275
328
|
|
|
276
329
|
There is no `eject`, because there is nothing to eject from. The schema is in
|
|
@@ -506,6 +559,111 @@ Two values are supplied when nobody gives them, and said when they are:
|
|
|
506
559
|
`--type` is `sale_invoice`, and `--date` is today on the machine running the
|
|
507
560
|
command. Whether that date may be booked on is the database's decision.
|
|
508
561
|
|
|
562
|
+
## Taking over books: `ekwo import`
|
|
563
|
+
|
|
564
|
+
To try Ekwo on your own books, bring them. One command, one reader per
|
|
565
|
+
source, and nothing is posted while an account has no answer:
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
ekwo import fec 123456789FEC20251231.txt --dry-run --open-years --save-mapping map.json
|
|
569
|
+
# read, propose a correspondence, rehearse the import in the database, take it back
|
|
570
|
+
$EDITOR map.json # answer what is null — read `suggested` — correct what is wrong
|
|
571
|
+
ekwo import fec 123456789FEC20251231.txt --mapping map.json --open-years
|
|
572
|
+
ekwo import trial-balance balance.csv --opening-date 2026-01-01 --dry-run --save-mapping map.json
|
|
573
|
+
ekwo import journal-items items.csv accounts.csv partners.csv --dry-run --save-mapping map.json
|
|
574
|
+
ekwo import journal-report report.csv chart.csv --date-order dmy --dry-run --save-mapping map.json
|
|
575
|
+
ekwo import camt.053 statement.xml # or coda, cfonb120: pending lines for `ekwo match`
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
| Source | What it reads |
|
|
579
|
+
|---|---|
|
|
580
|
+
| `trial-balance` | A trial balance as CSV — `account`, `debit`, `credit`, or one signed `balance` — which becomes the opening entry of the year `--opening-date` starts |
|
|
581
|
+
| `fec` | A *fichier des écritures comptables*: the eighteen columns of the arrêté of 29 July 2013, tab or bar separated |
|
|
582
|
+
| `journal-items` | The lines of every entry exported as CSV from the list view of an ERP whose ledger is a table of lines, with the chart of accounts and the partners exported beside it |
|
|
583
|
+
| `journal-report` | A journal report or a general ledger detail, saved as CSV from a cloud service's spreadsheet export, with its Journal ID and Account Code columns, and the chart and the contacts beside it |
|
|
584
|
+
| `camt.053`, `coda`, `cfonb120` | A bank statement: its lines, pending, ready for `ekwo match` |
|
|
585
|
+
|
|
586
|
+
Each reader is a brick of [`packages/formats/`](../formats/README.md), named
|
|
587
|
+
after the file; its README says which columns it reads and which official
|
|
588
|
+
pages the format was read from. The exports of other ledgers can also be named
|
|
589
|
+
by the software they come from: `ekwo import --help` lists those names, and
|
|
590
|
+
[`docs/compatibility.md`](../../docs/compatibility.md) gives each one's export,
|
|
591
|
+
official page and state.
|
|
592
|
+
|
|
593
|
+
**The correspondence is yours.** Every account of the old chart has to become
|
|
594
|
+
an account of the company's chart, and every old journal a journal of the
|
|
595
|
+
company. The codes give a candidate — the same code, the same digits without
|
|
596
|
+
the zeros a chart pads with (`411` and `411000`), or the account whose digits
|
|
597
|
+
are the longest beginning of the old code, three at least (`401ACME` and
|
|
598
|
+
`401000`); a tie is no answer — and what the files say of the old account —
|
|
599
|
+
the type its export gives it, its name, the side of its balance — is held
|
|
600
|
+
against the type of the candidate in the chart, because two charts give the
|
|
601
|
+
same digits to different things. Only the same code, not contradicted, is
|
|
602
|
+
`exact`. Anything else is `suggested`, with its reason, and waits for you; a
|
|
603
|
+
candidate the files contradict is dropped for the one account of the chart of
|
|
604
|
+
the kind they say. `--dry-run` prints the lines to read first, each with its
|
|
605
|
+
reason, and `--save-mapping` writes the correspondence as JSON:
|
|
606
|
+
|
|
607
|
+
```json
|
|
608
|
+
{
|
|
609
|
+
"version": 1,
|
|
610
|
+
"source": "fec",
|
|
611
|
+
"accounts": { "411000": "411000", "401ACME": null, "471200": null },
|
|
612
|
+
"journals": { "VE": "SAL", "AN": "@opening", "BQ1": "MISC" },
|
|
613
|
+
"suggested": { "401ACME": { "target": "401000", "reason": "the longest beginning of the code the chart has; …" } }
|
|
614
|
+
}
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
and `--mapping` gives it back: what it answers wins over the proposal, so the
|
|
618
|
+
second run posts what the first one showed. A suggestion is confirmed by
|
|
619
|
+
writing its code under `accounts`; `--accept-suggestions` takes all of them
|
|
620
|
+
once you have read them. Nothing is posted while one the books use is only
|
|
621
|
+
suggested. A journal mapped to `@opening`
|
|
622
|
+
becomes the opening entry of its year instead of ordinary entries — the
|
|
623
|
+
*à-nouveaux* of a FEC, typically. A journal whose code is the one the pack
|
|
624
|
+
opens years on is proposed as `@opening` on its own; `*` stands for entries
|
|
625
|
+
the source gives no journal.
|
|
626
|
+
|
|
627
|
+
**Whole or not at all.** `import_books()` is one call and one transaction: the
|
|
628
|
+
fiscal years it needs (with `--open-years`, as years of the same length and
|
|
629
|
+
first day as the company's own; without, an entry outside every year is
|
|
630
|
+
refused by name), the parties the lines name — found by their code or their
|
|
631
|
+
name, or created as customers or suppliers according to where their lines are
|
|
632
|
+
booked — every entry as a draft then posted by `post_entry()`, and the opening
|
|
633
|
+
through `opening_balance()`. One refusal — a locked period, an account the
|
|
634
|
+
chart does not have, a capability you do not hold — and nothing stays, not
|
|
635
|
+
even the years or the parties.
|
|
636
|
+
|
|
637
|
+
**`--dry-run` is the real thing, taken back.** The database runs the whole
|
|
638
|
+
import and rolls it back, so the numbers shown are the ones the entries would
|
|
639
|
+
take now and a refusal is the one the import would give. For a bank statement a
|
|
640
|
+
dry run reads the file and asks nothing: a statement books nothing anyway.
|
|
641
|
+
|
|
642
|
+
What else to know:
|
|
643
|
+
|
|
644
|
+
- **Refused before the database is asked**, and listed under `refusals` by a
|
|
645
|
+
dry run: an account or a journal with no answer or only a suggestion, books whose reader found
|
|
646
|
+
something that does not add up (an entry that does not balance, a line of a
|
|
647
|
+
draft entry), a currency the files name that is not the company's.
|
|
648
|
+
- **The numbers** are drawn by the journal each entry goes to; the old number
|
|
649
|
+
is kept as the entry's reference. `--keep-numbers` posts each under its old
|
|
650
|
+
number instead, where the country allows a number chosen by hand or you hold
|
|
651
|
+
`entries.import`.
|
|
652
|
+
- **No tax.** An imported line carries an account and an amount, not the tax
|
|
653
|
+
that produced it: the history feeds the ledger, the trial balance and the
|
|
654
|
+
statements, and no box of a VAT return. A period kept elsewhere was declared
|
|
655
|
+
from where it was kept.
|
|
656
|
+
- **The same files twice are refused** (`import_already_done`): `book_imports`
|
|
657
|
+
keeps the checksum of what each import read, and the refusal says which
|
|
658
|
+
files, when, and what that import wrote.
|
|
659
|
+
- **Dates and encodings are said, never guessed**: `--encoding` for a file
|
|
660
|
+
that is not UTF-8, `--date-order` for a report that writes dates in digits.
|
|
661
|
+
- **Reconciliation marks are read and not re-applied yet**: the matching of an
|
|
662
|
+
imported receivable against its payment is done in Ekwo, with `reconcile`.
|
|
663
|
+
|
|
664
|
+
The MCP server offers the same as `import_books`, and `import_bank_statement`
|
|
665
|
+
for a statement. [`docs/import.md`](../../docs/import.md) is the long form.
|
|
666
|
+
|
|
509
667
|
## `ekwo module`
|
|
510
668
|
|
|
511
669
|
A module is a Postgres schema beside the socle — `assets` for fixed assets,
|
|
@@ -536,9 +694,23 @@ them as history it has no file for.
|
|
|
536
694
|
|
|
537
695
|
## `ekwo company`
|
|
538
696
|
|
|
539
|
-
A firm keeps several companies in one installation,
|
|
540
|
-
|
|
541
|
-
|
|
697
|
+
A firm keeps several companies in one installation, each in its own country,
|
|
698
|
+
and each of them belongs to somebody. `new` creates one and `list` shows them —
|
|
699
|
+
see [several countries](#several-countries-in-one-installation-init---no-company):
|
|
700
|
+
|
|
701
|
+
```sh
|
|
702
|
+
ekwo company new "My Company Belgium" --country BE --chart default --language fr
|
|
703
|
+
ekwo company new "My Company France" --country FR --language fr
|
|
704
|
+
ekwo company list # name, country, currency, language, chart, pack, members
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
`company new --json` answers the company (`id`, `country`, `currency`,
|
|
708
|
+
`language`, `chart`, `packVersion`), its first financial year and its owner;
|
|
709
|
+
`company list --json` answers `companies`, one per company. Both shapes are
|
|
710
|
+
under `$defs/data` of the output schema, and the exit codes are the ones every
|
|
711
|
+
command has: 2 for a missing answer, 3 when the database refuses.
|
|
712
|
+
|
|
713
|
+
The two commands below are how a company leaves, and arrives somewhere else.
|
|
542
714
|
|
|
543
715
|
```sh
|
|
544
716
|
ekwo company export "My Company" --out ./my-company # manifest.json + data/<schema>.<table>.jsonl
|
|
@@ -715,7 +887,7 @@ Every command takes the connection flags:
|
|
|
715
887
|
| `--db-password <pw>` | Database password. Prompted, masked, when omitted. |
|
|
716
888
|
| `--db-region <region>` | With `--project-ref`, the session pooler in that region. Both generation prefixes are tried and the one that answers is kept. |
|
|
717
889
|
| `--supabase-url <url>` | `https://<ref>.supabase.co`. Needed only to create a user. |
|
|
718
|
-
| `--service-role-key <key>` | Needed only to create a user. |
|
|
890
|
+
| `--service-role-key <key>` | Needed only to create a user. Either form Supabase issues: a secret key, `sb_secret_…`, sent on the `apikey` header alone because it is not a JWT, or the legacy `service_role` JWT, sent on `apikey` and as a Bearer as before. |
|
|
719
891
|
| `--yes`, `-y` | Never ask a question. Everything must come from flags or the environment. |
|
|
720
892
|
|
|
721
893
|
`--project-ref` with `--db-password` and `--db-region` builds the session
|
|
@@ -750,6 +922,12 @@ dashboard under Connect → Session pooler, is the form that is never derived.
|
|
|
750
922
|
| `--register` | Register without being asked. `--register-email` sets the address. |
|
|
751
923
|
| `--registry-url <url>` | Where the registration is announced. |
|
|
752
924
|
| `--no-modules` | Leave the modules out. By default `init` installs them, as `ekwo migrate` does — empty schemas until a company enables one. |
|
|
925
|
+
| `--no-company` | Install without a company: schema, every pack, the modules, the first administrator, and no country on the instance row. The flags that only describe a company are refused with it. Then `ekwo company new`, once per company. |
|
|
926
|
+
|
|
927
|
+
`ekwo company new <name>` takes `--country`, `--chart`, `--language`,
|
|
928
|
+
`--currency`, `--fiscal-year` and `--fiscal-year-start` as `init` does, and
|
|
929
|
+
`--as-user <uuid>`: the administrator of the installation it is created as,
|
|
930
|
+
who becomes its owner — the only one, when there is exactly one.
|
|
753
931
|
|
|
754
932
|
Every command takes `--json`; see [what a command answers](#what-a-command-answers---json-and-the-exit-codes).
|
|
755
933
|
`ekwo migrate` takes `--skip-seeds`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "0.
|
|
3
|
-
"migration": "
|
|
2
|
+
"schemaVersion": "0.7.0",
|
|
3
|
+
"migration": "20260922124012",
|
|
4
4
|
"socle": {
|
|
5
5
|
"schema": "public",
|
|
6
6
|
"tables": [
|
|
@@ -599,6 +599,59 @@
|
|
|
599
599
|
}
|
|
600
600
|
]
|
|
601
601
|
},
|
|
602
|
+
{
|
|
603
|
+
"name": "book_imports",
|
|
604
|
+
"columns": [
|
|
605
|
+
{
|
|
606
|
+
"name": "checksum",
|
|
607
|
+
"type": "text"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "company_id",
|
|
611
|
+
"type": "uuid"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "created_at",
|
|
615
|
+
"type": "timestamp with time zone"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "created_by",
|
|
619
|
+
"type": "uuid"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "entry_count",
|
|
623
|
+
"type": "integer"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "file_names",
|
|
627
|
+
"type": "text[]"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "first_number",
|
|
631
|
+
"type": "text"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "id",
|
|
635
|
+
"type": "uuid"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "last_number",
|
|
639
|
+
"type": "text"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "line_count",
|
|
643
|
+
"type": "integer"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "opening_number",
|
|
647
|
+
"type": "text"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"name": "source",
|
|
651
|
+
"type": "text"
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
},
|
|
602
655
|
{
|
|
603
656
|
"name": "capabilities",
|
|
604
657
|
"columns": [
|
|
@@ -4078,10 +4131,18 @@
|
|
|
4078
4131
|
"name": "import_bank_statement",
|
|
4079
4132
|
"arguments": "p_company_id uuid, p_file jsonb, p_source jsonb, p_bank_account_id uuid"
|
|
4080
4133
|
},
|
|
4134
|
+
{
|
|
4135
|
+
"name": "import_books",
|
|
4136
|
+
"arguments": "p_company_id uuid, p_books jsonb, p_dry_run boolean, p_open_years boolean, p_allow_result_accounts boolean"
|
|
4137
|
+
},
|
|
4081
4138
|
{
|
|
4082
4139
|
"name": "import_company",
|
|
4083
4140
|
"arguments": "p_archive jsonb, p_owner_user_id uuid"
|
|
4084
4141
|
},
|
|
4142
|
+
{
|
|
4143
|
+
"name": "import_fiscal_year_for",
|
|
4144
|
+
"arguments": "p_company_id uuid, p_date date"
|
|
4145
|
+
},
|
|
4085
4146
|
{
|
|
4086
4147
|
"name": "init_instance",
|
|
4087
4148
|
"arguments": "p_organization_name text, p_country character, p_edition instance_edition"
|
|
@@ -4569,6 +4630,16 @@
|
|
|
4569
4630
|
"name": "bank_transactions_write",
|
|
4570
4631
|
"command": "all"
|
|
4571
4632
|
},
|
|
4633
|
+
{
|
|
4634
|
+
"table": "book_imports",
|
|
4635
|
+
"name": "book_imports_insert",
|
|
4636
|
+
"command": "insert"
|
|
4637
|
+
},
|
|
4638
|
+
{
|
|
4639
|
+
"table": "book_imports",
|
|
4640
|
+
"name": "book_imports_select",
|
|
4641
|
+
"command": "select"
|
|
4642
|
+
},
|
|
4572
4643
|
{
|
|
4573
4644
|
"table": "capabilities",
|
|
4574
4645
|
"name": "capabilities_select",
|
|
@@ -5959,6 +6030,18 @@
|
|
|
5959
6030
|
"update"
|
|
5960
6031
|
]
|
|
5961
6032
|
},
|
|
6033
|
+
{
|
|
6034
|
+
"name": "book_imports",
|
|
6035
|
+
"anon": [],
|
|
6036
|
+
"authenticated": [
|
|
6037
|
+
"insert",
|
|
6038
|
+
"select"
|
|
6039
|
+
],
|
|
6040
|
+
"service_role": [
|
|
6041
|
+
"insert",
|
|
6042
|
+
"select"
|
|
6043
|
+
]
|
|
6044
|
+
},
|
|
5962
6045
|
{
|
|
5963
6046
|
"name": "capabilities",
|
|
5964
6047
|
"anon": [],
|
|
@@ -7696,6 +7779,17 @@
|
|
|
7696
7779
|
"execute"
|
|
7697
7780
|
]
|
|
7698
7781
|
},
|
|
7782
|
+
{
|
|
7783
|
+
"name": "import_books",
|
|
7784
|
+
"arguments": "p_company_id uuid, p_books jsonb, p_dry_run boolean, p_open_years boolean, p_allow_result_accounts boolean",
|
|
7785
|
+
"anon": [],
|
|
7786
|
+
"authenticated": [
|
|
7787
|
+
"execute"
|
|
7788
|
+
],
|
|
7789
|
+
"service_role": [
|
|
7790
|
+
"execute"
|
|
7791
|
+
]
|
|
7792
|
+
},
|
|
7699
7793
|
{
|
|
7700
7794
|
"name": "import_company",
|
|
7701
7795
|
"arguments": "p_archive jsonb, p_owner_user_id uuid",
|
|
@@ -7707,6 +7801,17 @@
|
|
|
7707
7801
|
"execute"
|
|
7708
7802
|
]
|
|
7709
7803
|
},
|
|
7804
|
+
{
|
|
7805
|
+
"name": "import_fiscal_year_for",
|
|
7806
|
+
"arguments": "p_company_id uuid, p_date date",
|
|
7807
|
+
"anon": [],
|
|
7808
|
+
"authenticated": [
|
|
7809
|
+
"execute"
|
|
7810
|
+
],
|
|
7811
|
+
"service_role": [
|
|
7812
|
+
"execute"
|
|
7813
|
+
]
|
|
7814
|
+
},
|
|
7710
7815
|
{
|
|
7711
7816
|
"name": "init_instance",
|
|
7712
7817
|
"arguments": "p_organization_name text, p_country character, p_edition instance_edition",
|