mintly-lib 2.13.0-preview → 2.14.0-preview
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/build/clients/report-client.d.ts +5 -2
- package/build/clients/report-client.d.ts.map +1 -1
- package/build/clients/report-client.js +7 -2
- package/build/clients/report-client.js.map +1 -1
- package/build/core/data/reports/expenses-response.d.ts +86 -0
- package/build/core/data/reports/expenses-response.d.ts.map +1 -0
- package/build/core/data/reports/expenses-response.js +3 -0
- package/build/core/data/reports/expenses-response.js.map +1 -0
- package/build/core/data/reports/index.d.ts +1 -0
- package/build/core/data/reports/index.d.ts.map +1 -1
- package/build/core/data/reports/index.js +1 -0
- package/build/core/data/reports/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,11 @@ import { ResponseDto } from '../core';
|
|
|
2
2
|
import type { Headers } from '../core/data/request/headers';
|
|
3
3
|
import type { CashFlowQuery, CashFlowReport } from '../core/data/reports/cash-flow-response';
|
|
4
4
|
import type { ResultQuery, ResultReport } from '../core/data/reports/result-response';
|
|
5
|
+
import type { ExpensesQuery, ExpensesReport } from '../core/data/reports/expenses-response';
|
|
5
6
|
/**
|
|
6
7
|
* Relatórios de leitura (módulos novos). Só GETs próprios — compõe o
|
|
7
|
-
* HttpBaseClient pela conexão, como o FinancialMovementClient.
|
|
8
|
-
*
|
|
8
|
+
* HttpBaseClient pela conexão, como o FinancialMovementClient. A Visão Geral
|
|
9
|
+
* entra aqui como método.
|
|
9
10
|
*/
|
|
10
11
|
export declare class ReportClient {
|
|
11
12
|
private readonly http;
|
|
@@ -13,5 +14,7 @@ export declare class ReportClient {
|
|
|
13
14
|
cashFlow(query: CashFlowQuery, headers: Headers): Promise<ResponseDto<CashFlowReport>>;
|
|
14
15
|
/** Resultado (DRE) do mês: linhas, composição, ponto de equilíbrio, histórico e insights. */
|
|
15
16
|
result(query: ResultQuery, headers: Headers): Promise<ResponseDto<ResultReport>>;
|
|
17
|
+
/** Custos & Despesas do mês (fatia A): total, CMV, prime cost, taxa de plataforma e categorias. */
|
|
18
|
+
expenses(query: ExpensesQuery, headers: Headers): Promise<ResponseDto<ExpensesReport>>;
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=report-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-client.d.ts","sourceRoot":"","sources":["../../src/clients/report-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,SAAS,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"report-client.d.ts","sourceRoot":"","sources":["../../src/clients/report-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,SAAS,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAE3F;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgD;IAErE,oFAAoF;IAC9E,QAAQ,CAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAK7F,6FAA6F;IACvF,MAAM,CAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAKvF,mGAAmG;IAC7F,QAAQ,CAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;CAI9F"}
|
|
@@ -5,8 +5,8 @@ const core_1 = require("../core");
|
|
|
5
5
|
const http_base_client_1 = require("../core/client/http-base-client");
|
|
6
6
|
/**
|
|
7
7
|
* Relatórios de leitura (módulos novos). Só GETs próprios — compõe o
|
|
8
|
-
* HttpBaseClient pela conexão, como o FinancialMovementClient.
|
|
9
|
-
*
|
|
8
|
+
* HttpBaseClient pela conexão, como o FinancialMovementClient. A Visão Geral
|
|
9
|
+
* entra aqui como método.
|
|
10
10
|
*/
|
|
11
11
|
class ReportClient {
|
|
12
12
|
constructor() {
|
|
@@ -22,6 +22,11 @@ class ReportClient {
|
|
|
22
22
|
const response = await this.http.connection.get('/result', (0, core_1.withHeaders)(headers, { params: query }));
|
|
23
23
|
return response.data;
|
|
24
24
|
}
|
|
25
|
+
/** Custos & Despesas do mês (fatia A): total, CMV, prime cost, taxa de plataforma e categorias. */
|
|
26
|
+
async expenses(query, headers) {
|
|
27
|
+
const response = await this.http.connection.get('/expenses', (0, core_1.withHeaders)(headers, { params: query }));
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
exports.ReportClient = ReportClient;
|
|
27
32
|
//# sourceMappingURL=report-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-client.js","sourceRoot":"","sources":["../../src/clients/report-client.ts"],"names":[],"mappings":";;;AAAA,kCAAkD;AAClD,sEAAgE;
|
|
1
|
+
{"version":3,"file":"report-client.js","sourceRoot":"","sources":["../../src/clients/report-client.ts"],"names":[],"mappings":";;;AAAA,kCAAkD;AAClD,sEAAgE;AAMhE;;;;GAIG;AACH,MAAa,YAAY;IAAzB;QACmB,SAAI,GAAG,IAAI,iCAAc,CAAiB,SAAS,CAAC,CAAA;IAmBvE,CAAC;IAjBC,oFAAoF;IACpF,KAAK,CAAC,QAAQ,CAAE,KAAoB,EAAE,OAAgB;QACpD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAA8B,YAAY,EAAE,IAAA,kBAAW,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;QACnI,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED,6FAA6F;IAC7F,KAAK,CAAC,MAAM,CAAE,KAAkB,EAAE,OAAgB;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAA4B,SAAS,EAAE,IAAA,kBAAW,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;QAC9H,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED,mGAAmG;IACnG,KAAK,CAAC,QAAQ,CAAE,KAAoB,EAAE,OAAgB;QACpD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAA8B,WAAW,EAAE,IAAA,kBAAW,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;QAClI,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF;AApBD,oCAoBC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { CategoryBehavior, DreGroup } from '../financial/financial-category-schema';
|
|
2
|
+
import type { MovementChannel } from '../financial/financial-movement-schema';
|
|
3
|
+
/**
|
|
4
|
+
* Contrato de GET /reports/expenses (fatia 6). Por competência; número cru;
|
|
5
|
+
* percentuais e variações como fração (0.311 = 31,1%). Spec:
|
|
6
|
+
* MintlyApi/specs/modulos-novos/20261013/custos-despesas.md.
|
|
7
|
+
*/
|
|
8
|
+
/** `month` em AAAA-MM (padrão: mês corrente). Sem `channel` = Geral. */
|
|
9
|
+
export interface ExpensesQuery {
|
|
10
|
+
month?: string;
|
|
11
|
+
channel?: MovementChannel.DineIn | MovementChannel.Delivery;
|
|
12
|
+
}
|
|
13
|
+
export type ExpenseItemKind = 'category' | 'platformFee';
|
|
14
|
+
/** Linha de "Para onde está indo seu dinheiro": categoria ou taxa de uma conta de plataforma. */
|
|
15
|
+
export interface ExpenseItem {
|
|
16
|
+
/** categoryId, ou `platformFee:<accountId>`. */
|
|
17
|
+
key: string;
|
|
18
|
+
kind: ExpenseItemKind;
|
|
19
|
+
categoryId: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
behavior: CategoryBehavior;
|
|
22
|
+
dreGroup: DreGroup | null;
|
|
23
|
+
amount: number;
|
|
24
|
+
previous: number;
|
|
25
|
+
/** Média de M−1..M−3 (desde o primeiro lançamento); `null` sem mês elegível. */
|
|
26
|
+
average3: number | null;
|
|
27
|
+
deltaPrevious: number | null;
|
|
28
|
+
deltaAverage3: number | null;
|
|
29
|
+
pctOfRevenue: number | null;
|
|
30
|
+
}
|
|
31
|
+
export interface ExpensesTotal {
|
|
32
|
+
current: number;
|
|
33
|
+
previous: number;
|
|
34
|
+
average3: number | null;
|
|
35
|
+
deltaPrevious: number | null;
|
|
36
|
+
deltaAverage3: number | null;
|
|
37
|
+
}
|
|
38
|
+
export interface ExpensesPlatformFee {
|
|
39
|
+
amount: number;
|
|
40
|
+
previous: number;
|
|
41
|
+
deltaPrevious: number | null;
|
|
42
|
+
/** Σ receita bruta de canal efetivo delivery no mês. */
|
|
43
|
+
deliveryRevenue: number;
|
|
44
|
+
pctOfDelivery: number | null;
|
|
45
|
+
}
|
|
46
|
+
export interface ExpensesReport {
|
|
47
|
+
referenceMonth: string;
|
|
48
|
+
previousMonth: string;
|
|
49
|
+
channel: MovementChannel | null;
|
|
50
|
+
revenue: {
|
|
51
|
+
current: number;
|
|
52
|
+
previous: number;
|
|
53
|
+
};
|
|
54
|
+
total: ExpensesTotal;
|
|
55
|
+
cmv: {
|
|
56
|
+
amount: number;
|
|
57
|
+
pctOfRevenue: number | null;
|
|
58
|
+
target: {
|
|
59
|
+
min: number;
|
|
60
|
+
max: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
primeCost: {
|
|
64
|
+
amount: number;
|
|
65
|
+
cmv: number;
|
|
66
|
+
labor: number;
|
|
67
|
+
pctOfRevenue: number | null;
|
|
68
|
+
targetMax: number;
|
|
69
|
+
};
|
|
70
|
+
platformFee: ExpensesPlatformFee;
|
|
71
|
+
/** Misto separado (a tela mostra "Misto"). */
|
|
72
|
+
byBehavior: {
|
|
73
|
+
fixed: number;
|
|
74
|
+
variable: number;
|
|
75
|
+
mixed: number;
|
|
76
|
+
};
|
|
77
|
+
items: ExpenseItem[];
|
|
78
|
+
/** Só com `channel`: Σ saídas de canal efetivo `shared` que ficaram de fora. */
|
|
79
|
+
sharedExcluded: number | null;
|
|
80
|
+
/** 6 meses, do mais antigo ao mês de referência. */
|
|
81
|
+
history: {
|
|
82
|
+
month: string;
|
|
83
|
+
total: number;
|
|
84
|
+
}[];
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=expenses-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expenses-response.d.ts","sourceRoot":"","sources":["../../../../src/core/data/reports/expenses-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAA;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAE7E;;;;GAIG;AAEH,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAA;CAC5D;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,aAAa,CAAA;AAExD,iGAAiG;AACjG,MAAM,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;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;IAC1F,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IACzG,WAAW,EAAE,mBAAmB,CAAA;IAChC,8CAA8C;IAC9C,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9D,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,gFAAgF;IAChF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,oDAAoD;IACpD,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expenses-response.js","sourceRoot":"","sources":["../../../../src/core/data/reports/expenses-response.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./cash-flow-response"), exports);
|
|
18
18
|
__exportStar(require("./result-response"), exports);
|
|
19
|
+
__exportStar(require("./expenses-response"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,oDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,oDAAiC;AACjC,sDAAmC"}
|