import { SystemConfig } from 'src/config'; import { Column, DeepPartial, Entity, PrimaryColumn } from 'typeorm'; @Entity('system_metadata') export class SystemMetadataEntity { @PrimaryColumn({ type: 'varchar' }) key!: T; @Column({ type: 'jsonb' }) value!: SystemMetadata[T]; } export enum SystemMetadataKey { REVERSE_GEOCODING_STATE = 'reverse-geocoding-state', ADMIN_ONBOARDING = 'admin-onboarding', SYSTEM_CONFIG = 'system-config', } export interface SystemMetadata extends Record> { [SystemMetadataKey.REVERSE_GEOCODING_STATE]: { lastUpdate?: string; lastImportFileName?: string }; [SystemMetadataKey.ADMIN_ONBOARDING]: { isOnboarded: boolean }; [SystemMetadataKey.SYSTEM_CONFIG]: DeepPartial; }