Index: .idea/sqldialects.xml
===================================================================
--- .idea/sqldialects.xml	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ .idea/sqldialects.xml	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -2,25 +2,4 @@
 <project version="4">
   <component name="SqlDialectMappings">
-    <file url="file://$PROJECT_DIR$/music/constrains/general_constrains.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/constrains/soft_delete.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/normalization/personal_info.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/procedures/insert_track_with_price.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/transactions/add_tracks_to_playlist.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/transactions/batch_update_reports_to.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/transactions/create_invoice_with_lines.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/customer_deletion.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/media_type_deletion.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/normalize_and_validate_customer_email.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/prevent_artist_deletion.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/prevent_genre_deletion.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/prevent_price_deletion.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/update_invoice_total_after_delete.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/triggers/update_invoice_total_after_insert.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/avg_price_per_artist.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/avg_song_duration_per_artist.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/media_type_percentage.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/most_listened_genre_per_customer.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/rang_list_most_active_customers_view.sql" dialect="PostgreSQL" />
-    <file url="file://$PROJECT_DIR$/music/views/rank_list_artists.sql" dialect="PostgreSQL" />
     <file url="file://$PROJECT_DIR$/music/views/tracks_count_per_genre.sql" dialect="PostgreSQL" />
     <file url="PROJECT" dialect="PostgreSQL" />
Index: dea/vcs.xml
===================================================================
--- .idea/vcs.xml	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
-  </component>
-</project>
Index: MuiscOrganizationSystem/settings.py
===================================================================
--- MuiscOrganizationSystem/settings.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ MuiscOrganizationSystem/settings.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -16,4 +16,5 @@
 BASE_DIR = Path(__file__).resolve().parent.parent
 
+
 # Quick-start development settings - unsuitable for production
 # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
@@ -26,4 +27,5 @@
 
 ALLOWED_HOSTS = []
+
 
 # Application definition
@@ -47,5 +49,4 @@
     "django.contrib.messages.middleware.MessageMiddleware",
     "django.middleware.clickjacking.XFrameOptionsMiddleware",
-    'music.middleware.Redirect404ToHomeMiddleware',
 ]
 
@@ -71,4 +72,5 @@
 WSGI_APPLICATION = "MuiscOrganizationSystem.wsgi.application"
 
+
 # Database
 # https://docs.djangoproject.com/en/5.1/ref/settings/#databases
@@ -92,4 +94,5 @@
 }
 
+
 # Password validation
 # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
@@ -110,4 +113,5 @@
 ]
 
+
 # Internationalization
 # https://docs.djangoproject.com/en/5.1/topics/i18n/
@@ -121,4 +125,5 @@
 USE_TZ = True
 
+
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/5.1/howto/static-files/
@@ -130,4 +135,2 @@
 
 DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
