@hisaabo/cli 0.5.0 → 0.7.5

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.
Files changed (74) hide show
  1. package/.turbo/turbo-typecheck.log +1 -1
  2. package/dist/bin/{audit-trail-5LOCJ7XZ.js → audit-trail-DLSSSM4T.js} +3 -3
  3. package/dist/bin/{categories-64WWZTND.js → categories-63QR6WCV.js} +2 -2
  4. package/dist/bin/{check-slug-FLHHUDYS.js → check-slug-NXO55WKH.js} +2 -2
  5. package/dist/bin/{chunk-FIMJZAS4.js → chunk-7MJDOL6B.js} +18 -1
  6. package/dist/bin/{chunk-4MEL44QX.js → chunk-M42SETRZ.js} +243 -0
  7. package/dist/bin/{chunk-T63VQXNM.js → chunk-ZPYC767N.js} +1 -0
  8. package/dist/bin/{client-5NZ23GML.js → client-T32CIZA3.js} +1 -1
  9. package/dist/bin/{collection-efficiency-U56XNVEE.js → collection-efficiency-T6PWNTZO.js} +3 -3
  10. package/dist/bin/{config-335MN4I7.js → config-V4QFCONN.js} +3 -1
  11. package/dist/bin/{create-RPDEORDD.js → create-NUKHDWLK.js} +2 -2
  12. package/dist/bin/{default-account-AE6EXZZR.js → default-account-JWFPHMRF.js} +2 -2
  13. package/dist/bin/{expenses-5N2QSG54.js → expenses-2UWUZVLI.js} +3 -3
  14. package/dist/bin/{export-QICOQK34.js → export-XSX7WQH7.js} +2 -2
  15. package/dist/bin/{factory-KOCW2AQM.js → factory-BWOKRIP4.js} +3 -3
  16. package/dist/bin/{get-A43QCI2S.js → get-CHNTG3IM.js} +2 -2
  17. package/dist/bin/{get-GWH6S5SJ.js → get-ZSZ6SL3N.js} +3 -3
  18. package/dist/bin/hisaabo.js +901 -59
  19. package/dist/bin/{invitations-P3EEN5WI.js → invitations-H2SL3XAD.js} +2 -2
  20. package/dist/bin/{invite-T3CKX53E.js → invite-EW73UIBE.js} +2 -2
  21. package/dist/bin/{invoice-breakdown-FN5BEFJD.js → invoice-breakdown-XP4QATCF.js} +3 -3
  22. package/dist/bin/{items-2OOCQKVF.js → items-DPD6EFTP.js} +3 -3
  23. package/dist/bin/{items-toggle-SKZWCGJH.js → items-toggle-R4OPSE4W.js} +2 -2
  24. package/dist/bin/{list-T74SN6IR.js → list-KLEHBMQ2.js} +2 -2
  25. package/dist/bin/{list-A2RKI3ZG.js → list-PKHBE475.js} +3 -3
  26. package/dist/bin/{list-NRMBMKMI.js → list-UR7OOJVF.js} +2 -2
  27. package/dist/bin/{members-W2GW3ODT.js → members-XA3TF4IQ.js} +3 -3
  28. package/dist/bin/{monthly-comparison-T34ZFOHL.js → monthly-comparison-OLVS5HEY.js} +3 -3
  29. package/dist/bin/{order-cancel-TI27JYYD.js → order-cancel-MXMJFFRR.js} +2 -2
  30. package/dist/bin/{order-confirm-VMRAMNTD.js → order-confirm-IXU45Q4L.js} +2 -2
  31. package/dist/bin/{order-get-C2RBUR4O.js → order-get-RDXMHLJ7.js} +3 -3
  32. package/dist/bin/{order-update-RE3HATNF.js → order-update-KGIPBEJX.js} +3 -3
  33. package/dist/bin/{payment-modes-WOOT22I7.js → payment-modes-CZL35SVS.js} +3 -3
  34. package/dist/bin/{profit-loss-T4RESJ32.js → profit-loss-M332OSC5.js} +3 -3
  35. package/dist/bin/{receivables-aging-6XMENEWS.js → receivables-aging-OXRHGMBF.js} +3 -3
  36. package/dist/bin/{remove-6QZI4JCY.js → remove-I5HD2Y4K.js} +2 -2
  37. package/dist/bin/{revoke-AVEMPAC7.js → revoke-MFLWGCMP.js} +2 -2
  38. package/dist/bin/{revoke-YUCFZFNR.js → revoke-OC6AOMIZ.js} +2 -2
  39. package/dist/bin/{revoke-all-LFW5WBHO.js → revoke-all-FSAPBB3P.js} +2 -2
  40. package/dist/bin/{revoke-invitation-DTGQRJR4.js → revoke-invitation-JXDPXTOW.js} +2 -2
  41. package/dist/bin/{sales-trend-ZYBRUDUU.js → sales-trend-KK63WNDL.js} +3 -3
  42. package/dist/bin/{sequence-FPOJTI2P.js → sequence-IQ4HUJ3W.js} +2 -2
  43. package/dist/bin/{store-IOB4Y67C.js → store-6QT6HKG2.js} +3 -3
  44. package/dist/bin/{summary-5KYBA4ZO.js → summary-3FTF5B4A.js} +3 -3
  45. package/dist/bin/{top-customers-WSQ2UEJL.js → top-customers-HNYGXBQZ.js} +3 -3
  46. package/dist/bin/{top-items-RWQPDGLN.js → top-items-JUDG3BVW.js} +3 -3
  47. package/dist/bin/{top-outstanding-QAMO2E7Y.js → top-outstanding-WK26ZNE5.js} +3 -3
  48. package/dist/bin/{unpaid-invoices-WB3TK5B4.js → unpaid-invoices-RYFIIIK7.js} +3 -3
  49. package/dist/bin/{untracked-H733MYJL.js → untracked-FAFS3KCK.js} +3 -3
  50. package/dist/bin/{update-TLBUIC5J.js → update-5YSPXIWO.js} +3 -3
  51. package/dist/bin/{update-H6LPO2Z4.js → update-I46XLU77.js} +2 -2
  52. package/dist/bin/{update-JU2X3XU5.js → update-NAW2JWZS.js} +3 -3
  53. package/dist/bin/{update-role-QST7BVFX.js → update-role-5GV42MSN.js} +2 -2
  54. package/dist/bin/{update-settings-Q2EGRLKZ.js → update-settings-KYSQDIEO.js} +2 -2
  55. package/package.json +1 -1
  56. package/src/bin/hisaabo.ts +10 -0
  57. package/src/bin/registrars/bank-recon.ts +34 -0
  58. package/src/bin/registrars/einvoice.ts +46 -0
  59. package/src/bin/registrars/ewb.ts +37 -0
  60. package/src/bin/registrars/gst.ts +17 -1
  61. package/src/bin/registrars/itc.ts +56 -0
  62. package/src/bin/registrars/journal.ts +47 -0
  63. package/src/bin/registrars/report.ts +44 -0
  64. package/src/client.ts +269 -1
  65. package/src/commands/bank-recon/index.ts +127 -0
  66. package/src/commands/einvoice/index.ts +109 -0
  67. package/src/commands/ewb/index.ts +108 -0
  68. package/src/commands/gst/index.ts +79 -1
  69. package/src/commands/invoice/get.ts +9 -1
  70. package/src/commands/itc/index.ts +163 -0
  71. package/src/commands/journal/index.ts +156 -0
  72. package/src/commands/report/index.ts +171 -0
  73. package/src/config.ts +24 -0
  74. package/src/format.ts +1 -0
