@withpotter/lib 0.13.0-next.122 → 0.13.0-next.123
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What Olive earns, from the fee ledger (api-next `admin-core`, `overview/earnings`). Every amount is a string of
|
|
3
3
|
* minor units at the currency's own exponent; currencies are never added together.
|
|
4
4
|
*/
|
|
5
|
-
export type EarningsSource = 'payments' | 'cash' | 'settlements' | 'payouts' | 'plans' | 'transfers' | 'fx' | 'lending' | 'other';
|
|
5
|
+
export type EarningsSource = 'online' | 'pos' | 'payments' | 'cash' | 'settlements' | 'payouts' | 'plans' | 'transfers' | 'fx' | 'lending' | 'other';
|
|
6
6
|
export interface EarningsSlice {
|
|
7
7
|
source: EarningsSource;
|
|
8
8
|
label: string;
|
|
@@ -12,6 +12,11 @@ export interface EarningsSlice {
|
|
|
12
12
|
count: number;
|
|
13
13
|
previousFeeMinor: string;
|
|
14
14
|
}
|
|
15
|
+
export interface EarningsDay {
|
|
16
|
+
date: string;
|
|
17
|
+
feeMinor: string;
|
|
18
|
+
providerMinor: string;
|
|
19
|
+
}
|
|
15
20
|
export interface EarningsMerchant {
|
|
16
21
|
tenantId: string | null;
|
|
17
22
|
name: string | null;
|
|
@@ -30,10 +35,9 @@ export interface EarningsCurrency {
|
|
|
30
35
|
/** False when the ledger carries no processor cost for these fees: net equals gross by absence, not by fact. */
|
|
31
36
|
providerCostsRecorded: boolean;
|
|
32
37
|
bySource: EarningsSlice[];
|
|
33
|
-
series:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}[];
|
|
38
|
+
series: EarningsDay[];
|
|
39
|
+
/** The period before, day by day, for the dotted compare line. */
|
|
40
|
+
previousSeries: EarningsDay[];
|
|
37
41
|
topMerchants: EarningsMerchant[];
|
|
38
42
|
}
|
|
39
43
|
export interface EarningsSummary {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/admin-earnings-api.ts"],"sourcesContent":["import { apiFetch } from './api';\nimport { toQuery } from './admin-pos-query';\n\n/**\n * What Olive earns, from the fee ledger (api-next `admin-core`, `overview/earnings`). Every amount is a string of\n * minor units at the currency's own exponent; currencies are never added together.\n */\n\nexport type EarningsSource =\n | 'payments'\n | 'cash'\n | 'settlements'\n | 'payouts'\n | 'plans'\n | 'transfers'\n | 'fx'\n | 'lending'\n | 'other';\n\nexport interface EarningsSlice {\n source: EarningsSource;\n label: string;\n feeMinor: string;\n providerMinor: string;\n netMinor: string;\n count: number;\n previousFeeMinor: string;\n}\n\nexport interface EarningsMerchant {\n tenantId: string | null;\n name: string | null;\n feeMinor: string;\n count: number;\n}\n\nexport interface EarningsCurrency {\n currency: string;\n exponent: number;\n feeMinor: string;\n providerMinor: string;\n netMinor: string;\n previousFeeMinor: string;\n previousProviderMinor: string;\n count: number;\n /** False when the ledger carries no processor cost for these fees: net equals gross by absence, not by fact. */\n providerCostsRecorded: boolean;\n bySource: EarningsSlice[];\n series:
|
|
1
|
+
{"version":3,"sources":["../src/admin-earnings-api.ts"],"sourcesContent":["import { apiFetch } from './api';\nimport { toQuery } from './admin-pos-query';\n\n/**\n * What Olive earns, from the fee ledger (api-next `admin-core`, `overview/earnings`). Every amount is a string of\n * minor units at the currency's own exponent; currencies are never added together.\n */\n\nexport type EarningsSource =\n | 'online'\n | 'pos'\n | 'payments'\n | 'cash'\n | 'settlements'\n | 'payouts'\n | 'plans'\n | 'transfers'\n | 'fx'\n | 'lending'\n | 'other';\n\nexport interface EarningsSlice {\n source: EarningsSource;\n label: string;\n feeMinor: string;\n providerMinor: string;\n netMinor: string;\n count: number;\n previousFeeMinor: string;\n}\n\nexport interface EarningsDay {\n date: string;\n feeMinor: string;\n providerMinor: string;\n}\n\nexport interface EarningsMerchant {\n tenantId: string | null;\n name: string | null;\n feeMinor: string;\n count: number;\n}\n\nexport interface EarningsCurrency {\n currency: string;\n exponent: number;\n feeMinor: string;\n providerMinor: string;\n netMinor: string;\n previousFeeMinor: string;\n previousProviderMinor: string;\n count: number;\n /** False when the ledger carries no processor cost for these fees: net equals gross by absence, not by fact. */\n providerCostsRecorded: boolean;\n bySource: EarningsSlice[];\n series: EarningsDay[];\n /** The period before, day by day, for the dotted compare line. */\n previousSeries: EarningsDay[];\n topMerchants: EarningsMerchant[];\n}\n\nexport interface EarningsSummary {\n from: string;\n to: string;\n previousFrom: string;\n previousTo: string;\n currencies: EarningsCurrency[];\n}\n\nexport interface EarningsRow {\n id: string;\n at: string;\n source: EarningsSource;\n sourceLabel: string;\n description: string;\n merchant: { id: string | null; name: string | null };\n currency: string;\n exponent: number;\n feeMinor: string;\n providerMinor: string;\n netMinor: string;\n}\n\nexport interface EarningsPage {\n rows: EarningsRow[];\n total: number;\n page: number;\n limit: number;\n totalPages: number;\n}\n\nexport interface EarningsFilters {\n startDate?: string;\n endDate?: string;\n source?: string;\n merchantId?: string;\n q?: string;\n page?: number;\n limit?: number;\n}\n\nconst BASE = '/platform-admin/v1/overview/earnings';\n\nexport const adminEarningsApi = {\n summary: (range: { startDate?: string; endDate?: string } = {}) =>\n apiFetch<EarningsSummary>(`${BASE}${toQuery({ ...range })}`),\n\n transactions: (f: EarningsFilters = {}) =>\n apiFetch<EarningsPage>(`${BASE}/transactions${toQuery({ ...f })}`),\n\n /** The newest 5,000 that match, as CSV text. */\n transactionsCsv: (f: EarningsFilters = {}) =>\n apiFetch<string>(\n `${BASE}/transactions.csv${toQuery({ ...f, page: undefined, limit: undefined })}`,\n ),\n};\n"],"mappings":"AAAA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAqGxB,MAAM,OAAO;AAEN,MAAM,mBAAmB;AAAA,EAC9B,SAAS,CAAC,QAAkD,CAAC,MAC3D,SAA0B,GAAG,IAAI,GAAG,QAAQ,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE;AAAA,EAE7D,cAAc,CAAC,IAAqB,CAAC,MACnC,SAAuB,GAAG,IAAI,gBAAgB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;AAAA;AAAA,EAGnE,iBAAiB,CAAC,IAAqB,CAAC,MACtC;AAAA,IACE,GAAG,IAAI,oBAAoB,QAAQ,EAAE,GAAG,GAAG,MAAM,QAAW,OAAO,OAAU,CAAC,CAAC;AAAA,EACjF;AACJ;","names":[]}
|
package/package.json
CHANGED