@autobusal/admin-api-consumers 1.2.2 → 1.3.1

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/Manage.tsx CHANGED
@@ -42,7 +42,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
42
42
  return <Box />;
43
43
  }
44
44
 
45
- const onSave = (formData: Record<string, any>): void => {
45
+ const onSave = (formData: Record<string, any>, stay?: boolean): void => {
46
46
  Update(formData, {
47
47
  onSuccess: (response) => {
48
48
  success(t('admin_api_consumers.manage.messages.saved', { ns: 'common' }));
@@ -55,7 +55,9 @@ const Manage = ({ url, t }: Props): JSX.Element => {
55
55
  return;
56
56
  }
57
57
 
58
- navigate(url);
58
+ if (!stay) {
59
+ navigate(url);
60
+ }
59
61
  }
60
62
  });
61
63
  };
@@ -164,7 +166,7 @@ const Manage = ({ url, t }: Props): JSX.Element => {
164
166
  pending={ isPendingSave || isPendingDelete }
165
167
  t={ t }
166
168
  actions={
167
- id > 0 ? ['save', 'delete'] : ['save']
169
+ id > 0 ? ['save', 'save_stay', 'delete'] : ['save']
168
170
  }
169
171
  onSave={ onSave }
170
172
  onDelete={ onDelete }
@@ -111,7 +111,7 @@ const ReceivablesManage = ({ url, t }: Props): JSX.Element => {
111
111
  <tbody>
112
112
  { data?.data.map(order => (
113
113
  <tr key={ order.id }>
114
- <td>{ order.hash }</td>
114
+ <td>{ order.order_number }</td>
115
115
  <td>{ order.created_at }</td>
116
116
  <td>{ order.route?.name ?? '-' }</td>
117
117
  <td>{ order.date_travel ?? '-' }</td>
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@autobusal/admin-api-consumers",
3
- "version": "1.2.2",
3
+ "version": "1.3.1",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
- "main": "index.ts"
6
+ "main": "index.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ }
7
10
  }
package/types.ts CHANGED
@@ -48,6 +48,7 @@ export interface ReceivableData {
48
48
  export interface ReceivableOrderData {
49
49
  id: number
50
50
  hash: string
51
+ order_number: string
51
52
  tickets: number
52
53
  date_travel: string
53
54
  amount: number
package/CHANGELOG.md DELETED
@@ -1,58 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.2.2 (2026-08-28)
4
-
5
- - Requests view (?type=requests): the P8 self-serve queue - agents awaiting a partner-API ruling, with Decline per row; approving stays the ordinary manage/save flow. Toggle button beside Receivables.
6
-
7
- ## 1.2.1
8
-
9
- ### Fixed
10
-
11
- - **The token panel updates without a reload** - toggle/revoke/regenerate invalidate the consumer they changed. The button also reads "Generate Token" while no token exists. (Audit ADM-04f.)
12
-
13
- ## 1.2.0
14
-
15
- ### Added
16
-
17
- - **Credit limit on the partner form, running balance on receivables.** A
18
- Mode 1 partner now sells against a running account (obtapi Payments\
19
- External\Charge): every sale debits the net they owe, cancellations
20
- credit it back, and recorded settlements raise it. `credit_limit` is the
21
- floor - 0 means prepaid (deposit before selling), a positive number means
22
- postpaid down to -that-much. The receivables table shows the live
23
- `balance` and `headroom` alongside the statement figures, deliberately
24
- from two books: when they disagree, something needs investigating.
25
-
26
- All notable changes to `@autobusal/admin-api-consumers` are documented here.
27
- This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
28
- and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
29
-
30
- ## [1.1.0] - 2026-07-27
31
-
32
- ### Added
33
-
34
- - Package 3 of the external-routes plan: **receivables reports + settlements**.
35
- `Receivables.tsx` is a per-partner dashboard for a selectable period
36
- (orders/tickets/gross amount/commission/net/settled/outstanding, the
37
- last two accumulated all-time regardless of the period filter).
38
- `ReceivablesManage.tsx` is the per-partner drill-down (ticket-level order
39
- rows, doubling as the CSV/dispute document via a plain browser-download
40
- link to the backend export endpoint - no frontend CSV generation, same
41
- convention as `@autobusal/account-reports`), plus a settlements section
42
- to record/list/delete actual payments received. Backed by obtapi's
43
- `App\Http\Controllers\ApiConsumers\ReportsController`.
44
-
45
- ## [1.0.0] - 2026-07-27
46
-
47
- ### Added
48
-
49
- - Initial release. Admin GUI for third-party API Consumers (agent-type
50
- users authenticating with a Sanctum token against `/api/partners/*`),
51
- replacing the artisan-only `make:user_api` command (obtapi
52
- `App\Http\Controllers\ApiConsumers\AdminController`). Create with
53
- one-time token reveal, edit company/status/operators allowlist/external-
54
- providers allowlist/commission rates, enable-disable without touching
55
- the token, revoke, and regenerate (old token invalidated, new one
56
- revealed once). Deliberately relaxed validation vs the regular agents
57
- admin - no nipt/license/address/mobile/subscription required, since an
58
- API consumer has no storefront presence.