Skip to content

lcassettai/qbind_challenge

Repository files navigation

Qbind Italian VAT Number Validator

A web system for validating Italian VAT numbers

Features

  • Individual validation of Italian VAT numbers
  • Bulk processing via CSV files
  • Automatic correction of numbers without "IT" prefix
  • Storage of results in MySQL database
  • Visualization of categorized results (Valid, Corrected, Invalid)

Project Structure

qbind/
├── db/
│   ├── Database.php    # Database connection class
│   └── seed.sql        # Schema and sample data
├── layout/             # UI components
├── index.php           # Main page
├── process_upload.php  # CSV file processor
├── VatValidator.php    # VAT validation logic
├── results.php         # List data from DB 
├── styles.css          # CSS styles
└── README.md           # This documentation

Installation and Setup

Prerequisites

  1. XAMPP v8.2 installed and running
    • Apache Server
    • MySQL Database
    • PHP

Installation Steps

  1. Clone/Download the project

    # If you have git
    git clone into xampp\htdocs
    
    # Or extract files to:
    xampp\htdocs\qbind\
  2. Configure Database

    Option A: Using phpMyAdmin

    • Go to http://localhost/phpmyadmin
    • Create database named challenge
    • Import the file db/seed.sql

    Option B: From command line

    # Connect to MySQL
    mysql -u root -p
    
    # Create database
    CREATE DATABASE IF NOT EXISTS challenge;
    USE challenge;
    
    # Import schema (default route, change to your actual directory)
    SOURCE c:/xampp/htdocs/qbind/db/seed.sql;

System Usage

1. Access the Application

  • Open web browser
  • Go to: http://localhost/qbind

2. Individual Validation

  • Enter VAT number in the "Vat number" field
  • Valid examples:
    • IT12345678901 (complete format)
    • 12345678901 (auto-corrected by adding "IT")
  • Click "Check"

3. Bulk Validation (CSV)

  • Select CSV file
  • Click "Upload"
  • View categorized results

Italian VAT Format

Validation Rules

  • Valid format: IT followed by exactly 11 digits
  • Example: IT12345678901
  • Auto-correction: If only 11 digits are provided, "IT" prefix is automatically added

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published