<?php
//
// Run this script to check the status of subscriptions
// It should run at least once a day with cron or some other task runner
// It will check for subscriptions that have expired
//  If the expired subscription was CANCELED, do nothing
//  If the expired subscription was not CANCELED, update it to COMPLETED
//  If the newly COMPLETED subscription was TRIAL, then START the subscription based on the TRIAL - bill the user
//  If the newly COMPLETED subscription was START, then RENEW the subscription - bill the user
//  If the newly COMPLETED subscription was RENEW, then RENEW the subscription - bill the user
// It will check for subcriptions that are about to expire
// It sends an email notification to user based on their email preferences
// The content of the notification is based on:
//  If user has enough credit to cover the upcomming bill
//  If the user does not have enough credit to cover the upcomming bill
// php /path/to/scripts/check_lightning_invoices.php
//
require_once __DIR__ . '/../../vendor/autoload.php';

// Load environment variables from the .env file at project root
Dotenv\Dotenv::createImmutable(__DIR__ . '/../../')->load();