@@ -0,0 +1,34 @@
1
+ import { Command } from "commander";
2
+ import {
3
+ bankReconImportsCommand,
4
+ bankReconSummaryCommand,
5
+ bankReconRulesCommand,
6
+ } from "../../commands/bank-recon/index.js";
7
+
8
+ export function registerBankReconCommands(program: Command): void {
9
+ const bankRecon = program.command("bank-recon").description("Bank reconciliation");
10
+
11
+ bankRecon
12
+ .command("imports")
13
+ .description("List bank statement imports")
14
+ .option("--json", "JSON output")
15
+ .action(async (opts) => {
16
+ await bankReconImportsCommand({ json: opts.json });
17
+ });
18
+
19
+ bankRecon
20
+ .command("summary <importId>")
21
+ .description("Summary for a bank statement import")
22
+ .option("--json", "JSON output")
23
+ .action(async (importId: string, opts) => {
24
+ await bankReconSummaryCommand(importId, { json: opts.json });
25
+ });
26
+
27
+ bankRecon
28
+ .command("rules")
29
+ .description("List auto-matching rules")
30
+ .option("--json", "JSON output")
31
+ .action(async (opts) => {
32
+ await bankReconRulesCommand({ json: opts.json });
33
+ });
34
+ }
@@ -0,0 +1,46 @@
1
+ import { Command } from "commander";
2
+ import {
3
+ eInvoiceDashboardCommand,
4
+ eInvoiceGenerateCommand,
5
+ eInvoiceCancelCommand,
6
+ eInvoiceRetryCommand,
7
+ } from "../../commands/einvoice/index.js";
8
+
9
+ export function registerEInvoiceCommands(program: Command): void {
10
+ const einvoice = program.command("einvoice").description("E-Invoice (IRP) management");
11
+
12
+ einvoice
13
+ .command("dashboard")
14
+ .description("E-invoice generation summary")
15
+ .option("--json", "JSON output")
16
+ .option("--from <date>", "From date")
17
+ .option("--to <date>", "To date")
18
+ .action(async (opts) => {
19
+ await eInvoiceDashboardCommand(opts);
20
+ });
21
+
22
+ einvoice
23
+ .command("generate <invoiceId>")
24
+ .description("Generate an e-invoice (get IRN from IRP)")
25
+ .option("--json", "JSON output")
26
+ .action(async (invoiceId: string, opts) => {
27
+ await eInvoiceGenerateCommand(invoiceId, { json: opts.json });
28
+ });
29
+
30
+ einvoice
31
+ .command("cancel <invoiceId>")
32
+ .description("Cancel an e-invoice")
33
+ .option("--json", "JSON output")
34
+ .option("--reason <code>", "Cancel reason code (1-4)")
35
+ .action(async (invoiceId: string, opts) => {
36
+ await eInvoiceCancelCommand(invoiceId, { json: opts.json, reason: opts.reason });
37
+ });
38
+
39
+ einvoice
40
+ .command("retry <invoiceId>")
41
+ .description("Retry a failed e-invoice generation")
42
+ .option("--json", "JSON output")
43
+ .action(async (invoiceId: string, opts) => {
44
+ await eInvoiceRetryCommand(invoiceId, { json: opts.json });
45
+ });
46
+ }
@@ -0,0 +1,37 @@
1
+ import { Command } from "commander";
2
+ import {
3
+ ewbDashboardCommand,
4
+ ewbGenerateCommand,
5
+ ewbExpiringCommand,
6
+ } from "../../commands/ewb/index.js";
7
+
8
+ export function registerEwbCommands(program: Command): void {
9
+ const ewb = program.command("ewb").description("E-Way Bill management");
10
+
11
+ ewb
12
+ .command("dashboard")
13
+ .description("E-way bill summary dashboard")
14
+ .option("--json", "JSON output")
15
+ .option("--from <date>", "From date")
16
+ .option("--to <date>", "To date")
17
+ .action(async (opts) => {
18
+ await ewbDashboardCommand(opts);
19
+ });
20
+
21
+ ewb
22
+ .command("generate <invoiceId>")
23
+ .description("Generate an e-way bill for an invoice")
24
+ .option("--json", "JSON output")
25
+ .action(async (invoiceId: string, opts) => {
26
+ await ewbGenerateCommand(invoiceId, { json: opts.json });
27
+ });
28
+
29
+ ewb
30
+ .command("expiring")
31
+ .description("List e-way bills expiring soon")
32
+ .option("--json", "JSON output")
33
+ .option("--days <n>", "Within N days (default: 3)", parseInt)
34
+ .action(async (opts) => {
35
+ await ewbExpiringCommand({ json: opts.json, days: opts.days });
36
+ });
37
+ }
@@ -1,5 +1,5 @@
1
1
  import { Command } from "commander";
