@happyvertical/smrt-ledgers 0.49.6 → 0.49.7
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/dist/index.js +1 -1
- package/dist/manifest.json +998 -998
- package/dist/smrt-knowledge.json +2230 -2230
- package/package.json +5 -5
package/dist/manifest.json
CHANGED
|
@@ -2,171 +2,240 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
5
|
-
"packageVersion": "0.49.
|
|
5
|
+
"packageVersion": "0.49.7",
|
|
6
6
|
"objects": {
|
|
7
|
-
"@happyvertical/smrt-ledgers:
|
|
8
|
-
"name": "
|
|
9
|
-
"className": "
|
|
10
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
7
|
+
"@happyvertical/smrt-ledgers:Account": {
|
|
8
|
+
"name": "account",
|
|
9
|
+
"className": "Account",
|
|
10
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:Account",
|
|
11
11
|
"collection": "accounts",
|
|
12
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
12
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/models/Account.ts",
|
|
13
13
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
14
|
-
"fields": {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
"fields": {
|
|
15
|
+
"parentId": {
|
|
16
|
+
"type": "foreignKey",
|
|
17
|
+
"required": false,
|
|
18
|
+
"related": "Account",
|
|
19
|
+
"_meta": {
|
|
20
|
+
"nullable": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"tenantId": {
|
|
24
|
+
"type": "text",
|
|
25
|
+
"required": false,
|
|
26
|
+
"_meta": {
|
|
27
|
+
"sqlType": "UUID",
|
|
28
|
+
"nullable": true,
|
|
29
|
+
"__tenancy": {
|
|
30
|
+
"isTenantIdField": true,
|
|
31
|
+
"autoFilter": true,
|
|
32
|
+
"required": false,
|
|
33
|
+
"autoPopulate": true,
|
|
34
|
+
"nullable": true,
|
|
35
|
+
"mode": "optional",
|
|
36
|
+
"field": "tenantId",
|
|
37
|
+
"allowSuperAdminBypass": false
|
|
24
38
|
}
|
|
25
|
-
|
|
26
|
-
"returnType": "Promise<Account | null>",
|
|
27
|
-
"isStatic": false,
|
|
28
|
-
"isPublic": true
|
|
39
|
+
}
|
|
29
40
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
41
|
+
"number": {
|
|
42
|
+
"type": "text",
|
|
43
|
+
"required": false,
|
|
44
|
+
"default": ""
|
|
45
|
+
},
|
|
46
|
+
"name": {
|
|
47
|
+
"type": "text",
|
|
48
|
+
"required": false,
|
|
49
|
+
"default": ""
|
|
50
|
+
},
|
|
51
|
+
"description": {
|
|
52
|
+
"type": "text",
|
|
53
|
+
"required": false,
|
|
54
|
+
"default": ""
|
|
55
|
+
},
|
|
56
|
+
"type": {
|
|
57
|
+
"type": "text",
|
|
58
|
+
"required": false,
|
|
59
|
+
"default": "asset"
|
|
60
|
+
},
|
|
61
|
+
"active": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"required": false,
|
|
64
|
+
"default": true
|
|
65
|
+
},
|
|
66
|
+
"metadata": {
|
|
67
|
+
"type": "json",
|
|
68
|
+
"required": false,
|
|
69
|
+
"default": {}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"methods": {
|
|
73
|
+
"getParent": {
|
|
74
|
+
"name": "getParent",
|
|
32
75
|
"async": true,
|
|
33
|
-
"parameters": [
|
|
34
|
-
|
|
35
|
-
"name": "type",
|
|
36
|
-
"type": "AccountType",
|
|
37
|
-
"optional": false
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"returnType": "Promise<Account[]>",
|
|
76
|
+
"parameters": [],
|
|
77
|
+
"returnType": "Promise<this | null>",
|
|
41
78
|
"isStatic": false,
|
|
42
79
|
"isPublic": true
|
|
43
80
|
},
|
|
44
|
-
"
|
|
45
|
-
"name": "
|
|
81
|
+
"getChildren": {
|
|
82
|
+
"name": "getChildren",
|
|
46
83
|
"async": true,
|
|
47
84
|
"parameters": [],
|
|
48
|
-
"returnType": "Promise<
|
|
85
|
+
"returnType": "Promise<this[]>",
|
|
49
86
|
"isStatic": false,
|
|
50
87
|
"isPublic": true
|
|
51
88
|
},
|
|
52
|
-
"
|
|
53
|
-
"name": "
|
|
89
|
+
"getAncestors": {
|
|
90
|
+
"name": "getAncestors",
|
|
54
91
|
"async": true,
|
|
55
92
|
"parameters": [],
|
|
56
|
-
"returnType": "Promise<
|
|
93
|
+
"returnType": "Promise<this[]>",
|
|
57
94
|
"isStatic": false,
|
|
58
95
|
"isPublic": true
|
|
59
96
|
},
|
|
60
|
-
"
|
|
61
|
-
"name": "
|
|
97
|
+
"getDescendants": {
|
|
98
|
+
"name": "getDescendants",
|
|
62
99
|
"async": true,
|
|
63
|
-
"parameters": [
|
|
64
|
-
|
|
65
|
-
"name": "parentId",
|
|
66
|
-
"type": "string",
|
|
67
|
-
"optional": false
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"returnType": "Promise<Account[]>",
|
|
100
|
+
"parameters": [],
|
|
101
|
+
"returnType": "Promise<this[]>",
|
|
71
102
|
"isStatic": false,
|
|
72
103
|
"isPublic": true
|
|
73
104
|
},
|
|
74
|
-
"
|
|
75
|
-
"name": "
|
|
105
|
+
"getHierarchy": {
|
|
106
|
+
"name": "getHierarchy",
|
|
76
107
|
"async": true,
|
|
77
108
|
"parameters": [],
|
|
78
|
-
"returnType": "Promise<
|
|
109
|
+
"returnType": "Promise<HierarchyView<this>>",
|
|
79
110
|
"isStatic": false,
|
|
80
111
|
"isPublic": true
|
|
81
112
|
},
|
|
82
|
-
"
|
|
83
|
-
"name": "
|
|
113
|
+
"moveTo": {
|
|
114
|
+
"name": "moveTo",
|
|
84
115
|
"async": true,
|
|
85
116
|
"parameters": [
|
|
86
117
|
{
|
|
87
|
-
"name": "
|
|
88
|
-
"type": "string",
|
|
89
|
-
"optional": false
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
118
|
+
"name": "newParent",
|
|
119
|
+
"type": "this | string | null",
|
|
120
|
+
"optional": false,
|
|
121
|
+
"unionBranches": [
|
|
122
|
+
{
|
|
123
|
+
"type": "this"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"type": "null"
|
|
130
|
+
}
|
|
99
131
|
]
|
|
100
132
|
}
|
|
101
133
|
],
|
|
102
|
-
"returnType": "Promise<
|
|
134
|
+
"returnType": "Promise<void>",
|
|
103
135
|
"isStatic": false,
|
|
104
136
|
"isPublic": true
|
|
105
137
|
},
|
|
106
|
-
"
|
|
107
|
-
"name": "
|
|
138
|
+
"isTopLevel": {
|
|
139
|
+
"name": "isTopLevel",
|
|
140
|
+
"async": false,
|
|
141
|
+
"parameters": [],
|
|
142
|
+
"returnType": "boolean",
|
|
143
|
+
"isStatic": false,
|
|
144
|
+
"isPublic": true
|
|
145
|
+
},
|
|
146
|
+
"isDebitNormal": {
|
|
147
|
+
"name": "isDebitNormal",
|
|
148
|
+
"async": false,
|
|
149
|
+
"parameters": [],
|
|
150
|
+
"returnType": "boolean",
|
|
151
|
+
"isStatic": false,
|
|
152
|
+
"isPublic": true
|
|
153
|
+
},
|
|
154
|
+
"isCreditNormal": {
|
|
155
|
+
"name": "isCreditNormal",
|
|
156
|
+
"async": false,
|
|
157
|
+
"parameters": [],
|
|
158
|
+
"returnType": "boolean",
|
|
159
|
+
"isStatic": false,
|
|
160
|
+
"isPublic": true
|
|
161
|
+
},
|
|
162
|
+
"getFullPath": {
|
|
163
|
+
"name": "getFullPath",
|
|
108
164
|
"async": true,
|
|
109
165
|
"parameters": [],
|
|
110
|
-
"returnType": "Promise<
|
|
166
|
+
"returnType": "Promise<string>",
|
|
111
167
|
"isStatic": false,
|
|
112
168
|
"isPublic": true
|
|
113
169
|
},
|
|
114
|
-
"
|
|
115
|
-
"name": "
|
|
170
|
+
"toTreeNode": {
|
|
171
|
+
"name": "toTreeNode",
|
|
116
172
|
"async": true,
|
|
117
|
-
"parameters": [
|
|
118
|
-
|
|
119
|
-
"name": "accountId",
|
|
120
|
-
"type": "string",
|
|
121
|
-
"optional": false
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"returnType": "Promise<Account[]>",
|
|
173
|
+
"parameters": [],
|
|
174
|
+
"returnType": "Promise<AccountTreeNode>",
|
|
125
175
|
"isStatic": false,
|
|
126
176
|
"isPublic": true
|
|
127
177
|
},
|
|
128
|
-
"
|
|
129
|
-
"name": "
|
|
178
|
+
"getBalance": {
|
|
179
|
+
"name": "getBalance",
|
|
130
180
|
"async": true,
|
|
131
181
|
"parameters": [
|
|
132
182
|
{
|
|
133
|
-
"name": "
|
|
134
|
-
"type": "
|
|
135
|
-
"optional":
|
|
183
|
+
"name": "asOfDate",
|
|
184
|
+
"type": "Date",
|
|
185
|
+
"optional": true
|
|
136
186
|
}
|
|
137
187
|
],
|
|
138
|
-
"returnType": "Promise<
|
|
139
|
-
"isStatic": false,
|
|
140
|
-
"isPublic": true
|
|
141
|
-
},
|
|
142
|
-
"findGlobal": {
|
|
143
|
-
"name": "findGlobal",
|
|
144
|
-
"async": true,
|
|
145
|
-
"parameters": [],
|
|
146
|
-
"returnType": "Promise<Account[]>",
|
|
188
|
+
"returnType": "Promise<number>",
|
|
147
189
|
"isStatic": false,
|
|
148
190
|
"isPublic": true
|
|
149
191
|
},
|
|
150
|
-
"
|
|
151
|
-
"name": "
|
|
192
|
+
"createChild": {
|
|
193
|
+
"name": "createChild",
|
|
152
194
|
"async": true,
|
|
153
195
|
"parameters": [
|
|
154
196
|
{
|
|
155
|
-
"name": "
|
|
156
|
-
"type": "
|
|
197
|
+
"name": "options",
|
|
198
|
+
"type": "Omit<AccountOptions, 'parentId' | 'type'>",
|
|
157
199
|
"optional": false
|
|
158
200
|
}
|
|
159
201
|
],
|
|
160
|
-
"returnType": "Promise<Account
|
|
202
|
+
"returnType": "Promise<Account>",
|
|
161
203
|
"isStatic": false,
|
|
162
204
|
"isPublic": true
|
|
163
205
|
}
|
|
164
206
|
},
|
|
165
|
-
"decoratorConfig": {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
207
|
+
"decoratorConfig": {
|
|
208
|
+
"api": {
|
|
209
|
+
"include": [
|
|
210
|
+
"list",
|
|
211
|
+
"get",
|
|
212
|
+
"create",
|
|
213
|
+
"update",
|
|
214
|
+
"delete"
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"mcp": {
|
|
218
|
+
"include": [
|
|
219
|
+
"list",
|
|
220
|
+
"get",
|
|
221
|
+
"create"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"cli": {
|
|
225
|
+
"skipApiCheck": true
|
|
226
|
+
},
|
|
227
|
+
"tenantScoped": {
|
|
228
|
+
"mode": "optional"
|
|
229
|
+
},
|
|
230
|
+
"conflictColumns": [
|
|
231
|
+
"tenant_id",
|
|
232
|
+
"slug",
|
|
233
|
+
"context"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"extends": "SmrtHierarchical",
|
|
237
|
+
"exportName": "Account",
|
|
238
|
+
"collectionExportName": "AccountCollection",
|
|
170
239
|
"schema": {
|
|
171
240
|
"tableName": "accounts",
|
|
172
241
|
"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);",
|
|
@@ -280,168 +349,221 @@
|
|
|
280
349
|
},
|
|
281
350
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
282
351
|
},
|
|
283
|
-
"@happyvertical/smrt-ledgers:
|
|
284
|
-
"name": "
|
|
285
|
-
"className": "
|
|
286
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
287
|
-
"collection": "
|
|
288
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
352
|
+
"@happyvertical/smrt-ledgers:Journal": {
|
|
353
|
+
"name": "journal",
|
|
354
|
+
"className": "Journal",
|
|
355
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:Journal",
|
|
356
|
+
"collection": "journals",
|
|
357
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/models/Journal.ts",
|
|
289
358
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
290
|
-
"fields": {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
"
|
|
299
|
-
"
|
|
359
|
+
"fields": {
|
|
360
|
+
"tenantId": {
|
|
361
|
+
"type": "text",
|
|
362
|
+
"required": false,
|
|
363
|
+
"_meta": {
|
|
364
|
+
"sqlType": "UUID",
|
|
365
|
+
"nullable": true,
|
|
366
|
+
"__tenancy": {
|
|
367
|
+
"isTenantIdField": true,
|
|
368
|
+
"autoFilter": true,
|
|
369
|
+
"required": false,
|
|
370
|
+
"autoPopulate": true,
|
|
371
|
+
"nullable": true,
|
|
372
|
+
"mode": "optional",
|
|
373
|
+
"field": "tenantId",
|
|
374
|
+
"allowSuperAdminBypass": false
|
|
300
375
|
}
|
|
301
|
-
|
|
302
|
-
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"number": {
|
|
379
|
+
"type": "text",
|
|
380
|
+
"required": false,
|
|
381
|
+
"default": ""
|
|
382
|
+
},
|
|
383
|
+
"date": {
|
|
384
|
+
"type": "datetime",
|
|
385
|
+
"required": false
|
|
386
|
+
},
|
|
387
|
+
"description": {
|
|
388
|
+
"type": "text",
|
|
389
|
+
"required": false,
|
|
390
|
+
"default": ""
|
|
391
|
+
},
|
|
392
|
+
"sourceModule": {
|
|
393
|
+
"type": "text",
|
|
394
|
+
"required": false,
|
|
395
|
+
"default": ""
|
|
396
|
+
},
|
|
397
|
+
"sourceRef": {
|
|
398
|
+
"type": "text",
|
|
399
|
+
"required": false
|
|
400
|
+
},
|
|
401
|
+
"status": {
|
|
402
|
+
"type": "text",
|
|
403
|
+
"required": false,
|
|
404
|
+
"default": "draft"
|
|
405
|
+
},
|
|
406
|
+
"postedAt": {
|
|
407
|
+
"type": "datetime",
|
|
408
|
+
"required": false
|
|
409
|
+
},
|
|
410
|
+
"voidedAt": {
|
|
411
|
+
"type": "datetime",
|
|
412
|
+
"required": false
|
|
413
|
+
},
|
|
414
|
+
"voidReason": {
|
|
415
|
+
"type": "text",
|
|
416
|
+
"required": false
|
|
417
|
+
},
|
|
418
|
+
"metadata": {
|
|
419
|
+
"type": "json",
|
|
420
|
+
"required": false,
|
|
421
|
+
"default": {}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"methods": {
|
|
425
|
+
"isDraft": {
|
|
426
|
+
"name": "isDraft",
|
|
427
|
+
"async": false,
|
|
428
|
+
"parameters": [],
|
|
429
|
+
"returnType": "boolean",
|
|
303
430
|
"isStatic": false,
|
|
304
431
|
"isPublic": true
|
|
305
432
|
},
|
|
306
|
-
"
|
|
307
|
-
"name": "
|
|
308
|
-
"async":
|
|
309
|
-
"parameters": [
|
|
310
|
-
|
|
311
|
-
"name": "accountId",
|
|
312
|
-
"type": "string",
|
|
313
|
-
"optional": false
|
|
314
|
-
}
|
|
315
|
-
],
|
|
316
|
-
"returnType": "Promise<JournalEntry[]>",
|
|
433
|
+
"isPosted": {
|
|
434
|
+
"name": "isPosted",
|
|
435
|
+
"async": false,
|
|
436
|
+
"parameters": [],
|
|
437
|
+
"returnType": "boolean",
|
|
317
438
|
"isStatic": false,
|
|
318
439
|
"isPublic": true
|
|
319
440
|
},
|
|
320
|
-
"
|
|
321
|
-
"name": "
|
|
322
|
-
"async":
|
|
323
|
-
"parameters": [
|
|
324
|
-
|
|
325
|
-
"name": "accountId",
|
|
326
|
-
"type": "string",
|
|
327
|
-
"optional": false
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
"name": "asOfDate",
|
|
331
|
-
"type": "Date",
|
|
332
|
-
"optional": true
|
|
333
|
-
}
|
|
334
|
-
],
|
|
335
|
-
"returnType": "Promise<number>",
|
|
441
|
+
"isVoided": {
|
|
442
|
+
"name": "isVoided",
|
|
443
|
+
"async": false,
|
|
444
|
+
"parameters": [],
|
|
445
|
+
"returnType": "boolean",
|
|
336
446
|
"isStatic": false,
|
|
337
447
|
"isPublic": true
|
|
338
448
|
},
|
|
339
|
-
"
|
|
340
|
-
"name": "
|
|
449
|
+
"isEditable": {
|
|
450
|
+
"name": "isEditable",
|
|
451
|
+
"async": false,
|
|
452
|
+
"parameters": [],
|
|
453
|
+
"returnType": "boolean",
|
|
454
|
+
"isStatic": false,
|
|
455
|
+
"isPublic": true
|
|
456
|
+
},
|
|
457
|
+
"getEntries": {
|
|
458
|
+
"name": "getEntries",
|
|
341
459
|
"async": true,
|
|
342
|
-
"parameters": [
|
|
343
|
-
|
|
344
|
-
"name": "asOfDate",
|
|
345
|
-
"type": "Date",
|
|
346
|
-
"optional": true
|
|
347
|
-
}
|
|
348
|
-
],
|
|
349
|
-
"returnType": "Promise<TrialBalanceRow[]>",
|
|
460
|
+
"parameters": [],
|
|
461
|
+
"returnType": "any",
|
|
350
462
|
"isStatic": false,
|
|
351
463
|
"isPublic": true
|
|
352
464
|
},
|
|
353
|
-
"
|
|
354
|
-
"name": "
|
|
465
|
+
"getTotalDebits": {
|
|
466
|
+
"name": "getTotalDebits",
|
|
355
467
|
"async": true,
|
|
356
|
-
"parameters": [
|
|
357
|
-
|
|
358
|
-
"name": "start",
|
|
359
|
-
"type": "Date",
|
|
360
|
-
"optional": false
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"name": "end",
|
|
364
|
-
"type": "Date",
|
|
365
|
-
"optional": false
|
|
366
|
-
}
|
|
367
|
-
],
|
|
368
|
-
"returnType": "Promise<object>",
|
|
468
|
+
"parameters": [],
|
|
469
|
+
"returnType": "Promise<number>",
|
|
369
470
|
"isStatic": false,
|
|
370
471
|
"isPublic": true
|
|
371
472
|
},
|
|
372
|
-
"
|
|
373
|
-
"name": "
|
|
473
|
+
"getTotalCredits": {
|
|
474
|
+
"name": "getTotalCredits",
|
|
374
475
|
"async": true,
|
|
375
|
-
"parameters": [
|
|
376
|
-
|
|
377
|
-
"name": "accountIds",
|
|
378
|
-
"type": "string[]",
|
|
379
|
-
"optional": false
|
|
380
|
-
}
|
|
381
|
-
],
|
|
382
|
-
"returnType": "Promise<JournalEntry[]>",
|
|
476
|
+
"parameters": [],
|
|
477
|
+
"returnType": "Promise<number>",
|
|
383
478
|
"isStatic": false,
|
|
384
479
|
"isPublic": true
|
|
385
480
|
},
|
|
386
|
-
"
|
|
387
|
-
"name": "
|
|
481
|
+
"isBalanced": {
|
|
482
|
+
"name": "isBalanced",
|
|
388
483
|
"async": true,
|
|
389
|
-
"parameters": [
|
|
390
|
-
|
|
391
|
-
"name": "accountId",
|
|
392
|
-
"type": "string",
|
|
393
|
-
"optional": false
|
|
394
|
-
}
|
|
395
|
-
],
|
|
396
|
-
"returnType": "Promise<Array<object>>",
|
|
484
|
+
"parameters": [],
|
|
485
|
+
"returnType": "Promise<boolean>",
|
|
397
486
|
"isStatic": false,
|
|
398
487
|
"isPublic": true
|
|
399
488
|
},
|
|
400
|
-
"
|
|
401
|
-
"name": "
|
|
489
|
+
"addEntry": {
|
|
490
|
+
"name": "addEntry",
|
|
402
491
|
"async": true,
|
|
403
492
|
"parameters": [
|
|
404
493
|
{
|
|
405
|
-
"name": "
|
|
406
|
-
"type": "
|
|
494
|
+
"name": "data",
|
|
495
|
+
"type": "JournalEntryData",
|
|
407
496
|
"optional": false
|
|
408
497
|
}
|
|
409
498
|
],
|
|
410
|
-
"returnType": "Promise<
|
|
499
|
+
"returnType": "Promise<void>",
|
|
411
500
|
"isStatic": false,
|
|
412
501
|
"isPublic": true
|
|
413
502
|
},
|
|
414
|
-
"
|
|
415
|
-
"name": "
|
|
503
|
+
"post": {
|
|
504
|
+
"name": "post",
|
|
416
505
|
"async": true,
|
|
417
506
|
"parameters": [],
|
|
418
|
-
"returnType": "Promise<
|
|
507
|
+
"returnType": "Promise<void>",
|
|
419
508
|
"isStatic": false,
|
|
420
509
|
"isPublic": true
|
|
421
510
|
},
|
|
422
|
-
"
|
|
423
|
-
"name": "
|
|
511
|
+
"void": {
|
|
512
|
+
"name": "void",
|
|
424
513
|
"async": true,
|
|
425
514
|
"parameters": [
|
|
426
515
|
{
|
|
427
|
-
"name": "
|
|
516
|
+
"name": "reason",
|
|
428
517
|
"type": "string",
|
|
429
518
|
"optional": false
|
|
430
519
|
}
|
|
431
520
|
],
|
|
432
|
-
"returnType": "Promise<
|
|
521
|
+
"returnType": "Promise<void>",
|
|
522
|
+
"isStatic": false,
|
|
523
|
+
"isPublic": true
|
|
524
|
+
},
|
|
525
|
+
"summarize": {
|
|
526
|
+
"name": "summarize",
|
|
527
|
+
"async": true,
|
|
528
|
+
"parameters": [],
|
|
529
|
+
"returnType": "Promise<string>",
|
|
433
530
|
"isStatic": false,
|
|
434
531
|
"isPublic": true
|
|
435
532
|
}
|
|
436
533
|
},
|
|
437
|
-
"decoratorConfig": {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
534
|
+
"decoratorConfig": {
|
|
535
|
+
"api": {
|
|
536
|
+
"include": [
|
|
537
|
+
"list",
|
|
538
|
+
"get",
|
|
539
|
+
"create"
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
"mcp": {
|
|
543
|
+
"include": [
|
|
544
|
+
"list",
|
|
545
|
+
"get",
|
|
546
|
+
"create"
|
|
547
|
+
]
|
|
548
|
+
},
|
|
549
|
+
"cli": {
|
|
550
|
+
"skipApiCheck": true
|
|
551
|
+
},
|
|
552
|
+
"tenantScoped": {
|
|
553
|
+
"mode": "optional"
|
|
554
|
+
},
|
|
555
|
+
"conflictColumns": [
|
|
556
|
+
"tenant_id",
|
|
557
|
+
"slug",
|
|
558
|
+
"context"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
"extends": "SmrtObject",
|
|
562
|
+
"exportName": "Journal",
|
|
563
|
+
"collectionExportName": "JournalCollection",
|
|
442
564
|
"schema": {
|
|
443
|
-
"tableName": "
|
|
444
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
565
|
+
"tableName": "journals",
|
|
566
|
+
"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);",
|
|
445
567
|
"columns": {
|
|
446
568
|
"id": {
|
|
447
569
|
"type": "UUID",
|
|
@@ -474,59 +596,54 @@
|
|
|
474
596
|
"notNull": false,
|
|
475
597
|
"unique": false
|
|
476
598
|
},
|
|
477
|
-
"
|
|
478
|
-
"type": "
|
|
479
|
-
"referenceKind": "foreignKey",
|
|
599
|
+
"number": {
|
|
600
|
+
"type": "TEXT",
|
|
480
601
|
"notNull": false,
|
|
481
602
|
"unique": false,
|
|
482
|
-
"
|
|
483
|
-
"table": "journals",
|
|
484
|
-
"column": "id",
|
|
485
|
-
"onDelete": "NO ACTION",
|
|
486
|
-
"onUpdate": "CASCADE"
|
|
487
|
-
}
|
|
603
|
+
"default": ""
|
|
488
604
|
},
|
|
489
|
-
"
|
|
490
|
-
"type": "
|
|
491
|
-
"referenceKind": "foreignKey",
|
|
605
|
+
"date": {
|
|
606
|
+
"type": "TIMESTAMP",
|
|
492
607
|
"notNull": false,
|
|
493
|
-
"unique": false
|
|
494
|
-
"foreignKey": {
|
|
495
|
-
"table": "accounts",
|
|
496
|
-
"column": "id",
|
|
497
|
-
"onDelete": "NO ACTION",
|
|
498
|
-
"onUpdate": "CASCADE"
|
|
499
|
-
}
|
|
608
|
+
"unique": false
|
|
500
609
|
},
|
|
501
|
-
"
|
|
502
|
-
"type": "
|
|
610
|
+
"description": {
|
|
611
|
+
"type": "TEXT",
|
|
503
612
|
"notNull": false,
|
|
504
613
|
"unique": false,
|
|
505
|
-
"default":
|
|
614
|
+
"default": ""
|
|
506
615
|
},
|
|
507
|
-
"
|
|
508
|
-
"type": "
|
|
616
|
+
"source_module": {
|
|
617
|
+
"type": "TEXT",
|
|
509
618
|
"notNull": false,
|
|
510
619
|
"unique": false,
|
|
511
|
-
"default":
|
|
620
|
+
"default": ""
|
|
512
621
|
},
|
|
513
|
-
"
|
|
622
|
+
"source_ref": {
|
|
514
623
|
"type": "TEXT",
|
|
515
624
|
"notNull": false,
|
|
516
|
-
"unique": false
|
|
517
|
-
"default": "USD"
|
|
625
|
+
"unique": false
|
|
518
626
|
},
|
|
519
|
-
"
|
|
520
|
-
"type": "
|
|
627
|
+
"status": {
|
|
628
|
+
"type": "TEXT",
|
|
521
629
|
"notNull": false,
|
|
522
630
|
"unique": false,
|
|
523
|
-
"default":
|
|
631
|
+
"default": "draft"
|
|
524
632
|
},
|
|
525
|
-
"
|
|
633
|
+
"posted_at": {
|
|
634
|
+
"type": "TIMESTAMP",
|
|
635
|
+
"notNull": false,
|
|
636
|
+
"unique": false
|
|
637
|
+
},
|
|
638
|
+
"voided_at": {
|
|
639
|
+
"type": "TIMESTAMP",
|
|
640
|
+
"notNull": false,
|
|
641
|
+
"unique": false
|
|
642
|
+
},
|
|
643
|
+
"void_reason": {
|
|
526
644
|
"type": "TEXT",
|
|
527
645
|
"notNull": false,
|
|
528
|
-
"unique": false
|
|
529
|
-
"default": ""
|
|
646
|
+
"unique": false
|
|
530
647
|
},
|
|
531
648
|
"metadata": {
|
|
532
649
|
"type": "JSON",
|
|
@@ -537,7 +654,7 @@
|
|
|
537
654
|
},
|
|
538
655
|
"indexes": [
|
|
539
656
|
{
|
|
540
|
-
"name": "
|
|
657
|
+
"name": "journals_slug_context_idx",
|
|
541
658
|
"columns": [
|
|
542
659
|
"tenant_id",
|
|
543
660
|
"slug",
|
|
@@ -547,240 +664,173 @@
|
|
|
547
664
|
"nullsNotDistinct": true
|
|
548
665
|
},
|
|
549
666
|
{
|
|
550
|
-
"name": "
|
|
667
|
+
"name": "journals_tenant_id_created_at_idx",
|
|
551
668
|
"columns": [
|
|
552
669
|
"tenant_id",
|
|
553
670
|
"created_at"
|
|
554
671
|
]
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
"name": "journal_entries_journal_id_idx",
|
|
558
|
-
"columns": [
|
|
559
|
-
"journal_id"
|
|
560
|
-
]
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
"name": "journal_entries_account_id_idx",
|
|
564
|
-
"columns": [
|
|
565
|
-
"account_id"
|
|
566
|
-
]
|
|
567
672
|
}
|
|
568
673
|
],
|
|
569
|
-
"version": "
|
|
674
|
+
"version": "4b51d204"
|
|
570
675
|
},
|
|
571
676
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
572
677
|
},
|
|
573
|
-
"@happyvertical/smrt-ledgers:
|
|
574
|
-
"name": "
|
|
575
|
-
"className": "
|
|
576
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
577
|
-
"collection": "
|
|
578
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
678
|
+
"@happyvertical/smrt-ledgers:JournalEntry": {
|
|
679
|
+
"name": "journalentry",
|
|
680
|
+
"className": "JournalEntry",
|
|
681
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:JournalEntry",
|
|
682
|
+
"collection": "journalentries",
|
|
683
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/models/JournalEntry.ts",
|
|
579
684
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
580
|
-
"fields": {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
"
|
|
584
|
-
"
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
"
|
|
589
|
-
"
|
|
685
|
+
"fields": {
|
|
686
|
+
"tenantId": {
|
|
687
|
+
"type": "text",
|
|
688
|
+
"required": false,
|
|
689
|
+
"_meta": {
|
|
690
|
+
"sqlType": "UUID",
|
|
691
|
+
"nullable": true,
|
|
692
|
+
"__tenancy": {
|
|
693
|
+
"isTenantIdField": true,
|
|
694
|
+
"autoFilter": true,
|
|
695
|
+
"required": false,
|
|
696
|
+
"autoPopulate": true,
|
|
697
|
+
"nullable": true,
|
|
698
|
+
"mode": "optional",
|
|
699
|
+
"field": "tenantId",
|
|
700
|
+
"allowSuperAdminBypass": false
|
|
590
701
|
}
|
|
591
|
-
|
|
592
|
-
"returnType": "Promise<Journal | null>",
|
|
593
|
-
"isStatic": false,
|
|
594
|
-
"isPublic": true
|
|
702
|
+
}
|
|
595
703
|
},
|
|
596
|
-
"
|
|
597
|
-
"
|
|
598
|
-
"
|
|
599
|
-
"
|
|
600
|
-
{
|
|
601
|
-
"name": "start",
|
|
602
|
-
"type": "Date",
|
|
603
|
-
"optional": false
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
"name": "end",
|
|
607
|
-
"type": "Date",
|
|
608
|
-
"optional": false
|
|
609
|
-
}
|
|
610
|
-
],
|
|
611
|
-
"returnType": "Promise<Journal[]>",
|
|
612
|
-
"isStatic": false,
|
|
613
|
-
"isPublic": true
|
|
704
|
+
"journalId": {
|
|
705
|
+
"type": "foreignKey",
|
|
706
|
+
"required": false,
|
|
707
|
+
"related": "Journal"
|
|
614
708
|
},
|
|
615
|
-
"
|
|
616
|
-
"
|
|
617
|
-
"
|
|
618
|
-
"
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
"
|
|
627
|
-
"
|
|
709
|
+
"accountId": {
|
|
710
|
+
"type": "foreignKey",
|
|
711
|
+
"required": false,
|
|
712
|
+
"related": "Account"
|
|
713
|
+
},
|
|
714
|
+
"debit": {
|
|
715
|
+
"type": "decimal",
|
|
716
|
+
"required": false,
|
|
717
|
+
"default": 0
|
|
718
|
+
},
|
|
719
|
+
"credit": {
|
|
720
|
+
"type": "decimal",
|
|
721
|
+
"required": false,
|
|
722
|
+
"default": 0
|
|
723
|
+
},
|
|
724
|
+
"currency": {
|
|
725
|
+
"type": "text",
|
|
726
|
+
"required": false,
|
|
727
|
+
"default": "USD"
|
|
628
728
|
},
|
|
629
|
-
"
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
{
|
|
634
|
-
"name": "status",
|
|
635
|
-
"type": "JournalStatus",
|
|
636
|
-
"optional": false
|
|
637
|
-
}
|
|
638
|
-
],
|
|
639
|
-
"returnType": "Promise<Journal[]>",
|
|
640
|
-
"isStatic": false,
|
|
641
|
-
"isPublic": true
|
|
729
|
+
"exchangeRate": {
|
|
730
|
+
"type": "decimal",
|
|
731
|
+
"required": false,
|
|
732
|
+
"default": 1
|
|
642
733
|
},
|
|
643
|
-
"
|
|
644
|
-
"
|
|
645
|
-
"
|
|
734
|
+
"memo": {
|
|
735
|
+
"type": "text",
|
|
736
|
+
"required": false,
|
|
737
|
+
"default": ""
|
|
738
|
+
},
|
|
739
|
+
"metadata": {
|
|
740
|
+
"type": "json",
|
|
741
|
+
"required": false,
|
|
742
|
+
"default": {}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"methods": {
|
|
746
|
+
"isDebit": {
|
|
747
|
+
"name": "isDebit",
|
|
748
|
+
"async": false,
|
|
646
749
|
"parameters": [],
|
|
647
|
-
"returnType": "
|
|
750
|
+
"returnType": "boolean",
|
|
648
751
|
"isStatic": false,
|
|
649
752
|
"isPublic": true
|
|
650
753
|
},
|
|
651
|
-
"
|
|
652
|
-
"name": "
|
|
653
|
-
"async":
|
|
754
|
+
"isCredit": {
|
|
755
|
+
"name": "isCredit",
|
|
756
|
+
"async": false,
|
|
654
757
|
"parameters": [],
|
|
655
|
-
"returnType": "
|
|
758
|
+
"returnType": "boolean",
|
|
656
759
|
"isStatic": false,
|
|
657
760
|
"isPublic": true
|
|
658
761
|
},
|
|
659
|
-
"
|
|
660
|
-
"name": "
|
|
661
|
-
"async":
|
|
662
|
-
"parameters": [
|
|
663
|
-
|
|
664
|
-
"name": "data",
|
|
665
|
-
"type": "CreateJournalData",
|
|
666
|
-
"optional": false
|
|
667
|
-
}
|
|
668
|
-
],
|
|
669
|
-
"returnType": "Promise<Journal>",
|
|
762
|
+
"getAmount": {
|
|
763
|
+
"name": "getAmount",
|
|
764
|
+
"async": false,
|
|
765
|
+
"parameters": [],
|
|
766
|
+
"returnType": "number",
|
|
670
767
|
"isStatic": false,
|
|
671
768
|
"isPublic": true
|
|
672
769
|
},
|
|
673
|
-
"
|
|
674
|
-
"name": "
|
|
675
|
-
"async":
|
|
676
|
-
"parameters": [
|
|
677
|
-
|
|
678
|
-
"name": "journalId",
|
|
679
|
-
"type": "string",
|
|
680
|
-
"optional": false
|
|
681
|
-
}
|
|
682
|
-
],
|
|
683
|
-
"returnType": "Promise<Journal>",
|
|
770
|
+
"getBaseAmount": {
|
|
771
|
+
"name": "getBaseAmount",
|
|
772
|
+
"async": false,
|
|
773
|
+
"parameters": [],
|
|
774
|
+
"returnType": "number",
|
|
684
775
|
"isStatic": false,
|
|
685
776
|
"isPublic": true
|
|
686
777
|
},
|
|
687
|
-
"
|
|
688
|
-
"name": "
|
|
778
|
+
"getJournal": {
|
|
779
|
+
"name": "getJournal",
|
|
689
780
|
"async": true,
|
|
690
|
-
"parameters": [
|
|
691
|
-
|
|
692
|
-
"name": "journalId",
|
|
693
|
-
"type": "string",
|
|
694
|
-
"optional": false
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
"name": "reason",
|
|
698
|
-
"type": "string",
|
|
699
|
-
"optional": false
|
|
700
|
-
}
|
|
701
|
-
],
|
|
702
|
-
"returnType": "Promise<Journal>",
|
|
781
|
+
"parameters": [],
|
|
782
|
+
"returnType": "any",
|
|
703
783
|
"isStatic": false,
|
|
704
784
|
"isPublic": true
|
|
705
785
|
},
|
|
706
|
-
"
|
|
707
|
-
"name": "
|
|
786
|
+
"getAccount": {
|
|
787
|
+
"name": "getAccount",
|
|
708
788
|
"async": true,
|
|
709
|
-
"parameters": [
|
|
710
|
-
|
|
711
|
-
"name": "sourceRef",
|
|
712
|
-
"type": "string",
|
|
713
|
-
"optional": false
|
|
714
|
-
}
|
|
715
|
-
],
|
|
716
|
-
"returnType": "Promise<Journal[]>",
|
|
789
|
+
"parameters": [],
|
|
790
|
+
"returnType": "any",
|
|
717
791
|
"isStatic": false,
|
|
718
792
|
"isPublic": true
|
|
719
793
|
},
|
|
720
|
-
"
|
|
721
|
-
"name": "
|
|
794
|
+
"getDescription": {
|
|
795
|
+
"name": "getDescription",
|
|
722
796
|
"async": true,
|
|
723
|
-
"parameters": [
|
|
724
|
-
|
|
725
|
-
"name": "year",
|
|
726
|
-
"type": "number",
|
|
727
|
-
"optional": false
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
"name": "month",
|
|
731
|
-
"type": "number",
|
|
732
|
-
"optional": false
|
|
733
|
-
}
|
|
734
|
-
],
|
|
735
|
-
"returnType": "Promise<Journal[]>",
|
|
797
|
+
"parameters": [],
|
|
798
|
+
"returnType": "Promise<string>",
|
|
736
799
|
"isStatic": false,
|
|
737
800
|
"isPublic": true
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
"decoratorConfig": {
|
|
804
|
+
"api": {
|
|
805
|
+
"include": [
|
|
806
|
+
"list",
|
|
807
|
+
"get"
|
|
808
|
+
]
|
|
738
809
|
},
|
|
739
|
-
"
|
|
740
|
-
"
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
"name": "tenantId",
|
|
745
|
-
"type": "string",
|
|
746
|
-
"optional": false
|
|
747
|
-
}
|
|
748
|
-
],
|
|
749
|
-
"returnType": "Promise<Journal[]>",
|
|
750
|
-
"isStatic": false,
|
|
751
|
-
"isPublic": true
|
|
810
|
+
"mcp": {
|
|
811
|
+
"include": [
|
|
812
|
+
"list",
|
|
813
|
+
"get"
|
|
814
|
+
]
|
|
752
815
|
},
|
|
753
|
-
"
|
|
754
|
-
"
|
|
755
|
-
"async": true,
|
|
756
|
-
"parameters": [],
|
|
757
|
-
"returnType": "Promise<Journal[]>",
|
|
758
|
-
"isStatic": false,
|
|
759
|
-
"isPublic": true
|
|
816
|
+
"cli": {
|
|
817
|
+
"skipApiCheck": true
|
|
760
818
|
},
|
|
761
|
-
"
|
|
762
|
-
"
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
],
|
|
771
|
-
"returnType": "Promise<Journal[]>",
|
|
772
|
-
"isStatic": false,
|
|
773
|
-
"isPublic": true
|
|
774
|
-
}
|
|
819
|
+
"tenantScoped": {
|
|
820
|
+
"mode": "optional"
|
|
821
|
+
},
|
|
822
|
+
"conflictColumns": [
|
|
823
|
+
"tenant_id",
|
|
824
|
+
"slug",
|
|
825
|
+
"context"
|
|
826
|
+
]
|
|
775
827
|
},
|
|
776
|
-
"
|
|
777
|
-
"
|
|
778
|
-
"
|
|
779
|
-
"exportName": "JournalCollection",
|
|
780
|
-
"collectionExportName": "JournalCollectionCollection",
|
|
828
|
+
"extends": "SmrtObject",
|
|
829
|
+
"exportName": "JournalEntry",
|
|
830
|
+
"collectionExportName": "JournalEntryCollection",
|
|
781
831
|
"schema": {
|
|
782
|
-
"tableName": "
|
|
783
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
832
|
+
"tableName": "journal_entries",
|
|
833
|
+
"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);",
|
|
784
834
|
"columns": {
|
|
785
835
|
"id": {
|
|
786
836
|
"type": "UUID",
|
|
@@ -813,54 +863,59 @@
|
|
|
813
863
|
"notNull": false,
|
|
814
864
|
"unique": false
|
|
815
865
|
},
|
|
816
|
-
"
|
|
817
|
-
"type": "
|
|
866
|
+
"journal_id": {
|
|
867
|
+
"type": "UUID",
|
|
868
|
+
"referenceKind": "foreignKey",
|
|
818
869
|
"notNull": false,
|
|
819
870
|
"unique": false,
|
|
820
|
-
"
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
871
|
+
"foreignKey": {
|
|
872
|
+
"table": "journals",
|
|
873
|
+
"column": "id",
|
|
874
|
+
"onDelete": "NO ACTION",
|
|
875
|
+
"onUpdate": "CASCADE"
|
|
876
|
+
}
|
|
826
877
|
},
|
|
827
|
-
"
|
|
828
|
-
"type": "
|
|
878
|
+
"account_id": {
|
|
879
|
+
"type": "UUID",
|
|
880
|
+
"referenceKind": "foreignKey",
|
|
829
881
|
"notNull": false,
|
|
830
882
|
"unique": false,
|
|
831
|
-
"
|
|
883
|
+
"foreignKey": {
|
|
884
|
+
"table": "accounts",
|
|
885
|
+
"column": "id",
|
|
886
|
+
"onDelete": "NO ACTION",
|
|
887
|
+
"onUpdate": "CASCADE"
|
|
888
|
+
}
|
|
832
889
|
},
|
|
833
|
-
"
|
|
834
|
-
"type": "
|
|
890
|
+
"debit": {
|
|
891
|
+
"type": "REAL",
|
|
835
892
|
"notNull": false,
|
|
836
893
|
"unique": false,
|
|
837
|
-
"default":
|
|
894
|
+
"default": 0
|
|
838
895
|
},
|
|
839
|
-
"
|
|
840
|
-
"type": "
|
|
896
|
+
"credit": {
|
|
897
|
+
"type": "REAL",
|
|
841
898
|
"notNull": false,
|
|
842
|
-
"unique": false
|
|
899
|
+
"unique": false,
|
|
900
|
+
"default": 0
|
|
843
901
|
},
|
|
844
|
-
"
|
|
902
|
+
"currency": {
|
|
845
903
|
"type": "TEXT",
|
|
846
904
|
"notNull": false,
|
|
847
905
|
"unique": false,
|
|
848
|
-
"default": "
|
|
849
|
-
},
|
|
850
|
-
"posted_at": {
|
|
851
|
-
"type": "TIMESTAMP",
|
|
852
|
-
"notNull": false,
|
|
853
|
-
"unique": false
|
|
906
|
+
"default": "USD"
|
|
854
907
|
},
|
|
855
|
-
"
|
|
856
|
-
"type": "
|
|
908
|
+
"exchange_rate": {
|
|
909
|
+
"type": "REAL",
|
|
857
910
|
"notNull": false,
|
|
858
|
-
"unique": false
|
|
911
|
+
"unique": false,
|
|
912
|
+
"default": 1
|
|
859
913
|
},
|
|
860
|
-
"
|
|
914
|
+
"memo": {
|
|
861
915
|
"type": "TEXT",
|
|
862
916
|
"notNull": false,
|
|
863
|
-
"unique": false
|
|
917
|
+
"unique": false,
|
|
918
|
+
"default": ""
|
|
864
919
|
},
|
|
865
920
|
"metadata": {
|
|
866
921
|
"type": "JSON",
|
|
@@ -871,7 +926,7 @@
|
|
|
871
926
|
},
|
|
872
927
|
"indexes": [
|
|
873
928
|
{
|
|
874
|
-
"name": "
|
|
929
|
+
"name": "journal_entries_slug_context_idx",
|
|
875
930
|
"columns": [
|
|
876
931
|
"tenant_id",
|
|
877
932
|
"slug",
|
|
@@ -881,249 +936,192 @@
|
|
|
881
936
|
"nullsNotDistinct": true
|
|
882
937
|
},
|
|
883
938
|
{
|
|
884
|
-
"name": "
|
|
939
|
+
"name": "journal_entries_tenant_id_created_at_idx",
|
|
885
940
|
"columns": [
|
|
886
941
|
"tenant_id",
|
|
887
942
|
"created_at"
|
|
888
943
|
]
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"name": "journal_entries_journal_id_idx",
|
|
947
|
+
"columns": [
|
|
948
|
+
"journal_id"
|
|
949
|
+
]
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"name": "journal_entries_account_id_idx",
|
|
953
|
+
"columns": [
|
|
954
|
+
"account_id"
|
|
955
|
+
]
|
|
889
956
|
}
|
|
890
957
|
],
|
|
891
|
-
"version": "
|
|
958
|
+
"version": "0457e0e4"
|
|
892
959
|
},
|
|
893
960
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
894
961
|
},
|
|
895
|
-
"@happyvertical/smrt-ledgers:
|
|
896
|
-
"name": "
|
|
897
|
-
"className": "
|
|
898
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
962
|
+
"@happyvertical/smrt-ledgers:AccountCollection": {
|
|
963
|
+
"name": "accountcollection",
|
|
964
|
+
"className": "AccountCollection",
|
|
965
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:AccountCollection",
|
|
899
966
|
"collection": "accounts",
|
|
900
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
967
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/collections/Accounts.ts",
|
|
901
968
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
902
|
-
"fields": {
|
|
903
|
-
"parentId": {
|
|
904
|
-
"type": "foreignKey",
|
|
905
|
-
"required": false,
|
|
906
|
-
"related": "Account",
|
|
907
|
-
"_meta": {
|
|
908
|
-
"nullable": true
|
|
909
|
-
}
|
|
910
|
-
},
|
|
911
|
-
"tenantId": {
|
|
912
|
-
"type": "text",
|
|
913
|
-
"required": false,
|
|
914
|
-
"_meta": {
|
|
915
|
-
"sqlType": "UUID",
|
|
916
|
-
"nullable": true,
|
|
917
|
-
"__tenancy": {
|
|
918
|
-
"isTenantIdField": true,
|
|
919
|
-
"autoFilter": true,
|
|
920
|
-
"required": false,
|
|
921
|
-
"autoPopulate": true,
|
|
922
|
-
"nullable": true,
|
|
923
|
-
"mode": "optional",
|
|
924
|
-
"field": "tenantId",
|
|
925
|
-
"allowSuperAdminBypass": false
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
},
|
|
929
|
-
"number": {
|
|
930
|
-
"type": "text",
|
|
931
|
-
"required": false,
|
|
932
|
-
"default": ""
|
|
933
|
-
},
|
|
934
|
-
"name": {
|
|
935
|
-
"type": "text",
|
|
936
|
-
"required": false,
|
|
937
|
-
"default": ""
|
|
938
|
-
},
|
|
939
|
-
"description": {
|
|
940
|
-
"type": "text",
|
|
941
|
-
"required": false,
|
|
942
|
-
"default": ""
|
|
943
|
-
},
|
|
944
|
-
"type": {
|
|
945
|
-
"type": "text",
|
|
946
|
-
"required": false,
|
|
947
|
-
"default": "asset"
|
|
948
|
-
},
|
|
949
|
-
"active": {
|
|
950
|
-
"type": "boolean",
|
|
951
|
-
"required": false,
|
|
952
|
-
"default": true
|
|
953
|
-
},
|
|
954
|
-
"metadata": {
|
|
955
|
-
"type": "json",
|
|
956
|
-
"required": false,
|
|
957
|
-
"default": {}
|
|
958
|
-
}
|
|
959
|
-
},
|
|
969
|
+
"fields": {},
|
|
960
970
|
"methods": {
|
|
961
|
-
"
|
|
962
|
-
"name": "
|
|
963
|
-
"async": true,
|
|
964
|
-
"parameters": [],
|
|
965
|
-
"returnType": "Promise<this | null>",
|
|
966
|
-
"isStatic": false,
|
|
967
|
-
"isPublic": true
|
|
968
|
-
},
|
|
969
|
-
"getChildren": {
|
|
970
|
-
"name": "getChildren",
|
|
971
|
+
"findByNumber": {
|
|
972
|
+
"name": "findByNumber",
|
|
971
973
|
"async": true,
|
|
972
|
-
"parameters": [
|
|
973
|
-
|
|
974
|
+
"parameters": [
|
|
975
|
+
{
|
|
976
|
+
"name": "number",
|
|
977
|
+
"type": "string",
|
|
978
|
+
"optional": false
|
|
979
|
+
}
|
|
980
|
+
],
|
|
981
|
+
"returnType": "Promise<Account | null>",
|
|
974
982
|
"isStatic": false,
|
|
975
983
|
"isPublic": true
|
|
976
984
|
},
|
|
977
|
-
"
|
|
978
|
-
"name": "
|
|
985
|
+
"findByType": {
|
|
986
|
+
"name": "findByType",
|
|
979
987
|
"async": true,
|
|
980
|
-
"parameters": [
|
|
981
|
-
|
|
988
|
+
"parameters": [
|
|
989
|
+
{
|
|
990
|
+
"name": "type",
|
|
991
|
+
"type": "AccountType",
|
|
992
|
+
"optional": false
|
|
993
|
+
}
|
|
994
|
+
],
|
|
995
|
+
"returnType": "Promise<Account[]>",
|
|
982
996
|
"isStatic": false,
|
|
983
997
|
"isPublic": true
|
|
984
998
|
},
|
|
985
|
-
"
|
|
986
|
-
"name": "
|
|
999
|
+
"findActive": {
|
|
1000
|
+
"name": "findActive",
|
|
987
1001
|
"async": true,
|
|
988
1002
|
"parameters": [],
|
|
989
|
-
"returnType": "Promise<
|
|
1003
|
+
"returnType": "Promise<Account[]>",
|
|
990
1004
|
"isStatic": false,
|
|
991
1005
|
"isPublic": true
|
|
992
1006
|
},
|
|
993
|
-
"
|
|
994
|
-
"name": "
|
|
1007
|
+
"findTopLevel": {
|
|
1008
|
+
"name": "findTopLevel",
|
|
995
1009
|
"async": true,
|
|
996
1010
|
"parameters": [],
|
|
997
|
-
"returnType": "Promise<
|
|
1011
|
+
"returnType": "Promise<Account[]>",
|
|
998
1012
|
"isStatic": false,
|
|
999
1013
|
"isPublic": true
|
|
1000
1014
|
},
|
|
1001
|
-
"
|
|
1002
|
-
"name": "
|
|
1015
|
+
"findChildren": {
|
|
1016
|
+
"name": "findChildren",
|
|
1003
1017
|
"async": true,
|
|
1004
1018
|
"parameters": [
|
|
1005
1019
|
{
|
|
1006
|
-
"name": "
|
|
1007
|
-
"type": "
|
|
1008
|
-
"optional": false
|
|
1009
|
-
"unionBranches": [
|
|
1010
|
-
{
|
|
1011
|
-
"type": "this"
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
"type": "string"
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
"type": "null"
|
|
1018
|
-
}
|
|
1019
|
-
]
|
|
1020
|
+
"name": "parentId",
|
|
1021
|
+
"type": "string",
|
|
1022
|
+
"optional": false
|
|
1020
1023
|
}
|
|
1021
1024
|
],
|
|
1022
|
-
"returnType": "Promise<
|
|
1023
|
-
"isStatic": false,
|
|
1024
|
-
"isPublic": true
|
|
1025
|
-
},
|
|
1026
|
-
"isTopLevel": {
|
|
1027
|
-
"name": "isTopLevel",
|
|
1028
|
-
"async": false,
|
|
1029
|
-
"parameters": [],
|
|
1030
|
-
"returnType": "boolean",
|
|
1025
|
+
"returnType": "Promise<Account[]>",
|
|
1031
1026
|
"isStatic": false,
|
|
1032
1027
|
"isPublic": true
|
|
1033
1028
|
},
|
|
1034
|
-
"
|
|
1035
|
-
"name": "
|
|
1036
|
-
"async":
|
|
1029
|
+
"getTree": {
|
|
1030
|
+
"name": "getTree",
|
|
1031
|
+
"async": true,
|
|
1037
1032
|
"parameters": [],
|
|
1038
|
-
"returnType": "
|
|
1033
|
+
"returnType": "Promise<AccountTree>",
|
|
1039
1034
|
"isStatic": false,
|
|
1040
1035
|
"isPublic": true
|
|
1041
1036
|
},
|
|
1042
|
-
"
|
|
1043
|
-
"name": "
|
|
1044
|
-
"async":
|
|
1045
|
-
"parameters": [
|
|
1046
|
-
|
|
1037
|
+
"getOrCreateByNumber": {
|
|
1038
|
+
"name": "getOrCreateByNumber",
|
|
1039
|
+
"async": true,
|
|
1040
|
+
"parameters": [
|
|
1041
|
+
{
|
|
1042
|
+
"name": "number",
|
|
1043
|
+
"type": "string",
|
|
1044
|
+
"optional": false
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
"name": "defaults",
|
|
1048
|
+
"type": "Partial<object>",
|
|
1049
|
+
"optional": true,
|
|
1050
|
+
"memberTypes": [
|
|
1051
|
+
"string",
|
|
1052
|
+
"AccountType",
|
|
1053
|
+
"string | null"
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
],
|
|
1057
|
+
"returnType": "Promise<Account>",
|
|
1047
1058
|
"isStatic": false,
|
|
1048
1059
|
"isPublic": true
|
|
1049
1060
|
},
|
|
1050
|
-
"
|
|
1051
|
-
"name": "
|
|
1061
|
+
"groupByType": {
|
|
1062
|
+
"name": "groupByType",
|
|
1052
1063
|
"async": true,
|
|
1053
1064
|
"parameters": [],
|
|
1054
|
-
"returnType": "Promise<
|
|
1065
|
+
"returnType": "Promise<Record<AccountType, Account[]>>",
|
|
1055
1066
|
"isStatic": false,
|
|
1056
1067
|
"isPublic": true
|
|
1057
1068
|
},
|
|
1058
|
-
"
|
|
1059
|
-
"name": "
|
|
1069
|
+
"getDescendants": {
|
|
1070
|
+
"name": "getDescendants",
|
|
1060
1071
|
"async": true,
|
|
1061
|
-
"parameters": [
|
|
1062
|
-
|
|
1072
|
+
"parameters": [
|
|
1073
|
+
{
|
|
1074
|
+
"name": "accountId",
|
|
1075
|
+
"type": "string",
|
|
1076
|
+
"optional": false
|
|
1077
|
+
}
|
|
1078
|
+
],
|
|
1079
|
+
"returnType": "Promise<Account[]>",
|
|
1063
1080
|
"isStatic": false,
|
|
1064
1081
|
"isPublic": true
|
|
1065
1082
|
},
|
|
1066
|
-
"
|
|
1067
|
-
"name": "
|
|
1083
|
+
"findByTenant": {
|
|
1084
|
+
"name": "findByTenant",
|
|
1068
1085
|
"async": true,
|
|
1069
1086
|
"parameters": [
|
|
1070
1087
|
{
|
|
1071
|
-
"name": "
|
|
1072
|
-
"type": "
|
|
1073
|
-
"optional":
|
|
1088
|
+
"name": "tenantId",
|
|
1089
|
+
"type": "string",
|
|
1090
|
+
"optional": false
|
|
1074
1091
|
}
|
|
1075
1092
|
],
|
|
1076
|
-
"returnType": "Promise<
|
|
1093
|
+
"returnType": "Promise<Account[]>",
|
|
1077
1094
|
"isStatic": false,
|
|
1078
1095
|
"isPublic": true
|
|
1079
1096
|
},
|
|
1080
|
-
"
|
|
1081
|
-
"name": "
|
|
1097
|
+
"findGlobal": {
|
|
1098
|
+
"name": "findGlobal",
|
|
1099
|
+
"async": true,
|
|
1100
|
+
"parameters": [],
|
|
1101
|
+
"returnType": "Promise<Account[]>",
|
|
1102
|
+
"isStatic": false,
|
|
1103
|
+
"isPublic": true
|
|
1104
|
+
},
|
|
1105
|
+
"findWithGlobals": {
|
|
1106
|
+
"name": "findWithGlobals",
|
|
1082
1107
|
"async": true,
|
|
1083
1108
|
"parameters": [
|
|
1084
1109
|
{
|
|
1085
|
-
"name": "
|
|
1086
|
-
"type": "
|
|
1110
|
+
"name": "tenantId",
|
|
1111
|
+
"type": "string",
|
|
1087
1112
|
"optional": false
|
|
1088
1113
|
}
|
|
1089
1114
|
],
|
|
1090
|
-
"returnType": "Promise<Account>",
|
|
1115
|
+
"returnType": "Promise<Account[]>",
|
|
1091
1116
|
"isStatic": false,
|
|
1092
1117
|
"isPublic": true
|
|
1093
1118
|
}
|
|
1094
1119
|
},
|
|
1095
|
-
"decoratorConfig": {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
"create",
|
|
1101
|
-
"update",
|
|
1102
|
-
"delete"
|
|
1103
|
-
]
|
|
1104
|
-
},
|
|
1105
|
-
"mcp": {
|
|
1106
|
-
"include": [
|
|
1107
|
-
"list",
|
|
1108
|
-
"get",
|
|
1109
|
-
"create"
|
|
1110
|
-
]
|
|
1111
|
-
},
|
|
1112
|
-
"cli": {
|
|
1113
|
-
"skipApiCheck": true
|
|
1114
|
-
},
|
|
1115
|
-
"tenantScoped": {
|
|
1116
|
-
"mode": "optional"
|
|
1117
|
-
},
|
|
1118
|
-
"conflictColumns": [
|
|
1119
|
-
"tenant_id",
|
|
1120
|
-
"slug",
|
|
1121
|
-
"context"
|
|
1122
|
-
]
|
|
1123
|
-
},
|
|
1124
|
-
"extends": "SmrtHierarchical",
|
|
1125
|
-
"exportName": "Account",
|
|
1126
|
-
"collectionExportName": "AccountCollection",
|
|
1120
|
+
"decoratorConfig": {},
|
|
1121
|
+
"extends": "SmrtCollection",
|
|
1122
|
+
"extendsTypeArg": "Account",
|
|
1123
|
+
"exportName": "AccountCollection",
|
|
1124
|
+
"collectionExportName": "AccountCollectionCollection",
|
|
1127
1125
|
"schema": {
|
|
1128
1126
|
"tableName": "accounts",
|
|
1129
1127
|
"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);",
|
|
@@ -1237,221 +1235,168 @@
|
|
|
1237
1235
|
},
|
|
1238
1236
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
1239
1237
|
},
|
|
1240
|
-
"@happyvertical/smrt-ledgers:
|
|
1241
|
-
"name": "
|
|
1242
|
-
"className": "
|
|
1243
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
1244
|
-
"collection": "
|
|
1245
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
1238
|
+
"@happyvertical/smrt-ledgers:JournalEntryCollection": {
|
|
1239
|
+
"name": "journalentrycollection",
|
|
1240
|
+
"className": "JournalEntryCollection",
|
|
1241
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:JournalEntryCollection",
|
|
1242
|
+
"collection": "journalentries",
|
|
1243
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/collections/JournalEntries.ts",
|
|
1246
1244
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
1247
|
-
"fields": {
|
|
1248
|
-
"tenantId": {
|
|
1249
|
-
"type": "text",
|
|
1250
|
-
"required": false,
|
|
1251
|
-
"_meta": {
|
|
1252
|
-
"sqlType": "UUID",
|
|
1253
|
-
"nullable": true,
|
|
1254
|
-
"__tenancy": {
|
|
1255
|
-
"isTenantIdField": true,
|
|
1256
|
-
"autoFilter": true,
|
|
1257
|
-
"required": false,
|
|
1258
|
-
"autoPopulate": true,
|
|
1259
|
-
"nullable": true,
|
|
1260
|
-
"mode": "optional",
|
|
1261
|
-
"field": "tenantId",
|
|
1262
|
-
"allowSuperAdminBypass": false
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
"number": {
|
|
1267
|
-
"type": "text",
|
|
1268
|
-
"required": false,
|
|
1269
|
-
"default": ""
|
|
1270
|
-
},
|
|
1271
|
-
"date": {
|
|
1272
|
-
"type": "datetime",
|
|
1273
|
-
"required": false
|
|
1274
|
-
},
|
|
1275
|
-
"description": {
|
|
1276
|
-
"type": "text",
|
|
1277
|
-
"required": false,
|
|
1278
|
-
"default": ""
|
|
1279
|
-
},
|
|
1280
|
-
"sourceModule": {
|
|
1281
|
-
"type": "text",
|
|
1282
|
-
"required": false,
|
|
1283
|
-
"default": ""
|
|
1284
|
-
},
|
|
1285
|
-
"sourceRef": {
|
|
1286
|
-
"type": "text",
|
|
1287
|
-
"required": false
|
|
1288
|
-
},
|
|
1289
|
-
"status": {
|
|
1290
|
-
"type": "text",
|
|
1291
|
-
"required": false,
|
|
1292
|
-
"default": "draft"
|
|
1293
|
-
},
|
|
1294
|
-
"postedAt": {
|
|
1295
|
-
"type": "datetime",
|
|
1296
|
-
"required": false
|
|
1297
|
-
},
|
|
1298
|
-
"voidedAt": {
|
|
1299
|
-
"type": "datetime",
|
|
1300
|
-
"required": false
|
|
1301
|
-
},
|
|
1302
|
-
"voidReason": {
|
|
1303
|
-
"type": "text",
|
|
1304
|
-
"required": false
|
|
1305
|
-
},
|
|
1306
|
-
"metadata": {
|
|
1307
|
-
"type": "json",
|
|
1308
|
-
"required": false,
|
|
1309
|
-
"default": {}
|
|
1310
|
-
}
|
|
1311
|
-
},
|
|
1245
|
+
"fields": {},
|
|
1312
1246
|
"methods": {
|
|
1313
|
-
"
|
|
1314
|
-
"name": "
|
|
1315
|
-
"async":
|
|
1316
|
-
"parameters": [
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
"
|
|
1324
|
-
"parameters": [],
|
|
1325
|
-
"returnType": "boolean",
|
|
1247
|
+
"findByJournal": {
|
|
1248
|
+
"name": "findByJournal",
|
|
1249
|
+
"async": true,
|
|
1250
|
+
"parameters": [
|
|
1251
|
+
{
|
|
1252
|
+
"name": "journalId",
|
|
1253
|
+
"type": "string",
|
|
1254
|
+
"optional": false
|
|
1255
|
+
}
|
|
1256
|
+
],
|
|
1257
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1326
1258
|
"isStatic": false,
|
|
1327
1259
|
"isPublic": true
|
|
1328
1260
|
},
|
|
1329
|
-
"
|
|
1330
|
-
"name": "
|
|
1331
|
-
"async":
|
|
1332
|
-
"parameters": [
|
|
1333
|
-
|
|
1261
|
+
"findByAccount": {
|
|
1262
|
+
"name": "findByAccount",
|
|
1263
|
+
"async": true,
|
|
1264
|
+
"parameters": [
|
|
1265
|
+
{
|
|
1266
|
+
"name": "accountId",
|
|
1267
|
+
"type": "string",
|
|
1268
|
+
"optional": false
|
|
1269
|
+
}
|
|
1270
|
+
],
|
|
1271
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1334
1272
|
"isStatic": false,
|
|
1335
1273
|
"isPublic": true
|
|
1336
1274
|
},
|
|
1337
|
-
"
|
|
1338
|
-
"name": "
|
|
1339
|
-
"async":
|
|
1340
|
-
"parameters": [
|
|
1341
|
-
|
|
1275
|
+
"getAccountBalance": {
|
|
1276
|
+
"name": "getAccountBalance",
|
|
1277
|
+
"async": true,
|
|
1278
|
+
"parameters": [
|
|
1279
|
+
{
|
|
1280
|
+
"name": "accountId",
|
|
1281
|
+
"type": "string",
|
|
1282
|
+
"optional": false
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"name": "asOfDate",
|
|
1286
|
+
"type": "Date",
|
|
1287
|
+
"optional": true
|
|
1288
|
+
}
|
|
1289
|
+
],
|
|
1290
|
+
"returnType": "Promise<number>",
|
|
1342
1291
|
"isStatic": false,
|
|
1343
1292
|
"isPublic": true
|
|
1344
1293
|
},
|
|
1345
|
-
"
|
|
1346
|
-
"name": "
|
|
1294
|
+
"getTrialBalance": {
|
|
1295
|
+
"name": "getTrialBalance",
|
|
1347
1296
|
"async": true,
|
|
1348
|
-
"parameters": [
|
|
1349
|
-
|
|
1297
|
+
"parameters": [
|
|
1298
|
+
{
|
|
1299
|
+
"name": "asOfDate",
|
|
1300
|
+
"type": "Date",
|
|
1301
|
+
"optional": true
|
|
1302
|
+
}
|
|
1303
|
+
],
|
|
1304
|
+
"returnType": "Promise<TrialBalanceRow[]>",
|
|
1350
1305
|
"isStatic": false,
|
|
1351
1306
|
"isPublic": true
|
|
1352
1307
|
},
|
|
1353
|
-
"
|
|
1354
|
-
"name": "
|
|
1308
|
+
"getTotalsForDateRange": {
|
|
1309
|
+
"name": "getTotalsForDateRange",
|
|
1355
1310
|
"async": true,
|
|
1356
|
-
"parameters": [
|
|
1357
|
-
|
|
1311
|
+
"parameters": [
|
|
1312
|
+
{
|
|
1313
|
+
"name": "start",
|
|
1314
|
+
"type": "Date",
|
|
1315
|
+
"optional": false
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"name": "end",
|
|
1319
|
+
"type": "Date",
|
|
1320
|
+
"optional": false
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"returnType": "Promise<object>",
|
|
1358
1324
|
"isStatic": false,
|
|
1359
1325
|
"isPublic": true
|
|
1360
1326
|
},
|
|
1361
|
-
"
|
|
1362
|
-
"name": "
|
|
1327
|
+
"findByAccounts": {
|
|
1328
|
+
"name": "findByAccounts",
|
|
1363
1329
|
"async": true,
|
|
1364
|
-
"parameters": [
|
|
1365
|
-
|
|
1330
|
+
"parameters": [
|
|
1331
|
+
{
|
|
1332
|
+
"name": "accountIds",
|
|
1333
|
+
"type": "string[]",
|
|
1334
|
+
"optional": false
|
|
1335
|
+
}
|
|
1336
|
+
],
|
|
1337
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1366
1338
|
"isStatic": false,
|
|
1367
1339
|
"isPublic": true
|
|
1368
1340
|
},
|
|
1369
|
-
"
|
|
1370
|
-
"name": "
|
|
1341
|
+
"getAccountLedger": {
|
|
1342
|
+
"name": "getAccountLedger",
|
|
1371
1343
|
"async": true,
|
|
1372
|
-
"parameters": [
|
|
1373
|
-
|
|
1344
|
+
"parameters": [
|
|
1345
|
+
{
|
|
1346
|
+
"name": "accountId",
|
|
1347
|
+
"type": "string",
|
|
1348
|
+
"optional": false
|
|
1349
|
+
}
|
|
1350
|
+
],
|
|
1351
|
+
"returnType": "Promise<Array<object>>",
|
|
1374
1352
|
"isStatic": false,
|
|
1375
1353
|
"isPublic": true
|
|
1376
1354
|
},
|
|
1377
|
-
"
|
|
1378
|
-
"name": "
|
|
1355
|
+
"findByTenant": {
|
|
1356
|
+
"name": "findByTenant",
|
|
1379
1357
|
"async": true,
|
|
1380
1358
|
"parameters": [
|
|
1381
1359
|
{
|
|
1382
|
-
"name": "
|
|
1383
|
-
"type": "
|
|
1360
|
+
"name": "tenantId",
|
|
1361
|
+
"type": "string",
|
|
1384
1362
|
"optional": false
|
|
1385
1363
|
}
|
|
1386
1364
|
],
|
|
1387
|
-
"returnType": "Promise<
|
|
1365
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1388
1366
|
"isStatic": false,
|
|
1389
1367
|
"isPublic": true
|
|
1390
1368
|
},
|
|
1391
|
-
"
|
|
1392
|
-
"name": "
|
|
1369
|
+
"findGlobal": {
|
|
1370
|
+
"name": "findGlobal",
|
|
1393
1371
|
"async": true,
|
|
1394
1372
|
"parameters": [],
|
|
1395
|
-
"returnType": "Promise<
|
|
1373
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1396
1374
|
"isStatic": false,
|
|
1397
1375
|
"isPublic": true
|
|
1398
1376
|
},
|
|
1399
|
-
"
|
|
1400
|
-
"name": "
|
|
1377
|
+
"findWithGlobals": {
|
|
1378
|
+
"name": "findWithGlobals",
|
|
1401
1379
|
"async": true,
|
|
1402
1380
|
"parameters": [
|
|
1403
1381
|
{
|
|
1404
|
-
"name": "
|
|
1382
|
+
"name": "tenantId",
|
|
1405
1383
|
"type": "string",
|
|
1406
1384
|
"optional": false
|
|
1407
1385
|
}
|
|
1408
1386
|
],
|
|
1409
|
-
"returnType": "Promise<
|
|
1410
|
-
"isStatic": false,
|
|
1411
|
-
"isPublic": true
|
|
1412
|
-
},
|
|
1413
|
-
"summarize": {
|
|
1414
|
-
"name": "summarize",
|
|
1415
|
-
"async": true,
|
|
1416
|
-
"parameters": [],
|
|
1417
|
-
"returnType": "Promise<string>",
|
|
1387
|
+
"returnType": "Promise<JournalEntry[]>",
|
|
1418
1388
|
"isStatic": false,
|
|
1419
1389
|
"isPublic": true
|
|
1420
1390
|
}
|
|
1421
1391
|
},
|
|
1422
|
-
"decoratorConfig": {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
"create"
|
|
1428
|
-
]
|
|
1429
|
-
},
|
|
1430
|
-
"mcp": {
|
|
1431
|
-
"include": [
|
|
1432
|
-
"list",
|
|
1433
|
-
"get",
|
|
1434
|
-
"create"
|
|
1435
|
-
]
|
|
1436
|
-
},
|
|
1437
|
-
"cli": {
|
|
1438
|
-
"skipApiCheck": true
|
|
1439
|
-
},
|
|
1440
|
-
"tenantScoped": {
|
|
1441
|
-
"mode": "optional"
|
|
1442
|
-
},
|
|
1443
|
-
"conflictColumns": [
|
|
1444
|
-
"tenant_id",
|
|
1445
|
-
"slug",
|
|
1446
|
-
"context"
|
|
1447
|
-
]
|
|
1448
|
-
},
|
|
1449
|
-
"extends": "SmrtObject",
|
|
1450
|
-
"exportName": "Journal",
|
|
1451
|
-
"collectionExportName": "JournalCollection",
|
|
1392
|
+
"decoratorConfig": {},
|
|
1393
|
+
"extends": "SmrtCollection",
|
|
1394
|
+
"extendsTypeArg": "JournalEntry",
|
|
1395
|
+
"exportName": "JournalEntryCollection",
|
|
1396
|
+
"collectionExportName": "JournalEntryCollectionCollection",
|
|
1452
1397
|
"schema": {
|
|
1453
|
-
"tableName": "
|
|
1454
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1398
|
+
"tableName": "journal_entries",
|
|
1399
|
+
"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);",
|
|
1455
1400
|
"columns": {
|
|
1456
1401
|
"id": {
|
|
1457
1402
|
"type": "UUID",
|
|
@@ -1484,54 +1429,59 @@
|
|
|
1484
1429
|
"notNull": false,
|
|
1485
1430
|
"unique": false
|
|
1486
1431
|
},
|
|
1487
|
-
"
|
|
1488
|
-
"type": "
|
|
1432
|
+
"journal_id": {
|
|
1433
|
+
"type": "UUID",
|
|
1434
|
+
"referenceKind": "foreignKey",
|
|
1489
1435
|
"notNull": false,
|
|
1490
1436
|
"unique": false,
|
|
1491
|
-
"
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1437
|
+
"foreignKey": {
|
|
1438
|
+
"table": "journals",
|
|
1439
|
+
"column": "id",
|
|
1440
|
+
"onDelete": "NO ACTION",
|
|
1441
|
+
"onUpdate": "CASCADE"
|
|
1442
|
+
}
|
|
1497
1443
|
},
|
|
1498
|
-
"
|
|
1499
|
-
"type": "
|
|
1444
|
+
"account_id": {
|
|
1445
|
+
"type": "UUID",
|
|
1446
|
+
"referenceKind": "foreignKey",
|
|
1500
1447
|
"notNull": false,
|
|
1501
1448
|
"unique": false,
|
|
1502
|
-
"
|
|
1449
|
+
"foreignKey": {
|
|
1450
|
+
"table": "accounts",
|
|
1451
|
+
"column": "id",
|
|
1452
|
+
"onDelete": "NO ACTION",
|
|
1453
|
+
"onUpdate": "CASCADE"
|
|
1454
|
+
}
|
|
1503
1455
|
},
|
|
1504
|
-
"
|
|
1505
|
-
"type": "
|
|
1456
|
+
"debit": {
|
|
1457
|
+
"type": "REAL",
|
|
1506
1458
|
"notNull": false,
|
|
1507
1459
|
"unique": false,
|
|
1508
|
-
"default":
|
|
1460
|
+
"default": 0
|
|
1509
1461
|
},
|
|
1510
|
-
"
|
|
1511
|
-
"type": "
|
|
1462
|
+
"credit": {
|
|
1463
|
+
"type": "REAL",
|
|
1512
1464
|
"notNull": false,
|
|
1513
|
-
"unique": false
|
|
1465
|
+
"unique": false,
|
|
1466
|
+
"default": 0
|
|
1514
1467
|
},
|
|
1515
|
-
"
|
|
1468
|
+
"currency": {
|
|
1516
1469
|
"type": "TEXT",
|
|
1517
1470
|
"notNull": false,
|
|
1518
1471
|
"unique": false,
|
|
1519
|
-
"default": "
|
|
1520
|
-
},
|
|
1521
|
-
"posted_at": {
|
|
1522
|
-
"type": "TIMESTAMP",
|
|
1523
|
-
"notNull": false,
|
|
1524
|
-
"unique": false
|
|
1472
|
+
"default": "USD"
|
|
1525
1473
|
},
|
|
1526
|
-
"
|
|
1527
|
-
"type": "
|
|
1474
|
+
"exchange_rate": {
|
|
1475
|
+
"type": "REAL",
|
|
1528
1476
|
"notNull": false,
|
|
1529
|
-
"unique": false
|
|
1477
|
+
"unique": false,
|
|
1478
|
+
"default": 1
|
|
1530
1479
|
},
|
|
1531
|
-
"
|
|
1480
|
+
"memo": {
|
|
1532
1481
|
"type": "TEXT",
|
|
1533
1482
|
"notNull": false,
|
|
1534
|
-
"unique": false
|
|
1483
|
+
"unique": false,
|
|
1484
|
+
"default": ""
|
|
1535
1485
|
},
|
|
1536
1486
|
"metadata": {
|
|
1537
1487
|
"type": "JSON",
|
|
@@ -1542,7 +1492,7 @@
|
|
|
1542
1492
|
},
|
|
1543
1493
|
"indexes": [
|
|
1544
1494
|
{
|
|
1545
|
-
"name": "
|
|
1495
|
+
"name": "journal_entries_slug_context_idx",
|
|
1546
1496
|
"columns": [
|
|
1547
1497
|
"tenant_id",
|
|
1548
1498
|
"slug",
|
|
@@ -1552,173 +1502,240 @@
|
|
|
1552
1502
|
"nullsNotDistinct": true
|
|
1553
1503
|
},
|
|
1554
1504
|
{
|
|
1555
|
-
"name": "
|
|
1505
|
+
"name": "journal_entries_tenant_id_created_at_idx",
|
|
1556
1506
|
"columns": [
|
|
1557
1507
|
"tenant_id",
|
|
1558
1508
|
"created_at"
|
|
1559
1509
|
]
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"name": "journal_entries_journal_id_idx",
|
|
1513
|
+
"columns": [
|
|
1514
|
+
"journal_id"
|
|
1515
|
+
]
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
"name": "journal_entries_account_id_idx",
|
|
1519
|
+
"columns": [
|
|
1520
|
+
"account_id"
|
|
1521
|
+
]
|
|
1560
1522
|
}
|
|
1561
1523
|
],
|
|
1562
|
-
"version": "
|
|
1524
|
+
"version": "0457e0e4"
|
|
1563
1525
|
},
|
|
1564
1526
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
1565
1527
|
},
|
|
1566
|
-
"@happyvertical/smrt-ledgers:
|
|
1567
|
-
"name": "
|
|
1568
|
-
"className": "
|
|
1569
|
-
"qualifiedName": "@happyvertical/smrt-ledgers:
|
|
1570
|
-
"collection": "
|
|
1571
|
-
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/
|
|
1528
|
+
"@happyvertical/smrt-ledgers:JournalCollection": {
|
|
1529
|
+
"name": "journalcollection",
|
|
1530
|
+
"className": "JournalCollection",
|
|
1531
|
+
"qualifiedName": "@happyvertical/smrt-ledgers:JournalCollection",
|
|
1532
|
+
"collection": "journals",
|
|
1533
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/ledgers/src/collections/Journals.ts",
|
|
1572
1534
|
"packageName": "@happyvertical/smrt-ledgers",
|
|
1573
|
-
"fields": {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
"
|
|
1577
|
-
"
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
"
|
|
1582
|
-
"
|
|
1583
|
-
"required": false,
|
|
1584
|
-
"autoPopulate": true,
|
|
1585
|
-
"nullable": true,
|
|
1586
|
-
"mode": "optional",
|
|
1587
|
-
"field": "tenantId",
|
|
1588
|
-
"allowSuperAdminBypass": false
|
|
1535
|
+
"fields": {},
|
|
1536
|
+
"methods": {
|
|
1537
|
+
"findByNumber": {
|
|
1538
|
+
"name": "findByNumber",
|
|
1539
|
+
"async": true,
|
|
1540
|
+
"parameters": [
|
|
1541
|
+
{
|
|
1542
|
+
"name": "number",
|
|
1543
|
+
"type": "string",
|
|
1544
|
+
"optional": false
|
|
1589
1545
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
"
|
|
1594
|
-
"required": false,
|
|
1595
|
-
"related": "Journal"
|
|
1596
|
-
},
|
|
1597
|
-
"accountId": {
|
|
1598
|
-
"type": "foreignKey",
|
|
1599
|
-
"required": false,
|
|
1600
|
-
"related": "Account"
|
|
1601
|
-
},
|
|
1602
|
-
"debit": {
|
|
1603
|
-
"type": "decimal",
|
|
1604
|
-
"required": false,
|
|
1605
|
-
"default": 0
|
|
1606
|
-
},
|
|
1607
|
-
"credit": {
|
|
1608
|
-
"type": "decimal",
|
|
1609
|
-
"required": false,
|
|
1610
|
-
"default": 0
|
|
1611
|
-
},
|
|
1612
|
-
"currency": {
|
|
1613
|
-
"type": "text",
|
|
1614
|
-
"required": false,
|
|
1615
|
-
"default": "USD"
|
|
1546
|
+
],
|
|
1547
|
+
"returnType": "Promise<Journal | null>",
|
|
1548
|
+
"isStatic": false,
|
|
1549
|
+
"isPublic": true
|
|
1616
1550
|
},
|
|
1617
|
-
"
|
|
1618
|
-
"
|
|
1619
|
-
"
|
|
1620
|
-
"
|
|
1551
|
+
"findByDateRange": {
|
|
1552
|
+
"name": "findByDateRange",
|
|
1553
|
+
"async": true,
|
|
1554
|
+
"parameters": [
|
|
1555
|
+
{
|
|
1556
|
+
"name": "start",
|
|
1557
|
+
"type": "Date",
|
|
1558
|
+
"optional": false
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"name": "end",
|
|
1562
|
+
"type": "Date",
|
|
1563
|
+
"optional": false
|
|
1564
|
+
}
|
|
1565
|
+
],
|
|
1566
|
+
"returnType": "Promise<Journal[]>",
|
|
1567
|
+
"isStatic": false,
|
|
1568
|
+
"isPublic": true
|
|
1621
1569
|
},
|
|
1622
|
-
"
|
|
1623
|
-
"
|
|
1624
|
-
"
|
|
1625
|
-
"
|
|
1570
|
+
"findBySource": {
|
|
1571
|
+
"name": "findBySource",
|
|
1572
|
+
"async": true,
|
|
1573
|
+
"parameters": [
|
|
1574
|
+
{
|
|
1575
|
+
"name": "sourceModule",
|
|
1576
|
+
"type": "string",
|
|
1577
|
+
"optional": false
|
|
1578
|
+
}
|
|
1579
|
+
],
|
|
1580
|
+
"returnType": "Promise<Journal[]>",
|
|
1581
|
+
"isStatic": false,
|
|
1582
|
+
"isPublic": true
|
|
1626
1583
|
},
|
|
1627
|
-
"
|
|
1628
|
-
"
|
|
1629
|
-
"
|
|
1630
|
-
"
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
"
|
|
1638
|
-
"returnType": "boolean",
|
|
1584
|
+
"findByStatus": {
|
|
1585
|
+
"name": "findByStatus",
|
|
1586
|
+
"async": true,
|
|
1587
|
+
"parameters": [
|
|
1588
|
+
{
|
|
1589
|
+
"name": "status",
|
|
1590
|
+
"type": "JournalStatus",
|
|
1591
|
+
"optional": false
|
|
1592
|
+
}
|
|
1593
|
+
],
|
|
1594
|
+
"returnType": "Promise<Journal[]>",
|
|
1639
1595
|
"isStatic": false,
|
|
1640
1596
|
"isPublic": true
|
|
1641
1597
|
},
|
|
1642
|
-
"
|
|
1643
|
-
"name": "
|
|
1644
|
-
"async":
|
|
1598
|
+
"findDrafts": {
|
|
1599
|
+
"name": "findDrafts",
|
|
1600
|
+
"async": true,
|
|
1645
1601
|
"parameters": [],
|
|
1646
|
-
"returnType": "
|
|
1602
|
+
"returnType": "Promise<Journal[]>",
|
|
1647
1603
|
"isStatic": false,
|
|
1648
1604
|
"isPublic": true
|
|
1649
1605
|
},
|
|
1650
|
-
"
|
|
1651
|
-
"name": "
|
|
1652
|
-
"async":
|
|
1606
|
+
"findPosted": {
|
|
1607
|
+
"name": "findPosted",
|
|
1608
|
+
"async": true,
|
|
1653
1609
|
"parameters": [],
|
|
1654
|
-
"returnType": "
|
|
1610
|
+
"returnType": "Promise<Journal[]>",
|
|
1655
1611
|
"isStatic": false,
|
|
1656
1612
|
"isPublic": true
|
|
1657
1613
|
},
|
|
1658
|
-
"
|
|
1659
|
-
"name": "
|
|
1660
|
-
"async":
|
|
1661
|
-
"parameters": [
|
|
1662
|
-
|
|
1614
|
+
"createWithEntries": {
|
|
1615
|
+
"name": "createWithEntries",
|
|
1616
|
+
"async": true,
|
|
1617
|
+
"parameters": [
|
|
1618
|
+
{
|
|
1619
|
+
"name": "data",
|
|
1620
|
+
"type": "CreateJournalData",
|
|
1621
|
+
"optional": false
|
|
1622
|
+
}
|
|
1623
|
+
],
|
|
1624
|
+
"returnType": "Promise<Journal>",
|
|
1663
1625
|
"isStatic": false,
|
|
1664
1626
|
"isPublic": true
|
|
1665
1627
|
},
|
|
1666
|
-
"
|
|
1667
|
-
"name": "
|
|
1628
|
+
"post": {
|
|
1629
|
+
"name": "post",
|
|
1668
1630
|
"async": true,
|
|
1669
|
-
"parameters": [
|
|
1670
|
-
|
|
1631
|
+
"parameters": [
|
|
1632
|
+
{
|
|
1633
|
+
"name": "journalId",
|
|
1634
|
+
"type": "string",
|
|
1635
|
+
"optional": false
|
|
1636
|
+
}
|
|
1637
|
+
],
|
|
1638
|
+
"returnType": "Promise<Journal>",
|
|
1671
1639
|
"isStatic": false,
|
|
1672
1640
|
"isPublic": true
|
|
1673
1641
|
},
|
|
1674
|
-
"
|
|
1675
|
-
"name": "
|
|
1642
|
+
"void": {
|
|
1643
|
+
"name": "void",
|
|
1676
1644
|
"async": true,
|
|
1677
|
-
"parameters": [
|
|
1678
|
-
|
|
1645
|
+
"parameters": [
|
|
1646
|
+
{
|
|
1647
|
+
"name": "journalId",
|
|
1648
|
+
"type": "string",
|
|
1649
|
+
"optional": false
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"name": "reason",
|
|
1653
|
+
"type": "string",
|
|
1654
|
+
"optional": false
|
|
1655
|
+
}
|
|
1656
|
+
],
|
|
1657
|
+
"returnType": "Promise<Journal>",
|
|
1679
1658
|
"isStatic": false,
|
|
1680
1659
|
"isPublic": true
|
|
1681
1660
|
},
|
|
1682
|
-
"
|
|
1683
|
-
"name": "
|
|
1661
|
+
"findBySourceRef": {
|
|
1662
|
+
"name": "findBySourceRef",
|
|
1684
1663
|
"async": true,
|
|
1685
|
-
"parameters": [
|
|
1686
|
-
|
|
1664
|
+
"parameters": [
|
|
1665
|
+
{
|
|
1666
|
+
"name": "sourceRef",
|
|
1667
|
+
"type": "string",
|
|
1668
|
+
"optional": false
|
|
1669
|
+
}
|
|
1670
|
+
],
|
|
1671
|
+
"returnType": "Promise<Journal[]>",
|
|
1687
1672
|
"isStatic": false,
|
|
1688
1673
|
"isPublic": true
|
|
1689
|
-
}
|
|
1690
|
-
},
|
|
1691
|
-
"decoratorConfig": {
|
|
1692
|
-
"api": {
|
|
1693
|
-
"include": [
|
|
1694
|
-
"list",
|
|
1695
|
-
"get"
|
|
1696
|
-
]
|
|
1697
1674
|
},
|
|
1698
|
-
"
|
|
1699
|
-
"
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1675
|
+
"findByMonth": {
|
|
1676
|
+
"name": "findByMonth",
|
|
1677
|
+
"async": true,
|
|
1678
|
+
"parameters": [
|
|
1679
|
+
{
|
|
1680
|
+
"name": "year",
|
|
1681
|
+
"type": "number",
|
|
1682
|
+
"optional": false
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
"name": "month",
|
|
1686
|
+
"type": "number",
|
|
1687
|
+
"optional": false
|
|
1688
|
+
}
|
|
1689
|
+
],
|
|
1690
|
+
"returnType": "Promise<Journal[]>",
|
|
1691
|
+
"isStatic": false,
|
|
1692
|
+
"isPublic": true
|
|
1703
1693
|
},
|
|
1704
|
-
"
|
|
1705
|
-
"
|
|
1694
|
+
"findByTenant": {
|
|
1695
|
+
"name": "findByTenant",
|
|
1696
|
+
"async": true,
|
|
1697
|
+
"parameters": [
|
|
1698
|
+
{
|
|
1699
|
+
"name": "tenantId",
|
|
1700
|
+
"type": "string",
|
|
1701
|
+
"optional": false
|
|
1702
|
+
}
|
|
1703
|
+
],
|
|
1704
|
+
"returnType": "Promise<Journal[]>",
|
|
1705
|
+
"isStatic": false,
|
|
1706
|
+
"isPublic": true
|
|
1706
1707
|
},
|
|
1707
|
-
"
|
|
1708
|
-
"
|
|
1708
|
+
"findGlobal": {
|
|
1709
|
+
"name": "findGlobal",
|
|
1710
|
+
"async": true,
|
|
1711
|
+
"parameters": [],
|
|
1712
|
+
"returnType": "Promise<Journal[]>",
|
|
1713
|
+
"isStatic": false,
|
|
1714
|
+
"isPublic": true
|
|
1709
1715
|
},
|
|
1710
|
-
"
|
|
1711
|
-
"
|
|
1712
|
-
"
|
|
1713
|
-
"
|
|
1714
|
-
|
|
1716
|
+
"findWithGlobals": {
|
|
1717
|
+
"name": "findWithGlobals",
|
|
1718
|
+
"async": true,
|
|
1719
|
+
"parameters": [
|
|
1720
|
+
{
|
|
1721
|
+
"name": "tenantId",
|
|
1722
|
+
"type": "string",
|
|
1723
|
+
"optional": false
|
|
1724
|
+
}
|
|
1725
|
+
],
|
|
1726
|
+
"returnType": "Promise<Journal[]>",
|
|
1727
|
+
"isStatic": false,
|
|
1728
|
+
"isPublic": true
|
|
1729
|
+
}
|
|
1715
1730
|
},
|
|
1716
|
-
"
|
|
1717
|
-
"
|
|
1718
|
-
"
|
|
1731
|
+
"decoratorConfig": {},
|
|
1732
|
+
"extends": "SmrtCollection",
|
|
1733
|
+
"extendsTypeArg": "Journal",
|
|
1734
|
+
"exportName": "JournalCollection",
|
|
1735
|
+
"collectionExportName": "JournalCollectionCollection",
|
|
1719
1736
|
"schema": {
|
|
1720
|
-
"tableName": "
|
|
1721
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1737
|
+
"tableName": "journals",
|
|
1738
|
+
"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);",
|
|
1722
1739
|
"columns": {
|
|
1723
1740
|
"id": {
|
|
1724
1741
|
"type": "UUID",
|
|
@@ -1751,59 +1768,54 @@
|
|
|
1751
1768
|
"notNull": false,
|
|
1752
1769
|
"unique": false
|
|
1753
1770
|
},
|
|
1754
|
-
"
|
|
1755
|
-
"type": "
|
|
1756
|
-
"referenceKind": "foreignKey",
|
|
1771
|
+
"number": {
|
|
1772
|
+
"type": "TEXT",
|
|
1757
1773
|
"notNull": false,
|
|
1758
1774
|
"unique": false,
|
|
1759
|
-
"
|
|
1760
|
-
"table": "journals",
|
|
1761
|
-
"column": "id",
|
|
1762
|
-
"onDelete": "NO ACTION",
|
|
1763
|
-
"onUpdate": "CASCADE"
|
|
1764
|
-
}
|
|
1775
|
+
"default": ""
|
|
1765
1776
|
},
|
|
1766
|
-
"
|
|
1767
|
-
"type": "
|
|
1768
|
-
"referenceKind": "foreignKey",
|
|
1777
|
+
"date": {
|
|
1778
|
+
"type": "TIMESTAMP",
|
|
1769
1779
|
"notNull": false,
|
|
1770
|
-
"unique": false
|
|
1771
|
-
"foreignKey": {
|
|
1772
|
-
"table": "accounts",
|
|
1773
|
-
"column": "id",
|
|
1774
|
-
"onDelete": "NO ACTION",
|
|
1775
|
-
"onUpdate": "CASCADE"
|
|
1776
|
-
}
|
|
1780
|
+
"unique": false
|
|
1777
1781
|
},
|
|
1778
|
-
"
|
|
1779
|
-
"type": "
|
|
1782
|
+
"description": {
|
|
1783
|
+
"type": "TEXT",
|
|
1780
1784
|
"notNull": false,
|
|
1781
1785
|
"unique": false,
|
|
1782
|
-
"default":
|
|
1786
|
+
"default": ""
|
|
1783
1787
|
},
|
|
1784
|
-
"
|
|
1785
|
-
"type": "
|
|
1788
|
+
"source_module": {
|
|
1789
|
+
"type": "TEXT",
|
|
1786
1790
|
"notNull": false,
|
|
1787
1791
|
"unique": false,
|
|
1788
|
-
"default":
|
|
1792
|
+
"default": ""
|
|
1789
1793
|
},
|
|
1790
|
-
"
|
|
1794
|
+
"source_ref": {
|
|
1791
1795
|
"type": "TEXT",
|
|
1792
1796
|
"notNull": false,
|
|
1793
|
-
"unique": false
|
|
1794
|
-
"default": "USD"
|
|
1797
|
+
"unique": false
|
|
1795
1798
|
},
|
|
1796
|
-
"
|
|
1797
|
-
"type": "
|
|
1799
|
+
"status": {
|
|
1800
|
+
"type": "TEXT",
|
|
1798
1801
|
"notNull": false,
|
|
1799
1802
|
"unique": false,
|
|
1800
|
-
"default":
|
|
1803
|
+
"default": "draft"
|
|
1801
1804
|
},
|
|
1802
|
-
"
|
|
1805
|
+
"posted_at": {
|
|
1806
|
+
"type": "TIMESTAMP",
|
|
1807
|
+
"notNull": false,
|
|
1808
|
+
"unique": false
|
|
1809
|
+
},
|
|
1810
|
+
"voided_at": {
|
|
1811
|
+
"type": "TIMESTAMP",
|
|
1812
|
+
"notNull": false,
|
|
1813
|
+
"unique": false
|
|
1814
|
+
},
|
|
1815
|
+
"void_reason": {
|
|
1803
1816
|
"type": "TEXT",
|
|
1804
1817
|
"notNull": false,
|
|
1805
|
-
"unique": false
|
|
1806
|
-
"default": ""
|
|
1818
|
+
"unique": false
|
|
1807
1819
|
},
|
|
1808
1820
|
"metadata": {
|
|
1809
1821
|
"type": "JSON",
|
|
@@ -1814,7 +1826,7 @@
|
|
|
1814
1826
|
},
|
|
1815
1827
|
"indexes": [
|
|
1816
1828
|
{
|
|
1817
|
-
"name": "
|
|
1829
|
+
"name": "journals_slug_context_idx",
|
|
1818
1830
|
"columns": [
|
|
1819
1831
|
"tenant_id",
|
|
1820
1832
|
"slug",
|
|
@@ -1824,26 +1836,14 @@
|
|
|
1824
1836
|
"nullsNotDistinct": true
|
|
1825
1837
|
},
|
|
1826
1838
|
{
|
|
1827
|
-
"name": "
|
|
1839
|
+
"name": "journals_tenant_id_created_at_idx",
|
|
1828
1840
|
"columns": [
|
|
1829
1841
|
"tenant_id",
|
|
1830
1842
|
"created_at"
|
|
1831
1843
|
]
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
"name": "journal_entries_journal_id_idx",
|
|
1835
|
-
"columns": [
|
|
1836
|
-
"journal_id"
|
|
1837
|
-
]
|
|
1838
|
-
},
|
|
1839
|
-
{
|
|
1840
|
-
"name": "journal_entries_account_id_idx",
|
|
1841
|
-
"columns": [
|
|
1842
|
-
"account_id"
|
|
1843
|
-
]
|
|
1844
1844
|
}
|
|
1845
1845
|
],
|
|
1846
|
-
"version": "
|
|
1846
|
+
"version": "4b51d204"
|
|
1847
1847
|
},
|
|
1848
1848
|
"importPath": "@happyvertical/smrt-ledgers"
|
|
1849
1849
|
}
|