-
-DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000
Index: L/constrains/general_constrains.sql
===================================================================
--- SQL/constrains/general_constrains.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,34 +1,0 @@
--- Default Media Type Constrain
-ALTER TABLE track
-ALTER COLUMN media_type_id SET DEFAULT 1;
-
-ALTER TABLE track
-DROP CONSTRAINT IF EXISTS track_media_type_id_fkey;
-
-ALTER TABLE track
-ADD CONSTRAINT track_media_type_id_fkey
-FOREIGN KEY (media_type_id) REFERENCES media_type(media_type_id)
-ON DELETE SET DEFAULT;
-
-
-SELECT setval(pg_get_serial_sequence('invoice_line', 'invoice_line_id'), (SELECT MAX(invoice_line_id) FROM invoice_line));
-
-SELECT setval(pg_get_serial_sequence('playlist_track', 'id'), (SELECT MAX(id) FROM playlist_track));
-
-SELECT setval(pg_get_serial_sequence('playlist', 'playlist_id'), (SELECT MAX(playlist_id) FROM playlist));
-
-SELECT setval(pg_get_serial_sequence('artist', 'artist_id'), (SELECT MAX(artist_id) FROM artist));
-
-SELECT setval(pg_get_serial_sequence('album', 'album_id'), (SELECT MAX(album_id) FROM album));
-
-SELECT setval(pg_get_serial_sequence('track', 'track_id'), (SELECT MAX(track_id) FROM track));
-
-SELECT setval(pg_get_serial_sequence('media_type', 'media_type_id'), (SELECT MAX(media_type_id) FROM media_type));
-
-SELECT setval(pg_get_serial_sequence('genre', 'genre_id'), (SELECT MAX(genre_id) FROM genre));
-
-SELECT setval(pg_get_serial_sequence('customer', 'customer_id'), (SELECT MAX(customer_id) FROM customer));
-
-SELECT setval(pg_get_serial_sequence('employee', 'employee_id'), (SELECT MAX(employee_id) FROM employee));
-
-
Index: L/constrains/soft_delete.sql
===================================================================
--- SQL/constrains/soft_delete.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,66 +1,0 @@
---ADDING DELETED_AT COLUMN
-DO $$
-DECLARE
-    r RECORD;
-BEGIN
-    FOR r IN
-        SELECT table_name
-        FROM information_schema.tables
-        WHERE table_schema = 'public'
-          AND table_type = 'BASE TABLE'
-    LOOP
-        EXECUTE format('ALTER TABLE public.%I ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMP;', r.table_name);
-    END LOOP;
-END $$;
-
---SOFT DELETE TRIGGER
-DO $$
-DECLARE
-    r RECORD;
-    pk_col TEXT;
-BEGIN
-    FOR r IN (
-        SELECT table_name
-        FROM information_schema.tables
-        WHERE table_schema = 'public'
-          AND table_type = 'BASE TABLE'
-    )
-    LOOP
-        SELECT kcu.column_name INTO pk_col
-        FROM information_schema.table_constraints tc
-        JOIN information_schema.key_column_usage kcu
-          ON tc.constraint_name = kcu.constraint_name
-         AND tc.table_name = kcu.table_name
-        WHERE tc.constraint_type = 'PRIMARY KEY'
-          AND tc.table_name = r.table_name
-        LIMIT 1;
-
-        IF pk_col IS NULL THEN
-            RAISE NOTICE 'Table % has no primary key, skipping soft delete trigger', r.table_name;
-            CONTINUE;
-        END IF;
-
-        EXECUTE format('ALTER TABLE public.%I ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMP;', r.table_name);
-
-        EXECUTE format(
-            'CREATE OR REPLACE FUNCTION soft_delete_%I()
-             RETURNS TRIGGER AS $func$
-             BEGIN
-                 UPDATE %I SET deleted_at = NOW() WHERE %I = OLD.%I;
-                 RETURN NULL;
-             END;
-             $func$ LANGUAGE plpgsql;',
-            r.table_name, r.table_name, r.table_name, pk_col
-        );
-
-        EXECUTE format(
-            'DROP TRIGGER IF EXISTS trg_soft_delete_%I ON %I;
-             CREATE TRIGGER trg_soft_delete_%I
-             BEFORE DELETE ON %I
-             FOR EACH ROW
-             EXECUTE FUNCTION soft_delete_%I();',
-            r.table_name, r.table_name, r.table_name, r.table_name, r.table_name
-        );
-    END LOOP;
-END $$;
-
Index: L/normalization/personal_info.sql
===================================================================
--- SQL/normalization/personal_info.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,117 +1,0 @@
-CREATE TABLE PersonalInfo (
-    personal_info_id SERIAL PRIMARY KEY,
-    address TEXT,
-    city TEXT,
-    state TEXT,
-    country TEXT,
-    postalcode TEXT,
-    phone TEXT,
-    fax TEXT,
-    email TEXT
-);
-
-ALTER TABLE employee
-ADD COLUMN personal_info_id INTEGER REFERENCES PersonalInfo(personal_info_id);
-
-ALTER TABLE customer
-ADD COLUMN personal_info_id INTEGER REFERENCES PersonalInfo(personal_info_id);
-
---PERSONAL INFO DATA MIGRATION
-INSERT INTO PersonalInfo (address, city, state, country, postalcode, phone, fax, email)
-SELECT DISTINCT address, city, state, country, postal_code, phone, fax, email
-FROM employee;
-
-UPDATE employee e
-SET personal_info_id = p.personal_info_id
-FROM PersonalInfo p
-WHERE e.address = p.address
-  AND e.city = p.city
-  AND e.state = p.state
-  AND e.country = p.country
-  AND e.postal_code = p.postalcode
-  AND e.phone = p.phone
-  AND e.fax = p.fax
-  AND e.email = p.email;
-
-INSERT INTO PersonalInfo (address, city, state, country, postalcode, phone, fax, email)
-SELECT DISTINCT address, city, state, country, postal_code, phone, fax, email
-FROM customer;
-
-UPDATE customer c
-SET personal_info_id = p.personal_info_id
-FROM PersonalInfo p
-WHERE c.address = p.address
-  AND c.city = p.city
-  AND c.country = p.country
-  AND c.email = p.email;
-
-
-ALTER TABLE employee
-DROP COLUMN address,
-DROP COLUMN city,
-DROP COLUMN state,
-DROP COLUMN country,
-DROP COLUMN postal_code,
-DROP COLUMN phone,
-DROP COLUMN fax,
-DROP COLUMN email;
-
-ALTER TABLE customer
-DROP COLUMN address,
-DROP COLUMN city,
-DROP COLUMN state,
-DROP COLUMN country,
-DROP COLUMN postal_code,
-DROP COLUMN phone,
-DROP COLUMN fax,
-DROP COLUMN email;
-
-ALTER TABLE personalinfo
-RENAME COLUMN postalcode TO postal_code;
-
-SELECT *
-FROM employee
-
-CREATE TABLE Contact (
-    contact_id INT PRIMARY KEY,
-    phone VARCHAR(50),
-    fax VARCHAR(50),
-    email VARCHAR(100)
-);
-
-INSERT INTO Contact (contact_id, phone, fax, email)
-SELECT
-    personal_info_id,
-    Phone,
-    Fax,
-    Email
-FROM personalinfo;
-
-ALTER TABLE Employee
-ADD contact_id INT;
-
-UPDATE Employee
-SET contact_id = employee.personal_info_id
-where employee.personal_info_id IS NOT  NULL;
-
-ALTER TABLE Employee
-ADD CONSTRAINT FK_Employee_Contact FOREIGN KEY (contact_id)
-REFERENCES Contact(contact_id);
-
-ALTER TABLE Customer
-ADD contact_id INT;
-
-UPDATE Customer
-SET contact_id = customer.personal_info_id
-where customer.personal_info_id IS NOT  NULL;
-
-ALTER TABLE Customer
-ADD CONSTRAINT FK_Customer_Contact FOREIGN KEY (contact_id)
-REFERENCES Contact(contact_id);
-
-ALTER TABLE personalinfo
-DROP COLUMN fax,
-DROP COLUMN phone,
-DROP COLUMN email;
-
-ALTER TABLE personalinfo RENAME TO address_info;
Index: L/procedures/insert_track_with_price.sql
===================================================================
--- SQL/procedures/insert_track_with_price.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,35 +1,0 @@
-CREATE OR REPLACE PROCEDURE insert_track_with_price(
-    p_name VARCHAR,
-    p_album_id INT,
-    p_media_type_id INT,
-    p_genre_id INT,
-    p_composer VARCHAR,
-    p_milliseconds INT,
-    p_bytes INT,
-    p_price NUMERIC(10,2)
-)
-LANGUAGE plpgsql
-AS $$
-DECLARE
-    new_track_id INT;
-BEGIN
-    INSERT INTO track (
-        name, album_id, media_type_id, genre_id, composer, milliseconds, bytes
-    )
-    VALUES (
-        p_name, p_album_id, p_media_type_id, p_genre_id, p_composer, p_milliseconds, p_bytes
-    )
-    RETURNING track_id INTO new_track_id;
-
-    INSERT INTO price (
-        track_id, value, date
-    )
-    VALUES (
-        new_track_id, p_price, NOW()
-    );
-END;
-$$;
-
-GRANT EXECUTE ON PROCEDURE insert_track_with_price(
-    VARCHAR, INT, INT, INT, VARCHAR, INT, INT, NUMERIC
-) TO PUBLIC;
Index: L/transactions/add_tracks_to_playlist.sql
===================================================================
--- SQL/transactions/add_tracks_to_playlist.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,21 +1,0 @@
-CREATE OR REPLACE FUNCTION add_tracks_to_playlist(
-    _playlist_id INTEGER,
-    _playlist_tracks JSON
-) RETURNS VOID AS $$
-DECLARE
-    track JSON;
-    _track_id INTEGER;
-BEGIN
-    BEGIN
-        FOR track IN SELECT * FROM json_array_elements(_playlist_tracks)
-        LOOP
-            _track_id := (track->>'track_id')::INTEGER;
-
-            INSERT INTO playlist_track (playlist_id, track_id)
-            VALUES (_playlist_id, _track_id);
-        END LOOP;
-    EXCEPTION WHEN OTHERS THEN
-        RAISE EXCEPTION 'Error adding tracks to playlist: %', SQLERRM;
-    END;
-END;
-$$ LANGUAGE plpgsql;
Index: L/transactions/batch_update_reports_to.sql
===================================================================
--- SQL/transactions/batch_update_reports_to.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,27 +1,0 @@
-CREATE OR REPLACE FUNCTION batch_update_reports_to(
-    _updates JSON
-) RETURNS VOID AS $$
-DECLARE
-    item JSON;
-    _employee_id INTEGER;
-    _reports_to_id INTEGER;
-BEGIN
-    BEGIN
-        FOR item IN SELECT * FROM json_array_elements(_updates)
-        LOOP
-            _employee_id := (item->>'employee_id')::INTEGER;
-            _reports_to_id := (item->>'reports_to_id')::INTEGER;
-
-            UPDATE employee
-            SET reports_to = _reports_to_id
-            WHERE employee_id = _employee_id;
-
-            IF NOT FOUND THEN
-                RAISE EXCEPTION 'Employee with id % does not exist', _employee_id;
-            END IF;
-        END LOOP;
-    EXCEPTION WHEN OTHERS THEN
-        RAISE EXCEPTION 'Error updating reports_to: %', SQLERRM;
-    END;
-END;
-$$ LANGUAGE plpgsql;
Index: L/transactions/create_invoice_with_lines.sql
===================================================================
--- SQL/transactions/create_invoice_with_lines.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,23 +1,0 @@
-CREATE OR REPLACE FUNCTION add_invoice_lines_to_existing_invoice(
-    _invoice_id INTEGER,
-    _invoice_lines JSON
-) RETURNS VOID AS $$
-DECLARE
-    line JSON;
-    _track_id INTEGER;
-    _quantity INTEGER;
-BEGIN
-    BEGIN
-        FOR line IN SELECT * FROM json_array_elements(_invoice_lines)
-        LOOP
-            _track_id := (line->>'track_id')::INTEGER;
-            _quantity := (line->>'quantity')::INTEGER;
-
-            INSERT INTO invoice_line (invoice_id, track_id, quantity)
-            VALUES (_invoice_id, _track_id, _quantity);
-        END LOOP;
-    EXCEPTION WHEN OTHERS THEN
-        RAISE EXCEPTION 'Error adding invoice lines: %', SQLERRM;
-    END;
-END;
-$$ LANGUAGE plpgsql;
Index: L/triggers/customer_deletion.sql
===================================================================
--- SQL/triggers/customer_deletion.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,31 +1,0 @@
-DROP TRIGGER IF EXISTS trg_customer_deletion ON customer;
-DROP FUNCTION IF EXISTS customer_deletion();
-
-CREATE OR REPLACE FUNCTION customer_deletion()
-RETURNS TRIGGER AS $$
-DECLARE
-    total_spent NUMERIC(10, 2);
-    invoice_count INTEGER;
-BEGIN
-    SELECT COALESCE(SUM(total), 0), COUNT(*)
-    INTO total_spent, invoice_count
-    FROM invoice
-    WHERE customer_id = OLD.customer_id;
-
-    INSERT INTO deleted_customer_log (
-        first_name, last_name, deleted_at, total_spent, invoice_count
-    )
-    VALUES (
-        OLD.first_name, OLD.last_name, NOW(), total_spent, invoice_count
-    );
-
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
-
-DROP TRIGGER IF EXISTS trg_customer_deletion ON customer;
-
-CREATE TRIGGER trg_customer_deletion
-BEFORE DELETE ON customer
-FOR EACH ROW
-EXECUTE FUNCTION customer_deletion();
Index: L/triggers/media_type_deletion.sql
===================================================================
--- SQL/triggers/media_type_deletion.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,14 +1,0 @@
-CREATE OR REPLACE FUNCTION prevent_deletion_of_default_media_type()
-RETURNS TRIGGER AS $$
-BEGIN
-    IF OLD.media_type_id = 1 THEN
-        RAISE EXCEPTION 'Cannot delete default media type (id = 1)';
-    END IF;
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
-
-CREATE TRIGGER trg_prevent_deletion_of_default_media_type
-BEFORE DELETE ON media_type
-FOR EACH ROW
-EXECUTE FUNCTION prevent_deletion_of_default_media_type();
Index: L/triggers/normalize_and_validate_customer_email.sql
===================================================================
--- SQL/triggers/normalize_and_validate_customer_email.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-CREATE OR REPLACE FUNCTION normalize_and_validate_customer_email()
-RETURNS TRIGGER AS $$
-BEGIN
-    NEW.email := LOWER(NEW.email);
-
-    IF NEW.email !~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$' THEN
-        RAISE EXCEPTION 'Invalid email format: %', NEW.email;
-    END IF;
-
-    RETURN NEW;
-END;
-$$ LANGUAGE plpgsql;
-
-CREATE TRIGGER trg_normalize_validate_email
-BEFORE INSERT ON customer
-FOR EACH ROW
-EXECUTE FUNCTION normalize_and_validate_customer_email();
Index: L/triggers/prevent_artist_deletion.sql
===================================================================
--- SQL/triggers/prevent_artist_deletion.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-CREATE OR REPLACE FUNCTION prevent_artist_deletion()
-RETURNS TRIGGER AS $$
-BEGIN
-    IF EXISTS (
-        SELECT 1 FROM album WHERE artist_id = OLD.artist_id
-    ) THEN
-        RAISE EXCEPTION 'Cannot delete artist with albums.';
-    END IF;
-
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
-
-CREATE TRIGGER trg_prevent_artist_deletion
-BEFORE DELETE ON artist
-FOR EACH ROW
-EXECUTE FUNCTION prevent_artist_deletion();
Index: L/triggers/prevent_genre_deletion.sql
===================================================================
--- SQL/triggers/prevent_genre_deletion.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-CREATE OR REPLACE FUNCTION prevent_genre_deletion()
-RETURNS TRIGGER AS $$
-BEGIN
-    IF EXISTS (
-        SELECT 1 FROM track WHERE genre_id = OLD.genre_id
-    ) THEN
-        RAISE EXCEPTION 'Cannot delete genre with a track of it.';
-    END IF;
-
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
-
-CREATE TRIGGER trg_prevent_genre_deletion
-BEFORE DELETE ON genre
-FOR EACH ROW
-EXECUTE FUNCTION prevent_genre_deletion();
Index: L/triggers/prevent_price_deletion.sql
===================================================================
--- SQL/triggers/prevent_price_deletion.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,11 +1,0 @@
-CREATE OR REPLACE FUNCTION prevent_price_deletion()
-RETURNS trigger AS $$
-BEGIN
-    RAISE EXCEPTION 'Deletion from price table is not allowed.';
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
-CREATE TRIGGER trg_no_price_deletes
-BEFORE DELETE ON price
-FOR EACH ROW
-EXECUTE FUNCTION prevent_price_deletion();
Index: L/triggers/update_invoice_total_after_delete.sql
===================================================================
--- SQL/triggers/update_invoice_total_after_delete.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,20 +1,0 @@
-CREATE OR REPLACE FUNCTION update_invoice_total_after_delete()
-RETURNS TRIGGER AS $$
-BEGIN
-    UPDATE invoice
-    SET total = (
-        SELECT COALESCE(SUM(il.quantity * lp.value), 0)
-        FROM invoice_line il
-        JOIN (
-            SELECT DISTINCT ON (track_id)
-                track_id, value
-            FROM price
-            ORDER BY track_id, date DESC
-        ) lp ON il.track_id = lp.track_id
-        WHERE il.invoice_id = OLD.invoice_id
-    )
-    WHERE invoice_id = OLD.invoice_id;
-
-    RETURN OLD;
-END;
-$$ LANGUAGE plpgsql;
Index: L/triggers/update_invoice_total_after_insert.sql
===================================================================
--- SQL/triggers/update_invoice_total_after_insert.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,20 +1,0 @@
-CREATE OR REPLACE FUNCTION update_invoice_total_after_insert()
-RETURNS TRIGGER AS $$
-BEGIN
-    UPDATE invoice
-    SET total = (
-        SELECT COALESCE(SUM(il.quantity * lp.value), 0)
-        FROM invoice_line il
-        JOIN (
-            SELECT DISTINCT ON (track_id)
-                track_id, value
-            FROM price
-            ORDER BY track_id, date DESC
-        ) lp ON il.track_id = lp.track_id
-        WHERE il.invoice_id = NEW.invoice_id
-    )
-    WHERE invoice_id = NEW.invoice_id;
-
-    RETURN NEW;
-END;
-$$ LANGUAGE plpgsql;
Index: L/views/avg_price_per_artist.sql
===================================================================
--- SQL/views/avg_price_per_artist.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-CREATE VIEW avg_price_per_artist AS
-WITH latest_price AS (
-    SELECT DISTINCT ON (track_id)
-        track_id,
-        value
-    FROM price
-    ORDER BY track_id, date DESC
-)
-SELECT
-    ar.name,
-    COALESCE(ROUND(AVG(lp.value), 2)::text, 'not enough data') AS avg_price_per_track
-FROM artist ar
-LEFT JOIN album a ON ar.artist_id = a.artist_id
-LEFT JOIN track t ON a.album_id = t.album_id
-LEFT JOIN latest_price lp ON t.track_id = lp.track_id
-GROUP BY ar.name
-ORDER BY ar.name;
Index: L/views/avg_song_duration_per_artist.sql
===================================================================
--- SQL/views/avg_song_duration_per_artist.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,7 +1,0 @@
-CREATE VIEW  avg_track_duration_per_artist AS
-SELECT ar.name as artist_name, concat(ceil(avg(milliseconds) / 1000), 's') as avg_track_duration_in_seconds
-FROM artist ar
-left join album al on ar.artist_id = al.album_id
-left join track tr on al.album_id = tr.album_id
-group by ar.name
-order by ar.name
Index: L/views/media_type_percentage.sql
===================================================================
--- SQL/views/media_type_percentage.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,12 +1,0 @@
-CREATE VIEW media_type_percentage AS
-with cte as (SELECT count(track_id) as total
-             FROM media_type mt
-                      left join track tr on mt.media_type_id = tr.media_type_id)
-SELECT mt.name                                          as media_type,
-       count(tr.track_id)                               as num_of_tracks,
-       round(count(tr.track_id) * 100.0 / cte.total, 2) as percentage
-FROM media_type mt
-         left join track tr on mt.media_type_id = tr.media_type_id
-         cross join cte
-group by mt.media_type_id, mt.name, cte.total
-order by percentage desc
Index: L/views/most_listened_genre_per_customer.sql
===================================================================
--- SQL/views/most_listened_genre_per_customer.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-CREATE VIEW most_listened_genre_per_customer AS
-WITH genre_count AS
-         (SELECT c.customer_id, c.first_name, c.last_name, g.name as genre, count(tr.track_id) as num_songs_per_genre
-          FROM customer c
-                   left join invoice i on c.customer_id = i.customer_id
-                   left join invoice_line il on i.invoice_id = il.invoice_id
-                   left join track tr on il.track_id = tr.track_id
-                   left join genre g on tr.genre_id = g.genre_id
-          group by c.customer_id, c.first_name, c.last_name, g.genre_id, g.name
-          order by c.first_name, num_songs_per_genre desc),
-     ranked_genres AS (SELECT *,
-                              ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY num_songs_per_genre DESC) AS rn
-                       FROM genre_count)
-SELECT first_name, last_name, genre as most_listened_genre
-FROM ranked_genres
-WHERE rn = 1
-ORDER BY first_name, last_name;
Index: L/views/rang_list_most_active_customers_view.sql
===================================================================
--- SQL/views/rang_list_most_active_customers_view.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,9 +1,0 @@
-CREATE  VIEW rank_list_most_active_customers_view AS
-SELECT
-    c.first_name || ' ' || c.last_name as name,
-    COUNT(i.invoice_id) as total_orders,
-    SUM(i.total) as total_money_spent
-from customer c
-LEFT JOIN invoice i on c.customer_id = i.customer_id
-GROUP BY c.first_name, c.last_name
-order by total_money_spent desc
Index: L/views/rank_list_artists.sql
===================================================================
--- SQL/views/rank_list_artists.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,11 +1,0 @@
-CREATE VIEW rank_list_artists AS
-SELECT ar.name,
-       count(il.invoice_line_id) AS num_invoices,
-       COALESCE(SUM(i.total), 0) AS money_earned
-FROM artist ar
-         LEFT JOIN album al ON ar.artist_id = al.album_id
-         LEFT JOIN track tr ON al.album_id = tr.album_id
-         LEFT JOIN invoice_line il ON tr.track_id = il.track_id
-         LEFT JOIN invoice i on il.invoice_id = i.invoice_id
-GROUP BY ar.name
-ORDER BY money_earned DESC;
Index: L/views/tracks_count_per_genre.sql
===================================================================
--- SQL/views/tracks_count_per_genre.sql	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,5 +1,0 @@
-CREATE VIEW track_count_per_genre AS
-SELECT  g.name as Genre, count(t.track_id) as num_tracks
-FROM genre g
-LEFT JOIN track t on g.genre_id = t.genre_id
-GROUP BY g.name
Index: music/admin.py
===================================================================
--- music/admin.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ music/admin.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -16,3 +16,2 @@
 admin.site.register(PlaylistTrack, PlaylistTrackAdmin)
 admin.site.register(Track)
