From 8da7e043de144e02aa40a8bc7c45497e28c57b51 Mon Sep 17 00:00:00 2001 From: anuragsharma Date: Tue, 25 Nov 2025 16:17:58 +0530 Subject: [PATCH 1/2] fixed scrolling, govt id, visit purpose --- .../java/com/statusneo/vms/model/Visitor.java | 18 + web-backend/src/main/jte/employees.jte | 8 +- web-backend/src/main/jte/index.jte | 85 ++- .../main/resources/templates/index-th.html | 112 ++- .../src/main/resources/templates/visitor.html | 693 ++++++++++-------- 5 files changed, 527 insertions(+), 389 deletions(-) diff --git a/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java b/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java index 9e617bb..28ea472 100644 --- a/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java +++ b/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java @@ -103,6 +103,14 @@ public class Visitor { @Column(name = "laptop_number") private String laptop; + @Column(name = "valid_govt_id") + @Pattern(regexp = "^[0-9]{12}$|^[A-Z]{5}[0-9]{4}[A-Z]{1}$", message = "Invalid Aadhar or PAN format") + private String validGovtId; + + + @Column(name = "visit_purpose") + private String visitPurpose; + @ManyToOne @JoinColumn(name = "host_id", referencedColumnName = "id") private Employee host; @@ -220,6 +228,14 @@ public void setLaptop(String laptop) { this.laptop = laptop; } + public String getValidGovtId() { return validGovtId; } + + public void setValidGovtId(String validGovtId) { this.validGovtId = validGovtId; } + + public String getVisitPurpose() { return visitPurpose; } + + public void setVisitPurpose(String visitPurpose) { this.visitPurpose = visitPurpose; } + @Override public String toString() { @@ -232,6 +248,8 @@ public String toString() { ", company='" + company + '\'' + ", picturePath='" + picturePath + '\'' + ", laptop_number='" + laptop + '\'' + + ", valid_govt_id='" + validGovtId + '\'' + + ", visit_purpose='" + visitPurpose + '\'' + '}'; } diff --git a/web-backend/src/main/jte/employees.jte b/web-backend/src/main/jte/employees.jte index 69187eb..a48abed 100644 --- a/web-backend/src/main/jte/employees.jte +++ b/web-backend/src/main/jte/employees.jte @@ -1,12 +1,12 @@ @import java.util.List -@param List employees +@param List hosts -@if(employees != null) - @if(employees.isEmpty()) +@if(hosts != null) + @if(hosts.isEmpty())
  • No employee found
  • @else - @for(com.statusneo.vms.model.Employee employee : employees) + @for(com.statusneo.vms.model.Employee employee : hosts)
  • ${employee.getName()}
  • @endfor @endif diff --git a/web-backend/src/main/jte/index.jte b/web-backend/src/main/jte/index.jte index f99b330..3869b1a 100644 --- a/web-backend/src/main/jte/index.jte +++ b/web-backend/src/main/jte/index.jte @@ -6,15 +6,15 @@ Visitor Check-in + - - - + - -
    - -
    +
    +
    @@ -22,23 +22,17 @@

    Please fill in your details to register your visit

    -
    - -
    + class="space-y-6 h-full flex flex-col"> -
    -
    -
    -
    -
    -
    - -
    +
    + + +
    +
    -
    + +
    + + + +
    + <%--
    --%> -
    +
    + By checking in, you agree to our visitor policies and terms of service. +
    - - -
    - By checking in, you agree to our visitor policies and terms of service. -
    - - diff --git a/web-backend/src/main/resources/templates/index-th.html b/web-backend/src/main/resources/templates/index-th.html index a36711b..361cc8a 100644 --- a/web-backend/src/main/resources/templates/index-th.html +++ b/web-backend/src/main/resources/templates/index-th.html @@ -6,28 +6,25 @@ Visitor Check-in + - -
    - -
    + +
    +

    Visitor Check-in

    Please fill in your details to register your visit

    - -
    - + class="space-y-6 h-full flex flex-col">
    -
    - -
    - -
    -
    - -
    - - -
    +
    + + +
    +
    + + +
    +
    - -
    + + +
    + + + +
    + + -
    +
    + By checking in, you agree to our visitor policies and terms of service. +
    - - -
    - By checking in, you agree to our visitor policies and terms of service. -
    @@ -185,15 +227,17 @@

    Visitor Check-in

    const email = document.getElementById('email').value; const phone = document.getElementById('phone').value; const company = document.getElementById('company').value; + const govtId = document.getElementById('govtId').value; + const visitPurpose = document.getElementById('visit-purpose').value; - const isValid = name && email && phone && company; + const isValid = name && email && phone && company && govtId && visitPurpose; document.getElementById('send-otp-btn').disabled = !isValid; } document.querySelectorAll('input[required]').forEach(input => { input.addEventListener('input', validateForm); }); - + document.getElementById('visit-purpose').addEventListener('change', validateForm); validateForm(); diff --git a/web-backend/src/main/resources/templates/visitor.html b/web-backend/src/main/resources/templates/visitor.html index 1fd79a4..f016419 100644 --- a/web-backend/src/main/resources/templates/visitor.html +++ b/web-backend/src/main/resources/templates/visitor.html @@ -5,356 +5,411 @@ Visitor Check-in + - -
    - -
    -

    Visitor Check-in

    -

    Please fill in your details to register your visit

    -
    - - -
    -
    - -
    - -
    - - -
    - - -
    - -
    - - -
    - -
    - - -
    + +
    +
    +

    Visitor Check-in

    +

    Please fill in your details to register your visit

    +
    +
    + +
    +
    +
    + + +
    +
    + + +
    -
    - +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    -
    - -
    - -
    - - - - + id="host-search" + name="hostSearch" + autocomplete="off" + class="w-full px-4 py-3 pr-10 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors" + placeholder="Search by name or email..."> + +
    - -
    - + +
    + + +
    - + + - +
    + +
    +
    By checking in, you agree to our visitor policies and terms of service.
    -
    +
    - - +

    Check-in Successful!

    +

    Welcome to our office

    +

    Your host has been notified.

    + +
    + `; + } + \ No newline at end of file From 72dbe470f2878739e7b7a1a11660e98834e25edb Mon Sep 17 00:00:00 2001 From: anuragsharma Date: Wed, 26 Nov 2025 16:18:54 +0530 Subject: [PATCH 2/2] removed govt id validation and created enum for visit purpose --- .../com/statusneo/vms/enums/VisitPurpose.java | 23 +++++++++++++++++++ .../java/com/statusneo/vms/model/Visitor.java | 1 - web-backend/src/main/jte/index.jte | 13 +++++------ 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 web-backend/src/main/java/com/statusneo/vms/enums/VisitPurpose.java diff --git a/web-backend/src/main/java/com/statusneo/vms/enums/VisitPurpose.java b/web-backend/src/main/java/com/statusneo/vms/enums/VisitPurpose.java new file mode 100644 index 0000000..fd32419 --- /dev/null +++ b/web-backend/src/main/java/com/statusneo/vms/enums/VisitPurpose.java @@ -0,0 +1,23 @@ +package com.statusneo.vms.enums; + +public enum VisitPurpose { + VENDOR("Vendor"), + CLIENT_MEETING("Client Meeting"), + INTERVIEW("Interview"), + BUSINESS_MEETING("Business Meeting"), + DELIVERY("Delivery"); + + private final String displayName; + + VisitPurpose(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + public String getFormValue() { + return this.name().toLowerCase().replace('_', '-'); + } +} diff --git a/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java b/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java index 28ea472..4953d52 100644 --- a/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java +++ b/web-backend/src/main/java/com/statusneo/vms/model/Visitor.java @@ -104,7 +104,6 @@ public class Visitor { private String laptop; @Column(name = "valid_govt_id") - @Pattern(regexp = "^[0-9]{12}$|^[A-Z]{5}[0-9]{4}[A-Z]{1}$", message = "Invalid Aadhar or PAN format") private String validGovtId; diff --git a/web-backend/src/main/jte/index.jte b/web-backend/src/main/jte/index.jte index 3869b1a..8af6625 100644 --- a/web-backend/src/main/jte/index.jte +++ b/web-backend/src/main/jte/index.jte @@ -1,3 +1,4 @@ +@import com.statusneo.vms.enums.VisitPurpose @@ -154,25 +155,23 @@
    - <%--
    --%>