Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

731 B
Raw Blame
import { EntityRepositoryType, type Opt, PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';
import { TrekPhotoCacheMetaRepository } from '../repositories/TrekPhotoCacheMeta.repository';

export class TrekPhotoCacheMeta {
  [EntityRepositoryType]?: TrekPhotoCacheMetaRepository;
  [PrimaryKeyProp]?: 'cache_key';
  cache_key!: string;
  content_type: string & Opt = 'image/jpeg';
  fetched_at!: number;
}

export const TrekPhotoCacheMetaSchema = defineEntity({
  class: TrekPhotoCacheMeta,
  repository: () => TrekPhotoCacheMetaRepository,
  properties: {
    cache_key: p.text().primary(),
    content_type: p.text().default('image/jpeg'),
    fetched_at: p.integer().index('idx_trek_photo_cache_meta_fetched_at'),
  },
});