-admin.site.register(DeletedCustomerLog)
Index: sic/middleware.py
===================================================================
--- music/middleware.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,13 +1,0 @@
-from django.shortcuts import redirect
-from django.http import Http404
-
-class Redirect404ToHomeMiddleware:
-    def __init__(self, get_response):
-        self.get_response = get_response
-
-    def __call__(self, request):
-        try:
-            response = self.get_response(request)
-            return response
-        except Http404:
-            return redirect('homepage')
Index: sic/migrations/0004_deletedcustomerlog_delete_tracks_count_per_genre_and_more.py
===================================================================
--- music/migrations/0004_deletedcustomerlog_delete_tracks_count_per_genre_and_more.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,39 +1,0 @@
-# Generated by Django 5.1.3 on 2025-05-07 07:43
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0003_tracks_count_per_genre"),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name="DeletedCustomerLog",
-            fields=[
-                ("log_id", models.AutoField(primary_key=True, serialize=False)),
-                ("first_name", models.CharField(max_length=40)),
-                ("last_name", models.CharField(max_length=20)),
-                ("deleted_at", models.DateTimeField()),
-                ("total_spent", models.DecimalField(decimal_places=2, max_digits=10)),
-                ("invoice_count", models.IntegerField()),
-            ],
-            options={
-                "db_table": "deleted_customer_log",
-                "managed": False,
-            },
-        ),
-        migrations.DeleteModel(
-            name="tracks_count_per_genre",
-        ),
-        migrations.AlterModelOptions(
-            name="invoice",
-            options={"managed": False},
-        ),
-        migrations.AlterModelOptions(
-            name="invoiceline",
-            options={"managed": False},
-        ),
-    ]
Index: sic/migrations/0005_alter_deletedcustomerlog_options_and_more.py
===================================================================
--- music/migrations/0005_alter_deletedcustomerlog_options_and_more.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# Generated by Django 5.1.3 on 2025-05-07 09:03
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0004_deletedcustomerlog_delete_tracks_count_per_genre_and_more"),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name="deletedcustomerlog",
-            options={},
-        ),
-        migrations.AlterModelOptions(
-            name="invoice",
-            options={},
-        ),
-        migrations.AlterModelOptions(
-            name="invoiceline",
-            options={},
-        ),
-        migrations.AlterModelOptions(
-            name="playlisttrack",
-            options={},
-        ),
-    ]
Index: sic/migrations/0006_alter_deletedcustomerlog_options_and_more.py
===================================================================
--- music/migrations/0006_alter_deletedcustomerlog_options_and_more.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,49 +1,0 @@
-# Generated by Django 5.1.3 on 2025-05-07 11:22
-
-import django.db.models.deletion
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0005_alter_deletedcustomerlog_options_and_more"),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name="deletedcustomerlog",
-            options={"managed": False},
-        ),
-        migrations.AlterModelOptions(
-            name="invoice",
-            options={"managed": False},
-        ),
-        migrations.AlterModelOptions(
-            name="invoiceline",
-            options={"managed": False},
-        ),
-        migrations.AlterModelOptions(
-            name="playlisttrack",
-            options={"managed": False},
-        ),
-        migrations.CreateModel(
-            name="Price",
-            fields=[
-                ("price_id", models.AutoField(primary_key=True, serialize=False)),
-                ("value", models.DecimalField(decimal_places=2, max_digits=10)),
-                ("date", models.DateTimeField()),
-                (
-                    "track_id",
-                    models.ForeignKey(
-                        db_column="track_id",
-                        on_delete=django.db.models.deletion.DO_NOTHING,
-                        to="music.track",
-                    ),
-                ),
-            ],
-            options={
-                "db_table": "price",
-            },
-        ),
-    ]
Index: sic/migrations/0007_alter_price_options.py
===================================================================
--- music/migrations/0007_alter_price_options.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,17 +1,0 @@
-# Generated by Django 5.1.3 on 2025-05-07 11:22
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0006_alter_deletedcustomerlog_options_and_more"),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name="price",
-            options={"managed": False},
-        ),
-    ]
Index: sic/migrations/0008_remove_track_unit_price_album_deleted_at_and_more.py
===================================================================
--- music/migrations/0008_remove_track_unit_price_album_deleted_at_and_more.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,57 +1,0 @@
-# Generated by Django 5.1.3 on 2025-06-11 15:23
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0007_alter_price_options"),
-    ]
-
-    operations = [
-        migrations.RemoveField(
-            model_name="track",
-            name="unit_price",
-        ),
-        migrations.AddField(
-            model_name="album",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="artist",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="customer",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="employee",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="genre",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="mediatype",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="playlist",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-        migrations.AddField(
-            model_name="track",
-            name="deleted_at",
-            field=models.DateTimeField(blank=True, null=True),
-        ),
-    ]
Index: sic/migrations/0009_personalinfo_remove_customer_address_and_more.py
===================================================================
--- music/migrations/0009_personalinfo_remove_customer_address_and_more.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,101 +1,0 @@
-# Generated by Django 5.1.3 on 2025-06-11 15:28
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("music", "0008_remove_track_unit_price_album_deleted_at_and_more"),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name="PersonalInfo",
-            fields=[
-                (
-                    "id",
-                    models.BigAutoField(
-                        auto_created=True,
-                        primary_key=True,
-                        serialize=False,
-                        verbose_name="ID",
-                    ),
-                ),
-                ("address", models.CharField(max_length=255)),
-                ("city", models.CharField(max_length=100)),
-                ("state", models.CharField(blank=True, max_length=100, null=True)),
-                ("country", models.CharField(max_length=100)),
-                ("postal_code", models.CharField(blank=True, max_length=20, null=True)),
-                ("phone", models.CharField(blank=True, max_length=20, null=True)),
-            ],
-            options={
-                "db_table": "personalinfo",
-                "managed": False,
-            },
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="address",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="city",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="country",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="email",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="fax",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="phone",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="postal_code",
-        ),
-        migrations.RemoveField(
-            model_name="customer",
-            name="state",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="address",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="city",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="country",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="email",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="fax",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="phone",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="postal_code",
-        ),
-        migrations.RemoveField(
-            model_name="employee",
-            name="state",
-        ),
-    ]
Index: music/models.py
===================================================================
--- music/models.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ music/models.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -5,5 +5,4 @@
     artist_id = models.AutoField(primary_key=True)
     name = models.CharField(max_length=120, blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -18,5 +17,4 @@
     title = models.CharField(max_length=160)
     artist = models.ForeignKey(Artist, on_delete=models.CASCADE, db_column='artist_id')
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -35,5 +33,12 @@
     birth_date = models.DateTimeField(blank=True, null=True)
     hire_date = models.DateTimeField(blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
+    address = models.CharField(max_length=70, blank=True, null=True)
+    city = models.CharField(max_length=40, blank=True, null=True)
+    state = models.CharField(max_length=40, blank=True, null=True)
+    country = models.CharField(max_length=40, blank=True, null=True)
+    postal_code = models.CharField(max_length=10, blank=True, null=True)
+    phone = models.CharField(max_length=24, blank=True, null=True)
+    fax = models.CharField(max_length=24, blank=True, null=True)
+    email = models.CharField(max_length=60, blank=True, null=True)
 
     def __str__(self):
@@ -49,7 +54,13 @@
     last_name = models.CharField(max_length=20)
     company = models.CharField(max_length=80, blank=True, null=True)
-    support_rep = models.ForeignKey(Employee, on_delete=models.SET_NULL, blank=True, null=True,
-                                    db_column='support_rep_id')
-    deleted_at = models.DateTimeField(null=True, blank=True)
+    address = models.CharField(max_length=70, blank=True, null=True)
+    city = models.CharField(max_length=40, blank=True, null=True)
+    state = models.CharField(max_length=40, blank=True, null=True)
+    country = models.CharField(max_length=40, blank=True, null=True)
+    postal_code = models.CharField(max_length=10, blank=True, null=True)
+    phone = models.CharField(max_length=24, blank=True, null=True)
+    fax = models.CharField(max_length=24, blank=True, null=True)
+    email = models.CharField(max_length=60)
+    support_rep = models.ForeignKey(Employee, on_delete=models.SET_NULL, blank=True, null=True, db_column='support_rep_id')
 
     def __str__(self):
@@ -63,5 +74,4 @@
     genre_id = models.AutoField(primary_key=True)
     name = models.CharField(max_length=120, blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -75,5 +85,4 @@
     media_type_id = models.AutoField(primary_key=True)
     name = models.CharField(max_length=120, blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -93,5 +102,5 @@
     milliseconds = models.IntegerField()
     bytes = models.IntegerField(blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
+    unit_price = models.DecimalField(max_digits=10, decimal_places=2)
 
     def __str__(self):
@@ -104,5 +113,5 @@
 class Invoice(models.Model):
     invoice_id = models.AutoField(primary_key=True)
-    customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, db_column='customer_id', null=True)
+    customer = models.ForeignKey(Customer, on_delete=models.CASCADE, db_column='customer_id')
     invoice_date = models.DateTimeField()
     billing_address = models.CharField(max_length=70, blank=True, null=True)
@@ -112,5 +121,4 @@
     billing_postal_code = models.CharField(max_length=10, blank=True, null=True)
     total = models.DecimalField(max_digits=10, decimal_places=2)
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -119,5 +127,4 @@
     class Meta:
         db_table = 'invoice'
-        managed = False
 
 
@@ -126,10 +133,9 @@
     invoice = models.ForeignKey(Invoice, on_delete=models.CASCADE, db_column='invoice_id')
     track = models.ForeignKey(Track, on_delete=models.CASCADE, db_column='track_id')
+    unit_price = models.DecimalField(max_digits=10, decimal_places=2)
     quantity = models.IntegerField()
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     class Meta:
         db_table = 'invoice_line'
-        managed = False
 
 
@@ -137,5 +143,4 @@
     playlist_id = models.AutoField(primary_key=True)
     name = models.CharField(max_length=120, blank=True, null=True)
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     def __str__(self):
@@ -150,5 +155,4 @@
     playlist = models.ForeignKey(Playlist, on_delete=models.CASCADE, db_column='playlist_id')
     track = models.ForeignKey(Track, on_delete=models.CASCADE, db_column='track_id')
-    deleted_at = models.DateTimeField(null=True, blank=True)
 
     class Meta:
@@ -161,47 +165,14 @@
 
 
-class DeletedCustomerLog(models.Model):
-    log_id = models.AutoField(primary_key=True)
-    first_name = models.CharField(max_length=40)
-    last_name = models.CharField(max_length=20)
-    deleted_at = models.DateTimeField()
-    total_spent = models.DecimalField(max_digits=10, decimal_places=2)
-    invoice_count = models.IntegerField()
-    deleted_at = models.DateTimeField(null=True, blank=True)
+#VIEWS
+
+class tracks_count_per_genre(models.Model):
+    genre = models.CharField(max_length=20, blank=True, null=True)
+    count = models.IntegerField(blank=True, null=True)
 
     class Meta:
-        db_table = 'deleted_customer_log'
+        db_table = 'tracks_count_per_genre'
         managed = False
 
     def __str__(self):
-        return f"{self.first_name} {self.last_name} - Deleted on {self.deleted_at} - Total Spent: ${self.total_spent} from {self.invoice_count} invoices"
-
-
-class Price(models.Model):
-    price_id = models.AutoField(primary_key=True)
-    value = models.DecimalField(max_digits=10, decimal_places=2)
-    date = models.DateTimeField()
-    track_id = models.ForeignKey(Track, on_delete=models.DO_NOTHING, db_column='track_id')
-
-    class Meta:
-        managed = False
-        db_table = 'price'
-
-    def __str__(self):
-        return f"{self.track_id} - {self.value} - {self.date}"
-
-
-class PersonalInfo(models.Model):
-    customer = models.OneToOneField(Customer, on_delete=models.CASCADE, related_name='personalinfo')
-    address = models.CharField(max_length=255)
-    city = models.CharField(max_length=100)
-    state = models.CharField(max_length=100, blank=True, null=True)
-    country = models.CharField(max_length=100)
-    postal_code = models.CharField(max_length=20, blank=True, null=True)
-    phone = models.CharField(max_length=20, blank=True, null=True)
-
-    class Meta:
-        managed = False
-        db_table = 'personalinfo'
-    def __str__(self):
-        return f"Personal info for {self.customer.first_name} {self.customer.last_name}"
+        return f"{self.genre} - {self.count}"
Index: music/tests.py
===================================================================
--- music/tests.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ music/tests.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -8,2 +8,6 @@
 django.setup()
 
+from music.models import Artist
+artists = Artist.objects.raw('SELECT * FROM music_artist')
+for artist in artists:
+    print(artist.name)
Index: music/urls.py
===================================================================
--- music/urls.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ music/urls.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -1,28 +1,9 @@
 from django.urls import path
-from django.views.generic import RedirectView
-
 from . import views
 
 urlpatterns = [
-    path('', views.home_page, name='homepage'),
     path('album/', views.album_list, name='album_list'),
     path('artist/', views.artist_list, name='artist_list'),
-    path('artist/avg-track-duration', views.avg_track_duration, name='avg_track_duration'),
-    path('artist/avg-track-price', views.avg_price_per_artist, name='avg_track_price'),
-    path('artist/most-popular', views.rank_list_artists, name='rank_list_artists'),
     path('track/', views.track_list, name='track_list'),
-    path('customer/genres-per-customer', views.genres_per_customer, name='genres_per_customer'),
-    path('customer/invoices-per-customer', views.invoice_per_customer_after_date,
-         name='invoice_per_customer_after_date'),
-    path('customer/artist-per-genre', views.most_popular_artist_per_customer_per_genre,
-         name='most_popular_artist_per_customer_per_genre'),
-    path('customer/most-popular-genre-per-customer', views.most_listened_genre_per_customer,
-         name='most_listened_genre_per_customer'),
-    path('media-type/percentage', views.media_type_percentage, name='media_type_percentage'),
-    path('track/per-genre', views.tracks_count_per_genre, name='track_count_per_genre'),
-    path('customer/rank-list', views.rank_list_most_active_customers, name='rank_list_most_active_customers'),
-    path('employee/batch-update-reports-to/', views.batch_update_reports_to, name='batch_update_reports_to'),
-    path('playlists/add-tracks/', views.add_tracks_to_playlist, name='add_tracks_to_playlist'),
-    path('invoices/add-lines/', views.add_invoice_lines_to_invoice, name='add_invoice_lines_to_invoice'),
-
+    path('track/per_genre', views.tracks_count_per_genre, name='track_count_per_genre'),
 ]
Index: music/views.py
===================================================================
--- music/views.py	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ music/views.py	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -1,9 +1,6 @@
-import json
-
 from django.shortcuts import render
 import os
 import django
 from django.db import connection
-from django.shortcuts import redirect
 
 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MuiscOrganizationSystem.settings')
@@ -15,54 +12,16 @@
 # Create your views here.
 
-def home_page(request):
-    return render(request, 'home.html')
-
-
-def redirect_to_home(request, exception):
-    return redirect('home_page')
-
-
-## LIST OF ALL ##
 def album_list(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    if search_track:
-        data = Album.objects.filter(title__icontains=search_track).values_list('title', flat=True)
-    else:
-        data = Album.objects.all().values_list('title', flat=True)
-
     heading = request.GET.get('model', 'All Albums')
-    return render(request, 'list.html', {
-        'data': data,
-        'heading': heading,
-        'search_track': search_track,
-    })
+    data = Album.objects.values_list('title', flat=True)
+    return render(request, 'album_list.html', {'data': data, 'heading': heading})
 
 
 def track_list(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    if search_track:
-        data = Track.objects.filter(name__icontains=search_track).values_list('name', flat=True)
-    else:
-        data = Track.objects.all().values_list('name', flat=True)
-
     heading = request.GET.get('model', 'All Tracks')
-    return render(request, 'list.html', {'data': data, 'heading': heading, 'search_track': search_track, })
+    data = Track.objects.values_list('name', flat=True)
+    return render(request, 'album_list.html', {'data': data, 'heading': heading})
 
 
-def artist_list(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    if search_track:
-        data = Artist.objects.filter(name__icontains=search_track).values_list('name', flat=True)
-    else:
-        data = Artist.objects.all().values_list('name', flat=True)
-    heading = request.GET.get('model', 'All Artists')
-
-    return render(request, 'list.html', {'data': data, 'heading': heading, 'search_track': search_track, })
-
-
-## VIEWS ##
 def tracks_count_per_genre(request):
     with connection.cursor() as cursor:
@@ -71,325 +30,12 @@
 
     data = [{'genre': row[0], 'count': row[1]} for row in rows]
+    print(data)
 
     return render(request, 'track_count_per_genre.html', {'data': data})
 
 
-def avg_track_duration(request):
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM avg_track_duration_per_artist;")
-        rows = cursor.fetchall()
-
-    data = [{'artist': row[0], 'avg': row[1]} for row in rows]
-
-    return render(request, 'avg_track_duration.html', {'data': data})
-
-
-def rank_list_most_active_customers(request):
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM rank_list_most_active_customers_view;")
-        rows = cursor.fetchall()
-
-    data = [{'name': row[0], 'total_orders': row[1], 'total_money_spent': row[2]} for row in rows]
-
-    return render(request, 'rank_list_most_active_customers.html', {'data': data})
-
-
-def avg_price_per_artist(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM avg_price_per_artist;")
-        rows = cursor.fetchall()
-
-    if search_track:
-        rows = [row for row in rows if search_track.lower() in row[0].lower()]
-
-    data = [{'name': row[0], 'avg_price_per_track': row[1]} for row in rows]
-
-    return render(request, 'avg_price_per_artist.html', {'data': data, 'search_track': search_track})
-
-
-def rank_list_artists(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM rank_list_artists;")
-        rows = cursor.fetchall()
-
-    if search_track:
-        rows = [row for row in rows if search_track.lower() in row[0].lower()]
-
-    data = [{'name': row[0], 'num_invoices': row[1], 'money_earned': row[2]} for row in rows]
-
-    return render(request, 'rank_list_artists.html', {'data': data, 'search_track': search_track})
-
-
-def media_type_percentage(request):
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM media_type_percentage;")
-        rows = cursor.fetchall()
-
-    data = [{'name': row[0], 'num_of_tracks': row[1], 'percentage': row[2]} for row in rows]
-
-    return render(request, 'media_type_percentage.html', {'data': data})
-
-
-def most_listened_genre_per_customer(request):
-    with connection.cursor() as cursor:
-        cursor.execute("SELECT * FROM most_listened_genre_per_customer;")
-        rows = cursor.fetchall()
-
-    data = [{'first_name': row[0], 'last_name': row[1], 'most_listened_genre': row[2]} for row in rows]
-
-    return render(request, 'most_listened_genre_per_customer.html', {'data': data})
-
-
-## QUERRIES ##
-
-def genres_per_customer(request):
-    customers = Customer.objects.all()
-    selected_customer_id = request.GET.get('customer_id')
-    data = []
-    customer = None
-
-    if selected_customer_id:
-        customer = Customer.objects.filter(customer_id=selected_customer_id).first()
-        query = """
-            SELECT c.first_name as first_name, c.last_name as last_name, g.name as genre, COUNT(tr.track_id) as track_count
-            FROM customer c
-            LEFT JOIN invoice i ON c.customer_id = i.customer_id
-            LEFT JOIN invoice_line il ON i.invoice_id = il.invoice_id
-            LEFT JOIN track tr ON il.track_id = tr.track_id
-            LEFT JOIN genre g ON tr.genre_id = g.genre_id
-            WHERE c.customer_id = %s
-            GROUP BY c.customer_id, c.first_name, c.last_name, g.genre_id, g.name
-            ORDER BY c.first_name
-        """
-
-        with connection.cursor() as cursor:
-            cursor.execute(query, [selected_customer_id])
-            rows = cursor.fetchall()
-            data = [{'first_name': row[0], 'last_name': row[1], 'genre': row[2], 'track_count': row[3]} for row in rows]
-
-    return render(request, 'genres_per_customer.html', {
-        'customers': customers,
-        'data': data,
-        'customer': customer,
-        'selected_customer_id': selected_customer_id,
-    })
-
-
-def most_popular_artist_per_customer_per_genre(request):
-    customers = Customer.objects.all()
-    selected_customer_id = request.GET.get('customer_id')
-    data = []
-    customer = []
-    if selected_customer_id:
-        query = """WITH PlayCounts AS (
-                SELECT
-                    g.genre_id,
-                    g.name AS genre_name,
-                    ar.name AS artist_name,
-                    COUNT(*) AS play_count
-                FROM customer c
-                JOIN invoice i ON c.customer_id = i.customer_id
-                JOIN invoice_line il ON i.invoice_id = il.invoice_id
-                JOIN track tr ON il.track_id = tr.track_id
-                JOIN genre g ON tr.genre_id = g.genre_id
-                JOIN album a ON tr.album_id = a.album_id
-                JOIN artist ar ON a.artist_id = ar.artist_id
-                WHERE c.customer_id = %s
-                GROUP BY g.genre_id, g.name, ar.name
-            ),
-            MaxPlayCounts AS (
-                SELECT genre_id, MAX(play_count) AS max_count
-                FROM PlayCounts
-                GROUP BY genre_id
-            )
-            SELECT pc.genre_name, pc.artist_name, pc.play_count
-            FROM PlayCounts pc
-            JOIN MaxPlayCounts mpc ON pc.genre_id = mpc.genre_id AND pc.play_count = mpc.max_count;
-        """
-        customer = Customer.objects.filter(customer_id=selected_customer_id).first()
-
-        with connection.cursor() as cursor:
-            cursor.execute(query, [selected_customer_id])
-            rows = cursor.fetchall()
-            data = [{'genre': row[0], 'arist': row[1]} for row in rows]
-
-    return render(request, 'most_popular_artist_per_customer_per_genre.html', {
-        'customers': customers,
-        'customer': customer,
-        'data': data,
-        'selected_customer_id': selected_customer_id,
-    })
-
-
-def invoice_per_customer_after_date(request):
-    customers = Customer.objects.all()
-    selected_customer_id = request.GET.get('customer_id')
-    selected_date = request.GET.get('invoice_date', '2000-01-01')
-    data = []
-    sum = 0
-    customer = None
-
-    if selected_customer_id:
-        customer = Customer.objects.filter(customer_id=selected_customer_id).first()
-        if selected_date:
-            query = """
-                SELECT c.first_name, c.last_name, i.invoice_date::date, i.total
-                FROM customer c
-                JOIN invoice i ON c.customer_id = i.customer_id
-                WHERE c.customer_id = %s AND i.invoice_date > %s
-                ORDER BY i.invoice_date
-            """
-            with connection.cursor() as cursor:
-                cursor.execute(query, [selected_customer_id, selected_date])
-                rows = cursor.fetchall()
-                for r in rows:
-                    sum += r[3]
-
-                data = [{'first_name': row[0], 'last_name': row[1], 'invoice_date': row[2], 'total': row[3]} for row in
-                        rows]
-        else:
-            query = """
-                            SELECT c.first_name, c.last_name, i.invoice_date::date, i.total
-                            FROM customer c
-                            JOIN invoice i ON c.customer_id = i.customer_id
-                            WHERE c.customer_id = %s
-                            ORDER BY i.invoice_date
-                        """
-            with connection.cursor() as cursor:
-                cursor.execute(query, [selected_customer_id])
-                rows = cursor.fetchall()
-                for r in rows:
-                    sum += r[3]
-
-                data = [{'first_name': row[0], 'last_name': row[1], 'invoice_date': row[2], 'total': row[3]}
-                        for row in
-                        rows]
-
-    return render(request, 'invoices_per_customer_after_date.html', {
-        'customers': customers,
-        'total_sum': sum,
-        'data': data,
-        'customer': customer,
-        'selected_customer_id': selected_customer_id,
-    })
-
-
-from django.shortcuts import render, redirect
-from music.models import Employee
-from django.contrib import messages
-
-
-def batch_update_reports_to(request):
-    selected_manager_id = request.POST.get('manager_id') or request.GET.get('manager_id')
-    employees = Employee.objects.exclude(
-        employee_id=selected_manager_id) if selected_manager_id else Employee.objects.all()
-
-    if request.method == 'POST':
-        selected_employee_ids = request.POST.getlist('employee_ids')
-
-        if selected_manager_id and selected_employee_ids:
-            json_data = json.dumps([
-                {"employee_id": int(emp_id), "reports_to_id": int(selected_manager_id)}
-                for emp_id in selected_employee_ids
-            ])
-            try:
-                with connection.cursor() as cursor:
-                    cursor.execute("SELECT batch_update_reports_to(%s::json);", [json_data])
-                messages.success(request, "Batch update successful.")
-                return redirect('batch_update_reports_to')
-
-            except Exception as e:
-                messages.error(request, f"Error during update: {e}")
-
-    all_employees = Employee.objects.all()
-    return render(request, 'batch_update_reports_to.html', {
-        'employees': employees,
-        'all_employees': all_employees,
-        'selected_manager_id': selected_manager_id
-    })
-
-
-def add_tracks_to_playlist(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    invoices = Invoice.objects.all()
-
-    if search_track:
-        tracks = Track.objects.filter(name__icontains=search_track)
-    else:
-        tracks = Track.objects.all()
-
-    playlists = Playlist.objects.all()
-    selected_playlist_id = request.POST.get('playlist_id') or request.GET.get('playlist_id')
-
-    if request.method == 'POST':
-        selected_track_ids = request.POST.getlist('track_ids')
-
-        if selected_playlist_id and selected_track_ids:
-            json_data = json.dumps([
-                {"track_id": int(track_id)}
-                for track_id in selected_track_ids
-            ])
-            try:
-                with connection.cursor() as cursor:
-                    cursor.execute("SELECT add_tracks_to_playlist(%s, %s::json);", [selected_playlist_id, json_data])
-                messages.success(request, "Tracks successfully added to playlist.")
-                return redirect('add_tracks_to_playlist')
-
-            except Exception as e:
-                messages.error(request, f"Error adding tracks: {e}")
-
-    return render(request, 'add_tracks_to_playlist.html', {
-        'playlists': playlists,
-        'tracks': tracks,
-        'selected_playlist_id': selected_playlist_id,
-        'search_track': search_track,
-    })
-
-
-def add_invoice_lines_to_invoice(request):
-    search_track = request.GET.get('search_track', '').strip()
-
-    invoices = Invoice.objects.all().order_by('invoice_id')
-
-    if search_track:
-        tracks = Track.objects.filter(name__icontains=search_track)
-    else:
-        tracks = Track.objects.all()
-
-    selected_invoice_id = request.POST.get('invoice_id') or request.GET.get('invoice_id')
-
-    if request.method == 'POST':
-        selected_track_ids = request.POST.getlist('track_ids')
-        quantities = request.POST.getlist('quantities')
-
-        if selected_invoice_id and selected_track_ids and quantities:
-            try:
-                invoice_lines = []
-                for i in range(len(selected_track_ids)):
-                    track_id = int(selected_track_ids[i])
-                    quantity = int(quantities[i])
-                    invoice_lines.append({'track_id': track_id, 'quantity': quantity})
-
-                json_data = json.dumps(invoice_lines)
-
-                with connection.cursor() as cursor:
-                    cursor.execute("SELECT add_invoice_lines_to_existing_invoice(%s, %s::json);",
-                                   [selected_invoice_id, json_data])
-
-                messages.success(request, "Invoice lines added successfully.")
-                return redirect('add_invoice_lines_to_invoice')
-
-            except Exception as e:
-                messages.error(request, f"Error adding invoice lines: {e}")
-
-    return render(request, 'add_invoice_lines_to_invoice.html', {
-        'invoices': invoices,
-        'tracks': tracks,
-        'selected_invoice_id': selected_invoice_id,
-        'search_track': search_track,
-    })
+def artist_list(request):
+    heading = request.GET.get('model', 'All Artists')
+    data = Artist.objects.values_list('name', flat=True)
+    print(data)
+    return render(request, 'album_list.html', {'data': data, 'heading': heading})
Index: music/views/tracks_count_per_genre.sql
===================================================================
--- music/views/tracks_count_per_genre.sql	(revision d7662b5c5695b63b885011417efd780494e2e537)
+++ music/views/tracks_count_per_genre.sql	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -0,0 +1,5 @@
+CREATE VIEW track_count_per_genre AS
+SELECT  g.name as Genre, count(t.track_id) as num_tracks
+FROM genre g
+LEFT JOIN track t on g.genre_id = t.genre_id
+GROUP BY g.name
Index: mplates/add_invoice_lines_to_invoice.html
===================================================================
--- templates/add_invoice_lines_to_invoice.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,72 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Track Count Per Genre</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Add Invoice Lines</h1>
-
-    <form method="get" class="mb-3">
-        {% csrf_token %}
-        <input type="hidden" name="invoice_id" value="{{ selected_invoice_id }}">
-        <div class="input-group">
-            <input type="text" name="search_track" class="form-control" placeholder="Search tracks"
-                   value="{{ search_track }}">
-            <button class="btn btn-outline-secondary" type="submit">Search</button>
-        </div>
-    </form>
-
-    <form method="post" class="card p-4 shadow-sm bg-white">
-        {% csrf_token %}
-
-        <div class="mb-3">
-            <label for="invoice_id" class="form-label"><strong>Select Invoice</strong></label>
-            <select name="invoice_id" id="invoice_id" class="form-select" onchange="this.form.submit()">
-                <option value="">-- Choose Invoice --</option>
-                {% for invoice in invoices %}
-                    <option value="{{ invoice.invoice_id }}"
-                            {% if invoice.invoice_id|stringformat:"s" == selected_invoice_id %}selected{% endif %}>
-                        Invoice #{{ invoice.invoice_id }} - {{ invoice.invoice_date }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-
-        <div class="row">
-            <div class="col-6">
-                <div class="mb-3">
-                    <label class="form-label"><strong>Select Tracks and Quantities</strong></label>
-                    {% for track in tracks %}
-                        <div class="row mb-2">
-                            <div class="col-auto">
-                                <input class="form-check-input" type="checkbox" name="track_ids"
-                                       value="{{ track.track_id }}" id="track{{ track.track_id }}">
-                                <label class="form-check-label" for="track{{ track.track_id }}">
-                                    {{ track.name }}
-                                </label>
-                            </div>
-                            <div class="col">
-                                <input type="number" class="form-control" name="quantities" min="1" value="1"
-                                       placeholder="Quantity">
-                            </div>
-                        </div>
-                    {% endfor %}
-                </div>
-            </div>
-            <div class="col-4 mx-auto">
-                <button type="submit" class="btn btn-primary px-5">Add to Invoice</button>
-            </div>
-
-        </div>
-
-    </form>
-</div>
-</body>
-</html>
Index: mplates/add_tracks_to_playlist.html
===================================================================
--- templates/add_tracks_to_playlist.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,80 +1,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Title</title>
-</head>
-<body>
-
-</body>
-<!DOCTYPE html>
-<html>
-<head>
-    <title>Add Tracks to Playlist</title>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Add Tracks to Playlist</h1>
-
-    <form method="get" class="mb-3">
-        {% csrf_token %}
-        <input type="hidden" name="invoice_id" value="{{ selected_invoice_id }}">
-        <div class="input-group">
-            <input type="text" name="search_track" class="form-control" placeholder="Search tracks"
-                   value="{{ search_track }}">
-            <button class="btn btn-outline-secondary" type="submit">Search</button>
-        </div>
-    </form>
-
-    <form method="post" class="card p-4 shadow-sm bg-white">
-        {% csrf_token %}
-
-        <div class="mb-3">
-            <label for="playlist_id" class="form-label"><strong>Select Playlist</strong></label>
-            <select name="playlist_id" id="playlist_id" class="form-select" onchange="this.form.submit()">
-                <option value="">-- Choose Playlist --</option>
-                {% for playlist in playlists %}
-                    <option value="{{ playlist.playlist_id }}"
-                            {% if playlist.playlist_id|stringformat:"s" == selected_playlist_id %}selected{% endif %}>
-                        {{ playlist.name }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-
-        <div class="row justify-content-center">
-            <div class="col-6">
-                <div class="mb-3">
-                    <label class="form-label"><strong>Select Tracks to Add</strong></label>
-                    <div class="form-check">
-                        {% for track in tracks %}
-                            <div class="form-check mb-2">
-                                <input class="form-check-input" type="checkbox" name="track_ids"
-                                       value="{{ track.track_id }}"
-                                       id="track{{ track.track_id }}">
-                                <label class="form-check-label" for="track{{ track.track_id }}">
-                                    {{ track.name }}
-                                </label>
-                            </div>
-                        {% endfor %}
-                        {% if tracks|length == 0 %}
-                            <div class="alert alert-info mt-2">No tracks available.</div>
-                        {% endif %}
-                    </div>
-                </div>
-
-            </div>
-
-            <div class="col-4 justify-content-center">
-                <div class="d-grid">
-                    <button type="submit" class="btn btn-primary">Add Tracks</button>
-                </div>
-            </div>
-        </div>
-    </form>
-</div>
-</body>
-</html>
Index: templates/album_list.html
===================================================================
--- templates/album_list.html	(revision d7662b5c5695b63b885011417efd780494e2e537)
+++ templates/album_list.html	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>All Albums</title>
+</head>
+<body>
+    <h1>{{ heading }}</h1>
+    <ul>
+        {% for d in data %}
+            <li>{{ d }}</li>
+        {% empty %}
+            <li>No data found.</li>
+        {% endfor %}
+    </ul>
+</body>
+</html>
Index: mplates/avg_price_per_artist.html
===================================================================
--- templates/avg_price_per_artist.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,56 +1,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Average Track Price per Artist</title>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-</head>
-<body class="d-flex bg-light">
-
-{% include 'sidebar.html' %}
-
-<div class="container mt-5">
-    <h1 class="mb-4 text-center">Average Track Price per Artist</h1>
-
-    <h4 class="mb-4 text-center">Name - Average Track Price</h4>
-
-    {% if not data %}
-        <div class="alert alert-warning" role="alert">
-            No data available.
-        </div>
-    {% else %}
-        <form method="get" class="mb-3">
-            {% csrf_token %}
-            <input type="hidden" name="invoice_id" value="{{ selected_invoice_id }}">
-            <div class="input-group">
-                <input type="text" name="search_track" class="form-control" placeholder="Search artists"
-                       value="{{ search_track }}">
-                <button class="btn btn-outline-secondary" type="submit">Search</button>
-            </div>
-        </form>
-        <ul class="list-group">
-            {% for row in data %}
-                <li class="list-group-item d-flex justify-content-between align-items-center">
-                    <div class="col-6">
-                        {{ row.name }}
-                    </div>
-                    <div class="col-6 text-end">
-                        {% if row.avg_price_per_track == 'not enogu data' %}
-                            <span class="badge bg-danger rounded-pill">No data available</span>
-                        {% else %}
-                            <span class="badge bg-success rounded-pill">${{ row.avg_price_per_track|floatformat:2 }}</span>
-                        {% endif %}
-                    </div>
-                </li>
-            {% endfor %}
-        </ul>
-    {% endif %}
-</div>
-
-</body>
-</html>
Index: mplates/avg_track_duration.html
===================================================================
--- templates/avg_track_duration.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Average Track Duration per Artist</title>
-</head>
-<body class="d-flex bg-light">
-    {% include 'sidebar.html' %}
-
-    <div class="container mt-5">
-        <h1 class="text-center mb-4">Average Track Duration per Artist</h1>
-
-        <div class="list-group">
-            {% for row in data %}
-                <a href="#" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
-                    <div>
-                        {{ row.artist }}
-                    </div>
-                    <span class="badge bg-primary rounded-pill">{{ row.avg }}</span>
-                </a>
-            {% endfor %}
-        </div>
-    </div>
-</body>
-</html>
Index: mplates/batch_update_reports_to.html
===================================================================
--- templates/batch_update_reports_to.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,58 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Batch Update Reports To</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Batch Update Employees' Reports To</h1>
-
-    <form method="post" class="card p-4 shadow-sm bg-white">
-        {% csrf_token %}
-
-        <div class="mb-3">
-            <label for="manager_id" class="form-label"><strong>Select Manager</strong></label>
-            <select name="manager_id" id="manager_id" class="form-select" onchange="this.form.submit()">
-                <option value="">-- Choose Manager --</option>
-                {% for emp in all_employees %}
-                    <option value="{{ emp.employee_id }}"
-                        {% if emp.employee_id|stringformat:"s" == selected_manager_id %}selected{% endif %}>
-                        {{ emp.first_name }} {{ emp.last_name }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-
-        <div class="mb-3">
-            <label class="form-label"><strong>Select Employees to Report to the Manager</strong></label>
-            <div class="form-check">
-                {% for emp in employees %}
-                    <div class="form-check mb-2">
-                        <input class="form-check-input" type="checkbox" name="employee_ids" value="{{ emp.employee_id }}" id="emp{{ emp.employee_id }}">
-                        <label class="form-check-label" for="emp{{ emp.employee_id }}">
-                            {{ emp.first_name }} {{ emp.last_name }}
-                        </label>
-                    </div>
-                {% endfor %}
-                {% if employees|length == 0 %}
-                    <div class="alert alert-info mt-2">No employees available for assignment.</div>
-                {% endif %}
-            </div>
-        </div>
-
-        <div class="d-grid">
-            <button type="submit" class="btn btn-primary">Update Reports To</button>
-        </div>
-
-    </form>
-</div>
-
-</body>
-</html>
Index: mplates/genres_per_customer.html
===================================================================
--- templates/genres_per_customer.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,74 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Number of Tracks from Each Genre per Customer</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="mb-4 text-center">Number of Tracks from Each Genre per Customer</h1>
-
-    <form method="GET" action="" class="row g-3 mb-4">
-        <div class="col-md-4">
-            <label for="customer_id" class="form-label">Select Customer:</label>
-            <select name="customer_id" id="customer_id" class="form-select">
-                <option value="">All Customers</option>
-                {% for customer in customers %}
-                    <option value="{{ customer.customer_id }}"
-                            {% if request.GET.customer_id == customer.0|stringformat:'s' %}selected{% endif %}>
-                        {{ customer.first_name }} {{ customer.last_name }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-
-        <div class="col-md-4 d-flex align-items-end">
-            <button type="submit" class="btn btn-primary w-100">Filter</button>
-        </div>
-    </form>
-    {% if customer %}
-        <div class="row display-5">
-            <div class="col-3 bg-light-subtle m-1 pb-3 border border-secondary-subtle rounded-3">
-                {{ customer }}
-            </div>
-        </div>
-    {% endif %}
-    {% if not data %}
-        <div class="alert alert-warning" role="alert">
-            No data available for the selected customer.
-        </div>
-    {% else %}
-        <div class="container">
-            <div class="row col-6 justify-content-between mb-3">
-                <div class="col-6 font-weight-bold">
-                    <strong>Genre</strong>
-                </div>
-                <div class="col-6 font-weight-bold px-4">
-                    <strong>Number of tracks</strong>
-                </div>
-            </div>
-            <ul class="row list-group col-6">
-                {% for row in data %}
-                    <li class="list-group-item d-flex justify-content-between align-items-center">
-                        <div class="col-6">
-                            <span>{{ row.genre }}</span>
-                        </div>
-                        <div class="col-6">
-                             <span>Number of Tracks: {{ row.track_count }}</span>
-                        </div>
-                    </li>
-                {% empty %}
-                    <li class="list-group-item">No data available for this customer.</li>
-                {% endfor %}
-            </ul>
-        </div>
-    {% endif %}
-</div>
-
-</body>
-</html>
Index: mplates/home.html
===================================================================
--- templates/home.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,19 +1,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Number of Tracks per Customer</title>
-    <meta charset="UTF-8">
-    <title>HomePage</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="mb-4 text-center">Home</h1>
-</div>
-</body>
-</html>
Index: mplates/invoices_per_customer_after_date.html
===================================================================
--- templates/invoices_per_customer_after_date.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,90 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Number of Tracks per Customer</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="mb-4 text-center">Invoice Created by Customer</h1>
-
-    <form method="GET" action="" class="row g-3 mb-4">
-        <div class="col-md-4">
-            <label for="customer_id" class="form-label">Select Customer:</label>
-            <select name="customer_id" id="customer_id" class="form-select">
-                <option value="">All Customers</option>
-                {% for customer in customers %}
-                    <option value="{{ customer.customer_id }}"
-                            {% if request.GET.customer_id == customer.0|stringformat:'s' %}selected{% endif %}>
-                        {{ customer.first_name }} {{ customer.last_name }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-        <div class="col-md-4">
-            <label for="invoice_date" class="form-label">Select Date:</label>
-            <input type="date" id="invoice_date" name="invoice_date" value="{{ request.GET.invoice_date }}"
-                   class="form-control">
-        </div>
-
-        <div class="col-md-4 d-flex align-items-end">
-            <button type="submit" class="btn btn-primary w-100">Filter</button>
-        </div>
-    </form>
-
-      {% if customer %}
-            <div class="row display-5">
-                <div class="col-3 bg-light-subtle m-1 pb-3 border border-secondary-subtle rounded-3">
-                    {{ customer }}
-                </div>
-            </div>
-        {% endif %}
-
-    {% if not selected_customer_id %}
-        <div class="alert alert-warning" role="alert">
-            Please select a customer to see the results.
-        </div>
-    {% elif not data %}
-        <div class="alert alert-danger" role="alert">
-            No invoice found.
-        </div>
-    {% else %}
-        <div class="container">
-            <div class="row col-3 justify-content-between mb-3">
-                <div class="col-6 font-weight-bold">
-                    Date of Invoice
-                </div>
-                <div class="col-6 text-end font-weight-bold px-4">
-                    Price
-                </div>
-            </div>
-            <ul class="row list-group col-3">
-                {% for row in data %}
-                    <li class="list-group-item d-flex justify-content-between align-items-center">
-                        <div class="col-6">
-                            {{ row.invoice_date }}
-                        </div>
-                        <div class="col-6 text-end ">
-                            <span class="badge bg-success rounded-pill">${{ row.total }}</span>
-                        </div>
-                    </li>
-                {% empty %}
-                    <li class="list-group-item">No invoices found for this customer and date.</li>
-                {% endfor %}
-            </ul>
-        </div>
-        <div class="col-3 my-3">
-            <div class="alert alert-success" role="alert">
-                Total money spend: ${{ total_sum }}
-            </div>
-        </div>
-    {% endif %}
-</div>
-
-</body>
-</html>
Index: mplates/list.html
===================================================================
--- templates/list.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>{{ heading }}</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">{{ heading }}</h1>
-    <form method="get" class="mb-3">
-        {% csrf_token %}
-        <input type="hidden" name="invoice_id" value="{{ selected_invoice_id }}">
-        <div class="input-group">
-            <input type="text" name="search_track" class="form-control" placeholder="Search"
-                   value="{{ search_track }}">
-            <button class="btn btn-outline-secondary" type="submit">Search</button>
-        </div>
-    </form>
-    <div class="list-group">
-        {% for d in data %}
-            <a href="#" class="list-group-item list-group-item-action">
-                {{ d }}
-            </a>
-        {% empty %}
-            <div class="alert alert-warning" role="alert">
-                No data found.
-            </div>
-        {% endfor %}
-    </div>
-</div>
-</body>
-</html>
Index: mplates/media_type_percentage.html
===================================================================
--- templates/media_type_percentage.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Most Active Customers</title>
-</head>
-<body class="d-flex bg-light">
-    {% include 'sidebar.html' %}
-    <div class="container mt-5">
-        <h1 class="text-center mb-4">Most Active Customers</h1>
-        <div class="table-responsive">
-            <table class="table table-striped">
-                <thead>
-                    <tr>
-                        <th scope="col">Media Type</th>
-                        <th scope="col">Number of Tracks</th>
-                        <th scope="col">Percentage</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    {% for row in data %}
-                        <tr>
-                            <td>{{ row.name }}</td>
-                            <td>{{ row.num_of_tracks }}</td>
-                            <td>{{ row.percentage }}%</td>
-                        </tr>
-                    {% endfor %}
-                </tbody>
-            </table>
-        </div>
-    </div>
-</body>
-</html>
Index: mplates/most_listened_genre_per_customer.html
===================================================================
--- templates/most_listened_genre_per_customer.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Most listened Genre per Customer</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Most Listened Genre per Customer</h1>
-
-    <div class="list-group">
-        <div class="row">
-            <div class="col-4 font-weight-bold"><strong>First Name</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Last Name</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Genre</strong></div>
-        </div>
-        {% for row in data %}
-            <a href="#" class="list-group-item list-group-item-action">
-                <div class="row">
-                    <div class="col-4 font-weight-bold">{{ row.first_name }}</div>
-                    <div class="col-4 font-weight-bold">{{ row.last_name }}</div>
-                    <div class="col-4 font-weight-bold">{{ row.most_listened_genre }}</div>
-                </div>
-            </a>
-        {% empty %}
-            <div class="alert alert-warning" role="alert">
-                No data found.
-            </div>
-        {% endfor %}
-    </div>
-</div>
-</body>
-</html>
Index: mplates/most_popular_artist_per_customer_per_genre.html
===================================================================
--- templates/most_popular_artist_per_customer_per_genre.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,62 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Most Listened Artist of each Genre per Customer</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Most Listened Artist of each Genre per Customer</h1>
-
-    <form method="GET" action="" class="row g-3 mb-4">
-        <div class="col-md-4">
-            <label for="customer_id" class="form-label">Select Customer:</label>
-            <select name="customer_id" id="customer_id" class="form-select">
-                <option value="">All Customers</option>
-                {% for customer in customers %}
-                    <option value="{{ customer.customer_id }}"
-                            {% if request.GET.customer_id == customer.0|stringformat:'s' %}selected{% endif %}>
-                        {{ customer.first_name }} {{ customer.last_name }}
-                    </option>
-                {% endfor %}
-            </select>
-        </div>
-
-        <div class="col-md-4 d-flex align-items-end">
-            <button type="submit" class="btn btn-primary w-100">Filter</button>
-        </div>
-    </form>
-    {% if customer %}
-        <div class="row display-5">
-            <div class="col-3 bg-light-subtle m-1 pb-3 border border-secondary-subtle rounded-3">
-                {{ customer }}
-            </div>
-        </div>
-    {% endif %}
-
-    <div class="list-group">
-        <div class="row">
-            <div class="col-4 font-weight-bold"><strong>Genre</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Artist</strong></div>
-        </div>
-        {% for row in data %}
-            <a href="#" class="list-group-item list-group-item-action">
-                <div class="row">
-                    <div class="col-4 font-weight-bold">{{ row.genre }}</div>
-                    <div class="col-4 font-weight-bold">{{ row.arist }}</div>
-                </div>
-            </a>
-        {% empty %}
-            <div class="alert alert-warning" role="alert">
-                Select a customer.
-            </div>
-        {% endfor %}
-    </div>
-</div>
-</body>
-</html>
Index: mplates/rank_list_artists.html
===================================================================
--- templates/rank_list_artists.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,51 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Artist with Highest Earnings</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Artist with Highest Earnings</h1>
-
-    <form method="get" class="mb-3">
-        {% csrf_token %}
-        <input type="hidden" name="invoice_id" value="{{ selected_invoice_id }}">
-        <div class="input-group">
-            <input type="text" name="search_track" class="form-control" placeholder="Search artists"
-                   value="{{ search_track }}">
-            <button class="btn btn-outline-secondary" type="submit">Search</button>
-        </div>
-    </form>
-
-    <div class="list-group">
-        <div class="row">
-            <div class="col-4 font-weight-bold"><strong>Name</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Total Invoices</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Total Money Earned</strong></div>
-        </div>
-
-        {% for row in data %}
-
-            <a href="#" class="list-group-item list-group-item-action">
-                <div class="row">
-                    <div class="col-4 font-weight-bold">{{ row.name }}</div>
-                    <div class="col-4 font-weight-bold">{{ row.num_invoices }}</div>
-                    <div class="col-4 font-weight-bold">${{ row.money_earned }}</div>
-                </div>
-            </a>
-
-        {% empty %}
-            <div class="alert alert-warning" role="alert">
-                No data found.
-            </div>
-        {% endfor %}
-    </div>
-</div>
-</body>
-</html>
Index: mplates/rank_list_most_active_customers.html
===================================================================
--- templates/rank_list_most_active_customers.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Most Active Customers</title>
-</head>
-<body class="d-flex bg-light">
-{% include 'sidebar.html' %}
-<div class="container mt-5">
-    <h1 class="text-center mb-4">Most Active Customers</h1>
-
-    <div class="list-group">
-        <div class="row">
-            <div class="col-4 font-weight-bold"><strong>Name</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Total Orders</strong></div>
-            <div class="col-4 font-weight-bold"><strong>Total Money Spent</strong></div>
-        </div>
-        {% for row in data %}
-            <a href="#" class="list-group-item list-group-item-action">
-                <div class="row">
-                    <div class="col-4 font-weight-bold"> {{ row.name }}</div>
-                    <div class="col-4 font-weight-bold">{{ row.total_orders }}</div>
-                    <div class="col-4 font-weight-bold"> ${{ row.total_money_spent }}</div>
-                </div>
-            </a>
-        {% empty %}
-            <div class="alert alert-warning" role="alert">
-                No data found.
-            </div>
-        {% endfor %}
-    </div>
-</div>
-</body>
-</html>
Index: mplates/sidebar.html
===================================================================
--- templates/sidebar.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ 	(revision )
@@ -1,102 +1,0 @@
-<div class="h-100 d-flex flex-column flex-shrink-0 p-3 bg-light-subtle border border-2 border-secondary-subtle rounded-end-5"
-     style="width: 250px;">
-    <h4 class="mb-4">Menu</h4>
-    <ul class="nav nav-pills flex-column mb-auto">
-        <li class="nav-item">
-            <a href="{% url 'album_list' %}" class="nav-link {% if request.path == '/album/' %}active{% endif %}"
-               aria-current="page">
-                Album List
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'artist_list' %}" class="nav-link {% if request.path == '/artist/' %}active{% endif %}">
-                Artist List
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'track_list' %}" class="nav-link {% if request.path == '/track/' %}active{% endif %}">
-                Track List
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'avg_track_duration' %}"
-               class="nav-link {% if request.path == '/artist/avg-track-duration' %}active{% endif %}">
-                Average Track Duration
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'avg_track_price' %}"
-               class="nav-link {% if request.path == '/artist/avg-track-price' %}active{% endif %}">
-                Average Track Price per Artist
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'rank_list_artists' %}"
-               class="nav-link {% if request.path == '/artist/most-popular' %}active{% endif %}">
-                Artist with Highest Earnings
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'track_count_per_genre' %}"
-               class="nav-link {% if request.path == '/track/per-genre' %}active{% endif %}">
-                Track Count per Genre
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'rank_list_most_active_customers' %}"
-               class="nav-link {% if request.path == '/customer/rank-list' %}active{% endif %}">
-                Rank List of Most Active Customers
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'media_type_percentage' %}"
-               class="nav-link {% if request.path == '/media-type/percentage' %}active{% endif %}">
-                Media Type Percentage
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'most_listened_genre_per_customer' %}"
-               class="nav-link {% if request.path == '/customer/most-popular-genre-per-customer' %}active{% endif %}">
-                Most Popular Genre per Customer
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'genres_per_customer' %}"
-               class="nav-link {% if request.path == '/customer/genres-per-customer' %}active{% endif %}">
-                Genres per Customer
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'invoice_per_customer_after_date' %}"
-               class="nav-link {% if request.path == '/customer/invoices-per-customer' %}active{% endif %}">
-                Invoices per Customer
-            </a>
-        </li>
-
-        <li class="nav-item">
-            <a href="{% url 'most_popular_artist_per_customer_per_genre' %}"
-               class="nav-link {% if request.path == '/customer/artist-per-genre' %}active{% endif %}">
-                Most Popular Artists Per Customer
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'batch_update_reports_to' %}"
-               class="nav-link {% if request.path == '/employee/batch-update-reports-to/' %}active{% endif %}">
-                Update manager
-            </a>
-        </li>
-       <li class="nav-item">
-            <a href="{% url 'add_tracks_to_playlist' %}"
-               class="nav-link {% if request.path == '/playlists/add-tracks/' %}active{% endif %}">
-                Add tracks to playlist
-            </a>
-        </li>
-         <li class="nav-item">
-            <a href="{% url 'add_invoice_lines_to_invoice' %}"
-               class="nav-link {% if request.path == '/invoices/add-lines/' %}active{% endif %}">
-                Add invoice lines
-            </a>
-        </li>
-    </ul>
-
-</div>
Index: templates/track_count_per_genre.html
===================================================================
--- templates/track_count_per_genre.html	(revision da2058e8143fa9f5ea3a13cd627153d96c156af1)
+++ templates/track_count_per_genre.html	(revision d7662b5c5695b63b885011417efd780494e2e537)
@@ -2,28 +2,13 @@
 <html>
 <head>
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet"
-          integrity="sha384-SgOJa3DmI69IUzQ2PVdRZhwQ+dy64/BUtbMJw1MZ8t5HZApcHrRKUc4W0kG879m7" crossorigin="anonymous">
-    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"
-            integrity="sha384-k6d4wzSIapyDyv1kpU366/PK5hCdSbCRGRCMv+eplOQJWyd1fbcAu9OCUj5zNLiq"
-            crossorigin="anonymous"></script>
-    <title>Track Count Per Genre</title>
+    <title>Track count per Genre</title>
 </head>
-<body class="d-flex bg-light">
-    {% include 'sidebar.html' %}
-    <div class="container mt-5">
-        <h1 class="text-center mb-4">Track Count Per Genre</h1>
-
-        <div class="list-group">
-            {% for row in data %}
-                <a href="#" class="list-group-item list-group-item-action">
-                    {{ row.genre }} - {{ row.count }} tracks
-                </a>
-            {% empty %}
-                <div class="alert alert-warning" role="alert">
-                    No data available.
-                </div>
-            {% endfor %}
-        </div>
-    </div>
+<body>
+<h1>Track Count Per Genre</h1>
+<ul>
+    {% for row in data %}
+        <li>{{ row.genre }} - {{ row.count }} tracks</li>
+    {% endfor %}
+</ul>
 </body>
 </html>
