Migrate Event and EventBadge modules to unified type system
- Updated ae_types.ts with ae_Event, ae_EventBadge, and ae_EventBadgeTemplate interfaces. - Standardized return types (Promise<ae_Event[]>, etc.) for all core loading and CRUD functions in Events module. - Integrated triple-ID patterns for Dexie and V3 API parity in event-related objects. - Cleaned up local interface redundancies in favor of unified imports.
This commit is contained in:
@@ -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_Event } from '$lib/types/ae_types';
|
||||
|
||||
import { load_ae_obj_li__event_device } from './ae_events__event_device';
|
||||
import { load_ae_obj_li__event_location } from './ae_events__event_location';
|
||||
@@ -32,7 +33,7 @@ export async function load_ae_obj_id__event({
|
||||
inc_template_li?: boolean;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__event() *** event_id=${event_id}`);
|
||||
}
|
||||
@@ -124,10 +125,10 @@ export async function load_ae_obj_li__event({
|
||||
view?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'>;
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event[]> {
|
||||
let promise;
|
||||
|
||||
if (qry_conference !== null) {
|
||||
@@ -212,7 +213,7 @@ export async function create_ae_obj__event({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
@@ -288,7 +289,7 @@ export async function update_ae_obj__event({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
|
||||
@@ -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_EventBadge } from '$lib/types/ae_types';
|
||||
|
||||
import { load_ae_obj_id__event_badge_template } from '$lib/ae_events/ae_events__event_badge_template';
|
||||
|
||||
@@ -23,7 +24,7 @@ export async function load_ae_obj_id__event_badge({
|
||||
inc_template?: boolean;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__event_badge() *** event_badge_id=${event_badge_id}`);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ export async function load_ae_obj_li__event_badge({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge[]> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_li__event_badge() *** event_id=${event_id}`);
|
||||
}
|
||||
@@ -197,7 +198,7 @@ export async function create_ae_obj__event_badge({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** create_ae_obj__event_badge() *** event_id=${event_id}`);
|
||||
}
|
||||
@@ -287,7 +288,7 @@ export async function update_ae_obj__event_badge({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** update_ae_obj__event_badge() *** event_badge_id=${event_badge_id}`);
|
||||
}
|
||||
@@ -349,7 +350,7 @@ export async function qry__event_badge({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge[]> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** qry__event_badge() *** event_id=${event_id} qry_str=${qry_str}`);
|
||||
}
|
||||
@@ -443,7 +444,7 @@ export async function search__event_badge({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventBadge[] | false> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** search__event_badge() *** event_id=${event_id} printed_status=${printed_status} affiliations=${affiliations_qry_str} order_by_li=`, order_by_li);
|
||||
}
|
||||
|
||||
@@ -179,4 +179,102 @@ export interface ae_Person extends ae_BaseObj {
|
||||
tagline?: string;
|
||||
|
||||
data_json?: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event - A discrete conference or show
|
||||
*/
|
||||
export interface ae_Event extends ae_BaseObj {
|
||||
event_id: string;
|
||||
event_id_random: string;
|
||||
account_id: string;
|
||||
account_id_random: string;
|
||||
|
||||
conference: boolean;
|
||||
type?: string;
|
||||
summary?: string;
|
||||
format?: string;
|
||||
|
||||
timezone?: string;
|
||||
start_datetime?: string | Date;
|
||||
end_datetime?: string | Date;
|
||||
|
||||
location_text?: string;
|
||||
location_address_json?: any;
|
||||
|
||||
status?: string;
|
||||
approve?: boolean;
|
||||
ready?: boolean;
|
||||
ready_on?: string | Date;
|
||||
|
||||
cfg_json?: any;
|
||||
data_json?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* EventBadge - An attendee's printed credentials
|
||||
*/
|
||||
export interface ae_EventBadge extends ae_BaseObj {
|
||||
event_badge_id: string;
|
||||
event_badge_id_random: string;
|
||||
event_id: string;
|
||||
event_id_random: string;
|
||||
person_id: string;
|
||||
person_id_random: string;
|
||||
event_person_id?: string;
|
||||
event_person_id_random?: string;
|
||||
|
||||
event_badge_template_id?: string;
|
||||
event_badge_template_id_random?: string;
|
||||
|
||||
badge_type_code?: string;
|
||||
badge_type?: string;
|
||||
|
||||
member_type_code?: string;
|
||||
member_status?: string;
|
||||
|
||||
pronouns?: string;
|
||||
given_name?: string;
|
||||
middle_name?: string;
|
||||
family_name?: string;
|
||||
full_name?: string;
|
||||
affiliations?: string;
|
||||
|
||||
professional_title?: string;
|
||||
email?: string;
|
||||
city?: string;
|
||||
state_province?: string;
|
||||
country?: string;
|
||||
|
||||
print_count?: number;
|
||||
print_first_datetime?: string | Date;
|
||||
print_last_datetime?: string | Date;
|
||||
|
||||
ticket_list?: any[];
|
||||
data_json?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* EventBadgeTemplate - Layout and style for badges
|
||||
*/
|
||||
export interface ae_EventBadgeTemplate extends ae_BaseObj {
|
||||
event_badge_template_id: string;
|
||||
event_badge_template_id_random: string;
|
||||
event_id: string;
|
||||
event_id_random: string;
|
||||
|
||||
logo_path?: string;
|
||||
header_path?: string;
|
||||
header_row_1?: string;
|
||||
header_row_2?: string;
|
||||
|
||||
footer_path?: string;
|
||||
footer_title?: string;
|
||||
|
||||
badge_type_list?: any;
|
||||
ticket_list?: any;
|
||||
|
||||
layout?: string;
|
||||
style_href?: string;
|
||||
passcode?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user