Interface iUtilityListingDoc<T>

interface iUtilityListingDoc<T extends NumberType> {
    _docId: string;
    _id?: string;
    approvalStatus: {
        featuredPriority?: number;
        isApproved: boolean;
        isFeatured?: boolean;
        reason?: string;
        rejected?: boolean;
        updatedBy?: string;
    };
    categories: string[];
    content: iUtilityListingContent[];
    createdAt: T;
    createdBy: string;
    directLink?: string;
    displayTimes?: iUintRange<T>;
    estimatedCost?: iEstimatedCost<T>;
    estimatedTime?: string;
    homePageView?: {
        category: string;
        type: "badges" | "lists" | "claims" | "applications";
    };
    inheritMetadataFrom?: iInheritMetadataFrom<T>;
    lastUpdated?: T;
    linkedTo?: iLinkedTo<T>;
    links: iUtilityListingLink<T>[];
    listingId: string;
    locale?: string;
    managedBy: string;
    metadata: iMetadata<T>;
    type: string;
    viewCount?: T;
    viewsByPeriod?: {
        daily: number;
        hourly: number;
        monthly: number;
        weekly: number;
    };
    visibility: "public"
    | "private"
    | "unlisted";
}

Type Parameters

Hierarchy (View Summary, Expand)

  • Doc
    • iUtilityListingDoc

Implemented by

Properties

_docId: string

A unique stringified document ID

_id?: string

A unique document ID (Mongo DB ObjectID)

approvalStatus: {
    featuredPriority?: number;
    isApproved: boolean;
    isFeatured?: boolean;
    reason?: string;
    rejected?: boolean;
    updatedBy?: string;
}

Approval status - can be used for moderation

Type declaration

  • OptionalfeaturedPriority?: number

    Featured Priority

  • isApproved: boolean

    Whether the listing is approved

  • OptionalisFeatured?: boolean

    Is Featured

  • Optionalreason?: string

    Optional reason if not approved

  • Optionalrejected?: boolean

    Rejected or just pending

  • OptionalupdatedBy?: string

    Address of who last updated the approval status

categories: string[]

The categories of the listing

The paginated content for the listing

createdAt: T

The time the listing was created

createdBy: string

The BitBadges address of the user who created this listing

directLink?: string

The direct link for the listing. If specified, we will skip the entire content / listing page. Thus, content and links should be empty [].

displayTimes?: iUintRange<T>

Optional time range for when the listing should be shown

estimatedCost?: iEstimatedCost<T>

The estimated cost for this utility/service

estimatedTime?: string

The estimated time to complete or deliver this utility/service

homePageView?: {
    category: string;
    type: "badges" | "lists" | "claims" | "applications";
}

Home page view

inheritMetadataFrom?: iInheritMetadataFrom<T>

Where to inherit metadata from? Only one can be specified.

lastUpdated?: T

The last updated timestamp

linkedTo?: iLinkedTo<T>

Linked details

The relevant links for the listing

listingId: string

The listing ID

locale?: string

Locale (ex: es, fr, etc.). If not specified, we assume en.

managedBy: string

The BitBadges address of the user who is currently managing this

metadata: iMetadata<T>

The overall metadata for the listing

type: string

Type of the listing

viewCount?: T

The total view count for this listing. This is updated periodically from the view tracking document.

viewsByPeriod?: {
    daily: number;
    hourly: number;
    monthly: number;
    weekly: number;
}

Optional breakdown of views by time period for trending calculations

Type declaration

  • daily: number

    Views in the last 24 hours

  • hourly: number

    Views in the last hour

  • monthly: number

    Views in the last 30 days

  • weekly: number

    Views in the last 7 days

visibility: "public" | "private" | "unlisted"

Visibility state of the listing

MMNEPVFCICPMFPCPTTAAATR