mintly-lib 2.11.0-preview → 2.12.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.
@@ -1,6 +1,7 @@
1
1
  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
+ import type { ResultQuery, ResultReport } from '../core/data/reports/result-response';
4
5
  /**
5
6
  * Relatórios de leitura (módulos novos). Só GETs próprios — compõe o
6
7
  * HttpBaseClient pela conexão, como o FinancialMovementClient. As próximas
@@ -10,5 +11,7 @@ export declare class ReportClient {
10
11
  private readonly http;
11
12
  /** Fluxo de Caixa: caixa hoje, projeção no horizonte, vencimentos e dia crítico. */
12
13
  cashFlow(query: CashFlowQuery, headers: Headers): Promise<ResponseDto<CashFlowReport>>;
14
+ /** Resultado (DRE) do mês: linhas, composição, ponto de equilíbrio, histórico e insights. */
15
+ result(query: ResultQuery, headers: Headers): Promise<ResponseDto<ResultReport>>;
13
16
  }
14
17
  //# 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;AAE5F;;;;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;CAI9F"}
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;AAErF;;;;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;CAIxF"}
@@ -17,6 +17,11 @@ class ReportClient {
17
17
  const response = await this.http.connection.get('/cash-flow', (0, core_1.withHeaders)(headers, { params: query }));
18
18
  return response.data;
19
19
  }
20
+ /** Resultado (DRE) do mês: linhas, composição, ponto de equilíbrio, histórico e insights. */
21
+ async result(query, headers) {
22
+ const response = await this.http.connection.get('/result', (0, core_1.withHeaders)(headers, { params: query }));
23
+ return response.data;
24
+ }
20
25
  }
21
26
  exports.ReportClient = ReportClient;
22
27
  //# 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;AAIhE;;;;GAIG;AACH,MAAa,YAAY;IAAzB;QACmB,SAAI,GAAG,IAAI,iCAAc,CAAiB,SAAS,CAAC,CAAA;IAOvE,CAAC;IALC,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;CACF;AARD,oCAQC"}
1
+ {"version":3,"file":"report-client.js","sourceRoot":"","sources":["../../src/clients/report-client.ts"],"names":[],"mappings":";;;AAAA,kCAAkD;AAClD,sEAAgE;AAKhE;;;;GAIG;AACH,MAAa,YAAY;IAAzB;QACmB,SAAI,GAAG,IAAI,iCAAc,CAAiB,SAAS,CAAC,CAAA;IAavE,CAAC;IAXC,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;CACF;AAdD,oCAcC"}
@@ -1,2 +1,3 @@
1
1
  export * from './cash-flow-response';
2
+ export * from './result-response';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,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"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cash-flow-response"), exports);
18
+ __exportStar(require("./result-response"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/reports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,oDAAiC"}
@@ -0,0 +1,83 @@
1
+ import type { CategoryBehavior } from '../financial/financial-category-schema';
2
+ import type { TaxRegime } from '../restaurant/restaurant-schema';
3
+ /**
4
+ * Contrato de GET /reports/result (fatia 4). DRE simplificado por competência.
5
+ * Número cru; taxas e margens como fração (0.109 = 10,9%). Spec:
6
+ * MintlyApi/specs/modulos-novos/20261012/resultado-dre.md.
7
+ */
8
+ /** `month` em AAAA-MM; padrão o mês corrente no servidor. */
9
+ export interface ResultQuery {
10
+ month?: string;
11
+ }
12
+ export interface ResultLines {
13
+ grossRevenue: number;
14
+ taxes: number;
15
+ netRevenue: number;
16
+ cmv: number;
17
+ grossMargin: number;
18
+ operatingExpenses: number;
19
+ netProfit: number;
20
+ netMargin: number | null;
21
+ }
22
+ export type ResultLineKey = Exclude<keyof ResultLines, 'netMargin'>;
23
+ /** Item da composição das despesas operacionais (categoria ou a taxa de plataforma). */
24
+ export interface OpexItem {
25
+ categoryId: string | null;
26
+ name: string;
27
+ kind: 'labor' | 'opex' | 'platformFee';
28
+ behavior: CategoryBehavior;
29
+ amount: number;
30
+ previousAmount: number;
31
+ delta: number | null;
32
+ revenuePct: number | null;
33
+ }
34
+ export type ResultInsight = {
35
+ kind: 'profitChanged';
36
+ severity: 'positive' | 'warning';
37
+ difference: number;
38
+ previousProfit: number;
39
+ currentProfit: number;
40
+ previousMargin: number | null;
41
+ currentMargin: number | null;
42
+ } | {
43
+ kind: 'largestOpexItem';
44
+ severity: 'warning';
45
+ name: string;
46
+ amount: number;
47
+ revenuePct: number | null;
48
+ } | {
49
+ kind: 'taxRegimeNotConfigured';
50
+ severity: 'info';
51
+ };
52
+ export interface ResultBreakEven {
53
+ fixedCosts: number;
54
+ variableCosts: number;
55
+ /** Sobre a receita líquida: (líquida − variáveis) / líquida. */
56
+ contributionMarginPct: number | null;
57
+ /** Receita BRUTA do mês que paga os custos fixos — o que o dono compara com o que vende. */
58
+ breakEvenRevenue: number | null;
59
+ reachedOnDay: number | null;
60
+ }
61
+ export interface ResultHistoryPoint {
62
+ month: string;
63
+ grossRevenue: number;
64
+ netProfit: number;
65
+ netMargin: number | null;
66
+ }
67
+ export interface ResultReport {
68
+ referenceMonth: string;
69
+ previousMonth: string;
70
+ current: ResultLines;
71
+ previous: ResultLines;
72
+ deltas: Record<ResultLineKey, number | null>;
73
+ tax: {
74
+ regime: TaxRegime | null;
75
+ effectiveRate: number | null;
76
+ meiMonthlyDas: number | null;
77
+ };
78
+ operatingExpenseItems: OpexItem[];
79
+ breakEven: ResultBreakEven;
80
+ history: ResultHistoryPoint[];
81
+ insights: ResultInsight[];
82
+ }
83
+ //# sourceMappingURL=result-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-response.d.ts","sourceRoot":"","sources":["../../../../src/core/data/reports/result-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAEhE;;;;GAIG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,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,wBAAwB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,4FAA4F;IAC5F,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,WAAW,CAAA;IACrB,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IAC5C,GAAG,EAAE;QAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;IAC7F,qBAAqB,EAAE,QAAQ,EAAE,CAAA;IACjC,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=result-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-response.js","sourceRoot":"","sources":["../../../../src/core/data/reports/result-response.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mintly-lib",
3
- "version": "2.11.0-preview",
3
+ "version": "2.12.0-preview",
4
4
  "description": "Mintly Library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",