@happyvertical/smrt-ledgers 0.30.0

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.
@@ -0,0 +1,1561 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1782177087173,
4
+ "packageName": "@happyvertical/smrt-ledgers",
5
+ "packageVersion": "0.30.0",
6
+ "objects": {
7
+ "@happyvertical/smrt-ledgers:AccountCollection": {
8
+ "name": "accountcollection",
9
+ "className": "AccountCollection",
10
+ "qualifiedName": "@happyvertical/smrt-ledgers:AccountCollection",
11
+ "collection": "accounts",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/collections/Accounts.ts",
13
+ "packageName": "@happyvertical/smrt-ledgers",
14
+ "fields": {},
15
+ "methods": {
16
+ "findByNumber": {
17
+ "name": "findByNumber",
18
+ "async": true,
19
+ "parameters": [
20
+ {
21
+ "name": "number",
22
+ "type": "string",
23
+ "optional": false
24
+ }
25
+ ],
26
+ "returnType": "Promise<Account | null>",
27
+ "isStatic": false,
28
+ "isPublic": true
29
+ },
30
+ "findByType": {
31
+ "name": "findByType",
32
+ "async": true,
33
+ "parameters": [
34
+ {
35
+ "name": "type",
36
+ "type": "AccountType",
37
+ "optional": false
38
+ }
39
+ ],
40
+ "returnType": "Promise<Account[]>",
41
+ "isStatic": false,
42
+ "isPublic": true
43
+ },
44
+ "findActive": {
45
+ "name": "findActive",
46
+ "async": true,
47
+ "parameters": [],
48
+ "returnType": "Promise<Account[]>",
49
+ "isStatic": false,
50
+ "isPublic": true
51
+ },
52
+ "findTopLevel": {
53
+ "name": "findTopLevel",
54
+ "async": true,
55
+ "parameters": [],
56
+ "returnType": "Promise<Account[]>",
57
+ "isStatic": false,
58
+ "isPublic": true
59
+ },
60
+ "findChildren": {
61
+ "name": "findChildren",
62
+ "async": true,
63
+ "parameters": [
64
+ {
65
+ "name": "parentId",
66
+ "type": "string",
67
+ "optional": false
68
+ }
69
+ ],
70
+ "returnType": "Promise<Account[]>",
71
+ "isStatic": false,
72
+ "isPublic": true
73
+ },
74
+ "getTree": {
75
+ "name": "getTree",
76
+ "async": true,
77
+ "parameters": [],
78
+ "returnType": "Promise<AccountTree>",
79
+ "isStatic": false,
80
+ "isPublic": true
81
+ },
82
+ "getOrCreateByNumber": {
83
+ "name": "getOrCreateByNumber",
84
+ "async": true,
85
+ "parameters": [
86
+ {
87
+ "name": "number",
88
+ "type": "string",
89
+ "optional": false
90
+ },
91
+ {
92
+ "name": "defaults",
93
+ "type": "Partial<object>",
94
+ "optional": true
95
+ }
96
+ ],
97
+ "returnType": "Promise<Account>",
98
+ "isStatic": false,
99
+ "isPublic": true
100
+ },
101
+ "groupByType": {
102
+ "name": "groupByType",
103
+ "async": true,
104
+ "parameters": [],
105
+ "returnType": "Promise<Record<AccountType, Account[]>>",
106
+ "isStatic": false,
107
+ "isPublic": true
108
+ },
109
+ "getDescendants": {
110
+ "name": "getDescendants",
111
+ "async": true,
112
+ "parameters": [
113
+ {
114
+ "name": "accountId",
115
+ "type": "string",
116
+ "optional": false
117
+ }
118
+ ],
119
+ "returnType": "Promise<Account[]>",
120
+ "isStatic": false,
121
+ "isPublic": true
122
+ },
123
+ "findByTenant": {
124
+ "name": "findByTenant",
125
+ "async": true,
126
+ "parameters": [
127
+ {
128
+ "name": "tenantId",
129
+ "type": "string",
130
+ "optional": false
131
+ }
132
+ ],
133
+ "returnType": "Promise<Account[]>",
134
+ "isStatic": false,
135
+ "isPublic": true
136
+ },
137
+ "findGlobal": {
138
+ "name": "findGlobal",
139
+ "async": true,
140
+ "parameters": [],
141
+ "returnType": "Promise<Account[]>",
142
+ "isStatic": false,
143
+ "isPublic": true
144
+ },
145
+ "findWithGlobals": {
146
+ "name": "findWithGlobals",
147
+ "async": true,
148
+ "parameters": [
149
+ {
150
+ "name": "tenantId",
151
+ "type": "string",
152
+ "optional": false
153
+ }
154
+ ],
155
+ "returnType": "Promise<Account[]>",
156
+ "isStatic": false,
157
+ "isPublic": true
158
+ }
159
+ },
160
+ "decoratorConfig": {},
161
+ "extends": "SmrtCollection",
162
+ "extendsTypeArg": "Account",
163
+ "exportName": "AccountCollection",
164
+ "collectionExportName": "AccountCollectionCollection",
165
+ "schema": {
166
+ "tableName": "account_collections",
167
+ "ddl": "CREATE TABLE IF NOT EXISTS \"account_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
168
+ "columns": {
169
+ "id": {
170
+ "type": "UUID",
171
+ "primaryKey": true,
172
+ "referenceKind": "id",
173
+ "notNull": true
174
+ },
175
+ "slug": {
176
+ "type": "TEXT",
177
+ "notNull": true
178
+ },
179
+ "context": {
180
+ "type": "TEXT",
181
+ "notNull": true,
182
+ "default": ""
183
+ },
184
+ "created_at": {
185
+ "type": "TIMESTAMP",
186
+ "notNull": true,
187
+ "default": "current_timestamp"
188
+ },
189
+ "updated_at": {
190
+ "type": "TIMESTAMP",
191
+ "notNull": true,
192
+ "default": "current_timestamp"
193
+ }
194
+ },
195
+ "indexes": [
196
+ {
197
+ "name": "account_collections_id_idx",
198
+ "columns": [
199
+ "id"
200
+ ]
201
+ },
202
+ {
203
+ "name": "account_collections_slug_context_idx",
204
+ "columns": [
205
+ "slug",
206
+ "context"
207
+ ],
208
+ "unique": true
209
+ }
210
+ ],
211
+ "version": "3802b462"
212
+ }
213
+ },
214
+ "@happyvertical/smrt-ledgers:JournalEntryCollection": {
215
+ "name": "journalentrycollection",
216
+ "className": "JournalEntryCollection",
217
+ "qualifiedName": "@happyvertical/smrt-ledgers:JournalEntryCollection",
218
+ "collection": "journalentries",
219
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/collections/JournalEntries.ts",
220
+ "packageName": "@happyvertical/smrt-ledgers",
221
+ "fields": {},
222
+ "methods": {
223
+ "findByJournal": {
224
+ "name": "findByJournal",
225
+ "async": true,
226
+ "parameters": [
227
+ {
228
+ "name": "journalId",
229
+ "type": "string",
230
+ "optional": false
231
+ }
232
+ ],
233
+ "returnType": "Promise<JournalEntry[]>",
234
+ "isStatic": false,
235
+ "isPublic": true
236
+ },
237
+ "findByAccount": {
238
+ "name": "findByAccount",
239
+ "async": true,
240
+ "parameters": [
241
+ {
242
+ "name": "accountId",
243
+ "type": "string",
244
+ "optional": false
245
+ }
246
+ ],
247
+ "returnType": "Promise<JournalEntry[]>",
248
+ "isStatic": false,
249
+ "isPublic": true
250
+ },
251
+ "getAccountBalance": {
252
+ "name": "getAccountBalance",
253
+ "async": true,
254
+ "parameters": [
255
+ {
256
+ "name": "accountId",
257
+ "type": "string",
258
+ "optional": false
259
+ },
260
+ {
261
+ "name": "asOfDate",
262
+ "type": "Date",
263
+ "optional": true
264
+ }
265
+ ],
266
+ "returnType": "Promise<number>",
267
+ "isStatic": false,
268
+ "isPublic": true
269
+ },
270
+ "getTrialBalance": {
271
+ "name": "getTrialBalance",
272
+ "async": true,
273
+ "parameters": [
274
+ {
275
+ "name": "asOfDate",
276
+ "type": "Date",
277
+ "optional": true
278
+ }
279
+ ],
280
+ "returnType": "Promise<TrialBalanceRow[]>",
281
+ "isStatic": false,
282
+ "isPublic": true
283
+ },
284
+ "getTotalsForDateRange": {
285
+ "name": "getTotalsForDateRange",
286
+ "async": true,
287
+ "parameters": [
288
+ {
289
+ "name": "start",
290
+ "type": "Date",
291
+ "optional": false
292
+ },
293
+ {
294
+ "name": "end",
295
+ "type": "Date",
296
+ "optional": false
297
+ }
298
+ ],
299
+ "returnType": "Promise<object>",
300
+ "isStatic": false,
301
+ "isPublic": true
302
+ },
303
+ "findByAccounts": {
304
+ "name": "findByAccounts",
305
+ "async": true,
306
+ "parameters": [
307
+ {
308
+ "name": "accountIds",
309
+ "type": "string[]",
310
+ "optional": false
311
+ }
312
+ ],
313
+ "returnType": "Promise<JournalEntry[]>",
314
+ "isStatic": false,
315
+ "isPublic": true
316
+ },
317
+ "getAccountLedger": {
318
+ "name": "getAccountLedger",
319
+ "async": true,
320
+ "parameters": [
321
+ {
322
+ "name": "accountId",
323
+ "type": "string",
324
+ "optional": false
325
+ }
326
+ ],
327
+ "returnType": "Promise<Array<object>>",
328
+ "isStatic": false,
329
+ "isPublic": true
330
+ },
331
+ "findByTenant": {
332
+ "name": "findByTenant",
333
+ "async": true,
334
+ "parameters": [
335
+ {
336
+ "name": "tenantId",
337
+ "type": "string",
338
+ "optional": false
339
+ }
340
+ ],
341
+ "returnType": "Promise<JournalEntry[]>",
342
+ "isStatic": false,
343
+ "isPublic": true
344
+ },
345
+ "findGlobal": {
346
+ "name": "findGlobal",
347
+ "async": true,
348
+ "parameters": [],
349
+ "returnType": "Promise<JournalEntry[]>",
350
+ "isStatic": false,
351
+ "isPublic": true
352
+ },
353
+ "findWithGlobals": {
354
+ "name": "findWithGlobals",
355
+ "async": true,
356
+ "parameters": [
357
+ {
358
+ "name": "tenantId",
359
+ "type": "string",
360
+ "optional": false
361
+ }
362
+ ],
363
+ "returnType": "Promise<JournalEntry[]>",
364
+ "isStatic": false,
365
+ "isPublic": true
366
+ }
367
+ },
368
+ "decoratorConfig": {},
369
+ "extends": "SmrtCollection",
370
+ "extendsTypeArg": "JournalEntry",
371
+ "exportName": "JournalEntryCollection",
372
+ "collectionExportName": "JournalEntryCollectionCollection",
373
+ "schema": {
374
+ "tableName": "journal_entry_collections",
375
+ "ddl": "CREATE TABLE IF NOT EXISTS \"journal_entry_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
376
+ "columns": {
377
+ "id": {
378
+ "type": "UUID",
379
+ "primaryKey": true,
380
+ "referenceKind": "id",
381
+ "notNull": true
382
+ },
383
+ "slug": {
384
+ "type": "TEXT",
385
+ "notNull": true
386
+ },
387
+ "context": {
388
+ "type": "TEXT",
389
+ "notNull": true,
390
+ "default": ""
391
+ },
392
+ "created_at": {
393
+ "type": "TIMESTAMP",
394
+ "notNull": true,
395
+ "default": "current_timestamp"
396
+ },
397
+ "updated_at": {
398
+ "type": "TIMESTAMP",
399
+ "notNull": true,
400
+ "default": "current_timestamp"
401
+ }
402
+ },
403
+ "indexes": [
404
+ {
405
+ "name": "journal_entry_collections_id_idx",
406
+ "columns": [
407
+ "id"
408
+ ]
409
+ },
410
+ {
411
+ "name": "journal_entry_collections_slug_context_idx",
412
+ "columns": [
413
+ "slug",
414
+ "context"
415
+ ],
416
+ "unique": true
417
+ }
418
+ ],
419
+ "version": "2cb6f73a"
420
+ }
421
+ },
422
+ "@happyvertical/smrt-ledgers:JournalCollection": {
423
+ "name": "journalcollection",
424
+ "className": "JournalCollection",
425
+ "qualifiedName": "@happyvertical/smrt-ledgers:JournalCollection",
426
+ "collection": "journals",
427
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/collections/Journals.ts",
428
+ "packageName": "@happyvertical/smrt-ledgers",
429
+ "fields": {},
430
+ "methods": {
431
+ "findByNumber": {
432
+ "name": "findByNumber",
433
+ "async": true,
434
+ "parameters": [
435
+ {
436
+ "name": "number",
437
+ "type": "string",
438
+ "optional": false
439
+ }
440
+ ],
441
+ "returnType": "Promise<Journal | null>",
442
+ "isStatic": false,
443
+ "isPublic": true
444
+ },
445
+ "findByDateRange": {
446
+ "name": "findByDateRange",
447
+ "async": true,
448
+ "parameters": [
449
+ {
450
+ "name": "start",
451
+ "type": "Date",
452
+ "optional": false
453
+ },
454
+ {
455
+ "name": "end",
456
+ "type": "Date",
457
+ "optional": false
458
+ }
459
+ ],
460
+ "returnType": "Promise<Journal[]>",
461
+ "isStatic": false,
462
+ "isPublic": true
463
+ },
464
+ "findBySource": {
465
+ "name": "findBySource",
466
+ "async": true,
467
+ "parameters": [
468
+ {
469
+ "name": "sourceModule",
470
+ "type": "string",
471
+ "optional": false
472
+ }
473
+ ],
474
+ "returnType": "Promise<Journal[]>",
475
+ "isStatic": false,
476
+ "isPublic": true
477
+ },
478
+ "findByStatus": {
479
+ "name": "findByStatus",
480
+ "async": true,
481
+ "parameters": [
482
+ {
483
+ "name": "status",
484
+ "type": "JournalStatus",
485
+ "optional": false
486
+ }
487
+ ],
488
+ "returnType": "Promise<Journal[]>",
489
+ "isStatic": false,
490
+ "isPublic": true
491
+ },
492
+ "findDrafts": {
493
+ "name": "findDrafts",
494
+ "async": true,
495
+ "parameters": [],
496
+ "returnType": "Promise<Journal[]>",
497
+ "isStatic": false,
498
+ "isPublic": true
499
+ },
500
+ "findPosted": {
501
+ "name": "findPosted",
502
+ "async": true,
503
+ "parameters": [],
504
+ "returnType": "Promise<Journal[]>",
505
+ "isStatic": false,
506
+ "isPublic": true
507
+ },
508
+ "createWithEntries": {
509
+ "name": "createWithEntries",
510
+ "async": true,
511
+ "parameters": [
512
+ {
513
+ "name": "data",
514
+ "type": "CreateJournalData",
515
+ "optional": false
516
+ }
517
+ ],
518
+ "returnType": "Promise<Journal>",
519
+ "isStatic": false,
520
+ "isPublic": true
521
+ },
522
+ "post": {
523
+ "name": "post",
524
+ "async": true,
525
+ "parameters": [
526
+ {
527
+ "name": "journalId",
528
+ "type": "string",
529
+ "optional": false
530
+ }
531
+ ],
532
+ "returnType": "Promise<Journal>",
533
+ "isStatic": false,
534
+ "isPublic": true
535
+ },
536
+ "void": {
537
+ "name": "void",
538
+ "async": true,
539
+ "parameters": [
540
+ {
541
+ "name": "journalId",
542
+ "type": "string",
543
+ "optional": false
544
+ },
545
+ {
546
+ "name": "reason",
547
+ "type": "string",
548
+ "optional": false
549
+ }
550
+ ],
551
+ "returnType": "Promise<Journal>",
552
+ "isStatic": false,
553
+ "isPublic": true
554
+ },
555
+ "findBySourceRef": {
556
+ "name": "findBySourceRef",
557
+ "async": true,
558
+ "parameters": [
559
+ {
560
+ "name": "sourceRef",
561
+ "type": "string",
562
+ "optional": false
563
+ }
564
+ ],
565
+ "returnType": "Promise<Journal[]>",
566
+ "isStatic": false,
567
+ "isPublic": true
568
+ },
569
+ "findByMonth": {
570
+ "name": "findByMonth",
571
+ "async": true,
572
+ "parameters": [
573
+ {
574
+ "name": "year",
575
+ "type": "number",
576
+ "optional": false
577
+ },
578
+ {
579
+ "name": "month",
580
+ "type": "number",
581
+ "optional": false
582
+ }
583
+ ],
584
+ "returnType": "Promise<Journal[]>",
585
+ "isStatic": false,
586
+ "isPublic": true
587
+ },
588
+ "findByTenant": {
589
+ "name": "findByTenant",
590
+ "async": true,
591
+ "parameters": [
592
+ {
593
+ "name": "tenantId",
594
+ "type": "string",
595
+ "optional": false
596
+ }
597
+ ],
598
+ "returnType": "Promise<Journal[]>",
599
+ "isStatic": false,
600
+ "isPublic": true
601
+ },
602
+ "findGlobal": {
603
+ "name": "findGlobal",
604
+ "async": true,
605
+ "parameters": [],
606
+ "returnType": "Promise<Journal[]>",
607
+ "isStatic": false,
608
+ "isPublic": true
609
+ },
610
+ "findWithGlobals": {
611
+ "name": "findWithGlobals",
612
+ "async": true,
613
+ "parameters": [
614
+ {
615
+ "name": "tenantId",
616
+ "type": "string",
617
+ "optional": false
618
+ }
619
+ ],
620
+ "returnType": "Promise<Journal[]>",
621
+ "isStatic": false,
622
+ "isPublic": true
623
+ }
624
+ },
625
+ "decoratorConfig": {},
626
+ "extends": "SmrtCollection",
627
+ "extendsTypeArg": "Journal",
628
+ "exportName": "JournalCollection",
629
+ "collectionExportName": "JournalCollectionCollection",
630
+ "schema": {
631
+ "tableName": "journal_collections",
632
+ "ddl": "CREATE TABLE IF NOT EXISTS \"journal_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
633
+ "columns": {
634
+ "id": {
635
+ "type": "UUID",
636
+ "primaryKey": true,
637
+ "referenceKind": "id",
638
+ "notNull": true
639
+ },
640
+ "slug": {
641
+ "type": "TEXT",
642
+ "notNull": true
643
+ },
644
+ "context": {
645
+ "type": "TEXT",
646
+ "notNull": true,
647
+ "default": ""
648
+ },
649
+ "created_at": {
650
+ "type": "TIMESTAMP",
651
+ "notNull": true,
652
+ "default": "current_timestamp"
653
+ },
654
+ "updated_at": {
655
+ "type": "TIMESTAMP",
656
+ "notNull": true,
657
+ "default": "current_timestamp"
658
+ }
659
+ },
660
+ "indexes": [
661
+ {
662
+ "name": "journal_collections_id_idx",
663
+ "columns": [
664
+ "id"
665
+ ]
666
+ },
667
+ {
668
+ "name": "journal_collections_slug_context_idx",
669
+ "columns": [
670
+ "slug",
671
+ "context"
672
+ ],
673
+ "unique": true
674
+ }
675
+ ],
676
+ "version": "665cc41d"
677
+ }
678
+ },
679
+ "@happyvertical/smrt-ledgers:Account": {
680
+ "name": "account",
681
+ "className": "Account",
682
+ "qualifiedName": "@happyvertical/smrt-ledgers:Account",
683
+ "collection": "accounts",
684
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/models/Account.ts",
685
+ "packageName": "@happyvertical/smrt-ledgers",
686
+ "fields": {
687
+ "parentId": {
688
+ "type": "foreignKey",
689
+ "required": false,
690
+ "related": "Account",
691
+ "_meta": {
692
+ "nullable": true
693
+ }
694
+ },
695
+ "tenantId": {
696
+ "type": "text",
697
+ "required": false,
698
+ "_meta": {
699
+ "sqlType": "UUID",
700
+ "nullable": true,
701
+ "__tenancy": {
702
+ "isTenantIdField": true,
703
+ "autoFilter": true,
704
+ "required": false,
705
+ "autoPopulate": true,
706
+ "nullable": true,
707
+ "mode": "optional",
708
+ "field": "tenantId",
709
+ "allowSuperAdminBypass": false
710
+ }
711
+ }
712
+ },
713
+ "number": {
714
+ "type": "text",
715
+ "required": false,
716
+ "default": ""
717
+ },
718
+ "name": {
719
+ "type": "text",
720
+ "required": false,
721
+ "default": ""
722
+ },
723
+ "description": {
724
+ "type": "text",
725
+ "required": false,
726
+ "default": ""
727
+ },
728
+ "type": {
729
+ "type": "text",
730
+ "required": false,
731
+ "default": "asset"
732
+ },
733
+ "active": {
734
+ "type": "boolean",
735
+ "required": false,
736
+ "default": true
737
+ },
738
+ "metadata": {
739
+ "type": "json",
740
+ "required": false,
741
+ "default": {}
742
+ }
743
+ },
744
+ "methods": {
745
+ "getParent": {
746
+ "name": "getParent",
747
+ "async": true,
748
+ "parameters": [],
749
+ "returnType": "Promise<null>",
750
+ "isStatic": false,
751
+ "isPublic": true
752
+ },
753
+ "getChildren": {
754
+ "name": "getChildren",
755
+ "async": true,
756
+ "parameters": [],
757
+ "returnType": "Promise",
758
+ "isStatic": false,
759
+ "isPublic": true
760
+ },
761
+ "getAncestors": {
762
+ "name": "getAncestors",
763
+ "async": true,
764
+ "parameters": [],
765
+ "returnType": "Promise",
766
+ "isStatic": false,
767
+ "isPublic": true
768
+ },
769
+ "getDescendants": {
770
+ "name": "getDescendants",
771
+ "async": true,
772
+ "parameters": [],
773
+ "returnType": "Promise",
774
+ "isStatic": false,
775
+ "isPublic": true
776
+ },
777
+ "getHierarchy": {
778
+ "name": "getHierarchy",
779
+ "async": true,
780
+ "parameters": [],
781
+ "returnType": "Promise<HierarchyView>",
782
+ "isStatic": false,
783
+ "isPublic": true
784
+ },
785
+ "moveTo": {
786
+ "name": "moveTo",
787
+ "async": true,
788
+ "parameters": [
789
+ {
790
+ "name": "newParent",
791
+ "type": "string | null",
792
+ "optional": false
793
+ }
794
+ ],
795
+ "returnType": "Promise<void>",
796
+ "isStatic": false,
797
+ "isPublic": true
798
+ },
799
+ "isTopLevel": {
800
+ "name": "isTopLevel",
801
+ "async": false,
802
+ "parameters": [],
803
+ "returnType": "boolean",
804
+ "isStatic": false,
805
+ "isPublic": true
806
+ },
807
+ "isDebitNormal": {
808
+ "name": "isDebitNormal",
809
+ "async": false,
810
+ "parameters": [],
811
+ "returnType": "boolean",
812
+ "isStatic": false,
813
+ "isPublic": true
814
+ },
815
+ "isCreditNormal": {
816
+ "name": "isCreditNormal",
817
+ "async": false,
818
+ "parameters": [],
819
+ "returnType": "boolean",
820
+ "isStatic": false,
821
+ "isPublic": true
822
+ },
823
+ "getFullPath": {
824
+ "name": "getFullPath",
825
+ "async": true,
826
+ "parameters": [],
827
+ "returnType": "Promise<string>",
828
+ "isStatic": false,
829
+ "isPublic": true
830
+ },
831
+ "toTreeNode": {
832
+ "name": "toTreeNode",
833
+ "async": true,
834
+ "parameters": [],
835
+ "returnType": "Promise<AccountTreeNode>",
836
+ "isStatic": false,
837
+ "isPublic": true
838
+ },
839
+ "getBalance": {
840
+ "name": "getBalance",
841
+ "async": true,
842
+ "parameters": [
843
+ {
844
+ "name": "asOfDate",
845
+ "type": "Date",
846
+ "optional": true
847
+ }
848
+ ],
849
+ "returnType": "Promise<number>",
850
+ "isStatic": false,
851
+ "isPublic": true
852
+ },
853
+ "createChild": {
854
+ "name": "createChild",
855
+ "async": true,
856
+ "parameters": [
857
+ {
858
+ "name": "options",
859
+ "type": "Omit<AccountOptions, 'parentId' | 'type'>",
860
+ "optional": false
861
+ }
862
+ ],
863
+ "returnType": "Promise<Account>",
864
+ "isStatic": false,
865
+ "isPublic": true
866
+ }
867
+ },
868
+ "decoratorConfig": {
869
+ "api": {
870
+ "include": [
871
+ "list",
872
+ "get",
873
+ "create",
874
+ "update",
875
+ "delete"
876
+ ]
877
+ },
878
+ "mcp": {
879
+ "include": [
880
+ "list",
881
+ "get",
882
+ "create"
883
+ ]
884
+ },
885
+ "cli": true,
886
+ "tenantScoped": {
887
+ "mode": "optional"
888
+ }
889
+ },
890
+ "extends": "SmrtHierarchical",
891
+ "exportName": "Account",
892
+ "collectionExportName": "AccountCollection",
893
+ "schema": {
894
+ "tableName": "accounts",
895
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"number\" TEXT DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"type\" TEXT DEFAULT 'asset',\n \"active\" BOOLEAN DEFAULT TRUE,\n \"metadata\" JSON DEFAULT '{}'\n);",
896
+ "columns": {
897
+ "id": {
898
+ "type": "UUID",
899
+ "primaryKey": true,
900
+ "referenceKind": "id",
901
+ "notNull": true
902
+ },
903
+ "slug": {
904
+ "type": "TEXT",
905
+ "notNull": true
906
+ },
907
+ "context": {
908
+ "type": "TEXT",
909
+ "notNull": true,
910
+ "default": ""
911
+ },
912
+ "created_at": {
913
+ "type": "TIMESTAMP",
914
+ "notNull": true,
915
+ "default": "current_timestamp"
916
+ },
917
+ "updated_at": {
918
+ "type": "TIMESTAMP",
919
+ "notNull": true,
920
+ "default": "current_timestamp"
921
+ },
922
+ "parent_id": {
923
+ "type": "UUID",
924
+ "referenceKind": "foreignKey",
925
+ "notNull": false,
926
+ "unique": false
927
+ },
928
+ "tenant_id": {
929
+ "type": "UUID",
930
+ "referenceKind": "tenantId",
931
+ "notNull": false,
932
+ "unique": false
933
+ },
934
+ "number": {
935
+ "type": "TEXT",
936
+ "notNull": false,
937
+ "unique": false,
938
+ "default": ""
939
+ },
940
+ "name": {
941
+ "type": "TEXT",
942
+ "notNull": false,
943
+ "unique": false,
944
+ "default": ""
945
+ },
946
+ "description": {
947
+ "type": "TEXT",
948
+ "notNull": false,
949
+ "unique": false,
950
+ "default": ""
951
+ },
952
+ "type": {
953
+ "type": "TEXT",
954
+ "notNull": false,
955
+ "unique": false,
956
+ "default": "asset"
957
+ },
958
+ "active": {
959
+ "type": "BOOLEAN",
960
+ "notNull": false,
961
+ "unique": false,
962
+ "default": true
963
+ },
964
+ "metadata": {
965
+ "type": "JSON",
966
+ "notNull": false,
967
+ "unique": false,
968
+ "default": {}
969
+ }
970
+ },
971
+ "indexes": [
972
+ {
973
+ "name": "accounts_id_idx",
974
+ "columns": [
975
+ "id"
976
+ ]
977
+ },
978
+ {
979
+ "name": "accounts_slug_context_idx",
980
+ "columns": [
981
+ "slug",
982
+ "context"
983
+ ],
984
+ "unique": true
985
+ }
986
+ ],
987
+ "version": "d63f1df8"
988
+ }
989
+ },
990
+ "@happyvertical/smrt-ledgers:Journal": {
991
+ "name": "journal",
992
+ "className": "Journal",
993
+ "qualifiedName": "@happyvertical/smrt-ledgers:Journal",
994
+ "collection": "journals",
995
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/models/Journal.ts",
996
+ "packageName": "@happyvertical/smrt-ledgers",
997
+ "fields": {
998
+ "tenantId": {
999
+ "type": "text",
1000
+ "required": false,
1001
+ "_meta": {
1002
+ "sqlType": "UUID",
1003
+ "nullable": true,
1004
+ "__tenancy": {
1005
+ "isTenantIdField": true,
1006
+ "autoFilter": true,
1007
+ "required": false,
1008
+ "autoPopulate": true,
1009
+ "nullable": true,
1010
+ "mode": "optional",
1011
+ "field": "tenantId",
1012
+ "allowSuperAdminBypass": false
1013
+ }
1014
+ }
1015
+ },
1016
+ "number": {
1017
+ "type": "text",
1018
+ "required": false,
1019
+ "default": ""
1020
+ },
1021
+ "date": {
1022
+ "type": "datetime",
1023
+ "required": false
1024
+ },
1025
+ "description": {
1026
+ "type": "text",
1027
+ "required": false,
1028
+ "default": ""
1029
+ },
1030
+ "sourceModule": {
1031
+ "type": "text",
1032
+ "required": false,
1033
+ "default": ""
1034
+ },
1035
+ "sourceRef": {
1036
+ "type": "text",
1037
+ "required": false
1038
+ },
1039
+ "status": {
1040
+ "type": "text",
1041
+ "required": false,
1042
+ "default": "draft"
1043
+ },
1044
+ "postedAt": {
1045
+ "type": "datetime",
1046
+ "required": false
1047
+ },
1048
+ "voidedAt": {
1049
+ "type": "datetime",
1050
+ "required": false
1051
+ },
1052
+ "voidReason": {
1053
+ "type": "text",
1054
+ "required": false
1055
+ },
1056
+ "metadata": {
1057
+ "type": "json",
1058
+ "required": false,
1059
+ "default": {}
1060
+ }
1061
+ },
1062
+ "methods": {
1063
+ "isDraft": {
1064
+ "name": "isDraft",
1065
+ "async": false,
1066
+ "parameters": [],
1067
+ "returnType": "boolean",
1068
+ "isStatic": false,
1069
+ "isPublic": true
1070
+ },
1071
+ "isPosted": {
1072
+ "name": "isPosted",
1073
+ "async": false,
1074
+ "parameters": [],
1075
+ "returnType": "boolean",
1076
+ "isStatic": false,
1077
+ "isPublic": true
1078
+ },
1079
+ "isVoided": {
1080
+ "name": "isVoided",
1081
+ "async": false,
1082
+ "parameters": [],
1083
+ "returnType": "boolean",
1084
+ "isStatic": false,
1085
+ "isPublic": true
1086
+ },
1087
+ "isEditable": {
1088
+ "name": "isEditable",
1089
+ "async": false,
1090
+ "parameters": [],
1091
+ "returnType": "boolean",
1092
+ "isStatic": false,
1093
+ "isPublic": true
1094
+ },
1095
+ "getEntries": {
1096
+ "name": "getEntries",
1097
+ "async": true,
1098
+ "parameters": [],
1099
+ "returnType": "Promise",
1100
+ "isStatic": false,
1101
+ "isPublic": true
1102
+ },
1103
+ "getTotalDebits": {
1104
+ "name": "getTotalDebits",
1105
+ "async": true,
1106
+ "parameters": [],
1107
+ "returnType": "Promise<number>",
1108
+ "isStatic": false,
1109
+ "isPublic": true
1110
+ },
1111
+ "getTotalCredits": {
1112
+ "name": "getTotalCredits",
1113
+ "async": true,
1114
+ "parameters": [],
1115
+ "returnType": "Promise<number>",
1116
+ "isStatic": false,
1117
+ "isPublic": true
1118
+ },
1119
+ "isBalanced": {
1120
+ "name": "isBalanced",
1121
+ "async": true,
1122
+ "parameters": [],
1123
+ "returnType": "Promise<boolean>",
1124
+ "isStatic": false,
1125
+ "isPublic": true
1126
+ },
1127
+ "addEntry": {
1128
+ "name": "addEntry",
1129
+ "async": true,
1130
+ "parameters": [
1131
+ {
1132
+ "name": "data",
1133
+ "type": "JournalEntryData",
1134
+ "optional": false
1135
+ }
1136
+ ],
1137
+ "returnType": "Promise<void>",
1138
+ "isStatic": false,
1139
+ "isPublic": true
1140
+ },
1141
+ "post": {
1142
+ "name": "post",
1143
+ "async": true,
1144
+ "parameters": [],
1145
+ "returnType": "Promise<void>",
1146
+ "isStatic": false,
1147
+ "isPublic": true
1148
+ },
1149
+ "void": {
1150
+ "name": "void",
1151
+ "async": true,
1152
+ "parameters": [
1153
+ {
1154
+ "name": "reason",
1155
+ "type": "string",
1156
+ "optional": false
1157
+ }
1158
+ ],
1159
+ "returnType": "Promise<void>",
1160
+ "isStatic": false,
1161
+ "isPublic": true
1162
+ },
1163
+ "summarize": {
1164
+ "name": "summarize",
1165
+ "async": true,
1166
+ "parameters": [],
1167
+ "returnType": "Promise<string>",
1168
+ "isStatic": false,
1169
+ "isPublic": true
1170
+ }
1171
+ },
1172
+ "decoratorConfig": {
1173
+ "api": {
1174
+ "include": [
1175
+ "list",
1176
+ "get",
1177
+ "create"
1178
+ ]
1179
+ },
1180
+ "mcp": {
1181
+ "include": [
1182
+ "list",
1183
+ "get",
1184
+ "create"
1185
+ ]
1186
+ },
1187
+ "cli": true,
1188
+ "tenantScoped": {
1189
+ "mode": "optional"
1190
+ }
1191
+ },
1192
+ "extends": "SmrtObject",
1193
+ "exportName": "Journal",
1194
+ "collectionExportName": "JournalCollection",
1195
+ "schema": {
1196
+ "tableName": "journals",
1197
+ "ddl": "CREATE TABLE IF NOT EXISTS \"journals\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"number\" TEXT DEFAULT '',\n \"date\" TIMESTAMP,\n \"description\" TEXT DEFAULT '',\n \"source_module\" TEXT DEFAULT '',\n \"source_ref\" TEXT,\n \"status\" TEXT DEFAULT 'draft',\n \"posted_at\" TIMESTAMP,\n \"voided_at\" TIMESTAMP,\n \"void_reason\" TEXT,\n \"metadata\" JSON DEFAULT '{}'\n);",
1198
+ "columns": {
1199
+ "id": {
1200
+ "type": "UUID",
1201
+ "primaryKey": true,
1202
+ "referenceKind": "id",
1203
+ "notNull": true
1204
+ },
1205
+ "slug": {
1206
+ "type": "TEXT",
1207
+ "notNull": true
1208
+ },
1209
+ "context": {
1210
+ "type": "TEXT",
1211
+ "notNull": true,
1212
+ "default": ""
1213
+ },
1214
+ "created_at": {
1215
+ "type": "TIMESTAMP",
1216
+ "notNull": true,
1217
+ "default": "current_timestamp"
1218
+ },
1219
+ "updated_at": {
1220
+ "type": "TIMESTAMP",
1221
+ "notNull": true,
1222
+ "default": "current_timestamp"
1223
+ },
1224
+ "tenant_id": {
1225
+ "type": "UUID",
1226
+ "referenceKind": "tenantId",
1227
+ "notNull": false,
1228
+ "unique": false
1229
+ },
1230
+ "number": {
1231
+ "type": "TEXT",
1232
+ "notNull": false,
1233
+ "unique": false,
1234
+ "default": ""
1235
+ },
1236
+ "date": {
1237
+ "type": "TIMESTAMP",
1238
+ "notNull": false,
1239
+ "unique": false
1240
+ },
1241
+ "description": {
1242
+ "type": "TEXT",
1243
+ "notNull": false,
1244
+ "unique": false,
1245
+ "default": ""
1246
+ },
1247
+ "source_module": {
1248
+ "type": "TEXT",
1249
+ "notNull": false,
1250
+ "unique": false,
1251
+ "default": ""
1252
+ },
1253
+ "source_ref": {
1254
+ "type": "TEXT",
1255
+ "notNull": false,
1256
+ "unique": false
1257
+ },
1258
+ "status": {
1259
+ "type": "TEXT",
1260
+ "notNull": false,
1261
+ "unique": false,
1262
+ "default": "draft"
1263
+ },
1264
+ "posted_at": {
1265
+ "type": "TIMESTAMP",
1266
+ "notNull": false,
1267
+ "unique": false
1268
+ },
1269
+ "voided_at": {
1270
+ "type": "TIMESTAMP",
1271
+ "notNull": false,
1272
+ "unique": false
1273
+ },
1274
+ "void_reason": {
1275
+ "type": "TEXT",
1276
+ "notNull": false,
1277
+ "unique": false
1278
+ },
1279
+ "metadata": {
1280
+ "type": "JSON",
1281
+ "notNull": false,
1282
+ "unique": false,
1283
+ "default": {}
1284
+ }
1285
+ },
1286
+ "indexes": [
1287
+ {
1288
+ "name": "journals_id_idx",
1289
+ "columns": [
1290
+ "id"
1291
+ ]
1292
+ },
1293
+ {
1294
+ "name": "journals_slug_context_idx",
1295
+ "columns": [
1296
+ "slug",
1297
+ "context"
1298
+ ],
1299
+ "unique": true
1300
+ }
1301
+ ],
1302
+ "version": "4b51d204"
1303
+ }
1304
+ },
1305
+ "@happyvertical/smrt-ledgers:JournalEntry": {
1306
+ "name": "journalentry",
1307
+ "className": "JournalEntry",
1308
+ "qualifiedName": "@happyvertical/smrt-ledgers:JournalEntry",
1309
+ "collection": "journalentries",
1310
+ "filePath": "/home/runner/_work/smrt/smrt/packages/ledgers/src/models/JournalEntry.ts",
1311
+ "packageName": "@happyvertical/smrt-ledgers",
1312
+ "fields": {
1313
+ "tenantId": {
1314
+ "type": "text",
1315
+ "required": false,
1316
+ "_meta": {
1317
+ "sqlType": "UUID",
1318
+ "nullable": true,
1319
+ "__tenancy": {
1320
+ "isTenantIdField": true,
1321
+ "autoFilter": true,
1322
+ "required": false,
1323
+ "autoPopulate": true,
1324
+ "nullable": true,
1325
+ "mode": "optional",
1326
+ "field": "tenantId",
1327
+ "allowSuperAdminBypass": false
1328
+ }
1329
+ }
1330
+ },
1331
+ "journalId": {
1332
+ "type": "foreignKey",
1333
+ "required": false,
1334
+ "related": "Journal"
1335
+ },
1336
+ "accountId": {
1337
+ "type": "foreignKey",
1338
+ "required": false,
1339
+ "related": "Account"
1340
+ },
1341
+ "debit": {
1342
+ "type": "decimal",
1343
+ "required": false,
1344
+ "default": 0
1345
+ },
1346
+ "credit": {
1347
+ "type": "decimal",
1348
+ "required": false,
1349
+ "default": 0
1350
+ },
1351
+ "currency": {
1352
+ "type": "text",
1353
+ "required": false,
1354
+ "default": "USD"
1355
+ },
1356
+ "exchangeRate": {
1357
+ "type": "decimal",
1358
+ "required": false,
1359
+ "default": 1
1360
+ },
1361
+ "memo": {
1362
+ "type": "text",
1363
+ "required": false,
1364
+ "default": ""
1365
+ },
1366
+ "metadata": {
1367
+ "type": "json",
1368
+ "required": false,
1369
+ "default": {}
1370
+ }
1371
+ },
1372
+ "methods": {
1373
+ "isDebit": {
1374
+ "name": "isDebit",
1375
+ "async": false,
1376
+ "parameters": [],
1377
+ "returnType": "boolean",
1378
+ "isStatic": false,
1379
+ "isPublic": true
1380
+ },
1381
+ "isCredit": {
1382
+ "name": "isCredit",
1383
+ "async": false,
1384
+ "parameters": [],
1385
+ "returnType": "boolean",
1386
+ "isStatic": false,
1387
+ "isPublic": true
1388
+ },
1389
+ "getAmount": {
1390
+ "name": "getAmount",
1391
+ "async": false,
1392
+ "parameters": [],
1393
+ "returnType": "number",
1394
+ "isStatic": false,
1395
+ "isPublic": true
1396
+ },
1397
+ "getBaseAmount": {
1398
+ "name": "getBaseAmount",
1399
+ "async": false,
1400
+ "parameters": [],
1401
+ "returnType": "number",
1402
+ "isStatic": false,
1403
+ "isPublic": true
1404
+ },
1405
+ "getJournal": {
1406
+ "name": "getJournal",
1407
+ "async": true,
1408
+ "parameters": [],
1409
+ "returnType": "Promise<null>",
1410
+ "isStatic": false,
1411
+ "isPublic": true
1412
+ },
1413
+ "getAccount": {
1414
+ "name": "getAccount",
1415
+ "async": true,
1416
+ "parameters": [],
1417
+ "returnType": "Promise<null>",
1418
+ "isStatic": false,
1419
+ "isPublic": true
1420
+ },
1421
+ "getDescription": {
1422
+ "name": "getDescription",
1423
+ "async": true,
1424
+ "parameters": [],
1425
+ "returnType": "Promise<string>",
1426
+ "isStatic": false,
1427
+ "isPublic": true
1428
+ }
1429
+ },
1430
+ "decoratorConfig": {
1431
+ "api": {
1432
+ "include": [
1433
+ "list",
1434
+ "get"
1435
+ ]
1436
+ },
1437
+ "mcp": {
1438
+ "include": [
1439
+ "list",
1440
+ "get"
1441
+ ]
1442
+ },
1443
+ "cli": true,
1444
+ "tenantScoped": {
1445
+ "mode": "optional"
1446
+ }
1447
+ },
1448
+ "extends": "SmrtObject",
1449
+ "exportName": "JournalEntry",
1450
+ "collectionExportName": "JournalEntryCollection",
1451
+ "schema": {
1452
+ "tableName": "journal_entries",
1453
+ "ddl": "CREATE TABLE IF NOT EXISTS \"journal_entries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"journal_id\" UUID,\n \"account_id\" UUID,\n \"debit\" REAL DEFAULT 0,\n \"credit\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"exchange_rate\" REAL DEFAULT 1,\n \"memo\" TEXT DEFAULT '',\n \"metadata\" JSON DEFAULT '{}'\n);",
1454
+ "columns": {
1455
+ "id": {
1456
+ "type": "UUID",
1457
+ "primaryKey": true,
1458
+ "referenceKind": "id",
1459
+ "notNull": true
1460
+ },
1461
+ "slug": {
1462
+ "type": "TEXT",
1463
+ "notNull": true
1464
+ },
1465
+ "context": {
1466
+ "type": "TEXT",
1467
+ "notNull": true,
1468
+ "default": ""
1469
+ },
1470
+ "created_at": {
1471
+ "type": "TIMESTAMP",
1472
+ "notNull": true,
1473
+ "default": "current_timestamp"
1474
+ },
1475
+ "updated_at": {
1476
+ "type": "TIMESTAMP",
1477
+ "notNull": true,
1478
+ "default": "current_timestamp"
1479
+ },
1480
+ "tenant_id": {
1481
+ "type": "UUID",
1482
+ "referenceKind": "tenantId",
1483
+ "notNull": false,
1484
+ "unique": false
1485
+ },
1486
+ "journal_id": {
1487
+ "type": "UUID",
1488
+ "referenceKind": "foreignKey",
1489
+ "notNull": false,
1490
+ "unique": false
1491
+ },
1492
+ "account_id": {
1493
+ "type": "UUID",
1494
+ "referenceKind": "foreignKey",
1495
+ "notNull": false,
1496
+ "unique": false
1497
+ },
1498
+ "debit": {
1499
+ "type": "REAL",
1500
+ "notNull": false,
1501
+ "unique": false,
1502
+ "default": 0
1503
+ },
1504
+ "credit": {
1505
+ "type": "REAL",
1506
+ "notNull": false,
1507
+ "unique": false,
1508
+ "default": 0
1509
+ },
1510
+ "currency": {
1511
+ "type": "TEXT",
1512
+ "notNull": false,
1513
+ "unique": false,
1514
+ "default": "USD"
1515
+ },
1516
+ "exchange_rate": {
1517
+ "type": "REAL",
1518
+ "notNull": false,
1519
+ "unique": false,
1520
+ "default": 1
1521
+ },
1522
+ "memo": {
1523
+ "type": "TEXT",
1524
+ "notNull": false,
1525
+ "unique": false,
1526
+ "default": ""
1527
+ },
1528
+ "metadata": {
1529
+ "type": "JSON",
1530
+ "notNull": false,
1531
+ "unique": false,
1532
+ "default": {}
1533
+ }
1534
+ },
1535
+ "indexes": [
1536
+ {
1537
+ "name": "journal_entries_id_idx",
1538
+ "columns": [
1539
+ "id"
1540
+ ]
1541
+ },
1542
+ {
1543
+ "name": "journal_entries_slug_context_idx",
1544
+ "columns": [
1545
+ "slug",
1546
+ "context"
1547
+ ],
1548
+ "unique": true
1549
+ }
1550
+ ],
1551
+ "version": "b5a42f7b"
1552
+ }
1553
+ }
1554
+ },
1555
+ "moduleType": "smrt",
1556
+ "smrtDependencies": [
1557
+ "@happyvertical/smrt-core",
1558
+ "@happyvertical/smrt-prompts",
1559
+ "@happyvertical/smrt-tenancy"
1560
+ ]
1561
+ }