Migrate Event child modules to unified type system

- Added ae_EventFile, ae_EventDevice, ae_EventAbstract, and ae_Organization to ae_types.ts.
- Replaced local interfaces in EventFile and EventDevice logic files with unified imports.
- Standardized Promise return types for all core data loading, creation, search, and update functions.
- Integrated triple-ID patterns for Dexie and V3 API parity across files and devices.
This commit is contained in:
Scott Idem
2026-01-08 13:59:03 -05:00
parent c46485a954
commit 541a06135c
3 changed files with 81 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
import { db_events } from '$lib/ae_events/db_events';
import type { ae_EventDevice } from '$lib/types/ae_types';
import { load_ae_obj_id__event_location } from './ae_events__event_location';
@@ -21,7 +22,7 @@ export async function load_ae_obj_id__event_device({
inc_location_id?: boolean;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventDevice | null> {
if (log_lvl) {
console.log(`*** load_ae_obj_id__event_device() *** event_device_id=${event_device_id}`);
}
@@ -131,11 +132,10 @@ export async function load_ae_obj_li__event_device({
hidden?: 'hidden' | 'all' | 'not_hidden' | undefined; // all, hidden, not_hidden
limit?: number; // 99
offset?: number; // 0
order_by_li?: key_val;
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventDevice[]> {
if (log_lvl) {
console.log(
`*** load_ae_obj_li__event_device() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
@@ -260,7 +260,7 @@ export async function create_ae_obj__event_device({
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventDevice | null> {
if (log_lvl) {
console.log(`*** create_ae_obj__event_device() *** event_id=${event_id}`);
}
@@ -392,7 +392,7 @@ export async function update_ae_obj__event_device({
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventDevice | null> {
if (log_lvl) {
console.log(
`*** update_ae_obj__event_device() *** event_device_id=${event_device_id}`,
@@ -480,7 +480,7 @@ export async function search__event_device({
params?: any;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventDevice[] | false> {
if (log_lvl) {
console.log(`*** search__event_device() *** event_id=${event_id}`);
}

View File

@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
import { db_events } from '$lib/ae_events/db_events';
import type { ae_EventFile } from '$lib/types/ae_types';
const ae_promises: key_val = {};
@@ -17,7 +18,7 @@ export async function load_ae_obj_id__event_file({
event_file_id: string;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventFile | null> {
if (log_lvl) {
console.log(`*** load_ae_obj_id__event_file() *** event_file_id=${event_file_id}`);
}
@@ -101,7 +102,7 @@ export async function load_ae_obj_li__event_file({
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventFile[]> {
if (log_lvl) {
console.log(
`*** load_ae_obj_li__event_file() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
@@ -321,7 +322,7 @@ export async function update_ae_obj__event_file({
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventFile | null> {
if (log_lvl) {
console.log(`*** update_ae_obj__event_file() *** event_file_id=${event_file_id}`);
}
@@ -414,7 +415,7 @@ export async function qry__event_file({
params?: any;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventFile[]> {
if (log_lvl) {
console.log(`*** qry__event_file() *** event_id=${event_id}`);
}
@@ -558,7 +559,7 @@ export async function search__event_file({
params?: any;
try_cache?: boolean;
log_lvl?: number;
}) {
}): Promise<ae_EventFile[]> {
if (log_lvl) {
console.log(`*** search__event_file() *** event_id=${event_id}`);
}

View File

@@ -609,4 +609,72 @@ export interface ae_ArchiveContent extends ae_BaseObj {
hosted_file_id_random?: string;
filename?: string;
}
}
/**
* EventFile - A file associated with an event or event component
*/
export interface ae_EventFile extends ae_BaseObj {
event_file_id: string;
event_file_id_random: string;
event_id: string;
event_id_random: string;
hosted_file_id_random?: string;
for_type?: string;
for_id_random?: string;
filename?: string;
filename_no_ext?: string;
extension?: string;
file_purpose?: string;
approve?: boolean;
}
/**
* EventDevice - A local hardware device at an event
*/
export interface ae_EventDevice extends ae_BaseObj {
event_device_id: string;
event_device_id_random: string;
event_id: string;
event_id_random: string;
event_location_id_random?: string;
app_mode?: string;
status?: string;
heartbeat?: string | Date;
info_hostname?: string;
info_ip?: string;
}
/**
* EventAbstract - A proposal for a session or presentation
*/
export interface ae_EventAbstract extends ae_BaseObj {
event_abstract_id: string;
event_abstract_id_random: string;
event_id: string;
event_id_random: string;
external_id?: string;
abstract?: string;
status?: number;
approve?: boolean;
}
/**
* Organization - A business or group entity
*/
export interface ae_Organization extends ae_BaseObj {
organization_id: string;
organization_id_random: string;
account_id: string;
account_id_random: string;
tagline?: string;
logo_path?: string;
industry?: number;
}