<?php

namespace App\Campaigns;

/**
 * How a freshly published campaign is left on its platform, in the buyer's words.
 *
 * Meta and Google build every level paused. LinkedIn holds the tree at the
 * campaign (the API's campaign group) and builds the ad set and ads active, so
 * the ads go through review while nothing spends. Saying "created paused" for
 * LinkedIn sent buyers looking for paused ads that were in fact on.
 */
class PublishedState
{
    /** Completes "It will be created …" and "Published …, created …". */
    public static function describe(string $platform): string
    {
        return $platform === 'linkedin'
            ? 'with the campaign paused and its ad set and ads active'
            : 'paused';
    }

    /**
     * What the chat says once a start is accepted. LinkedIn holds delivery at
     * "Campaign scheduled" for several minutes after it accepts a start.
     */
    public static function afterStart(string $platform): string
    {
        return $platform === 'linkedin'
            ? 'LinkedIn has accepted the start. Say in one line, with the budget, that it is switched on and '
                .'LinkedIn usually begins delivering within about 10 minutes (Campaign Manager may show '
                .'"Campaign scheduled" until then), and mention they can stop it here at any time.'
            : 'It is now live and spending. Say so in one line with the budget, and mention '
                .'they can stop it here at any time.';
    }
}
