Customers are the end users of the petrol pump. Each customer record is identified by a uniqueDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Adarsh275/PetrolPump-Management-System/llms.txt
Use this file to discover all available pages before exploring further.
Customer_Code and can be linked to multiple invoices for fuel purchase history. The Customer table sits at the heart of sales tracking — every invoice optionally carries a Customer_Code foreign key so that per-customer purchase history can be reconstructed at any time.
Customer Fields
Primary key. A unique alphanumeric code that identifies the customer across the system. Example:
"SFG252".Full name of the customer.
10-digit mobile or landline number. Stored as a fixed-width char to preserve leading zeros.
Customer email address, used for communication and record-keeping.
Single character representing gender. Accepted values:
'M' (Male) or 'F' (Female).City of residence of the customer.
Age of the customer in years.
Add a Customer
Choose the Add operation
Select Add from the CRUD Operations dropdown. The subheader will read “Enter trainer Details:”.
Fill in the form fields
Complete the following fields in the form:
- Customer_Code — unique identifier (e.g.
SFG252) - C_Name — customer’s full name
- Phone_No — 10-digit phone number
- Email_ID — email address
- Gender —
MorF - City — city of residence
- Age — age in years (numeric input)
create.py):
add_Customer_data() in database.py:
View Customers
The
read_for_Customer() function in read.py fetches all rows and maps them to a pandas DataFrame with these columns:
Update a Customer
Choose the customer to edit
The current records are shown in the Current Customer details expander. Select the target customer from the Customer to Edit dropdown, which is populated with all existing
Customer_Code values.Edit the mutable fields
The form pre-fills with the selected customer’s current values. Modify any of the following fields:
- C_Name
- Phone_No
- Email_ID
- Gender
- City
- Age
Customer_Code is the primary key and is not editable through the UI. Only C_Name, Phone_No, Email_ID, Gender, City, and Age can be changed. To change a Customer_Code, the record must be deleted and re-created.edit_Customer_data() in database.py:
Delete a Customer
Select the customer
Choose the
Customer_Code of the customer to remove from the Customer to delete dropdown. A warning banner will display the selected code for confirmation.delete_data_Customer() in database.py:
Seed / Sample Data
The following six customer records are inserted bycreate_table.sql and serve as the initial dataset:
The Serves join table (
Employee_ID, Customer_Code) records which employees have served which customers. This relationship is seeded directly in the database and is not exposed through the Streamlit UI — it can be queried via Query → Custom Query using SELECT * FROM Serves.