2
- import { gstR1Command, gstR3bCommand, gstR1CsvCommand } from "../../commands/gst/index.js";
2
+ import { gstR1Command, gstR3bCommand, gstR1CsvCommand, gstR9Command, gstr2bUploadsCommand } from "../../commands/gst/index.js";
3
3
 
4
4
  export function registerGstCommands(program: Command): void {
5
5
  // ── gst ───────────────────────────────────────────────────────────────────
@@ -38,4 +38,20 @@ export function registerGstCommands(program: Command): void {
38
38
  .action(async (opts) => {
39
39
  await gstR1CsvCommand({ quarter: opts.quarter, month: opts.month, year: opts.year, output: opts.output });
40
40
  });
41
+
42
+ gst
43
+ .command("gstr9 <fy>")
44
+ .description("GSTR-9 annual return (e.g. 2023-24)")
45
+ .option("--json", "JSON output")
46
+ .action(async (fy: string, opts) => {
47
+ await gstR9Command(fy, { json: opts.json });
48
+ });
49
+
50
+ gst
51
+ .command("gstr2b-uploads")
52
+ .description("List GSTR-2B uploaded periods")
53
+ .option("--json", "JSON output")
54
+ .action(async (opts) => {
55
+ await gstr2bUploadsCommand({ json: opts.json });
56
+ });
41
57
  }
@@ -0,0 +1,56 @@
1
+ import { Command } from "commander";
2
+ import {
3
+ itcDashboardCommand,
4
+ itcLedgerCommand,
5
+ itcAgingCommand,
6
+ itcBlockCommand,
7
+ itcUnblockCommand,
8
+ } from "../../commands/itc/index.js";
9
+
10
+ export function registerItcCommands(program: Command): void {
11
+ const itc = program.command("itc").description("Input Tax Credit tracking");
12
+
13
+ itc
14
+ .command("dashboard")
15
+ .description("ITC summary dashboard")
16
+ .option("--json", "JSON output")
17
+ .option("--from <date>", "From date")
18
+ .option("--to <date>", "To date")
19
+ .action(async (opts) => {
20
+ await itcDashboardCommand(opts);
21
+ });
22
+
23
+ itc
24
+ .command("ledger")
25
+ .description("ITC ledger — all eligible purchase credits")
26
+ .option("--json", "JSON output")
27
+ .option("--from <date>", "From date")
28
+ .option("--to <date>", "To date")
29
+ .action(async (opts) => {
30
+ await itcLedgerCommand(opts);
31
+ });
32
+
33
+ itc
34
+ .command("aging")
35
+ .description("ITC aging alerts — credits at risk of reversal")
36
+ .option("--json", "JSON output")
37
+ .action(async (opts) => {
38
+ await itcAgingCommand({ json: opts.json });
39
+ });
40
+
41
+ itc
42
+ .command("block <invoiceId>")
43
+ .description("Mark ITC for an invoice as blocked")
44
+ .option("--json", "JSON output")
45
+ .action(async (invoiceId: string, opts) => {
46
+ await itcBlockCommand(invoiceId, { json: opts.json });
47
+ });
48
+
49
+ itc
50
+ .command("unblock <invoiceId>")
51
+ .description("Mark ITC for an invoice as eligible")
52
+ .option("--json", "JSON output")
53
+ .action(async (invoiceId: string, opts) => {
54
+ await itcUnblockCommand(invoiceId, { json: opts.json });
55
+ });
56
+ }
@@ -0,0 +1,47 @@
1
+ import { Command } from "commander";
2
+ import {
3
+ journalListCommand,
4
+ journalGetCommand,
5
+ journalVoidCommand,
6
+ journalTemplatesCommand,
7
+ } from "../../commands/journal/index.js";
8
+
9
+ export function registerJournalCommands(program: Command): void {
10
+ const journal = program.command("journal").description("Journal entries and templates");
11
+
12
+ journal
13
+ .command("list")
14
+ .description("List journal entries")
15
+ .option("--json", "JSON output")
16
+ .option("--page <n>", "Page number", parseInt)
17
+ .option("--limit <n>", "Results per page", parseInt)
18
+ .option("--from <date>", "From date")
19
+ .option("--to <date>", "To date")
20
+ .action(async (opts) => {
21
+ await journalListCommand(opts);
22
+ });
23
+
24
+ journal
25
+ .command("get <id>")
26
+ .description("Get journal entry details")
27
+ .option("--json", "JSON output")
28
+ .action(async (id: string, opts) => {
29
+ await journalGetCommand(id, { json: opts.json });
30
+ });
31
+
32
+ journal
33
+ .command("void <id>")
34
+ .description("Void a journal entry")
35
+ .option("--json", "JSON output")
36
+ .action(async (id: string, opts) => {
37
+ await journalVoidCommand(id, { json: opts.json });
38
+ });
39
+
40
+ journal
41
+ .command("templates")
42
+ .description("List journal entry templates")
43
+ .option("--json", "JSON output")
44
+ .action(async (opts) => {
45
+ await journalTemplatesCommand({ json: opts.json });
46
+ });
47
+ }
@@ -5,6 +5,8 @@ import {
5
5
  reportSalesRegisterCommand, reportPurchaseRegisterCommand,
6
6
  reportPartyStatementCommand, reportPaymentSummaryCommand,
7
7
  reportCashFlowCommand, reportCollectionEfficiencyCommand,
8
+ reportTrialBalanceCommand, reportBalanceSheetCommand,
9
+ reportCashFlowStatementCommand, reportGeneralLedgerCommand,
8
10
  } from "../../commands/report/index.js";
9
11
 
10
12
  export function registerReportCommands(program: Command): void {
@@ -139,4 +141,46 @@ export function registerReportCommands(program: Command): void {
139
141
  .action(async (opts) => {
140
142
  await reportCollectionEfficiencyCommand(opts);
141
143
  });
144
+
145
+ report
146
+ .command("trial-balance")
147
+ .description("Trial balance report")
148
+ .option("--json", "JSON output")
149
+ .option("--to <date>", "As of date")
150
+ .option("--this-fy", "Current financial year")
151
+ .action(async (opts) => {
152
+ await reportTrialBalanceCommand(opts);
153
+ });
154
+
155
+ report
156
+ .command("balance-sheet")
157
+ .description("Balance sheet")
158
+ .option("--json", "JSON output")
159
+ .option("--to <date>", "As of date")
160
+ .option("--this-fy", "Current financial year")
161
+ .action(async (opts) => {
162
+ await reportBalanceSheetCommand(opts);
163
+ });
164
+
165
+ report
166
+ .command("cash-flow-statement")
167
+ .description("Cash flow statement (operating/investing/financing)")
168
+ .option("--json", "JSON output")
169
+ .option("--from <date>", "From date")
170
+ .option("--to <date>", "To date")
171
+ .option("--this-fy", "Current financial year")
172
+ .action(async (opts) => {
173
+ await reportCashFlowStatementCommand(opts);
174
+ });
175
+
176
+ report
177
+ .command("general-ledger <accountId>")
178
+ .description("General ledger for a specific account")
179
+ .option("--json", "JSON output")
180
+ .option("--from <date>", "From date")
181
+ .option("--to <date>", "To date")
182
+ .option("--this-fy", "Current financial year")
183
+ .action(async (accountId: string, opts) => {
184
+ await reportGeneralLedgerCommand(accountId, opts);
185
+ });
142
186
  }
package/src/client.ts CHANGED
@@ -485,6 +485,12 @@ export class HisaaboClient {
485
485
  gstr1CSV(input: GstReportInput) {
486
486
  return c.query<{ csv: string; filename: string }>("gst.gstr1CSV", input);
487
487
  },
488
+ gstr9(input: { financialYear: string }) {
489
+ return c.query<any>("gst.gstr9", input);
490
+ },
491
+ gstr2bUploads(input?: Record<string, unknown>) {
492
+ return c.query<any>("gstr2b.uploads", input ?? {});
493
+ },
488
494
  };
489
495
  }
490
496
 
@@ -587,6 +593,33 @@ export class HisaaboClient {
587
593
  collectionEfficiency(input: { fromDate: string; toDate: string }) {
588
594
  return c.query<any>("reports.collectionEfficiency", input);
589
595
  },
596
+ trialBalance(input?: Record<string, unknown>) {
597
+ return c.query<any>("reports.trialBalance", input ?? {});
598
+ },
599
+ balanceSheet(input?: Record<string, unknown>) {
600
+ return c.query<any>("reports.balanceSheet", input ?? {});
601
+ },
602
+ profitAndLoss(input?: Record<string, unknown>) {
603
+ return c.query<any>("reports.profitAndLoss", input ?? {});
604
+ },
605
+ cashFlowStatement(input?: Record<string, unknown>) {
606
+ return c.query<any>("reports.cashFlowStatement", input ?? {});
607
+ },
608
+ generalLedger(input: { accountId: string; fromDate?: string; toDate?: string }) {
609
+ return c.query<any>("reports.generalLedger", input);
610
+ },
611
+ comparativeTrialBalance(input?: Record<string, unknown>) {
612
+ return c.query<any>("reports.comparativeTrialBalance", input ?? {});
613
+ },
614
+ comparativeBalanceSheet(input?: Record<string, unknown>) {
615
+ return c.query<any>("reports.comparativeBalanceSheet", input ?? {});
616
+ },
617
+ comparativeProfitAndLoss(input?: Record<string, unknown>) {
618
+ return c.query<any>("reports.comparativeProfitAndLoss", input ?? {});
619
+ },
620
+ tallyExport(input?: Record<string, unknown>) {
621
+ return c.query<any>("reports.tallyExport", input ?? {});
622
+ },
590
623
  };
591
624
  }
