namespace GBDD;

public static class SqlQueries
{
    public static string AuthorizationUser(string login, string password)
    {
        return $"select authorization_user('{login}', '{password}')";
    }

    public static string DriverIdByLogin(string login)
    {
        return $"select driver_id from app_user where login = '{login}'";
    }

    public static string AddDriver(
        string lastName,
        string firstName,
        string middleName,
        string birthDate,
        string city,
        string street,
        string building,
        string apartment,
        string postalCode)
    {
        return $"""
            select add_driver(
                '{lastName}',
                '{firstName}',
                '{middleName}',
                '{birthDate}',
                '{city}',
                '{street}',
                '{building}',
                '{apartment}',
                '{postalCode}'
            )
            """;
    }

    public static string AddViolation(
        int driverId,
        int vehicleId,
        int violationTypeId,
        string uin,
        string amount)
    {
        return $"""
            select add_violation(
                {driverId},
                {vehicleId},
                {violationTypeId},
                current_date,
                null,
                '{uin}',
                {amount}
            )
            """;
    }
}
