@wirecat/cli-core 0.572.0 → 0.573.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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ shape of this file.
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 0.573.0 — 05.11.2026
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The owner sets a confirmed payment's wrong split right.** `store.finance.unallocate` now takes an allocation back
|
|
15
|
+
from a confirmed payment too, when `by` is the owner; `allocate` then puts the right amounts on, under the same
|
|
16
|
+
over-payment, over-invoice and currency rules, and the invoices' statuses follow. A bot is still refused on a
|
|
17
|
+
confirmed payment (`finance.owner-only`); a rejected or deleted payment is `finance.unallocate`.
|
|
18
|
+
|
|
10
19
|
## 0.572.0 — 05.11.2026
|
|
11
20
|
|
|
12
21
|
### Changed — may break callers
|
package/dist/errors/reasons.js
CHANGED
|
@@ -181,7 +181,7 @@ const OTHERS = [
|
|
|
181
181
|
validation("finance.ref", "the reference names no invoice or payment"),
|
|
182
182
|
validation("finance.status", "the invoice's status does not allow this"),
|
|
183
183
|
validation("finance.total", "the invoice's total is not the sum of its lines"),
|
|
184
|
-
validation("finance.unallocate", "
|
|
184
|
+
validation("finance.unallocate", "a rejected or deleted payment's allocations are not taken back"),
|
|
185
185
|
validation("record.entity", "the invoice or payment the record stands for was refused"),
|
|
186
186
|
["record.map-owner-only", "permission_error", "only the owner says which entity a source record is"],
|
|
187
187
|
validation("record.map-type", "a record maps only to an entity of its own type"),
|
|
@@ -181,8 +181,8 @@ export interface FinanceStore {
|
|
|
181
181
|
by: Author;
|
|
182
182
|
}): Promise<Allocation>;
|
|
183
183
|
/**
|
|
184
|
-
* Takes one allocation back
|
|
185
|
-
*
|
|
184
|
+
* Takes one allocation back, under the same rule as `allocate`: the owner from any payment, confirmed too, to set a
|
|
185
|
+
* wrong split right; a bot only from one it proposed that is still proposed.
|
|
186
186
|
*/
|
|
187
187
|
unallocate(input: {
|
|
188
188
|
payment: string;
|
|
@@ -501,8 +501,8 @@ export const financeOperationsOver = (context) => {
|
|
|
501
501
|
const row = rowOf(payment, "payment");
|
|
502
502
|
const ref = `payment:${row.id}`;
|
|
503
503
|
mayAllocate(row, by);
|
|
504
|
-
if (row.review
|
|
505
|
-
refuse(`${ref} is ${row.deleted_at != null ? "deleted" :
|
|
504
|
+
if (row.review === "rejected" || row.deleted_at != null)
|
|
505
|
+
refuse(`${ref} is ${row.deleted_at != null ? "deleted" : "rejected"}; only a proposed or confirmed payment's ` +
|
|
506
506
|
"allocations are taken back", "finance.unallocate");
|
|
507
507
|
const target = rowOf(invoice, "invoice");
|
|
508
508
|
write(database, () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.573.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|