592
625
 
@@ -935,6 +968,232 @@ export class HisaaboClient {
935
968
  },
936
969
  };
937
970
  }
971
+
972
+ // ── Journal ───────────────────────────────────────────────────
973
+
974
+ get journal() {
975
+ const c = this;
976
+ return {
977
+ list(input?: Record<string, unknown>) {
978
+ return c.query<any>("journal.list", input ?? {});
979
+ },
980
+ getById(id: string) {
981
+ return c.query<any>("journal.getById", { id });
982
+ },
983
+ create(input: Record<string, unknown>) {
984
+ return c.mutate<any>("journal.create", input);
985
+ },
986
+ update(input: Record<string, unknown>) {
987
+ return c.mutate<any>("journal.update", input);
988
+ },
989
+ void(id: string) {
990
+ return c.mutate<any>("journal.void", { id });
991
+ },
992
+ delete(id: string) {
993
+ return c.mutate<any>("journal.delete", { id });
994
+ },
995
+ templateList() {
996
+ return c.query<any>("journal.templateList");
997
+ },
998
+ templateCreate(input: Record<string, unknown>) {
999
+ return c.mutate<any>("journal.templateCreate", input);
1000
+ },
1001
+ templateDelete(id: string) {
1002
+ return c.mutate<any>("journal.templateDelete", { id });
1003
+ },
1004
+ createFromTemplate(input: Record<string, unknown>) {
1005
+ return c.mutate<any>("journal.createFromTemplate", input);
1006
+ },
1007
+ };
1008
+ }
1009
+
1010
+ // ── ITC ───────────────────────────────────────────────────────
1011
+
1012
+ get itc() {
1013
+ const c = this;
1014
+ return {
1015
+ dashboard(input?: Record<string, unknown>) {
1016
+ return c.query<any>("itc.dashboard", input ?? {});
1017
+ },
1018
+ ledger(input?: Record<string, unknown>) {
1019
+ return c.query<any>("itc.ledger", input ?? {});
1020
+ },
1021
+ agingAlerts() {
1022
+ return c.query<any>("itc.agingAlerts");
1023
+ },
1024
+ markBlocked(input: Record<string, unknown>) {
1025
+ return c.mutate<any>("itc.markBlocked", input);
1026
+ },
1027
+ markEligible(input: Record<string, unknown>) {
1028
+ return c.mutate<any>("itc.markEligible", input);
1029
+ },
1030
+ recordUtilization(input: Record<string, unknown>) {
1031
+ return c.mutate<any>("itc.recordUtilization", input);
1032
+ },
1033
+ gstr3bTable4(input?: Record<string, unknown>) {
1034
+ return c.query<any>("itc.gstr3bTable4", input ?? {});
1035
+ },
1036
+ };
1037
+ }
1038
+
1039
+ // ── Bank Recon ────────────────────────────────────────────────
1040
+
1041
+ get bankRecon() {
1042
+ const c = this;
1043
+ return {
1044
+ importList(input?: Record<string, unknown>) {
1045
+ return c.query<any>("bankRecon.importList", input ?? {});
1046
+ },
1047
+ importDetail(importId: string) {
1048
+ return c.query<any>("bankRecon.importDetail", { importId });
1049
+ },
1050
+ summary(importId: string) {
1051
+ return c.query<any>("bankRecon.summary", { importId });
1052
+ },
1053
+ lines(input: Record<string, unknown>) {
1054
+ return c.query<any>("bankRecon.lines", input);
1055
+ },
1056
+ ruleList() {
1057
+ return c.query<any>("bankRecon.ruleList");
1058
+ },
1059
+ ruleCreate(input: Record<string, unknown>) {
1060
+ return c.mutate<any>("bankRecon.ruleCreate", input);
1061
+ },
1062
+ ruleUpdate(input: Record<string, unknown>) {
1063
+ return c.mutate<any>("bankRecon.ruleUpdate", input);
1064
+ },
1065
+ ruleDelete(id: string) {
1066
+ return c.mutate<any>("bankRecon.ruleDelete", { id });
1067
+ },
1068
+ templateList() {
1069
+ return c.query<any>("bankRecon.templateList");
1070
+ },
1071
+ confirmMatch(input: Record<string, unknown>) {
1072
+ return c.mutate<any>("bankRecon.confirmMatch", input);
1073
+ },
1074
+ manualMatch(input: Record<string, unknown>) {
1075
+ return c.mutate<any>("bankRecon.manualMatch", input);
1076
+ },
1077
+ unmatch(input: Record<string, unknown>) {
1078
+ return c.mutate<any>("bankRecon.unmatch", input);
1079
+ },
1080
+ createExpense(input: Record<string, unknown>) {
1081
+ return c.mutate<any>("bankRecon.createExpense", input);
1082
+ },
1083
+ ignoreLine(input: Record<string, unknown>) {
1084
+ return c.mutate<any>("bankRecon.ignoreLine", input);
1085
+ },
1086
+ };
1087
+ }
1088
+
1089
+ // ── E-Invoice ─────────────────────────────────────────────────
1090
+
1091
+ get eInvoice() {
1092
+ const c = this;
1093
+ return {
1094
+ dashboard(input?: Record<string, unknown>) {
1095
+ return c.query<any>("eInvoice.dashboard", input ?? {});
1096
+ },
1097
+ generate(input: Record<string, unknown>) {
1098
+ return c.mutate<any>("eInvoice.generate", input);
1099
+ },
1100
+ cancel(input: Record<string, unknown>) {
1101
+ return c.mutate<any>("eInvoice.cancel", input);
1102
+ },
1103
+ retryFailed(input: Record<string, unknown>) {
1104
+ return c.mutate<any>("eInvoice.retryFailed", input);
1105
+ },
1106
+ bulkRetry(input?: Record<string, unknown>) {
1107
+ return c.mutate<any>("eInvoice.bulkRetry", input ?? {});
1108
+ },
1109
+ getStatus(invoiceId: string) {
1110
+ return c.query<any>("eInvoice.getStatus", { invoiceId });
1111
+ },
1112
+ };
1113
+ }
1114
+
1115
+ // ── E-Way Bill ────────────────────────────────────────────────
1116
+
1117
+ get ewayBill() {
1118
+ const c = this;
1119
+ return {
1120
+ dashboard(input?: Record<string, unknown>) {
1121
+ return c.query<any>("ewayBill.dashboard", input ?? {});
1122
+ },
1123
+ generate(input: Record<string, unknown>) {
1124
+ return c.mutate<any>("ewayBill.generate", input);
1125
+ },
1126
+ cancel(input: Record<string, unknown>) {
1127
+ return c.mutate<any>("ewayBill.cancel", input);
1128
+ },
1129
+ updateVehicle(input: Record<string, unknown>) {
1130
+ return c.mutate<any>("ewayBill.updateVehicle", input);
1131
+ },
1132
+ extend(input: Record<string, unknown>) {
1133
+ return c.mutate<any>("ewayBill.extend", input);
1134
+ },
1135
+ getByInvoice(invoiceId: string) {
1136
+ return c.query<any>("ewayBill.getByInvoice", { invoiceId });
1137
+ },
1138
+ expiringList(input?: Record<string, unknown>) {
1139
+ return c.query<any>("ewayBill.expiringList", input ?? {});
1140
+ },
1141
+ };
1142
+ }
1143
+
1144
+ // ── GSTR-2B ───────────────────────────────────────────────────
1145
+
1146
+ get gstr2b() {
1147
+ const c = this;
1148
+ return {
1149
+ uploads(input?: Record<string, unknown>) {
1150
+ return c.query<any>("gstr2b.uploads", input ?? {});
1151
+ },
1152
+ records(input: Record<string, unknown>) {
1153
+ return c.query<any>("gstr2b.records", input);
1154
+ },
1155
+ summary(input: Record<string, unknown>) {
1156
+ return c.query<any>("gstr2b.summary", input);
1157
+ },
1158
+ missingInBooks(input: Record<string, unknown>) {
1159
+ return c.query<any>("gstr2b.missingInBooks", input);
1160
+ },
1161
+ missingIn2B(input: Record<string, unknown>) {
1162
+ return c.query<any>("gstr2b.missingIn2B", input);
1163
+ },
1164
+ };
1165
+ }
1166
+
1167
+ // ── Account ───────────────────────────────────────────────────
1168
+
1169
+ get account() {
1170
+ const c = this;
1171
+ return {
1172
+ list(input?: Record<string, unknown>) {
1173
+ return c.query<any>("account.list", input ?? {});
1174
+ },
1175
+ create(input: Record<string, unknown>) {
1176
+ return c.mutate<any>("account.create", input);
1177
+ },
1178
+ update(input: Record<string, unknown>) {
1179
+ return c.mutate<any>("account.update", input);
1180
+ },
1181
+ delete(id: string) {
1182
+ return c.mutate<any>("account.delete", { id });
1183
+ },
1184
+ };
1185
+ }
1186
+
1187
+ // ── System ──────────────────────────────────────────────────────
1188
+
1189
+ get system() {
1190
+ const c = this;
1191
+ return {
1192
+ maintenanceStatus() {
1193
+ return c.query<MaintenanceStatus>("system.maintenanceStatus");
1194
+ },
1195
+ };
1196
+ }
938
1197
  }
