/
DaniilSk
/
DesignLab
Обзор
Документация
Войти
/
DaniilSk
/
DesignLab
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
frontend/src/types/api.ts
146 строк
3 KB
Даниил
feat(app): add typed api stores and navigation
13 июл 2026, 01:57
13 июл 2026, 01:57
c3dc2f7
Код
Авторство
О чём код?
export interface UserRead { id: string name: string email: string | null avatar_url: string | null status: string referral_code: string referred_by_user_id: string | null profile_settings: Record<string, unknown> created_at: string updated_at: string last_login_at: string | null } export interface SpeakerRead { id: string name: string photo_url: string | null position: string | null company: string | null bio: string | null links: Record<string, string> } export interface EventRead { id: string status: string starts_at: string | null location: string | null short_title: string full_title: string short_description: string | null slug: string image_url: string | null published_at: string | null display_order: number is_visible: boolean registration_limit: number | null registration_remaining: number | null is_registration_available: boolean user_registration_status: EventUserRegistrationStatus seo_title: string | null seo_description: string | null speakers: SpeakerRead[] } export type EventStatus = 'draft' | 'published' | 'registration_open' | 'registration_closed' | 'completed' | 'cancelled' export type EventUserRegistrationStatus = 'not_registered' | 'registered' | 'cancelled' | 'attended' | 'unavailable' export interface ArticleBlockRead { id: string type: 'heading' | 'paragraph' | 'image' | 'quote' | 'gallery' | 'list' | 'link' content: Record<string, unknown> settings: Record<string, unknown> display_order: number } export interface ArticleRead { id: string event_id: string status: string blocks: ArticleBlockRead[] } export interface EventDetailRead extends EventRead { article: ArticleRead | null } export interface ProgressSummary { level: number points_balance: number total_points: number } export interface ReferralSummary { referral_code: string invite_url: string invited_count: number } export interface HomeRead { user: UserRead | null progress: ProgressSummary referrals: ReferralSummary | null events: EventRead[] } export interface ProfileRead { user: UserRead progress: ProgressSummary referrals: ReferralSummary attended_events: EventRead[] registered_events: EventRead[] } export type RewardSemanticState = 'locked' | 'available' | 'claimed' | 'alternative_selected' | 'unavailable' export type RewardDisabledReason = 'already_claimed' | 'level_not_reached' | 'another_reward_selected' | 'reward_unavailable' | 'out_of_stock' export interface LoyaltyRewardRead { id: string title: string description: string | null image_url: string | null display_order: number is_active: boolean stock_limit: number | null claimed_count: number semantic_state: RewardSemanticState disabled_reason: RewardDisabledReason | null } export interface LoyaltyLevelRead { id: string title: string level_order: number required_points: number choose_one_reward: boolean rewards: LoyaltyRewardRead[] } export interface LoyaltyProgramRead { id: string code: string title: string description: string | null image_url: string | null } export interface LoyaltyProgressRead { points: number current_level_id: string | null current_level_order: number next_level_points: number | null } export interface LoyaltyRead { program: LoyaltyProgramRead progress: LoyaltyProgressRead levels: LoyaltyLevelRead[] } export interface RewardClaimRead { reward_id: string status: string claimed_at: string }