New Base func

This commit is contained in:
Jakob Wennberg
2026-02-19 09:48:02 +01:00
parent afc9f69def
commit cdf1dcc4c8
73 changed files with 11036 additions and 51 deletions
+34
View File
@@ -0,0 +1,34 @@
import type { Extension } from '@/lib/extensions/types'
import type { EventPayload } from '@/lib/events/types'
/**
* Example Logger Extension
*
* Minimal reference implementation that logs events to the console.
* Not wired into the loader by default — add to FIRST_PARTY_EXTENSIONS
* in lib/extensions/loader.ts to activate.
*/
export const exampleLoggerExtension: Extension = {
id: 'example-logger',
name: 'Example Logger',
version: '0.1.0',
eventHandlers: [
{
eventType: 'journal_entry.committed',
handler: async (payload: EventPayload<'journal_entry.committed'>) => {
console.log(
`[example-logger] Journal entry committed: ${payload.entry.voucher_series}${payload.entry.voucher_number} — ${payload.entry.description}`
)
},
},
{
eventType: 'document.uploaded',
handler: async (payload: EventPayload<'document.uploaded'>) => {
console.log(
`[example-logger] Document uploaded: ${payload.document.file_name} (${payload.document.sha256_hash.slice(0, 12)}…)`
)
},
},
],
}