939
1198
 
940
1199
  // ── Type definitions ───────────────────────────────────────────────────────
@@ -953,8 +1212,15 @@ export interface AuthUser {
953
1212
  role: string;
954
1213
  }
955
1214
 
1215
+ export interface MaintenanceStatus {
1216
+ enabled: boolean;
1217
+ message: string;
1218
+ startsAt: string | null;
1219
+ endsAt: string | null;
1220
+ }
1221
+
956
1222
  export type InvoiceStatus =
957
- | "draft" | "unfulfilled" | "sent" | "paid" | "partial" | "overdue" | "cancelled";
1223
+ | "draft" | "unfulfilled" | "sent" | "paid" | "partial" | "overdue" | "cancelled" | "adjusted";
958
1224
 
959
1225
  export type DocumentType =
960
1226
  | "invoice" | "quotation" | "credit_note" | "debit_note"
@@ -973,6 +1239,8 @@ export interface InvoiceSummary {
973
1239
  totalAmount: string;
974
1240
  amountPaid: string;
975
1241
  balanceDue: string;
1242
+ totalAdjusted?: string;
1243
+ relatedDocuments?: Array<{ id: string; documentType: string; invoiceNumber: string; totalAmount: string; status: string }>;
976
1244
  }
977
1245
 
978
1246
  export interface LineItem {