0% found this document useful (0 votes)
64 views127 pages

Angular CLI Installation and Project Setup

The document provides detailed steps for installing Angular CLI and creating a new Angular project, along with the necessary commands to set up a server and view the application. It also includes code snippets for adding and managing stations and trains within an Angular application, featuring forms for user input and services for data handling. Additionally, it contains styles and component tests to ensure functionality and maintain a consistent user interface.

Uploaded by

Lovekush Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views127 pages

Angular CLI Installation and Project Setup

The document provides detailed steps for installing Angular CLI and creating a new Angular project, along with the necessary commands to set up a server and view the application. It also includes code snippets for adding and managing stations and trains within an Angular application, featuring forms for user input and services for data handling. Additionally, it contains styles and component tests to ensure functionality and maintain a consistent user interface.

Uploaded by

Lovekush Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

//NotePad

please find the Angular CLI Installation Steps (Associates need to do this every
day morning)
//Setting the TCS proxy for installation
npm config set proxy [Link]

//Command for installing Angular CLI


npm install -g @angular/cli

//Check the version details after the installation


npx ng version

//Create a new project hello-world


npx ng new hello-world // npx @angular/cli@15.2.7 new my-world

//Switch to the newly created project folder


cd my-world

//Start the server


npx ng serve

//Open the browser and enter the url ttp://localhost:4200/ to see the application
run

//----------------------------------

//Add-Station

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}

/* PAGE BACKGROUND */
:host {
display: block;
background: linear-gradient(120deg, #f8f6f4, #353434);
color: #333;
}

/* MAIN CARD */
.container {
max-width: 1200px;
margin: 40px auto;
padding: 40px;
background: rgba(255, 255, 255, 0.781);
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
}

/* HEADER STRIP */
.header {
background: #07508b;
color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
display: flex;
align-items: center;
justify-content: space-between;
}

.header h1 {
font-size: 2rem;
}

/* TITLES */
h2,
h3 {
color: #004b87;
font-size: 1.6rem;
margin-bottom: 20px;
}

/* FORM */
.form-group {
margin: 20px 0;
}

label {
display: block;
font-weight: bold;
margin-bottom: 8px;
}

input[type='text'] {
width: 100%;
padding: 12px;
font-size: 1.1rem;
border: 1px solid #ddd;
border-radius: 6px;
background: #f9f9f9;
}

input[type='text']:focus {
border-color: #3498db;
outline: none;
}

button {
width: 100%;
padding: 12px 20px;
font-size: 1.1rem;
border: none;
border-radius: 6px;
cursor: pointer;
background: #58b4f1;
color: #fff;
transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
background: #2980b9;
transform: translateY(-2px);
}
button:active {
background: #1d6ea1;
transform: translateY(1px);
}

/* TABLE */
.table-container {
max-height: 400px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 8px;
padding: 10px;
}

table {
width: 100%;
border-collapse: collapse;
}

table th,
table td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}

table th {
background: #004b87;
color: #fff;
text-align: center;
}

table tr:nth-child(even) {
background: #f9f9f9;
}

table tr:hover {
background: #e1f5fe;
transition: background 0.3s ease;
}

/* DELETE BUTTON */
.btn-danger {
background: #d9534f;
color: #fff;
padding: 8px 15px;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
}

.btn-danger:hover {
background: #c9302c;
transform: translateY(-2px);
}

.btn-danger:active {
transform: translateY(1px);
}

//--------------------------------------

<div class="container">
<!-- HEADER STRIP -->
<div class="header" style="justify-content:center;">
<h1>Add / Remove Stations</h1>
</div>

<!-- NAV BAR -->


<app-admin-navigation></app-admin-navigation>
<br />

<!-- ADD STATION FORM -->


<h3>Add Station</h3>
<form #stationForm="ngForm" (ngSubmit)="addStation(stationForm)" novalidate>
<div class="form-group">
<label for="stationName">Station Name</label>
<input
type="text"
id="stationName"
name="stationName"
required pattern="^(?![Nn][Uu][Ll][Ll]$).+"
[(ngModel)]="stationName"
/>
<div
class="error"
*ngif="([Link]?.required ||
[Link]?.pattern) &&
[Link]"
>Station name cannot be null.
</div>
</div>
<button type="submit">Add Station</button>
</form>

<!-- STATION LIST -->


<br />
<h3>Station List</h3>
<div class="table-container">
<table>
<thead>
<tr>
<th>#</th>
<th>Station Code</th>
<th>Station Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let st of stations; let i = index">
<td>{{ i + 1 }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>
<button
class="btn-danger"
(click)="deleteStation(st)"
type="button"
>
Delete
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>

//--------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AddStationComponent } from './[Link]';

describe('AddStationComponent', () => {
let component: AddStationComponent;
let fixture: ComponentFixture<AddStationComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AddStationComponent ]
})
.compileComponents();

fixture = [Link](AddStationComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//--------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-add-station',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AddStationComponent {

// }
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { StationService } from './[Link]';

/** Minimal Station interface */


interface Station {
stationId: number;
stationName: string;
}

@Component({
selector: 'app-add-stations',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AddStationComponent implements OnInit {
stations: Station[] = [];
stationName:string="";

constructor(private stationService: StationService) {}

ngOnInit(): void {
[Link]();
}

/* ---------- Add station ---------- */


addStation(form: NgForm): void {
const name = [Link]?.trim();
if (!name) {
alert('Station Name cannot be empty.');
return;
}

// Call backend
[Link](name).subscribe({
next: (newStation) => {
alert('Station added successfully!');
[Link](newStation);
[Link]();
},
error: () => alert('Error adding station'),
});
}

/* ---------- Delete station ---------- */


deleteStation(st: Station): void {
const ok = confirm(
`Are you sure you want to delete the station "${[Link]}"?`
);
if (!ok) return;

[Link]([Link]).subscribe({
next: () => {
[Link] = [Link]((s) => [Link] !== [Link]);
},
error: () => alert('Error deleting station'),
});
}

/* ---------- Load list ---------- */


private loadStations(): void {
[Link]().subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load stations'),
});
}
}

//--------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

interface Station {
stationId: number;
stationName: string;
}

@Injectable({ providedIn: 'root' })


export class StationService {
private mock: Station[] = [
{ stationId: 1, stationName: 'Demo Station A' },
{ stationId: 2, stationName: 'Demo Station B' },
];

getStations(): Observable<Station[]> {
// return [Link]<Station[]>('/api/stations');
return of([Link]);
}

addStation(name: string): Observable<Station> {


// return [Link]<Station>('/api/stations', { stationName: name });
const newSt: Station = {
stationId: [Link](...[Link]((s) => [Link])) + 1,
stationName: name,
};
[Link](newSt);
return of(newSt);
}

deleteStation(id: number): Observable<void> {


// return [Link]<void>(`/api/stations/${id}`);
[Link] = [Link]((s) => [Link] !== id);
return of(void 0);
}
}

//--------------------------------------

//Add-train

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}

:host {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(120deg, #fcfaf8, #302f2f);
color: #333;
}

/* CARD */
.container {
max-width: 1200px;
width: 100%;
background: rgba(255, 255, 255, 0.808);
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
padding: 40px;
}

/* HEADER STRIP */
.header {
background: #074d86;
color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
display: flex;
align-items: center;
justify-content: center;
}

/* SECTION TITLES */
h2,
h3 {
font-size: 1.6rem;
margin-bottom: 20px;
}

/* FORM ELEMENTS */
.form-group {
margin: 20px 0;
}

.[Link] {
display: flex;
gap: 20px;
}

.half {
flex: 1;
}

label {
display: block;
font-weight: bold;
margin-bottom: 8px;
}

input[type='text'],
input[type='number'],
select {
width: 100%;
padding: 12px;
font-size: 1.1rem;
border: 1px solid #ddd;
border-radius: 6px;
background: #f9f9f9;
transition: border-color 0.3s ease;
}

input:focus,
select:focus {
border-color: #3498db;
outline: none;
}

.btn-primary {
display: block;
width: 100%;
padding: 12px 20px;
background: #004b87;
color: #fff;
border: none;
border-radius: 6px;
font-size: 1.1rem;
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
background: #2980b9;
transform: translateY(-2px);
}

.btn-primary:active {
background: #1d6ea1;
transform: translateY(1px);
}

/* MOBILE */
@media (max-width: 768px) {
.container {
padding: 20px;
}

.header h1 {
font-size: 1.8rem;
}

.[Link] {
flex-direction: column;
}
}

//--------------------------------------

<div class="container">
<!-- PAGE HEADER -->
<div class="header" style="justify-content:center;">
<h1>Add Train</h1>
</div>

<!-- RE-USABLE NAV BAR -->


<app-admin-navigation></app-admin-navigation>

<!-- ADD-TRAIN FORM -->


<form
#trainForm="ngForm"
(ngSubmit)="addTrain(trainForm)"
novalidate
>
<!-- Train name -->
<div class="form-group">
<label for="trainName">Train Name</label>
<input
type="text"
id="trainName"
name="trainName"
required pattern="^(?![Nn][Uu][Ll][Ll]$).+"
[(ngModel)]="trainName"
#trainNameField="ngModel"
/>
<div
class="error"
*ngif="([Link]?.required ||
[Link]?.pattern) &&
[Link]"
>Train name cannot be null.
</div>
</div>
<!-- From / To stations -->
<div class="form-group row">
<div class="half">
<label for="fromStation">From Station</label>
<select
id="fromStation"
name="fromStation"
required
ngModel
>
<option value="">Select a Station</option>
<option *ngFor="let st of stations" [value]="[Link]">
{{ [Link] }}
</option>
</select>
</div>

<div class="half">
<label for="toStation">To Station</label>
<select
id="toStation"
name="toStation"
required
ngModel
>
<option value="">Select a Station</option>
<option *ngFor="let st of stations" [value]="[Link]">
{{ [Link] }}
</option>
</select>
</div>
</div>

<!-- Seats -->


<div class="form-group">
<label for="availableSeats">Available Seats</label>
<input
type="number"
id="availableSeats"
name="availableSeats"
required
ngModel
/>
</div>

<!-- Fare -->


<div class="form-group">
<label for="fare">Fare</label>
<input
type="number"
id="fare"
name="fare"
required
ngModel
/>
</div>

<button type="submit" class="btn-primary">Add Train</button>


</form>
</div>

//--------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AddTrainComponent } from './[Link]';

describe('AddTrainComponent', () => {
let component: AddTrainComponent;
let fixture: ComponentFixture<AddTrainComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AddTrainComponent ]
})
.compileComponents();

fixture = [Link](AddTrainComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//--------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-add-train',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AddTrainComponent {

// }
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { StationService } from '../add-station/[Link]';
import { TrainService } from './[Link]';

/* Simple Station model */


interface Station {
stationId: number;
stationName: string;
}

@Component({
selector: 'app-add-train',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AddTrainComponent implements OnInit {
stations: Station[] = [];
trainName:string="";

constructor(
private stationService: StationService,
private trainService: TrainService
) {}

ngOnInit(): void {
[Link]();
}

/* ---------- Populate dropdowns ---------- */


private fetchStations(): void {
[Link]().subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load station list'),
});
}

/* ---------- Validate + call API ---------- */


addTrain(form: NgForm): void {
if ([Link]) {
alert('Please fill all required fields correctly. ');
return;
}

const {
trainName,
fromStation,
toStation,
availableSeats,
fare,
} = [Link];

/* Extra client checks */


if(!trainName|| [Link]().length===0||
[Link]().toLowerCase()===null){
alert('Train name cannot be null');
return;
}
if (fromStation === toStation) {
alert('From and To stations cannot be the same.');
return;
}
if (availableSeats <= 0 || fare <= 0) {
alert('Seats and fare must be positive numbers.');
return;
}

// Call backend
[Link]
.addTrain({
trainName:[Link](),
fromStation,
toStation,
availableSeats: +availableSeats,
fare: +fare,
})
.subscribe({
next: () => {
alert('Train added successfully!');
[Link]();
},
error: () => alert('Error adding train'),
});
}
}

//--------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

interface Station {
stationId: number;
stationName: string;
}

@Injectable({ providedIn: 'root' })


export class StationService {
private mock: Station[] = [
{ stationId: 1, stationName: 'Mumbai' },
{ stationId: 2, stationName: 'Delhi' },
];

getStations(): Observable<Station[]> {
// return [Link]<Station[]>('/api/stations');
return of([Link]);
}
}

//--------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

interface NewTrain {
trainName: string;
fromStation: string;
toStation: string;
availableSeats: number;
fare: number;
}

@Injectable({ providedIn: 'root' })


export class TrainService {
addTrain(payload: NewTrain): Observable<void> {
// return [Link]<void>('/api/trains', payload);
[Link]('Adding train (mock):', payload);
return of(void 0);
}
}

//--------------------------------------

//Admin-dashboard------------------------->

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}

/* PAGE BACKGROUND */
:host {
display: block;
background: linear-gradient(120deg, #faf9f8, #353534);
min-height: 100vh;
min-width: 100vh;
margin: 0;
padding: 0;
overflow-x: hidden;
}

/* CARD */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px;
background: rgba(255, 255, 255, 0.788);
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
}

/* HEADER STRIP */
.header {
background: #004b87;
color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
display: flex;
align-items: center;
justify-content: center;
}

.header h1 {
font-size: 2rem;
}

/* TITLE */
h3 {
color: #004b87;
font-size: 1.8rem;
text-align: center;
margin: 20px 0;
}

/* TABLE */
.table-container {
max-height: 400px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 8px;
padding: 10px;
}

