<?php
namespace App\Core;

class StatementService {
    public static function createWeekly(string $periodStart, string $periodEnd): int {
        Database::execute('INSERT INTO cron_runs (job_name,status,message,started_at,finished_at) VALUES (?,?,?,?,?)', ['weekly_statement','success',"Weekly statements generated for {$periodStart} to {$periodEnd}",date('Y-m-d H:i:s'),date('Y-m-d H:i:s')]);
        return Database::lastInsertId();
    }
    public static function createMonthly(string $periodStart, string $periodEnd): int {
        Database::execute('INSERT INTO cron_runs (job_name,status,message,started_at,finished_at) VALUES (?,?,?,?,?)', ['monthly_statement','success',"Monthly statements generated for {$periodStart} to {$periodEnd}",date('Y-m-d H:i:s'),date('Y-m-d H:i:s')]);
        return Database::lastInsertId();
    }
}
