interface DateTime {
    start: string;
    end: string;
}

interface Address {
    name: string;
    address: string;
}

interface Organizer {
    name: string;
    email: string;
}

interface ReceiptItem {
    name: string;
    quantity: number;
    price: number;
    currency: string;
}

interface DataItemType<T extends string, D> {
    id: string;
    title: string;
    type: T;
    rawData: string;
    data: D;
}

interface EventData {
    title: string;
    dateTime: DateTime;
    location: string;
    description: string;
    organizer: Organizer;
    attendees: string[];
    category: string;
}

interface ContactData {
    name: string;
    phoneNumber: string;
    emailAddress: string;
    address: string;
    organization: string;
    title: string;
    notes: string;
}

interface LocationData {
    name: string;
    address: string;
    category: string;
    description: string;
}

interface NoteData {
    title: string;
    keywords: string[];
    content: string;
}

interface WebsiteData {
    url: string;
    title: string;
    description: string;
    category: string;
}

interface ReceiptData {
    receiptDate: string;
    orderNumber: string;
    amount: number;
    currency: string;
    vendor: string;
    items: ReceiptItem[];
    paymentMethod: string;
    shippingAddress: Address;
    category: string;
}

type Event = DataItemType<"Event", EventData>;
type Contact = DataItemType<"Contact", ContactData>;
type Location = DataItemType<"Location", LocationData>;
type Note = DataItemType<"Note", NoteData>;
type Website = DataItemType<"Website", WebsiteData>;
type Receipt = DataItemType<"Receipt", ReceiptData>;

type DataItem = Event | Contact | Location | Note | Website | Receipt;
type DataArray = DataItem[];

export type {
    DateTime,
    Address,
    Organizer,
    ReceiptItem,
    Event,
    Contact,
    Location,
    Note,
    Website,
    Receipt,
    DataItem,
    DataArray,
};