table {
width: 100%;
border-collapse: collapse;
}

table th,
table td {
padding: 12px;
border: 1px solid #ddd;
text-align: left;
}

table th {
background: #004b87;
color: #fff;
font-weight: bold;
}

table tr:nth-child(even) {
background: #f9f9f9;
}
table tr:hover {
background: #e1f5fe;
}

.text-center {
text-align: center;
font-size: 1.2rem;
color: #999;
padding: 20px;
}

/* CANCEL BUTTON */
.btn-danger {
background: #d9534f;
color: #fff;
border: none;
padding: 8px 15px;
border-radius: 6px;
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
}

.btn-danger:hover {
background: #c9302c;
transform: translateY(-2px);
}

.btn-danger:active {
transform: translateY(1px);
}

//--------------------------------------

<div class="container">
<!-- HEADER STRIP -->
<div class="header" style="justify-content:center;">
<div>
<p>Welcome to Admin Dashboard</p>
<h1>{{ admin?.uname }}!</h1>
</div>
</div>

<!-- NAV BAR -->


<app-admin-navigation></app-admin-navigation>

<!-- TRAIN TABLE -->


<h3>Running Train List</h3>
<div class="table-container">
<table>
<thead>
<tr>
<th>Train No</th>
<th>Train Name</th>
<th>From Station</th>
<th>To Station</th>
<th>Available Seats</th>
<th>Fare</th>
<th>Actions</th>
</tr>
</thead>

<tbody>
<tr *ngFor="let tr of trains">
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] | currency:'INR' }}</td>
<td>
<button
class="btn-danger"
type="button"
(click)="cancelTrain(tr)"
>
Cancel
</button>
</td>
</tr>

<tr *ngIf="![Link]">
<td colspan="7" class="text-center">No trains available</td>
</tr>
</tbody>
</table>
</div>
</div>

//--------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminDashboardComponent } from './[Link]';

describe('AdminDashboardComponent', () => {
let component: AdminDashboardComponent;
let fixture: ComponentFixture<AdminDashboardComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AdminDashboardComponent ]
})
.compileComponents();

