Implement unified frontend type system and migrate core modules
- Created src/lib/types/ae_types.ts to serve as the central repository for Aether object interfaces. - Standardized interfaces to include the triple-ID pattern (id, [type]_id, [type]_id_random) for Dexie and V3 API compatibility. - Migrated Account and JournalEntry modules to use ae_Account and ae_JournalEntry types. - Added explicit Promise return types to all core data loading, creation, and update functions in migrated modules.
This commit is contained in:
@@ -5,6 +5,7 @@ import { api } from '$lib/api/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
|
||||
import { db_journals } from '$lib/ae_journals/db_journals';
|
||||
import type { ae_JournalEntry } from '$lib/types/ae_types';
|
||||
|
||||
const ae_promises: key_val = {};
|
||||
|
||||
@@ -19,7 +20,7 @@ export async function load_ae_obj_id__journal_entry({
|
||||
journal_entry_id: string;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_JournalEntry | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__journal_entry() *** journal_entry_id=${journal_entry_id}`);
|
||||
}
|
||||
@@ -95,7 +96,7 @@ export async function load_ae_obj_li__journal_entry({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_JournalEntry[]> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_li__journal_entry() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
|
||||
@@ -194,7 +195,7 @@ export async function create_ae_obj__journal_entry({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_JournalEntry | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** create_ae_obj__journal_entry() *** journal_id=${journal_id}`);
|
||||
}
|
||||
@@ -496,7 +497,7 @@ export async function update_ae_obj__journal_entry({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_JournalEntry | null> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** update_ae_obj__journal_entry() *** journal_entry_id=${journal_entry_id}`,
|
||||
|
||||
Reference in New Issue
Block a user