Files
podzahr/lib/types.ts
T

74 lines
1.8 KiB
TypeScript

export type AlbumTag = 'Album' | 'EP' | 'Demo' | 'Deluxe' | 'Single';
export type AudioFormat = 'mp3' | 'm4a' | 'flac' | 'wav';
export interface Song {
id: string;
title: string;
duration: string;
previewUrl: string; // URL to 30-second preview
fullUrl: string; // URL to full song (locked until purchase)
}
export interface Album {
id: string;
title: string;
coverImage: string;
year: number;
genre: string;
price: number;
description: string;
songs: Song[];
tag: AlbumTag; // EP, Demo, Deluxe, etc.
format: AudioFormat; // mp3, m4a, flac, wav
bitrate: string; // e.g., "320kbps", "lossless"
}
export type PurchaseStatus = 'pending' | 'approved' | 'rejected';
export type PaymentMethod = 'ipg' | 'card-to-card';
export interface Purchase {
id?: number;
albumId: string;
albumIds?: string[];
transactionId: string;
customerName?: string;
email?: string;
phoneNumber?: string;
txReceipt?: string;
purchaseDate: Date | number;
approvalStatus?: PurchaseStatus; // pending, approved, rejected
paymentMethod?: PaymentMethod; // ipg or card-to-card
reviewedByTelegramId?: string;
reviewedAt?: Date | number;
telegramUserId?: string;
telegramChatId?: string;
receiptType?: 'text' | 'photo';
receiptTelegramFileId?: string;
}
export interface TelegramApprover {
userId: string;
label?: string;
createdAt?: Date | number;
}
export interface TelegramBotSettings {
baseUrl: string;
botTokenConfigured: boolean;
greetingText: string;
cardNumber: string;
cardHolderName: string;
updatedAt?: Date | number;
}
export type TelegramSessionState = 'browsing' | 'awaiting_receipt';
export interface TelegramUserSession {
userId: string;
chatId: string;
state: TelegramSessionState;
cartAlbumIds: string[];
displayName?: string;
updatedAt: Date | number;
}