fixture = [Link](AdminDashboardComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//--------------------------------------
// import { Component } from '@angular/core';

// @Component({
// selector: 'app-admin-dashboard',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AdminDashboardComponent {

// }
import { Component, OnInit } from '@angular/core';
import { TrainService, Train } from './[Link]';
import { AuthService, Admin } from './[Link]';
import { Router } from '@angular/router';

@Component({
selector: 'app-admin-dashboard',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AdminDashboardComponent implements OnInit {
trains: Train[] = [];
admin: Admin | null = null;

constructor(
private trainService: TrainService,
private authService: AuthService,
private router: Router
) {}

ngOnInit(): void {
/* greet admin */
[Link] = [Link]();
if (![Link]) {
[Link](['/admin-login']);
return;
}

/* optional login alert (message stored in authService) */


const loginMsg = [Link]();
if (loginMsg) alert(loginMsg);

/* load data */
[Link]();
}

/* ---------- API calls ---------- */


private loadTrains(): void {
[Link]().subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load trains'),
});
}

cancelTrain(tr: Train): void {


const ok = confirm(
`Are you sure you want to cancel the train number ${[Link]}?`
);
if (!ok) return;

[Link]([Link]).subscribe({
next: () => {
[Link] = [Link]((t) => [Link] !== [Link]);
},
error: () => alert('Error cancelling train'),
});
}
}

//------------------------------------------

import { Injectable } from '@angular/core';

export interface Admin {


adminId: number;
name: string;
uname: string;
}

@Injectable({ providedIn: 'root' })


export class AuthService {
private admin: Admin | null = {
adminId: 1,
name: 'Demo Admin',
uname: 'demoadmin',
};

private loginMessage = 'Login successful!';

currentAdmin(): Admin | null {


return [Link];
}

/* Return the message once, then clear it */


consumeLoginMessage(): string | null {
const msg = [Link];
[Link] = "null";
return msg;
}

/* Real app: clear tokens, notify server, etc. */


logout(): void {
[Link] = null;
}
}

//------------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

export interface Train {


trainNo: number;
trainName: string;
fromStation: string;
toStation: string;
availableSeats: number;
fare: number;
}

@Injectable({ providedIn: 'root' })


export class TrainService {
/* mock data */
private mock: Train[] = [
{
trainNo: 101,
trainName: 'Express A',
fromStation: 'Mumbai',
toStation: 'Delhi',
availableSeats: 120,
fare: 950,
},
{
trainNo: 202,
trainName: 'Superfast B',
fromStation: 'Chennai',
toStation: 'Bangalore',
availableSeats: 80,
fare: 650,
},
];

getTrains(): Observable<Train[]> {
// return [Link]<Train[]>('/api/trains');
return of([Link]);
}

cancelTrain(no: number): Observable<void> {


// return [Link]<void>('/api/trains/cancel', { trainNo: no });
[Link] = [Link]((t) => [Link] !== no);
return of(void 0);
}
}

//------------------------------------------

//----------------------->admin-login

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* -------- PAGE BACKGROUND -------- */


:host {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #95b7ee;
color: #caf2f3;
}

/* -------- CARD LAYOUT -------- */


.login-container {
display: flex;
width: 80%;
max-width: 1200px;
background: #eef9fa;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 0 20px rgb(0 0 0 / 0.1);
}

/* left image pane */


.image-container {
width: 50%;
display: flex;
justify-content: center;
align-items: center;
padding: 2rem;
background: #e4f7f4;
}

.image-container img {
width: 100%;
height: auto;
object-fit: cover;
border-radius: 10px;
box-shadow: 0 0 15px rgb(0 0 0 / 0.1);
}

/* right form pane */


.login-form-container {
width: 50%;
padding: 2rem;
background: #b4f3ee;
align-self: center;
}

/* header */
.login-header {
text-align: center;
margin-bottom: 2rem;
}

.login-header h1 {
font-size: 2rem;
color: #607694;
}

/* form layout */
.login-form {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
position: relative;
}

.form-group label {
font-weight: 600;
color: #3e5879;
}

.form-group input {
padding: 0.8rem;
border: 2px solid #ddd;
border-radius: 5px;
font-size: 1rem;
transition: border-color 0.3s ease;
}

.form-group input:focus {
outline: none;
border-color: #213555;
}

/* eye icon */
.eye-icon {
position: absolute;
top: 50%;
right: 10px;
width: 8%;
transform: translateY(-50%);
cursor: pointer;
}

/* error text */
.error-message {
font-size: 0.9rem;
color: #e74c3c;
}

/* button */
.login-button {
padding: 1rem;
border: none;
border-radius: 5px;
background: #213555;
color: #fff;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}

.login-button:hover {
background: #3e5879;
}

/* links */
.additional-options {
margin-top: 1.5rem;
text-align: center;
}

.additional-options a {
font-size: 0.9rem;
color: #213555;
text-decoration: none;
}

.additional-options a:hover {
text-decoration: underline;
}

/* mobile */
@media (max-width: 768px) {
.login-container {
flex-direction: column;
}
.image-container,
.login-form-container {
width: 100%;
}
}

//-----------------------

<div class="login-container">
<!-- Left-side image -->
<div class="image-container">
<img src="assets/images/[Link]" alt="Admin Login" />
</div>

<!-- Form card -->


<div class="login-form-container">
<div class="login-header">
<h1>Admin Login</h1>
</div>

<!-- Template-driven form -->


<form
#adminForm="ngForm"
(ngSubmit)="onSubmit(adminForm)"
class="login-form"
novalidate
>
<!-- ADMIN USERNAME -->
<div class="form-group">
<label for="adminUsername">Admin Username</label>
<input
type="text"
id="adminUsername"
name="username"
maxlength="50"
ngModel
required
/>
<span id="adminUsernameError" class="error-message"></span>
</div>

<!-- PASSWORD -->


<div class="form-group">
<label for="adminPassword">Password</label>
<img
src="assets/icons/[Link]"
alt="Eye Icon"
class="eye-icon"
id="eyeIcon"
(click)="togglePassword()"
/>
<input
type="password"
id="adminPassword"
name="password"
minlength="6"
maxlength="12"
ngModel
required
/>
<span id="adminPasswordError" class="error-message"></span>
</div>

<button type="submit" class="login-button">Login</button>


</form>

<!-- LINKS -->


<div class="additional-options">
<p>
<a routerLink="/admin-register">Don't have an account? Register Admin
here</a>.
</p>
<p>
<a routerLink="/user-login">Are you a User? Login as User</a>.
</p>
</div>
</div>
</div>

//------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminLoginComponent } from './[Link]';

describe('AdminLoginComponent', () => {
let component: AdminLoginComponent;
let fixture: ComponentFixture<AdminLoginComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AdminLoginComponent ]
})
.compileComponents();

fixture = [Link](AdminLoginComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-admin-login',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AdminLoginComponent {

// }
import { Component, ElementRef } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';

@Component({
selector: 'app-admin-login',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AdminLoginComponent {
stationName:string="";
constructor(private el: ElementRef, private router: Router) {}

/* ---------- Toggle password visibility ---------- */


togglePassword(): void {
const pwdField = [Link](
'#adminPassword'
) as HTMLInputElement;
const eyeIcon = [Link](
'#eyeIcon'
) as HTMLImageElement;
if (!pwdField || !eyeIcon) return;

const masked = [Link] === 'password';


[Link] = masked ? 'text' : 'password';
[Link] = masked
? 'assets/icons/[Link]'
: 'assets/icons/[Link]';
}

/* ---------- Form submit + client validation ---------- */


onSubmit(form: NgForm): void {
/* Clear previous errors */
[Link]();

const { username, password } = [Link] as {


username: string;
password: string;
};

let isValid = true;

/* USERNAME */
if (!username || ![Link]()) {
[Link]('adminUsernameError', 'Username is required.');
isValid = false;
}

/* PASSWORD 6-12 chars */


if (!password) {
[Link]('adminPasswordError', 'Password is required.');
isValid = false;
} else if ([Link] < 6 || [Link] > 12) {
[Link](
'adminPasswordError',
'Password must be between 6 and 12 characters.'
);
isValid = false;
}

if (!isValid) return;

/* Success placeholder */
alert('Admin login successful!');
// TODO: Replace with real service, then [Link]()
[Link](['/admin-dashboard']);
}

/* ---------- Helpers ---------- */


private setError(id: string, msg: string): void {
const el = [Link](`#${id}`) as HTMLElement;
if (el) [Link] = msg;
}

private clearErrors(): void {


[Link]
.querySelectorAll('.error-message')
.forEach((e: HTMLElement) => ([Link] = ''));
}
}

//------------------------------------------------

//--------------------------------->Admin-nav

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

:host {
display: block;
font-family: Arial, sans-serif;
}

/* NAV BAR */
.admin-nav {
background: #004b87;
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 20px;
box-shadow: 0 4px 6px rgb(0 0 0 / 0.1);
}

.logo {
font-size: 1.5rem;
font-weight: bold;
letter-spacing: 1px;
}

/* LINKS */
.nav-links {
list-style: none;
display: flex;
}

.nav-links li {
margin: 0 15px;
}

.nav-links li a {
color: #fff;
text-decoration: none;
font-size: 1rem;
position: relative;
transition: color 0.3s ease;
}

.nav-links li a::after {
content: '';
position: absolute;
left: 0;
bottom: -3px;
height: 2px;
width: 0;
background: #fff;
transition: width 0.3s ease;
}

.nav-links li a:hover {
color: #f1c40f;
}

.nav-links li a:hover::after {
width: 100%;
}

/* LOGOUT BUTTON */
.logout-btn {
background: #e74c3c;
color: #fff;
border: none;
padding: 8px 15px;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background 0.3s ease, transform 0.2s ease;
}

.logout-btn:hover {
background: #c0392b;
transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 768px) {
.nav-links {
flex-direction: column;
align-items: center;
}

.nav-links li {
margin: 10px 0;
}
}

//----------------------------

<nav class="admin-nav">
<div class="logo">Admin Panel</div>

<ul class="nav-links">
<li><a routerLink="/admin-dashboard">Dashboard</a></li>
<li><a routerLink="/add-train">Add Train</a></li>
<li><a routerLink="/station-maintenance">Add&nbsp;/&nbsp;Remove
Station</a></li>
<li><a routerLink="/admin-profile">Profile</a></li>
<!-- <li><a routerLink="/view-bookings">View Bookings</a></li> -->
</ul>

<button class="logout-btn" (click)="confirmLogout()">Logout</button>


</nav>

//---------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminNavComponent } from './[Link]';

describe('AdminNavComponent', () => {
let component: AdminNavComponent;
let fixture: ComponentFixture<AdminNavComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AdminNavComponent ]
})
.compileComponents();

fixture = [Link](AdminNavComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-admin-nav',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AdminNavComponent {

// }
import { Component } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'app-admin-navigation',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AdminNavComponent {
constructor(private router: Router) {}

/** Shows a confirm dialog and logs out if confirmed */


confirmLogout(): void {
const ok = confirm('Are you sure you want to log out?');
if (!ok) return;

/* TODO: Call your AuthService to clear tokens / session on server


[Link]().subscribe(() => [Link](['/admin-
login'])); */

// Client-side redirect stub


[Link](['/admin-login']);
}
}

//------------------------------------------------

---------------------------------->admin-profile

:host {
display: block;
min-height: 100vh;
background: linear-gradient(120deg, #f8f6f5, #3d3d3c);
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}

/* MAIN CARD */
.container {
max-width: 1200px;
margin: 30px auto;
padding: 20px;
background: rgba(255, 255, 255, 0.678);
border-radius: 8px;
box-shadow: 0 2px 10px rgb(0 0 0 / 0.1);
}

/* HEADER STRIP */
.header {
display: flex;
align-items: center;
justify-content: space-between;
background: #004b87;
color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
transition: background 0.3s ease;
}

/* TABLE STYLES */
h2,
h3 {
color: #333;
margin-bottom: 20px;
}

table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}

table th,
table td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}

table th {
background: #f2f2f2;
font-weight: bold;
}

table tr:hover {
background: #f9f9f9;
}
/* OPTIONAL LOGOUT BUTTON */
.btn-danger {
display: inline-block;
background: #d9534f;
color: #fff;
padding: 10px 20px;
font-size: 1rem;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
}

.btn-danger:hover {
background: #c9302c;
}

//------------------------------------------------

<div class="container">
<!-- PAGE HEADER -->
<div class="header" style="justify-content:center;">
<!-- Optional icons go here -->
<div class="text-container">
<h1>Your Admin Credentials</h1>
</div>
</div>
<app-admin-navigation></app-admin-navigation>
<!-- GREETING -->
<h2>Welcome, {{ [Link] }}!</h2>

<!-- Nav bar from a separate component -->


<!-- <app-admin-navigation></app-admin-navigation> -->

<br />

<!-- PROFILE TABLE -->


<h3>Admin Profile</h3>
<table>
<thead>
<tr>
<th>Field</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Admin ID</strong></td>
<td>{{ [Link] }}</td>
</tr>
<tr>
<td><strong>Admin Name</strong></td>
<td>{{ [Link] }}</td>
</tr>
<tr>
<td><strong>Username</strong></td>
<td>{{ [Link] }}</td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td>{{ [Link] }}</td>
</tr>
<tr>
<td><strong>Contact No.</strong></td>
<td>{{ [Link] }}</td>
</tr>
</tbody>
</table>

<!-- LOGOUT BUTTON (enable when wired to service) -->


<!--
<br />
<button class="btn-danger" (click)="logout()">Logout</button>
-->
</div>

//------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminProfileComponent } from './[Link]';

describe('AdminProfileComponent', () => {
let component: AdminProfileComponent;
let fixture: ComponentFixture<AdminProfileComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AdminProfileComponent ]
})
.compileComponents();

fixture = [Link](AdminProfileComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-admin-profile',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AdminProfileComponent {

// }
import { Component } from '@angular/core';
import { Router } from '@angular/router';

/* Demo model (replace / import your real model) */


interface Admin {
adminId: number;
name: string;
uname: string;
email: string;
phoneNo: string;
}

@Component({
selector: 'app-admin-profile',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AdminProfileComponent {
/* In production, inject an Auth / AdminService to fetch the logged-in admin */
admin: Admin = {
adminId: 101,
name: 'Demo Admin',
uname: 'demoadmin',
email: 'demo@[Link]',
phoneNo: '9876543210',
};

constructor(private router: Router) {}

/* Uncomment when wired to backend auth logic


logout(): void {
[Link]();
[Link](['/admin-login']);
}
*/
}

//------------------------------------------------

//------------------------------->admin-register

:host {
display: block;
min-height: 100vh;
background: linear-gradient(120deg, #b9f1f1, #ecd6f5);
font-family: Arial, sans-serif;
overflow-x: hidden;
}

/* Card */
.container {
max-width: 600px;
margin: 100px auto;
padding: 30px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgb(0 0 0 / 0.1);
}

/* Headline */
h2 {
text-align: center;
color: #333;
}

/* FORM GRID */
.form-row {
display: flex;
justify-content: space-between;
gap: 20px;
margin-bottom: 15px;
}

.form-column {
flex: 1;
}

label {
display: block;
font-size: 1rem;
color: #333;
margin-bottom: 5px;
}

input[type='text'],
input[type='email'],
input[type='password'] {
width: 100%;
padding: 10px;
font-size: 1rem;
border: 1px solid #ddd;
border-radius: 4px;
margin-bottom: 5px;
}

/* Errors */
.error-message {
color: red;
font-size: 0.9em;
}

/* Button */
button {
width: 100%;
padding: 10px;
background: #3498db;
color: #fff;
font-size: 1.2rem;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #2980b9;
}

/* Links */
.text-center {
text-align: center;
}

.text-center p {
margin-top: 15px;
font-size: 1rem;
}

.text-center a {
color: #3498db;
text-decoration: none;
}

.text-center a:hover {
text-decoration: underline;
}

//------------------------------------------------

<div class="container">
<h2>Admin Register</h2>

<!-- Template-driven form -->


<form
#regForm="ngForm"
(ngSubmit)="onSubmit(regForm)"
novalidate
>
<!-- USERNAME + NAME -->
<div class="form-row">
<div class="form-column">
<label for="uname">Username</label>
<input
type="text"
id="uname"
name="uname"
maxlength="40"
[(ngModel)]="adminUserName"
required pattern="^(?![Nn][Uu][Ll][Ll]$).+"
/>
<div id="unameError" class="error-message"></div>
</div>

<div class="form-column">
<label for="name">Name</label>
<input
type="text"
id="name"
name="name"
maxlength="40"
[(ngModel)]="adminName"
required pattern="^(?![Nn][Uu][Ll][Ll]$).+"
/>
<div id="nameError" class="error-message"></div>
</div>
</div>

<!-- EMAIL + PHONE -->


<div class="form-row">
<div class="form-column">
<label for="email">Email</label>
<input
type="email"
id="email"
name="email"
maxlength="60"
ngModel
required
/>
<div id="emailError" class="error-message"></div>
</div>

<div class="form-column">
<label for="phoneNo">Phone Number</label>
<input
type="text"
id="phoneNo"
name="phoneNo"
maxlength="10"
ngModel
required
/>
<div id="phoneNoError" class="error-message"></div>
</div>
</div>

<!-- PASSWORD + CONFIRM -->


<div class="form-row">
<div class="form-column">
<label for="password">Password</label>
<input
type="password"
id="password"
name="password"
minlength="6"
maxlength="12"
ngModel
required
/>
<div id="passwordError" class="error-message"></div>
</div>

<div class="form-column">
<label for="confirmPassword">Confirm Password</label>
<input
type="password"
id="confirmPassword"
name="confirmPassword"
minlength="6"
maxlength="12"
ngModel
required
/>
<div id="confirmPasswordError" class="error-message"></div>
</div>
</div>

<button type="submit">Register</button>
</form>

<div class="text-center">
<p>
Already have an account?
<a routerLink="/admin-login">Login as Admin here</a>.
</p>
</div>
</div>

//-------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminRegisterComponent } from './[Link]';

describe('AdminRegisterComponent', () => {
let component: AdminRegisterComponent;
let fixture: ComponentFixture<AdminRegisterComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ AdminRegisterComponent ]
})
.compileComponents();

fixture = [Link](AdminRegisterComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//-------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-admin-register',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class AdminRegisterComponent {

// }

import { Component, ElementRef } from '@angular/core';


import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';

@Component({
selector: 'app-admin-register',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class AdminRegisterComponent {
adminUserName:string="";
adminName:string="";
constructor(private el: ElementRef, private router: Router) {}

onSubmit(form: NgForm): void {


[Link]();

const {
uname,
name,
email,
password,
confirmPassword,
phoneNo,
} = [Link] as {
uname: string;
name: string;
email: string;
password: string;
confirmPassword: string;
phoneNo: string;
};

let valid = true;

/* USERNAME */
if (!uname || [Link]().length===0||[Link]().toLowerCase()===null) {
[Link]('unameError', 'Username is required.');
valid = false;
}

/* NAME */
// if (!name || ![Link]()) {
// [Link]('nameError', 'Name is required.');
// valid = false;
// }
if(!name|| [Link]().length===0||[Link]().toLowerCase()===null){
alert('name cannot be null');
return;
}

/* EMAIL (gmail only) */


if (!email || ![Link]('@[Link]')) {
[Link]('emailError', 'Email must be a valid Gmail address.');
valid = false;
}

/* PASSWORD length 6-12 */


if ([Link] < 6 || [Link] > 12) {
[Link](
'passwordError',
'Password must be 6 to 12 characters long.'
);
valid = false;
}

/* CONFIRM PASSWORD */
if (password !== confirmPassword) {
[Link]('confirmPasswordError', 'Passwords do not match.');
valid = false;
}

/* PHONE NUMBER 10 digits numeric */


if ([Link] !== 10 || isNaN(+phoneNo)) {
[Link](
'phoneNoError',
'Phone number must be exactly 10 digits.'
);
valid = false;
}

if (!valid) return;

/* Success placeholder */
alert('Admin registration successful!');
// TODO: call backend service then redirect
[Link](['/admin-login']);
}

/* ---------- Helpers ---------- */


private setError(id: string, msg: string): void {
const span = [Link](`#${id}`) as HTMLElement;
if (span) [Link] = msg;
}

private clearErrors(): void {


[Link]
.querySelectorAll('.error-message')
.forEach((e: HTMLElement) => ([Link] = ''));
}
}

//----------------------------------------------------------

//------------------------------------>book-ticket

import { Injectable } from "@angular/core";

/* Extend the earlier AuthService with customer info */


export interface User {
customerId: number;
name: string;
username: string;
}

@Injectable({ providedIn: 'root' })


export class AuthService {
private user: User | null = {
customerId: 1,
name: 'Demo User',
username: 'demo',
};

currentUser(): User | null {


return [Link];
}
}

//------------------------------------

:host {
display: block;
font-family: Arial, sans-serif;
background: linear-gradient(120deg, #c7e9eb, #ecf1f1);
margin: 0;
overflow-y: hidden;
}

.container {
max-width: 1200px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.856);
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
padding: 40px;
}

/* FORM ELEMENTS */
.form-group {
width: 100%;
margin-bottom: 15px;
}

.form-row {
display: flex;
gap: 20px;
align-items: center;
}

.half-width {
width: 48%;
}

label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}

.form-control {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 1rem;
}

/* BUTTONS */
.btn-back,
.btn-book {
width: 100%;
padding: 12px;
font-weight: bold;
font-size: 1rem;
color: #fff;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background 0.3s ease;
}

.btn-back {
background: #ff4122;
}

.btn-back:hover {
background: #ff8164;
}

.btn-book {
background: #6fc276;
}

.btn-book:hover {
background: #419a49;
}

/* ALERT */
.alert {
padding: 15px;
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
border-radius: 6px;
margin-bottom: 20px;
text-align: center;
}

/* SMALL SCREEN */
@media (max-width: 768px) {
.form-row {
flex-direction: column;
}
.half-width {
width: 100%;
}
}

//----------------------------------------------------------

<div class="container">
<!-- NAV BAR -->
<app-user-nav></app-user-nav>

<!-- ERROR ALERT -->


<div
class="alert"
*ngIf="error"
>
{{ error }}
</div>

<!-- MAIN CARD -->


<h1 *ngIf="train">Book Your Ticket</h1>

<form
#bookForm="ngForm"
(ngSubmit)="submit(bookForm)"
*ngIf="train"
novalidate
>
<!-- Train details -->
<div class="form-row">
<div class="form-group half-width">
<label>Train ID:</label>
<input
type="number"
class="form-control"
[value]="[Link]"
readonly
/>
</div>

<div class="form-group half-width">


<label>Train Name:</label>
<input
type="text"
class="form-control"
[value]="[Link]"
readonly
/>
</div>
</div>

<div class="form-row">
<div class="form-group half-width">
<label>From Station:</label>
<input
type="text"
id="fromStation"
class="form-control"
[value]="[Link]"
readonly
/>
<div id="fromStationError" class="error-message"></div>
</div>

<div class="form-group half-width">


<label>To Station:</label>
<input
type="text"
id="toStation"
class="form-control"
[value]="[Link]"
readonly
/>
<div id="toStationError" class="error-message"></div>
</div>
</div>

<div class="form-row">
<div class="form-group half-width">
<label>Fare (per seat):</label>
<input
type="text"
id="fare"
class="form-control"
[value]="[Link]"
readonly
/>
</div>

<div class="form-group half-width">


<label>Available Seats:</label>
<input
type="number"
id="availableSeats"
class="form-control"
[value]="[Link]"
readonly
/>
</div>
</div>

<!-- Inputs the customer can edit -->


<div class="form-group">
<label>Number of Seats:</label>
<input
type="number"
id="seatCount"
name="seatCount"
class="form-control"
ngModel
min="1"
max="6"
required
(input)="updateTotal()"
/>
</div>

<div class="form-group">
<label>Booking Date:</label>
<input
type="datetime-local"
id="bookingDate"
name="bookingDate"
class="form-control"
[min]="today"
[max]="maxDate"
ngModel
required
/>
</div>

<div class="form-group">
<label>Total Fare (₹):</label>
<input
type="text"
id="totalFare"
class="form-control"
[value]="totalFare | number:'1.2-2'"
readonly
/>
</div>

<!-- Buttons -->


<div class="form-row">
<div class="form-group" style="flex:0 0 30%;padding-right:10px;">
<button type="button" class="btn-back" (click)="goBack()">Back</button>
</div>
<div class="form-group" style="flex:0 0 30%;padding-left:10px;">
<button type="submit" class="btn-book">Book Ticket</button>
</div>
</div>
</form>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { BookTicketComponent } from './[Link]';

describe('BookTicketComponent', () => {
let component: BookTicketComponent;
let fixture: ComponentFixture<BookTicketComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ BookTicketComponent ]
})
.compileComponents();

fixture = [Link](BookTicketComponent);
component = [Link];
[Link]();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-book-ticket',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class BookTicketComponent {

// }
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { TrainService, Train } from './[Link]';
import { AuthService } from './[Link]';

@Component({
selector: 'app-book-ticket',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class BookTicketComponent implements OnInit {
train?: Train | null = null;
error: string | null = null;

today = new Date().toISOString().slice(0, 16); // yyyy-MM-ddTHH:mm


maxDate = (() => {
const d = new Date();
[Link]([Link]() + 3);
return [Link]().slice(0, 16);
})();

totalFare = 0;

constructor(
private route: ActivatedRoute,
private trainService: TrainService,
private auth: AuthService,
private router: Router
) {}

ngOnInit(): void {
/* guard */
if (![Link]()) {
[Link](['/user-login']);
return;
}

/* get train id from route param */


const id = [Link]('id') ;
[Link](parseInt("id")).subscribe({
next: (t) => ([Link] = t),
error: () => ([Link] = 'Could not load train details'),
});
}

/* Updates total fare when user changes seat count */


updateTotal(seatCountInput?: HTMLInputElement): void {
const seatControl = seatCountInput
? seatCountInput
: ([Link]('seatCount') as HTMLInputElement);
if (!seatControl || ![Link]) return;

const seatCount = +[Link] || 0;


[Link] = seatCount * [Link];
}

submit(f: NgForm): void {


if (![Link]) return;

if ([Link]) {
alert('Please fill all required fields.');
return;
}

const { seatCount, bookingDate } = [Link];

if (seatCount > [Link]) {


alert('Not enough seats available.');
return;
}

/* Confirm & call backend */


if (!confirm('Are you sure you want to book this ticket?')) return;

[Link]
.bookTicket({
trainNo: [Link],
seats: +seatCount,
date: bookingDate,
})
.subscribe({
next: () => {
alert('Ticket booked successfully!');
[Link](['/book-ticket']);
},
error: () => alert('Booking failed'),
});
}

goBack(): void {
[Link](['/search-train']);
}
}

//----------------------------------------------------------
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';

export interface Train {


trainNo: number;
trainName: string;
fromStation: string;
toStation: string;
availableSeats: number;
fare: number;
}

@Injectable({ providedIn: 'root' })


export class TrainService {
private mock: Train[] = [
{
trainNo: 101,
trainName: 'Express A',
fromStation: 'Mumbai',
toStation: 'Delhi',
availableSeats: 120,
fare: 950,
},
];

getTrain(no: number): Observable<Train | undefined> {


// return [Link]<Train>(`/api/trains/${no}`);
return of([Link]((t) => [Link] === no));
}

bookTicket(payload: {
trainNo: number;
seats: number;
date: string;
}): Observable<void> {
// return [Link]<void>('/api/bookings', payload);
[Link]('booking payload', payload);
return of(void 0);
}
}

//----------------------------------------------------------

//---------------------------------->error-page

.error-container {
margin-top: 100px;
text-align: center;
}

.error-message {
font-size: 2rem;
font-weight: bold;
color: #e74a3b;
}
.error-details {
margin-top: 20px;
font-size: 1.1rem;
}

.retry-button {
margin-top: 20px;
}

//----------------------------------------------------------

<div class="container error-container">


<div class="row justify-content-center">
<div class="col-md-6">
<div class="alert alert-danger text-center">
<h4 class="error-message">Oops! Something went wrong.</h4>

<!-- optional custom message -->


<p *ngIf="msg" class="error-details">{{ msg }}</p>

<!-- default explanation -->


<p *ngIf="!msg" class="error-details">
We encountered an error while processing your request.<br />
Please try again later.
</p>

<p class="mt-3">
Reasons might be: <br />
Session expired &nbsp;|&nbsp; Wrong credentials &nbsp;|&nbsp; Invalid
input &nbsp;|&nbsp; Server issue
</p>

<button class="btn btn-warning retry-button" (click)="goBack()">


Go Back
</button>
<a routerLink="/login" class="btn btn-primary retry-button">
Go to Login Page
</a>
</div>
</div>
</div>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ErrorPageComponent } from './[Link]';

describe('ErrorPageComponent', () => {
let component: ErrorPageComponent;
let fixture: ComponentFixture<ErrorPageComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ ErrorPageComponent ]
})
.compileComponents();

fixture = [Link](ErrorPageComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-error-page',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class ErrorPageComponent {

// }
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
selector: 'app-error-page',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class ErrorPageComponent implements OnInit {
/** optional message coming from query param ?msg=... */
msg: string | null = null;

constructor(private route: ActivatedRoute, private router: Router) {}

ngOnInit(): void {
[Link] = [Link]('msg');
}

goBack(): void {
[Link]([Link], { skipLocationChange: true });
[Link]();
}
}

//----------------------------------------------------------

//--------------------------->index-page

.Train-container{
text-align: center;
margin-top: 100px;
font-family: Arial, Helvetica, sans-serif;
color: #004b87;
}
//----------------------------------------------------------

<div class = "Train-container">


<h1>RailMail</h1>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { IndexPageComponent } from './[Link]';

describe('IndexPageComponent', () => {
let component: IndexPageComponent;
let fixture: ComponentFixture<IndexPageComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ IndexPageComponent ]
})
.compileComponents();

fixture = [Link](IndexPageComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

import { Component } from '@angular/core';

@Component({
selector: 'app-index-page',
templateUrl: './[Link]',
styleUrls: ['./[Link]']
})
export class IndexPageComponent {

//----------------------------------------------------------

//-------------------------------->landing

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:host {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-image:
url("[Link]
;
background-size: cover;
background-position: center;
overflow: hidden;
}

.login-container {
display: flex;
width: 80%;
max-width: 1200px;
justify-content: space-between;
}

.image-container {
width: 50%;
display: flex;
align-items: center;
justify-content: center;
}

.login-form-container {
display: flex;
flex-direction: column;
justify-content: center;
margin-bottom: 21vh;
}

.login-header h1 {
font-size: 4rem;
color: #3e5879;
text-align: center;
margin-bottom: 2rem;
}

.button-container {
display: flex;
justify-content: center;
gap: 2rem;
}

.login-button,
.admin-button {
padding: 1rem 2rem;
font-size: 1.5rem;
font-weight: bold;
color: white;
background-color: #213555;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s;
}

.login-button:hover,
.admin-button:hover {
background-color: #3e5879;
}

@media (max-width: 768px) {


.login-container {
flex-direction: column;
align-items: center;
}

.image-container {
width: 100%;
padding: 1rem;
}

.login-form-container {
width: 100%;
margin-bottom: 5vh;
}

.button-container {
flex-direction: column;
gap: 1rem;
}
}

//----------------------------------------------------------

<div class="login-container">
<div class="image-container">
<!-- If you had an <img> here, keep it; omitted because the original snippet
was empty -->
</div>

<div class="login-form-container">
<div class="login-header" style="display:flex; justify-content:center;
margin-right:3vh">
<h1>RailMail</h1>
</div>

<div class="landing-main">
<div class="login-form-container">
<div class="button-container" style="display:flex; justify-
content:center;">
<button
type="button"
class="login-button"
style="margin-right:1vw"
(click)="userLogin()"
>
Login as User
</button>

<button
type="button"
class="admin-button"
style="margin-left:1vw"
(click)="adminLogin()"
>
Login as Admin
</button>
</div>
</div>
</div>
</div>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { LandingComponent } from './[Link]';

describe('LandingComponent', () => {
let component: LandingComponent;
let fixture: ComponentFixture<LandingComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ LandingComponent ]
})
.compileComponents();

fixture = [Link](LandingComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-landing',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class LandingComponent {

// }
import { Component } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-landing-page',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class LandingComponent {
constructor(private router: Router) {}

// ---------- NAVIGATION ----------


userLogin(): void {
// adjust the target route to match your routing table
[Link](['/user-login']);
}

adminLogin(): void {
// adjust the target route to match your routing table
[Link](['/admin-login']);
}

// ---------- VALIDATION + UI HELPERS ----------


/** Mirrors the original JS show/hide password logic. */
togglePasswordVisibility(): void {
const passwordInput = [Link](
'adminPassword'
) as HTMLInputElement | null;
const eyeIcon = [Link](
'eyeIcon'
) as HTMLImageElement | null;

if (passwordInput && eyeIcon) {


const isMasked = [Link] === 'password';
[Link] = isMasked ? 'text' : 'password';
[Link] = isMasked
? 'assets/icons/[Link]'
: 'assets/icons/[Link]';
}
}

/**
* Replicates validateAdminLoginForm() from the original snippet.
* Returns true when the client-side check passes.
*/
validateAdminLoginForm(): boolean {
let isValid = true;

// Clear previous messages


document
.querySelectorAll('.error-message')
.forEach((el) => ((el as HTMLElement).innerText = ''));

// Username
const usernameInput = [Link](
'adminUsername'
) as HTMLInputElement | null;
if (usernameInput && [Link]() === '') {
const err = [Link]('adminUsernameError');
if (err) [Link] = 'Username is required.';
isValid = false;
}
// Password
const passwordInput = [Link](
'adminPassword'
) as HTMLInputElement | null;
if (passwordInput) {
const { value: pwd } = passwordInput;
if (!pwd) {
const err = [Link]('adminPasswordError');
if (err) [Link] = 'Password is required.';
isValid = false;
} else if ([Link] < 6 || [Link] > 12) {
const err = [Link]('adminPasswordError');
if (err)
[Link] = 'Password must be between 6 and 12 characters.';
isValid = false;
}
}

return isValid;
}
}

//----------------------------------------------------------

//----------------------------------->search-train

:host {
display: block;
font-family: Arial, sans-serif;
background: linear-gradient(120deg, #d0f4f5, #ffffff);
color: #333;
overflow-x: hidden;
overflow-y: hidden;
}

.container {
max-width: 1200px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.87);
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
padding: 40px;
}

/* FORM SECTIONS */
.booking-form,
.booking-form-green,
.booking-form-red {
padding: 20px;
margin: 20px 0;
border-radius: 10px;
box-shadow: 0 4px 8px rgb(0 0 0 / 0.1);
}

.booking-form {
background: #f9f9f9;
}

.booking-form-green {
background: #e5f6df;
max-height: 400px;
overflow-y: auto;
}

.booking-form-red {
background: #ff8886;
}

/* INPUTS */
label {
display: block;
margin: 10px 0 5px;
}

select {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}

button {
background: #337ab7;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}

button:hover {
background: #003f7f;
}

/* TABLES */
.table-container {
max-height: 400px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 8px;
padding: 10px;
}

table {
width: 100%;
border-collapse: collapse;
}

th,
td {
padding: 12px;
border: 1px solid #ddd;
}
th {
background: #004b87;
color: #fff;
font-weight: bold;
}

tr:nth-child(even) {
background: #f9f9f9;
}

tr:hover {
background: #e1f5fe;
}

//----------------------------------------------------------

<div class="container">
<!-- USER NAV BAR -->
<app-user-nav></app-user-nav>

<!-- ────────────────── SEARCH FORM ────────────────── -->


<section class="booking-form">
<h2>Search Trains</h2>

<form #searchForm="ngForm" (ngSubmit)="search(searchForm)" novalidate>


<label>From Station:</label>
<select
name="fromStation"
id="fromStation"
ngModel
required
>
<option value="">Select Station</option>
<option *ngFor="let st of stations" [value]="[Link]">
{{ [Link] }}
</option>
</select>

<label class="mt-3">To Station:</label>


<select
name="toStation"
id="toStation"
ngModel
required
>
<option value="">Select Station</option>
<option *ngFor="let st of stations" [value]="[Link]">
{{ [Link] }}
</option>
</select>

<br /><br />


<button type="submit">Search</button>
</form>
</section>

<!-- ────────────────── SEARCH RESULTS ────────────────── -->


<section
*ngIf="searchDone && [Link]"
class="booking-form-green"
>
<h3>Search Results</h3>
<p>
<strong>{{ [Link] }}</strong>
train(s) found for your search criteria.
</p>

<table>
<thead>
<tr>
<th>Train ID</th>
<th>Train Name</th>
<th>From</th>
<th>To</th>
<th>Seats</th>
<th>Fare&nbsp;₹</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let t of trains">
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>
<button (click)="book(t)">Book</button>
</td>
</tr>
</tbody>
</table>
</section>

<section
*ngIf="searchDone && ![Link]"
class="booking-form-red"
>
No trains found for the selected route.
</section>

<!-- ────────────────── ALL RUNNING TRAINS ────────────────── -->


<section class="booking-form">
<h3>All Running Trains</h3>

<div class="table-container" *ngIf="[Link]; else noRuns">


<table>
<thead>
<tr>
<th>Train ID</th>
<th>Train Name</th>
<th>From</th>
<th>To</th>
<th>Seats</th>
<th>Fare&nbsp;₹</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let t of allTrains">
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>{{ [Link] }}</td>
<td>
<button (click)="book(t)">Book</button>
</td>
</tr>
</tbody>
</table>
</div>

<ng-template #noRuns>
<div class="alert alert-warning">No running trains available.</div>
</ng-template>
</section>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SearchTrainComponent } from './[Link]';

describe('SearchTrainComponent', () => {
let component: SearchTrainComponent;
let fixture: ComponentFixture<SearchTrainComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ SearchTrainComponent ]
})
.compileComponents();

fixture = [Link](SearchTrainComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';


// @Component({
// selector: 'app-search-train',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class SearchTrainComponent {

// }
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';
import { StationService, Station } from './[Link]';
import { TrainService, Train } from './[Link]';
import { AuthService } from '../book-ticket/[Link]';

@Component({
selector: 'app-search-train',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class SearchTrainComponent implements OnInit {
stations: Station[] = [];
trains: Train[] = [];
allTrains: Train[] = [];
searchDone = false;

constructor(
private stationService: StationService,
private trainService: TrainService,
private auth: AuthService,
private router: Router
) {}

ngOnInit(): void {
/* guard against unauthenticated users */
if (![Link]()) {
[Link](['/user-login']);
return;
}

[Link]();
[Link]();
}

/* ---------- DATA LOADERS ---------- */


private loadStations(): void {
[Link]().subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load stations'),
});
}

private loadAllTrains(): void {


[Link]().subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load trains'),
});
}
/* ---------- SEARCH ---------- */
search(form: NgForm): void {
if ([Link]) return;

const { fromStation, toStation } = [Link];


if (fromStation === toStation) {
alert('Source and destination cannot be the same.');
return;
}

[Link](fromStation, toStation).subscribe({
next: (data) => {
[Link] = data;
[Link] = true;
},
error: () => alert('Search failed'),
});
}

/* ---------- BOOK ---------- */


book(train: Train): void {
[Link](['/book-ticket', [Link]]);
}
}

//----------------------------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

export interface Station {


stationId: number;
stationName: string;
}

@Injectable({ providedIn: 'root' })


export class StationService {
private mock: Station[] = [
{ stationId: 1, stationName: 'Mumbai' },
{ stationId: 2, stationName: 'Delhi' },
{ stationId: 3, stationName: 'Chennai' },
{ stationId: 4, stationName: 'Bangalore' },
];

getStations(): Observable<Station[]> {
// return [Link]<Station[]>('/api/stations');
return of([Link]);
}
}

//----------------------------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';
export interface Train {
trainNo: number;
trainName: string;
fromStation: string;
toStation: string;
availableSeats: number;
fare: number;
}

@Injectable({ providedIn: 'root' })


export class TrainService {
private mock: Train[] = [
{
trainNo: 101,
trainName: 'Express A',
fromStation: 'Mumbai',
toStation: 'Delhi',
availableSeats: 120,
fare: 950,
},
{
trainNo: 202,
trainName: 'Superfast B',
fromStation: 'Chennai',
toStation: 'Bangalore',
availableSeats: 80,
fare: 650,
},
];

getTrains(): Observable<Train[]> {
// return [Link]<Train[]>('/api/trains');
return of([Link]);
}

searchTrains(from: string, to: string): Observable<Train[]> {


// return [Link]<Train[]>(`/api/trains/search?from=${from}&to=${to}`);
return of(
[Link](
(t) =>
[Link]() === [Link]() &&
[Link]() === [Link]()
)
);
}
}

//----------------------------------------------------------

//------------------------------->user-home

// export interface Customer {


// customerId: number;
// name: string;
// username: string;
// }

// /* in AuthService */
// private customer: Customer | null = {
// customerId: 1,
// name: 'Demo User',
// username: 'demo',
// };

// currentCustomer(): Customer | null {


// return [Link];
// }
import { Injectable } from "@angular/core";

/* Extend the earlier AuthService with customer info */


export interface User {
customerId: number;
name: string;
username: string;
}

@Injectable({ providedIn: 'root' })


export class AuthService {
logout() {
throw new Error('Method not implemented.');
}
private user: User | null = {
customerId: 1,
name: 'Demo User',
username: 'demo',
};

currentCustomer(): User | null {


return [Link];
}
}

//----------------------------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

export interface Ticket {


pnr: string;
trainName: string;
fromStation: string;
toStation: string;
seatCount: number;
totalFare: number;
bookingDate: string;
}

@Injectable({ providedIn: 'root' })


export class TicketService {
private mock: Ticket[] = [
{
pnr: 'PNR123',
trainName: 'Express A',
fromStation: 'Mumbai',
toStation: 'Delhi',
seatCount: 2,
totalFare: 1900,
bookingDate: new Date().toISOString(),
},
];

getTickets(userId: number): Observable<Ticket[]> {


// return [Link]<Ticket[]>(`/api/tickets?user=${userId}`);
return of([Link]);
}

cancelTicket(pnr: string): Observable<void> {


// return [Link]<void>('/api/tickets/cancel', { pnr });
[Link] = [Link]((t) => [Link] !== pnr);
return of(void 0);
}
}

//----------------------------------------------------------

:host {
display: block;
font-family: Arial, sans-serif;
background: linear-gradient(120deg, #bdfdfd, #eaf7f7);
min-height: 100vh;
overflow-x: hidden;
}

.container {
max-width: 1200px;
margin: 5vh auto;
background: #f6f9f9;
border-radius: 12px;
box-shadow: 0 6px 15px rgb(0 0 0 / 0.1);
padding: 40px;
}

/* buttons */
.buttons-container {
text-align: center;
margin: 30px 0;
}

.book-button {
padding: 15px 30px;
font-weight: bold;
border: none;
border-radius: 30px;
cursor: pointer;
animation: colorChange 5s infinite alternate;
color: #fff;
}

@keyframes colorChange {
0% { background: #2b3b5f; }
25% { background: #3a5080; }
50% { background: #4a65a2; }
75% { background: #647eb8; }
100% { background: #869ac8; }
}
/* ticket card */
.ticket-card {
background: #fff;
border: 2px solid #00529b;
border-radius: 10px;
box-shadow: 0 8px 20px rgb(0 0 0 / 0.2);
padding: 20px;
margin-bottom: 20px;
transition: transform 0.3s, box-shadow 0.3s;
}

.ticket-card:hover {
transform: translateY(-5px);
box-shadow: 0 12px 30px rgb(0 0 0 / 0.3);
}

.card-header {
display: flex;
justify-content: space-between;
border-bottom: 2px solid #00529b;
margin-bottom: 15px;
}

.route {
display: flex;
align-items: center;
font-weight: bold;
color: #00529b;
}

.route-line {
flex: 1;
height: 2px;
background: #ccc;
margin: 0 10px;
}

.price-cancel {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}

.price {
font-weight: bold;
font-size: 1.2rem;
}

.cancel {
background: #d9534f;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
transition: background 0.3s;
}
.cancel:hover {
background: #c9302c;
}

/* collapsible details */
.card-details {
border-top: 1px solid #ddd;
margin-top: 15px;
padding-top: 10px;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s;
}

.[Link] {
max-height: 500px;
}

.toggle-button {
margin-top: 10px;
cursor: pointer;
color: #007bff;
text-decoration: underline;
}

/* misc */
.text-center {
text-align: center;
font-size: 1.2rem;
color: #999;
padding: 20px;
}

//----------------------------------------------------------

<div class="container">
<!-- top nav bar -->
<app-user-nav></app-user-nav>

<!-- buttons -->


<div class="buttons-container">
<button
class="book-button"
(click)="[Link](['/search-train'])"
>
Book Ticket
</button>
</div>

<!-- optional flash messages -->


<div *ngIf="pnrMessage" class="alert alert-success">
Your ticket has been successfully booked. Your PNR is:
<strong>{{ pnrMessage }}</strong>
</div>

<div *ngIf="genericMessage" class="alert alert-success">


{{ genericMessage }}
</div>

<!-- tickets section -->


<h3>Your Booked Tickets</h3>

<ng-container *ngIf="[Link]; else noTickets">


<div class="card-container">
<div
class="ticket-card"
*ngFor="let t of tickets"
>
<div class="card-header">
<h4>Train Name: {{ [Link] }}</h4>
<p>PNR: {{ [Link] }}</p>
</div>

<div class="card-body">
<!-- route -->
<div class="route">
<span>{{ [Link] }}</span>
<div class="route-line"></div>
<span>{{ [Link] }}</span>
</div>

<!-- amount + cancel -->


<div class="price-cancel">
<span class="price">Amount Paid: Rs.&nbsp;{{ [Link] }}</span>

<button
class="cancel"
(click)="cancel(t)"
>
Cancel
</button>
</div>

<!-- collapsible details -->


<div
[[Link]]="[Link]"
class="card-details"
>
<p><strong>Seats:</strong> {{ [Link] }}</p>
<p><strong>Booked On:</strong> {{ [Link] | date:'medium'
}}</p>
</div>

<span
class="toggle-button"
(click)="[Link] = ![Link]"
>
{{ [Link] ? 'Hide Details' : 'Show Details' }}
</span>
</div>
</div>
</div>
</ng-container>

<ng-template #noTickets>
<p class="text-center">You have no booked tickets.</p>
</ng-template>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserHomeComponent } from './[Link]';

describe('UserHomeComponent', () => {
let component: UserHomeComponent;
let fixture: ComponentFixture<UserHomeComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ UserHomeComponent ]
})
.compileComponents();

fixture = [Link](UserHomeComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-user-home',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class UserHomeComponent {

// }
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { TicketService, Ticket } from './[Link]';
//import { AuthService } from './[Link]';
import {AuthService} from '../book-ticket/[Link]';
import { User } from './[Link]';
import { UserNavComponent } from '../user-nav/[Link]';
@Component({
selector: 'app-user-home',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
// export class UserHomeComponent implements OnInit {
// tickets: (Ticket & { show?: boolean })[] = [];
// pnrMessage: string | null = null;
// genericMessage: string | null = null;

// constructor(
// private ticketService: TicketService,
// public router: Router,
// private auth: AuthService
// ) {}

// ngOnInit(): void {
// /* guard */
// if (![Link]()) {
// [Link](['/login']);
// return;
// }

// /* flash messages via query params */


// const query = [Link]()?.[Link];
// [Link] = query?.pnr || null;
// [Link] = query?.msg || null;

// [Link]();
// }

// private loadTickets(): void {


// const userId = [Link]().customerId;
// [Link](userId).subscribe({
// next: (data) => ([Link] = data),
// error: () => alert('Could not load tickets'),
// });
// }

// cancel(t: Ticket): void {


// if (!confirm(`Cancel ticket with PNR ${[Link]}?`)) return;

// [Link]([Link]).subscribe({
// next: () => {
// [Link] = [Link]((tk) => [Link] !== [Link]);
// },
// error: () => alert('Cancellation failed'),
// });
// }
export class UserHomeComponent implements OnInit {
tickets: (Ticket & { show?: boolean })[] = [];
pnrMessage: string | null = null;
genericMessage: string | null = null;

constructor(
private ticketService: TicketService,
public router: Router,
private route: ActivatedRoute,
private auth: AuthService
) {}

ngOnInit(): void {
/* ---------- guard ---------- */
const cust: User | null = [Link]();
if (!cust) {
[Link](['/user-login']);
return;
}

/* ---------- flash messages ---------- */


const params = [Link];
[Link] = [Link]('pnr');
[Link] = [Link]('msg');

/* ---------- load data ---------- */


[Link]([Link]);
}

/* load tickets for a specific userId */


private loadTickets(userId: number): void {
[Link](userId).subscribe({
next: (data) => ([Link] = data),
error: () => alert('Could not load tickets'),
});
}

cancel(t: Ticket): void {


if (!confirm(`Cancel ticket with PNR ${[Link]}?`)) return;

[Link]([Link]).subscribe({
next: () => ([Link] = [Link]((tk) => [Link] !== [Link])),
error: () => alert('Cancellation failed'),
});
}
}

//----------------------------------------------------------

//-------------------------------->user-login

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
:host {
display: block;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #c5d9fa;
color: #fdfdfd;
}

body {
min-height: 100vh;
background: #213555;
color: #b0f8f8;
/* background-image: url('./images/[Link]');*/
background-repeat: no-repeat;
background-size: cover;
}

.login-container {
position: relative;
background-color: rgba(255, 255, 255, 0);
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
width: 40%;
max-width: 1200px;
overflow: hidden;
top: 20vh;
left: 10vw;
}

.login-form-container {
background: #f5ebe4;
padding: 2rem;
width: 100%;
}

.login-header {
text-align: center;
margin-bottom: 2rem;
}

.login-header h1 {
color: #3e5879;
font-size: 2rem;
margin-bottom: 0.5rem;
}

.login-form {
display: flex;
flex-direction: column;
gap: 1.5rem;
}

.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
position: relative;
}

.form-group label {
color: #3e5879;
font-weight: 600;
}

.form-group input {
padding: 0.8rem;
border: 2px solid #080707;
border-radius: 5px;
font-size: 1rem;
transition: border-color 0.3s ease;
}

.form-group input:focus {
outline: none;
border-color: #213555;
}

.error-message {
color: #e74c3c;
font-size: 0.9rem;
display: none;
}

.login-button {
background: #337ab7;
color: white;
padding: 1rem;
border: none;
border-radius: 5px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}

.login-button:hover {
background: #3e5879;
}

.additional-options {
margin-top: 1.5rem;
text-align: center;
}

.additional-options a {
color: #213555;
text-decoration: none;
font-size: 0.9rem;
}

.additional-options a:hover {
text-decoration: underline;
}

.image-container {
margin-top: 8%;
width: 50%;
/* background-image: url('path/to/your/[Link]');*/
background-size: cover;
background-position: center;
}

.user-icon,
.eye-icon {
position: absolute;
margin-top: 3%;
right: 10px;
top: 50%;
width: 8%;
transform: translateY(-50%);
cursor: pointer;
}
@media (max-width: 768px) {
.login-container {
flex-direction: column;
}
.image-container {
width: 100%;
height: 200px;
}
.login-form-container {
width: 100%;
}
}

//----------------------------------------------------------

<div class="login-container">
<div class="login-form-container">
<div class="login-header">
<h1>RailMail</h1>
</div>

<!-- Template-driven form (you may swap for Reactive Forms if you prefer) -->
<form
#loginForm="ngForm"
(ngSubmit)="onSubmit(loginForm)"
class="login-form"
novalidate
>
<!-- USERNAME -->
<div class="form-group">
<label for="username">Username</label>
<input
type="text"
id="username"
name="username"
class="form-control"
placeholder="Enter your user name"
maxlength="50"
ngModel
required
/>
<span id="usernameError" class="error-message"></span>
</div>

<!-- PASSWORD -->


<div class="form-group">
<label for="password">Password</label>
<img
src="assets/icons/[Link]"
alt="Eye Icon"
class="eye-icon"
id="eyeIcon"
(click)="togglePasswordVisibility()"
/>
<input
type="password"
id="password"
name="password"
class="form-control"
placeholder="Enter your password"
minlength="6"
maxlength="12"
ngModel
required
/>
<span id="passwordError" class="error-message"></span>
</div>

<button type="submit" class="login-button">Login</button>


</form>

<div class="additional-options">
<br />
<a routerLink="/user-register">Don't have an account? Sign Up</a>
</div>
</div>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserLoginComponent } from './[Link]';

describe('UserLoginComponent', () => {
let component: UserLoginComponent;
let fixture: ComponentFixture<UserLoginComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ UserLoginComponent ]
})
.compileComponents();

fixture = [Link](UserLoginComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-user-login',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class UserLoginComponent {

// }
import { Component, ElementRef, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { NgForm } from '@angular/forms';

@Component({
selector: 'app-user-login',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class UserLoginComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
private el: ElementRef
) {}

/* ---------- Show alert message on page load (mirrors [Link]) ----------


*/
ngOnInit(): void {
const message = [Link]('message');
if (message) {
alert(message);
}
}

/* ---------- Password show / hide ---------- */


togglePasswordVisibility(): void {
const pwdInput = [Link](
'#password'
) as HTMLInputElement | null;
const eyeIcon = [Link](
'#eyeIcon'
) as HTMLImageElement | null;

if (pwdInput && eyeIcon) {


const isMasked = [Link] === 'password';
[Link] = isMasked ? 'text' : 'password';
[Link] = isMasked
? 'assets/icons/[Link]'
: 'assets/icons/[Link]';
}
}

/* ---------- Client-side form validation + submit ---------- */


onSubmit(form: NgForm): void {
// Clear any old error text
[Link]('usernameError');
[Link]('passwordError');

const { username, password } = [Link];


let isValid = true;

/* Username check */
if (!username || ![Link]()) {
[Link]('usernameError', 'Username is required.');
isValid = false;
}

/* Password check */
if (!password) {
[Link]('passwordError', 'Password is required.');
isValid = false;
} else if ([Link] < 6 || [Link] > 12) {
[Link](
'passwordError',
'Password must be between 6 and 12 characters.'
);
isValid = false;
}

if (!isValid) {
return; // stop submit
}

/* → Replace with real login service / API call */


// For demo purposes just redirect to the protected area:
[Link](['/user-home']);
}

private setError(id: string, msg: string): void {


const span = [Link](`#${id}`) as HTMLElement;
if (span) {
[Link] = msg;
[Link] = 'block';
}
}

private clearError(id: string): void {


const span = [Link](`#${id}`) as HTMLElement;
if (span) {
[Link] = '';
[Link] = 'none';
}
}
}

//----------------------------------------------------------

//------------------------------>user-nav

header {
width: 95%;
background: #337ab7;
color: #fff;
padding: 10px 20px;
}

/* FLEX LAYOUT */
nav {
display: flex;
justify-content: space-between;
align-items: center;
}

/* brand */
h1 {
position: relative;
padding-right: 60vh;
margin: 0;
}

/* left logo list */


.nav-left {
list-style: none;
display: flex;
align-items: center;
}

.logo {
width: 50px;
height: auto;
}

/* right links */
.nav-right {
list-style: none;
display: flex;
gap: 15px;
margin: 0;
padding: 0;
}

.nav-right a {
display: flex;
align-items: center;
color: #fff;
text-decoration: none;
padding: 8px 15px;
border-radius: 5px;
transition: background 0.3s, color 0.3s;
}

.nav-right a:hover {
background: #ff8886;
text-shadow: 0 0 8px #4caf50;
}

/* icons */
.logout-icon,
.profile-nav,
.ticket-nav {
width: 20px;
height: auto;
margin-right: 8px;
filter: invert(1) brightness(2);
}
/* ///////// */
header {
background: #337ab7;
color: #fff;
padding: 10px 20px;
}

nav {
display: flex;
align-items: center;
justify-content: space-between;
}

h1 {
margin: 0;
}

.nav-links {
list-style: none;
display: flex;
gap: 20px;
margin: 0;
padding: 0;
}

.nav-links a {
color: #fff;
text-decoration: none;
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 4px;
transition: background 0.3s;
}

.nav-links a:hover,
.nav-links [Link] {
background: #ff8886;
}

.icon {
width: 18px;
filter: invert(1) brightness(2);
}

//----------------------------------------------------------

<header>
<nav>
<!-- left (logo placeholder) -->
<ul class="nav-left">
<!--
<li>
<a routerLink="/">
<img src="assets/icons/[Link]" alt="logo" class="logo" />
</a>
</li>
-->
</ul>
<!-- center brand -->
<h1><b>RailGo</b></h1>

<!-- right links -->


<ul class="nav-right">
<li>
<a routerLink="/user-home">
<img src="assets/icons/[Link]" class="ticket-nav" alt="" />
Bookings
</a>
</li>
<li>
<a routerLink="/user-profile">
<img src="assets/icons/[Link]" class="profile-nav" alt="" />
Profile
</a>
</li>
<li>
<a (click)="logout()">
<img src="assets/icons/[Link]" class="logout-icon" alt="" />
Logout
</a>
</li>
</ul>
</nav>
</header>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserNavComponent } from './[Link]';

describe('UserNavComponent', () => {
let component: UserNavComponent;
let fixture: ComponentFixture<UserNavComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ UserNavComponent ]
})
.compileComponents();

fixture = [Link](UserNavComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';


// @Component({
// selector: 'app-user-nav',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class UserNavComponent {

// }
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '../user-home/[Link]';

@Component({
selector: 'app-user-nav',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class UserNavComponent {
constructor(private auth: AuthService, private router: Router) {}

logout(): void {
[Link](); // clear tokens / session
[Link](['/user-login']); // redirect to login screen
}
}

//----------------------------------------------------------

//---------------------------------->user-profile

import { Injectable } from "@angular/core";

/* Extend the earlier AuthService with customer info */


export interface User {
email?: string | null | undefined;
phone?: string | null | undefined;
address?: string | null | undefined;
aadhar?: string | null | undefined;
customerId: number;
name: string;
username: string;
}

@Injectable({ providedIn: 'root' })


export class AuthService {
currentUser(): User {
throw new Error('Method not implemented.');
}
logout(): void {
throw new Error('Method not implemented.');
}
private customer: User | null = {
customerId: 1,
name: 'Demo User',
username: 'demo',
};
currentCustomer(): User | null {
return [Link];
}
}

//----------------------------------------------------------

:host {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: Arial, sans-serif;
background: linear-gradient(120deg, #f7d5d5, #b8fcf8);
overflow-x: hidden;
}

/* card */
.form-container {
width: 70vw;
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 15px rgb(0 0 0 / 0.1);
padding: 40px;
position: relative;
overflow-y: hidden;
}

/* inputs & labels */


.form-group {
margin-bottom: 25px;
display: flex;
flex-direction: column;
}

label {
font-weight: bold;
margin-bottom: 6px;
}

input {
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
transition: border 0.3s;
}

input:focus {
border-color: #004b87;
box-shadow: 0 0 8px rgb(0 75 135 / 0.2);
}

/* errors */
.error-message {
color: red;
font-size: 0.9rem;
margin-top: 5px;
}
/* buttons */
.button-container {
display: flex;
justify-content: space-between;
margin-top: 25px;
}

.back-button,
.submit-button,
.deactivate-button {
padding: 12px 25px;
font-weight: bold;
border: none;
border-radius: 6px;
cursor: pointer;
width: 48%;
transition: background 0.3s;
}

.back-button {
background: #d9534f;
color: #fff;
}

.back-button:hover {
background: #c9302c;
}

.submit-button {
background: #213555;
color: #fff;
}

.submit-button:hover {
background: #003c72;
}

.deactivate-button {
margin-top: 20px;
background: #d9534f;
color: #fff;
width: 100%;
}

.deactivate-button:hover {
background: #c9302c;
}

/* alerts */
.alert {
padding: 15px;
margin-bottom: 20px;
border-radius: 6px;
animation: fade 0.5s;
}

.alert-success {
background: #d4edda;
color: #155724;
}

.alert-danger {
background: #f8d7da;
color: #721c24;
}

@keyframes fade {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}

//----------------------------------------------------------

<div class="form-container">
<!-- Re-use the nav bar component -->
<app-user-nav></app-user-nav>

<h2>User Profile</h2>

<!-- Success / error flash messages from query-params -->


<div *ngIf="msg" class="alert" [ngClass]="msgClass">
{{ msg }}
</div>

<!-- Profile form -->


<form [formGroup]="profileForm" (ngSubmit)="submit()">
<div class="form-group">
<label>Username</label>
<input formControlName="username" />
<div class="error-message" *ngIf="[Link] &&
[Link]">
{{ usernameError }}
</div>
</div>

<div class="form-group">
<label>Email</label>
<input formControlName="email" type="email" />
<div class="error-message" *ngIf="[Link] && [Link]">
{{ emailError }}
</div>
</div>

<div class="form-group">
<label>Phone</label>
<input formControlName="phone" />
<div class="error-message" *ngIf="[Link] && [Link]">
{{ phoneError }}
</div>
</div>

<div class="form-group">
<label>Address</label>
<input formControlName="address" />
<div class="error-message" *ngIf="[Link] &&
[Link]">
Address must be 10-100 valid characters.
</div>
</div>

<div class="form-group">
<label>Aadhar</label>
<input formControlName="aadhar" />
<div class="error-message" *ngIf="[Link] && [Link]">
Aadhar must be exactly 12 digits.
</div>
</div>

<div class="form-group">
<label>Current Password</label>
<input formControlName="oldPassword" type="password" />
<div class="error-message" *ngIf="[Link] &&
[Link]">
Password is required.
</div>
</div>

<!-- buttons -->


<div class="button-container">
<button
type="button"
class="back-button"
(click)="[Link](['/user-home'])"
>
Back
</button>
<button type="submit" class="submit-button"
[disabled]="[Link]">
Update Profile
</button>
</div>
</form>

<!-- Deactivate account -->


<button class="deactivate-button" (click)="deactivate()">
Deactivate Account
</button>
</div>

//----------------------------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserProfileComponent } from './[Link]';

describe('UserProfileComponent', () => {
let component: UserProfileComponent;
let fixture: ComponentFixture<UserProfileComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ UserProfileComponent ]
})
.compileComponents();
fixture = [Link](UserProfileComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});

//----------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-user-profile',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class UserProfileComponent {

// }
import { Component, OnInit } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { AuthService, User } from './[Link]';
import { UserProfileService } from './[Link]';
import { ReactiveFormsModule } from '@angular/forms';

@Component({
selector: 'app-user-profile',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class UserProfileComponent implements OnInit {
customer?: User;
msg: string | null = null;
msgClass = 'alert-success';

/* regex patterns */
private nameRx = /^[a-zA-Z]{5,}$/;
private emailRx = /^[a-zA-Z0-9._%+-]+@(gmail\.com|hotmail\.com)$/;
private phoneRx = /^[6-9]\d{9}$/;
private noFiveConsecutive = /(.)\1{4,}/;
private aadharRx = /^\d{12}$/;
private addressRx = /^[\w\s,.\-]{10,100}$/;

profileForm = [Link]({
username: ['', [[Link], [Link]([Link])]],
email: ['', [[Link], [Link]([Link])]],
phone: [
'',
[
[Link],
[Link]([Link]),
(c: { value: any; }) =>
[Link]([Link] || '')
? { consecutive: true }
: null,
],
],
address: ['', [[Link], [Link]([Link])]],
aadhar: ['', [[Link], [Link]([Link])]],
oldPassword: ['', [Link]],
});

constructor(
private fb: FormBuilder,
private auth: AuthService,
public router: Router,
private route: ActivatedRoute,
private service: UserProfileService
) {}

ngOnInit(): void {
[Link] = [Link]();
if (![Link]) {
[Link](['/user-login']);
return;
}

/* pre-fill */
[Link]({
username: [Link],
email: [Link],
phone: [Link],
address: [Link],
aadhar: [Link],
});

/* query-param flash message */


[Link] = [Link]('msg');
if ([Link]?.toLowerCase().includes('error')) [Link] = 'alert-danger';
}

get fc() {
return [Link];
}

/* readable messages */
get usernameError(): string {
if ([Link]('required')) return 'Username is required.';
return 'Username must be ≥5 letters (only a-z).';
}
get emailError(): string {
return 'Email must end with [Link] or [Link].';
}
get phoneError(): string {
if ([Link]('consecutive'))
return 'Cannot contain >4 identical consecutive digits.';
return 'Phone must be 10 digits starting 6-9.';
}

submit(): void {
if ([Link]) {
[Link] = 'Please correct highlighted errors.';
[Link] = 'alert-danger';
return;
}

const payload = { ...[Link], id: [Link]?.customerId };

[Link](payload).subscribe({
next: () => {
[Link] = 'Profile updated successfully!';
[Link] = 'alert-success';
},
error: () => {
[Link] = 'Update failed.';
[Link] = 'alert-danger';
},
});
}

deactivate(): void {
if (!confirm('Deactivate account? All bookings will be lost.')) return;

[Link]([Link]!.customerId).subscribe({
next: () => [Link](),
error: () => alert('Deactivation failed'),
});
}
}

//------------------------------------------------------------

import { Injectable } from '@angular/core';


import { Observable, of } from 'rxjs';

@Injectable({ providedIn: 'root' })


export class UserProfileService {
updateProfile(payload: any): Observable<void> {
// return [Link]<void>('/api/user/update', payload);
[Link]('update', payload);
return of(void 0);
}

deactivate(id: number): Observable<void> {


// return [Link]<void>('/api/user/deactivate', { id });
[Link]('deactivate', id);
return of(void 0);
}
}

//------------------------------------------------------------

//------------------------------------->user-register

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* PAGE BACKGROUND (scoped) */


:host {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #c5d9fa;
color: #fdfdfd;
}

/* CARD */
.register-container {
display: flex;
width: 50%;
max-width: 1200px;
background: #fff;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 0 20px rgb(0 0 0 / 0.1);
}

.register-form-container {
width: 100%;
padding: 2rem;
background: #c9fafa;
}

/* HEADER */
.register-header {
text-align: center;
margin-bottom: 2rem;
}

.register-header h2 {
font-size: 2rem;
color: #3e5879;
}

/* FORM GRID */
.register-form {
display: grid;
gap: 1.5rem;
}

.form-row {
display: flex;
justify-content: space-between;
gap: 1rem;
}

.form-group {
flex: 1;
display: flex;
flex-direction: column;
}

label {
margin-bottom: 0.5rem;
font-weight: bold;
color: #3e5879;
}

input,
textarea {
padding: 0.8rem;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}

textarea {
resize: none;
}

.error-message {
margin-top: 5px;
font-size: 0.9rem;
color: #e74c3c;
}

/* BUTTON */
.btn-register {
width: 100%;
padding: 0.8rem;
border: none;
border-radius: 5px;
background: #213555;
color: #fff;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}

.btn-register:hover {
background: #3e5879;
}

/* LINKS */
.text-center p {
color: #2c3e50;
}

.text-center a {
color: #2980b9;
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease;
}

.text-center a:hover {
color: #3498db;
}

/* MOBILE */
@media (max-width: 768px) {
.register-container {
width: 90%;
}
}

//-------------------------------------

<div class="register-container">
<div class="register-form-container">
<div class="register-header">
<h2>USER REGISTRATION</h2>
</div>

<form
#registerForm="ngForm"
(ngSubmit)="onSubmit(registerForm)"
novalidate
class="register-form"
>
<input type="hidden" name="action" value="register" />

<!-- ───── Row 1 ───── -->


<div class="form-row">
<div class="form-group">
<label for="userName">User Name</label>
<input
id="userName"
name="userName"
maxlength="50"
required
ngModel
/>
<div id="userNameError" class="error-message"></div>
</div>

<div class="form-group">
<label for="email">Email</label>
<input
id="email"
name="email"
type="email"
maxlength="100"
required
ngModel
/>
<div id="emailError" class="error-message"></div>
</div>
</div>

<!-- ───── Row 2 ───── -->


<div class="form-row">
<div class="form-group">
<label for="password">Password</label>
<input
id="password"
name="password"
type="password"
minlength="6"
maxlength="12"
required
ngModel
/>
<div id="passwordError" class="error-message"></div>
</div>

<div class="form-group">
<label for="confirmPassword">Confirm Password</label>
<input
id="confirmPassword"
name="confirmPassword"
type="password"
minlength="6"
maxlength="12"
required
ngModel
/>
<div id="confirmPasswordError" class="error-message"></div>
</div>
</div>

<!-- ───── Row 3 ───── -->


<div class="form-row">
<div class="form-group">
<label for="contactNumber">Contact Number</label>
<input
id="contactNumber"
name="contactNumber"
maxlength="10"
required
ngModel
/>
<div id="contactNumberError" class="error-message"></div>
</div>

<div class="form-group">
<label for="aadharNumber">Aadhar Number</label>
<input
id="aadharNumber"
name="aadharNumber"
maxlength="12"
required
ngModel
/>
<div id="aadharNumberError" class="error-message"></div>
</div>
</div>

<!-- ───── Address ───── -->


<div class="form-group">
<label for="address">Address</label>
<textarea
id="address"
name="address"
maxlength="100"
rows="3"
required
ngModel
></textarea>
<div id="addressError" class="error-message"></div>
</div>

<button type="submit" class="btn-register">Register</button>


</form>

<!-- Links -->


<div class="text-center mt-3">
<p>
Already have an account?
<a routerLink="/user-login">Login as User here</a>.
</p>
<p>
Are you an Admin?
<a routerLink="/admin-login">Login as Admin</a>.
</p>
</div>
</div>

<!-- OPTIONAL image pane (commented out like original) -->


<!--
<div class="image-container">
<h1>RailGo</h1>
<img src="assets/images/[Link]" alt="ticket" />
</div>
-->
</div>

//-------------------------------------

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { UserRegisterComponent } from './[Link]';

describe('UserRegisterComponent', () => {
let component: UserRegisterComponent;
let fixture: ComponentFixture<UserRegisterComponent>;

beforeEach(async () => {
await [Link]({
declarations: [ UserRegisterComponent ]
})
.compileComponents();

fixture = [Link](UserRegisterComponent);
component = [Link];
[Link]();
});

it('should create', () => {


expect(component).toBeTruthy();
});
});
//------------------------------------------------------------

// import { Component } from '@angular/core';

// @Component({
// selector: 'app-user-register',
// templateUrl: './[Link]',
// styleUrls: ['./[Link]']
// })
// export class UserRegisterComponent {

// }
import { Component, ElementRef } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';

@Component({
selector: 'app-user-register',
templateUrl: './[Link]',
styleUrls: ['./[Link]'],
})
export class UserRegisterComponent {
constructor(private el: ElementRef, private router: Router) {}

onSubmit(form: NgForm): void {


/* Clear previous errors */
[Link]();

const {
userName,
email,
password,
confirmPassword,
contactNumber,
aadharNumber,
address,
} = [Link];

let isValid = true;

/* USERNAME: ≥5 letters, letters only */


const usernameRegex = /^[a-zA-Z]+$/;
if (!userName || [Link] < 5) {
[Link]('userNameError', 'Username must contain at least 5 letters.');
isValid = false;
} else if (![Link](userName)) {
[Link]('userNameError', 'Username must contain only letters.');
isValid = false;
}

/* EMAIL: [Link] or [Link] */


const emailRegex = /^[a-zA-Z0-9._%+-]+@(gmail\.com|hotmail\.com)$/;
if (![Link](email || '')) {
[Link](
'emailError',
"Email must end with '[Link]' or '[Link]'."
);
isValid = false;
}
/* PASSWORD complexity */
const minlen = /.{8,}/;
const specialchar = /[!@#$%^&*(),.?":{}|<>]/;
const num = /\d/;
const uppercase = /[A-Z]/;
const lowercase = /[a-z]/;
if (![Link](password || '')) {
[Link]('passwordError', 'Password must be at least 8 characters.');
isValid = false;
} else if (![Link](password)) {
[Link](
'passwordError',
'Password must include at least 1 special character.'
);
isValid = false;
} else if (![Link](password)) {
[Link]('passwordError', 'Password must include at least 1 number.');
isValid = false;
} else if (![Link](password)) {
[Link](
'passwordError',
'Password must include at least 1 uppercase letter.'
);
isValid = false;
} else if (![Link](password)) {
[Link](
'passwordError',
'Password must include at least 1 lowercase letter.'
);
isValid = false;
}

/* CONFIRM PASSWORD */
if (password !== confirmPassword) {
[Link]('confirmPasswordError', 'Passwords do not match.');
isValid = false;
}

/* PHONE NUMBER: starts 6-9, 10 digits, no >4 identical */


const phoneRegex = /^[6-9]\d{9}$/;
const consecutiveRegex = /(\d)\1{4,}/;
if (![Link](contactNumber || '')) {
[Link](
'contactNumberError',
'Phone number must be 10 digits and start with 6-9.'
);
isValid = false;
} else if ([Link](contactNumber)) {
[Link](
'contactNumberError',
'Phone number cannot contain more than 4 identical consecutive digits.'
);
isValid = false;
}

/* AADHAR: exactly 12 digits */


const aadharRegex = /^\d{12}$/;
if (![Link](aadharNumber || '')) {
[Link](
'aadharNumberError',
'Aadhar number must be exactly 12 digits.'
);
isValid = false;
}

/* ADDRESS: 10–100 chars, allowed chars */


const addressRegex = /^[a-zA-Z0-9\s,.\-]+$/;
if (!address || [Link] < 10 || [Link] > 100) {
[Link](
'addressError',
'Address must be between 10 and 100 characters.'
);
isValid = false;
} else if (![Link](address)) {
[Link](
'addressError',
'Address can contain letters, numbers, commas, periods, spaces, and hyphens
only.'
);
isValid = false;
}

/* FINAL */
if (!isValid) return;

// Success placeholder
alert('Registration Successful!');
/* Navigate or call API here */
[Link](['/user-login']);
}

/* ---------- Helpers ---------- */


private setError(id: string, msg: string): void {
const el = [Link](`#${id}`) as HTMLElement;
if (el) [Link] = msg;
}

private clearErrors(): void {


[Link]
.querySelectorAll('.error-message')
.forEach((e: HTMLElement) => ([Link] = ''));
}
}

//------------------------------------------------------------

//---------------------------->app-component

import { NgModule } from '@angular/core';


import { RouterModule, Routes } from '@angular/router';
import { AddStationComponent } from './pages/add-station/[Link]';
import { AddTrainComponent } from './pages/add-train/[Link]';
import { AdminDashboardComponent } from './pages/admin-dashboard/admin-
[Link]';
import { AdminLoginComponent } from './pages/admin-login/[Link]';
import { AdminNavComponent } from './pages/admin-nav/[Link]';
import { AdminProfileComponent } from './pages/admin-profile/admin-
[Link]';
import { AdminRegisterComponent } from './pages/admin-register/admin-
[Link]';
import { BookTicketComponent } from './pages/book-ticket/[Link]';
import { ErrorPageComponent } from './pages/error-page/[Link]';
import { IndexPageComponent } from './pages/index-page/[Link]';
import { LandingComponent } from './pages/landing/[Link]';
import { SearchTrainComponent } from './pages/search-train/[Link]';
import { UserHomeComponent } from './pages/user-home/[Link]';
import { UserLoginComponent } from './pages/user-login/[Link]';
import { UserNavComponent } from './pages/user-nav/[Link]';
import { UserProfileComponent } from './pages/user-profile/[Link]';
import { UserRegisterComponent } from './pages/user-register/user-
[Link]';

const routes: Routes = [


{path: '', redirectTo: 'landing', pathMatch: 'full'},
{path: 'landing', component: LandingComponent},
{path: 'user-login', component: UserLoginComponent},
{path: 'user-register', component: UserRegisterComponent},
{path: 'admin-login', component: AdminLoginComponent},
{path: 'admin-register' , component: AdminRegisterComponent},
{path: 'admin-profile' , component: AdminProfileComponent},
{path: 'admin-dashboard', component: AdminDashboardComponent},
{path: 'admin-nav', component: AdminNavComponent},
{path: 'add-train' , component: AddTrainComponent},
{path: 'add-station' , component: AddStationComponent},
{path: 'book-ticket/:id' , component: BookTicketComponent},
{path: 'error-page' , component: ErrorPageComponent},
{ path: 'index-page' , component: IndexPageComponent},
{path: 'search-train',component:SearchTrainComponent},
{path: 'user-home', component: UserHomeComponent},
{path:'user-nav',component: UserNavComponent},
{path: 'user-profile' , component: UserProfileComponent}
];

@NgModule({
imports: [[Link](routes)],
exports: [RouterModule]
})
export class AppRoutingModule {

//------------------------------------------------------------

<router-outlet />

//------------------------------------------------------------

import { TestBed } from '@angular/core/testing';


import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './[Link]';

describe('AppComponent', () => {
beforeEach(async () => {
await [Link]({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});

it('should create the app', () => {


const fixture = [Link](AppComponent);
const app = [Link];
expect(app).toBeTruthy();
});

it(`should have as title 'TrainManagementSystem'`, () => {


const fixture = [Link](AppComponent);
const app = [Link];
expect([Link]).toEqual('TrainManagementSystem');
});

it('should render title', () => {


const fixture = [Link](AppComponent);
[Link]();
const compiled = [Link] as HTMLElement;
expect([Link]('.content
span')?.textContent).toContain('TrainManagementSystem app is running!');
});
});

//------------------------------------------------------------

import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './[Link]',
styleUrls: ['./[Link]']
})
export class AppComponent {
title = 'TrainManagementSystem';
}

//------------------------------------------------------------

import { NgModule } from '@angular/core';


import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { AppRoutingModule } from './[Link]';
import { AppComponent } from './[Link]';
import { LandingComponent } from './pages/landing/[Link]';
import { UserLoginComponent } from './pages/user-login/[Link]';
import { UserRegisterComponent } from './pages/user-register/user-
[Link]';
import { AdminRegisterComponent } from './pages/admin-register/admin-
[Link]';
import { AdminLoginComponent } from './pages/admin-login/[Link]';
import { AdminProfileComponent } from './pages/admin-profile/admin-
[Link]';
import { AdminDashboardComponent } from './pages/admin-dashboard/admin-
[Link]';
import { AdminNavComponent } from './pages/admin-nav/[Link]';
import { AddTrainComponent } from './pages/add-train/[Link]';
import { AddStationComponent } from './pages/add-station/[Link]';
import { BookTicketComponent } from './pages/book-ticket/[Link]';
import { ErrorPageComponent } from './pages/error-page/[Link]';
import { IndexPageComponent } from './pages/index-page/[Link]';
import { SearchTrainComponent } from './pages/search-train/[Link]';
import { UserHomeComponent } from './pages/user-home/[Link]';
import { UserNavComponent } from './pages/user-nav/[Link]';
import { UserProfileComponent } from './pages/user-profile/[Link]';
@NgModule({
declarations: [
AppComponent,
LandingComponent,
UserLoginComponent,
UserRegisterComponent,
AdminRegisterComponent,
AdminLoginComponent,
AdminProfileComponent,
AdminDashboardComponent,
AdminNavComponent,
AddTrainComponent,
AddStationComponent,
BookTicketComponent,
ErrorPageComponent,
IndexPageComponent,
SearchTrainComponent,
UserHomeComponent,
UserNavComponent,
UserProfileComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule { }

//------------------------------------------------------------
[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 15,
"startColumn": 8,
"endLineNumber": 15,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 16,
"startColumn": 8,
"endLineNumber": 16,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 29,
"startColumn": 3,
"endLineNumber": 29,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 29,
"startColumn": 30,
"endLineNumber": 29,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 36,
"startColumn": 3,
"endLineNumber": 36,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 36,
"startColumn": 19,
"endLineNumber": 36,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 44,
"startColumn": 3,
"endLineNumber": 44,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 44,
"startColumn": 30,
"endLineNumber": 44,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 59,
"startColumn": 3,
"endLineNumber": 59,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 59,
"startColumn": 30,
"endLineNumber": 59,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 70,
"startColumn": 3,
"endLineNumber": 70,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 70,
"startColumn": 30,
"endLineNumber": 70,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 72,
"startColumn": 3,
"endLineNumber": 72,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 72,
"startColumn": 16,
"endLineNumber": 72,
"endColumn": 20
}]

[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 14,
"startColumn": 8,
"endLineNumber": 14,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 15,
"startColumn": 8,
"endLineNumber": 15,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 28,
"startColumn": 3,
"endLineNumber": 28,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 28,
"startColumn": 33,
"endLineNumber": 28,
"endColumn": 48
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 35,
"startColumn": 3,
"endLineNumber": 35,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 35,
"startColumn": 19,
"endLineNumber": 35,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 43,
"startColumn": 3,
"endLineNumber": 43,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 43,
"startColumn": 33,
"endLineNumber": 43,
"endColumn": 48
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 58,
"startColumn": 3,
"endLineNumber": 58,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 58,
"startColumn": 33,
"endLineNumber": 58,
"endColumn": 48
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 69,
"startColumn": 3,
"endLineNumber": 69,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 69,
"startColumn": 33,
"endLineNumber": 69,
"endColumn": 48
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 78,
"startColumn": 3,
"endLineNumber": 78,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "CustomerService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 78,
"startColumn": 33,
"endLineNumber": 78,
"endColumn": 48
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 80,
"startColumn": 3,
"endLineNumber": 80,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 80,
"startColumn": 16,
"endLineNumber": 80,
"endColumn": 20
}]

[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 15,
"startColumn": 8,
"endLineNumber": 15,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 16,
"startColumn": 8,
"endLineNumber": 16,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 27,
"startColumn": 3,
"endLineNumber": 27,
"endColumn": 17
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 27,
"startColumn": 32,
"endLineNumber": 27,
"endColumn": 46
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 33,
"startColumn": 3,
"endLineNumber": 33,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 33,
"startColumn": 19,
"endLineNumber": 33,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 41,
"startColumn": 3,
"endLineNumber": 41,
"endColumn": 17
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 41,
"startColumn": 32,
"endLineNumber": 41,
"endColumn": 46
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 43,
"startColumn": 3,
"endLineNumber": 43,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 43,
"startColumn": 16,
"endLineNumber": 43,
"endColumn": 20
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 52,
"startColumn": 3,
"endLineNumber": 52,
"endColumn": 17
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "StationService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 52,
"startColumn": 32,
"endLineNumber": 52,
"endColumn": 46
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 58,
"startColumn": 3,
"endLineNumber": 58,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 58,
"startColumn": 19,
"endLineNumber": 58,
"endColumn": 23
}]

[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 18,
"startColumn": 8,
"endLineNumber": 18,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 19,
"startColumn": 8,
"endLineNumber": 19,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 20,
"startColumn": 8,
"endLineNumber": 20,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 21,
"startColumn": 8,
"endLineNumber": 21,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 26,
"startColumn": 3,
"endLineNumber": 26,
"endColumn": 16
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 26,
"startColumn": 31,
"endLineNumber": 26,
"endColumn": 44
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 32,
"startColumn": 3,
"endLineNumber": 32,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 32,
"startColumn": 19,
"endLineNumber": 32,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 39,
"startColumn": 3,
"endLineNumber": 39,
"endColumn": 16
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 39,
"startColumn": 29,
"endLineNumber": 39,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 55,
"startColumn": 3,
"endLineNumber": 55,
"endColumn": 16
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 55,
"startColumn": 31,
"endLineNumber": 55,
"endColumn": 44
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 57,
"startColumn": 3,
"endLineNumber": 57,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 57,
"startColumn": 16,
"endLineNumber": 57,
"endColumn": 20
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 65,
"startColumn": 3,
"endLineNumber": 65,
"endColumn": 16
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 65,
"startColumn": 31,
"endLineNumber": 65,
"endColumn": 44
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 67,
"startColumn": 3,
"endLineNumber": 67,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 67,
"startColumn": 16,
"endLineNumber": 67,
"endColumn": 20
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 74,
"startColumn": 3,
"endLineNumber": 74,
"endColumn": 16
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TicketService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 74,
"startColumn": 31,
"endLineNumber": 74,
"endColumn": 44
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 87,
"startColumn": 3,
"endLineNumber": 87,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "AdminService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 87,
"startColumn": 30,
"endLineNumber": 87,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 89,
"startColumn": 3,
"endLineNumber": 89,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 89,
"startColumn": 16,
"endLineNumber": 89,
"endColumn": 20
}]

[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 15,
"startColumn": 8,
"endLineNumber": 15,
"endColumn": 35
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435846",
"severity": 8,
"message": "The import [Link] cannot be resolved",
"source": "Java",
"startLineNumber": 16,
"startColumn": 8,
"endLineNumber": 16,
"endColumn": 18
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 28,
"startColumn": 3,
"endLineNumber": 28,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 28,
"startColumn": 30,
"endLineNumber": 28,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 38,
"startColumn": 3,
"endLineNumber": 38,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 38,
"startColumn": 19,
"endLineNumber": 38,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 46,
"startColumn": 3,
"endLineNumber": 46,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 46,
"startColumn": 30,
"endLineNumber": 46,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 57,
"startColumn": 3,
"endLineNumber": 57,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 57,
"startColumn": 30,
"endLineNumber": 57,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 59,
"startColumn": 3,
"endLineNumber": 59,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 59,
"startColumn": 16,
"endLineNumber": 59,
"endColumn": 20
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 68,
"startColumn": 3,
"endLineNumber": 68,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 68,
"startColumn": 30,
"endLineNumber": 68,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 70,
"startColumn": 3,
"endLineNumber": 70,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 70,
"startColumn": 16,
"endLineNumber": 70,
"endColumn": 20
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 78,
"startColumn": 3,
"endLineNumber": 78,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 78,
"startColumn": 30,
"endLineNumber": 78,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 84,
"startColumn": 3,
"endLineNumber": 84,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 84,
"startColumn": 19,
"endLineNumber": 84,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 91,
"startColumn": 3,
"endLineNumber": 91,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 91,
"startColumn": 28,
"endLineNumber": 91,
"endColumn": 40
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 105,
"startColumn": 3,
"endLineNumber": 105,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 105,
"startColumn": 30,
"endLineNumber": 105,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 114,
"startColumn": 3,
"endLineNumber": 114,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 114,
"startColumn": 19,
"endLineNumber": 114,
"endColumn": 23
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 121,
"startColumn": 3,
"endLineNumber": 121,
"endColumn": 15
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "TrainService cannot be resolved to a type",
"source": "Java",
"startLineNumber": 121,
"startColumn": 30,
"endLineNumber": 121,
"endColumn": 42
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 130,
"startColumn": 3,
"endLineNumber": 130,
"endColumn": 7
},{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/controller/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "16777218",
"severity": 8,
"message": "Gson cannot be resolved to a type",
"source": "Java",
"startLineNumber": 130,
"startColumn": 19,
"endLineNumber": 130,
"endColumn": 23
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/add-station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"startLineNumber": 17,
"startColumn": 18,
"endLineNumber": 17,
"endColumn": 18
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/add-station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"startLineNumber": 22,
"startColumn": 18,
"endLineNumber": 22,
"endColumn": 18
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/add-station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"startLineNumber": 32,
"startColumn": 18,
"endLineNumber": 32,
"endColumn": 18
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/add-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 15,
"startColumn": 18,
"endLineNumber": 15,
"endColumn": 18
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/admin-dashboard/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 36,
"startColumn": 18,
"endLineNumber": 36,
"endColumn": 18
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/admin-dashboard/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 41,
"startColumn": 18,
"endLineNumber": 41,
"endColumn": 18
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/admin-profile/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'authService' does not exist on type
'AdminProfileComponent'.",
"startLineNumber": 42,
"startColumn": 10,
"endLineNumber": 42,
"endColumn": 10
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/book-ticket/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 27,
"startColumn": 18,
"endLineNumber": 27,
"endColumn": 18
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/book-ticket/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 36,
"startColumn": 17,
"endLineNumber": 36,
"endColumn": 17
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/search-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"startLineNumber": 19,
"startColumn": 17,
"endLineNumber": 19,
"endColumn": 17
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/search-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 36,
"startColumn": 17,
"endLineNumber": 36,
"endColumn": 17
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/search-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 41,
"startColumn": 18,
"endLineNumber": 41,
"endColumn": 18
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/search-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 36,
"startColumn": 17,
"endLineNumber": 36,
"endColumn": 17
},{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/search-train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"startLineNumber": 41,
"startColumn": 18,
"endLineNumber": 41,
"endColumn": 18
}]
[{
"resource": "/c:/SpringProject/TrainManagementSystem/Error:
src/app/pages/user-home/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TicketService'.",
"startLineNumber": 34,
"startColumn": 17,
"endLineNumber": 34,
"endColumn": 17
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/add-
station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"source": "ts",
"startLineNumber": 17,
"startColumn": 18,
"endLineNumber": 17,
"endColumn": 22
},{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/add-
station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"source": "ts",
"startLineNumber": 22,
"startColumn": 18,
"endLineNumber": 22,
"endColumn": 22
},{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/add-
station/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"source": "ts",
"startLineNumber": 32,
"startColumn": 18,
"endLineNumber": 32,
"endColumn": 22
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/add-
train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"source": "ts",
"startLineNumber": 17,
"startColumn": 18,
"endLineNumber": 17,
"endColumn": 22
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/add-
train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 15,
"startColumn": 18,
"endLineNumber": 15,
"endColumn": 22
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/admin-
dashboard/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 36,
"startColumn": 18,
"endLineNumber": 36,
"endColumn": 22
},{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/admin-
dashboard/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 41,
"startColumn": 18,
"endLineNumber": 41,
"endColumn": 22
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/admin-
profile/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'authService' does not exist on type
'AdminProfileComponent'.",
"source": "ts",
"startLineNumber": 42,
"startColumn": 10,
"endLineNumber": 42,
"endColumn": 21
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/book-
ticket/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 27,
"startColumn": 18,
"endLineNumber": 27,
"endColumn": 22
},{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/book-
ticket/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 36,
"startColumn": 17,
"endLineNumber": 36,
"endColumn": 21
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/search-
train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'StationService'.",
"source": "ts",
"startLineNumber": 19,
"startColumn": 17,
"endLineNumber": 19,
"endColumn": 21
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/search-
train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 36,
"startColumn": 17,
"endLineNumber": 36,
"endColumn": 21
},{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/search-
train/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TrainService'.",
"source": "ts",
"startLineNumber": 41,
"startColumn": 18,
"endLineNumber": 41,
"endColumn": 22
}]

[{
"resource": "/c:/SpringProject/TrainManagementSystem/src/app/pages/user-
home/[Link]",
"owner": "typescript",
"code": "2339",
"severity": 8,
"message": "Property 'http' does not exist on type 'TicketService'.",
"source": "ts",
"startLineNumber": 34,
"startColumn": 17,
"endLineNumber": 34,
"endColumn": 21
}]

[{
"resource":
"/C:/SpringProject/TrainManagementSystem/backend/TrainManagementSystem/src/main/
java/com/CustomerService/bean/[Link]",
"owner": "_generated_diagnostic_collection_name_#7",
"code": "268435844",
"severity": 4,
"message": "The import [Link] is never used",
"source": "Java",
"startLineNumber": 5,
"startColumn": 8,
"endLineNumber": 5,
"endColumn": 17,
"tags": [
1
]
}]

You might also like