import { dataBuilder } from "@helpers/datas/dataBuilder"; import { lorem } from "@helpers/ui/lipsum"; import { type Offer, RDFTYPE_OFFER } from "@src/rdf"; export const offerPurchase: Offer = { "@id": "store://local.sample-object/offers/1/", "@type": RDFTYPE_OFFER, creation_date: "2024-11-11T14:03:03.534000Z", update_date: "2024-11-18T13:59:20.223723Z", name: "Purchase by content", description: "Select and access specific fact-checking reports on demand. Pay only for the content you need, when you need it.", kind: "purchase", }; export const offerSubscription: Offer = { "@id": "store://local.sample-object/offers/2/", "@type": RDFTYPE_OFFER, creation_date: "2024-11-11T14:03:03.534000Z", update_date: "2024-11-18T13:59:20.223723Z", name: "Subscription", description: "Select and access specific infographics on demand. Pay only for the content you need, when you need it.", kind: "subscription", }; export const get_random_offer = (): Offer => { const removables: string[] = []; const replacements: Offer = { "@id": `store://local.sample-object/${Math.floor(Math.random() * 1000)}/`, creation_date: new Date( Date.now() - Math.random() * 365 * 24 * 60 * 60 * 1000, ).toISOString(), update_date: new Date( Date.now() - Math.random() * 30 * 24 * 60 * 60 * 1000, ).toISOString(), name: lorem.generateWords(Math.floor(Math.random() * 3) + 1), description: lorem.generateSentences(2), kind: Math.random() < 0.5 ? "purchase" : "subscription", }; return dataBuilder( offerSubscription, removables, replacements, true, ) as Offer; };