Showing preview only (739K chars total). Download the full file or copy to clipboard to get everything.
Repository: mwinteringham/restful-booker-platform
Branch: trunk
Commit: 8f8b207faa99
Files: 332
Total size: 30.1 MB
Directory structure:
gitextract_ivlqm7kd/
├── .github/
│ └── workflows/
│ ├── assets-build.yml
│ ├── auth-build.yml
│ ├── booking-build.yml
│ ├── branding-build.yml
│ ├── e2e-tests.yml
│ ├── message-build.yml
│ ├── report-build.yml
│ └── room-build.yml
├── .gitignore
├── .utilities/
│ ├── mocking/
│ │ ├── README.md
│ │ ├── mappings/
│ │ │ ├── branding.json
│ │ │ ├── count.json
│ │ │ ├── message.json
│ │ │ ├── messages.json
│ │ │ ├── report.json
│ │ │ └── validate.json
│ │ └── wiremock-standalone.jar
│ ├── monitor/
│ │ ├── apimonitor.js
│ │ ├── local_monitor.js
│ │ └── prod_monitor.js
│ └── wirebridge/
│ ├── Dockerfile
│ ├── README.md
│ ├── Wirebridge-0.0.3.jar
│ └── mappings/
│ ├── add_booking.json
│ ├── add_room.json
│ ├── config.json
│ └── query_booking.json
├── LICENSE
├── README.md
├── assets/
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── next.config.js
│ ├── package.json
│ ├── pom.xml
│ ├── src/
│ │ ├── __tests__/
│ │ │ ├── Branding.test.tsx
│ │ │ ├── Footer.test.tsx
│ │ │ ├── HomeNav.test.tsx
│ │ │ ├── HotelContact.test.tsx
│ │ │ ├── HotelLogo.test.tsx
│ │ │ ├── HotelMap.test.tsx
│ │ │ ├── HotelRoomInfo.test.tsx
│ │ │ ├── Message.test.tsx
│ │ │ ├── MessageList.test.tsx
│ │ │ ├── Nav.test.tsx
│ │ │ ├── Notification.test.tsx
│ │ │ ├── Report.test.tsx
│ │ │ ├── RoomDetails.test.tsx
│ │ │ ├── __snapshots__/
│ │ │ │ ├── Branding.test.tsx.snap
│ │ │ │ ├── Message.test.tsx.snap
│ │ │ │ ├── MessageList.test.tsx.snap
│ │ │ │ ├── Nav.test.tsx.snap
│ │ │ │ ├── Notification.test.tsx.snap
│ │ │ │ └── RoomDetails.test.tsx.snap
│ │ │ ├── examples/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── contract-test.tsx.snap
│ │ │ │ ├── contract-test.tsx
│ │ │ │ ├── contract.json
│ │ │ │ ├── home-page-test.tsx
│ │ │ │ └── task-analysis-test.tsx
│ │ │ └── jest.setup.ts
│ │ ├── app/
│ │ │ ├── admin/
│ │ │ │ ├── branding/
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── message/
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── page.tsx
│ │ │ │ ├── report/
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── room/
│ │ │ │ │ └── [id]/
│ │ │ │ │ └── page.tsx
│ │ │ │ └── rooms/
│ │ │ │ └── page.tsx
│ │ │ ├── api/
│ │ │ │ ├── auth/
│ │ │ │ │ ├── login/
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ ├── logout/
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ └── validate/
│ │ │ │ │ └── route.ts
│ │ │ │ ├── booking/
│ │ │ │ │ ├── [id]/
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ ├── route.ts
│ │ │ │ │ └── summary/
│ │ │ │ │ └── route.ts
│ │ │ │ ├── branding/
│ │ │ │ │ └── route.ts
│ │ │ │ ├── message/
│ │ │ │ │ ├── [id]/
│ │ │ │ │ │ ├── read/
│ │ │ │ │ │ │ └── route.ts
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ ├── count/
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ └── route.ts
│ │ │ │ ├── report/
│ │ │ │ │ ├── room/
│ │ │ │ │ │ └── [roomid]/
│ │ │ │ │ │ └── route.ts
│ │ │ │ │ └── route.ts
│ │ │ │ └── room/
│ │ │ │ ├── [id]/
│ │ │ │ │ └── route.ts
│ │ │ │ └── route.ts
│ │ │ ├── cookie/
│ │ │ │ └── page.tsx
│ │ │ ├── globals.css
│ │ │ ├── layout.tsx
│ │ │ ├── page.tsx
│ │ │ ├── privacy/
│ │ │ │ └── page.tsx
│ │ │ └── reservation/
│ │ │ └── [id]/
│ │ │ └── page.tsx
│ │ ├── components/
│ │ │ ├── Footer.tsx
│ │ │ ├── HomeNav.tsx
│ │ │ ├── admin/
│ │ │ │ ├── AdminBooking.tsx
│ │ │ │ ├── BookingListing.tsx
│ │ │ │ ├── BookingListings.tsx
│ │ │ │ ├── Branding.tsx
│ │ │ │ ├── Loading.tsx
│ │ │ │ ├── Login.tsx
│ │ │ │ ├── Message.tsx
│ │ │ │ ├── MessageList.tsx
│ │ │ │ ├── Nav.tsx
│ │ │ │ ├── Notification.tsx
│ │ │ │ ├── Report.tsx
│ │ │ │ ├── RoomDetails.tsx
│ │ │ │ ├── RoomForm.tsx
│ │ │ │ ├── RoomListing.tsx
│ │ │ │ └── RoomListings.tsx
│ │ │ ├── home/
│ │ │ │ ├── Availability.tsx
│ │ │ │ ├── HotelContact.tsx
│ │ │ │ ├── HotelLogo.tsx
│ │ │ │ ├── HotelMap.tsx
│ │ │ │ └── HotelRoomInfo.tsx
│ │ │ └── reservation/
│ │ │ ├── BookingForm.tsx
│ │ │ ├── Breadcrumb.tsx
│ │ │ ├── RoomDetails.tsx
│ │ │ └── SimilarRooms.tsx
│ │ ├── styles/
│ │ │ └── reservations.css
│ │ ├── types/
│ │ │ ├── availability.d.ts
│ │ │ ├── booking.d.ts
│ │ │ ├── branding.d.ts
│ │ │ ├── react-big-calendar.d.ts
│ │ │ └── room.d.ts
│ │ └── utils/
│ │ ├── fetch-retry.ts
│ │ └── iconUtils.ts
│ ├── tsconfig.json
│ └── tsconfig.test.json
├── auth/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── AuthApplication.java
│ │ │ │ ├── AuthController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── db/
│ │ │ │ └── AuthDB.java
│ │ │ ├── model/
│ │ │ │ ├── Auth.java
│ │ │ │ ├── Decision.java
│ │ │ │ └── Token.java
│ │ │ └── service/
│ │ │ ├── AuthService.java
│ │ │ ├── DatabaseScheduler.java
│ │ │ └── RandomString.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── db.sql
│ │ └── seed.sql
│ └── test/
│ └── java/
│ └── com/
│ └── automationintesting/
│ ├── integration/
│ │ ├── AuthIntegrationTest.java
│ │ └── example/
│ │ └── TaskAnalysisIntegrationTest.java
│ └── unit/
│ ├── db/
│ │ ├── AuthDBTest.java
│ │ └── BaseTest.java
│ ├── example/
│ │ └── TaskAnalysisTest.java
│ └── service/
│ └── AuthServiceTest.java
├── booking/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── BookingApplication.java
│ │ │ │ ├── BookingController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── db/
│ │ │ │ ├── BookingDB.java
│ │ │ │ ├── InsertSql.java
│ │ │ │ └── UpdateSql.java
│ │ │ ├── model/
│ │ │ │ ├── db/
│ │ │ │ │ ├── AvailableRoom.java
│ │ │ │ │ ├── Booking.java
│ │ │ │ │ ├── BookingDates.java
│ │ │ │ │ ├── BookingSummaries.java
│ │ │ │ │ ├── BookingSummary.java
│ │ │ │ │ ├── Bookings.java
│ │ │ │ │ ├── CreatedBooking.java
│ │ │ │ │ ├── Message.java
│ │ │ │ │ └── Token.java
│ │ │ │ └── service/
│ │ │ │ └── BookingResult.java
│ │ │ ├── requests/
│ │ │ │ ├── AuthRequests.java
│ │ │ │ └── MessageRequests.java
│ │ │ └── service/
│ │ │ ├── BookingService.java
│ │ │ ├── DatabaseScheduler.java
│ │ │ ├── DateCheckValidator.java
│ │ │ ├── MessageBuilder.java
│ │ │ └── MethodArgumentNotValidExceptionHandler.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── db.sql
│ │ └── seed.sql
│ └── test/
│ ├── java/
│ │ └── com/
│ │ └── automationintesting/
│ │ ├── integration/
│ │ │ ├── BookingDateConflictIT.java
│ │ │ ├── BookingValidationIT.java
│ │ │ ├── GetBookingIT.java
│ │ │ ├── MessageRequestIT.java
│ │ │ └── examples/
│ │ │ ├── BookingIntegrationIT.java
│ │ │ └── ContractIT.java
│ │ └── unit/
│ │ ├── BaseTest.java
│ │ ├── db/
│ │ │ └── DateConflictTest.java
│ │ ├── examples/
│ │ │ └── SqlTest.java
│ │ ├── model/
│ │ │ └── MessageBuilderTest.java
│ │ └── service/
│ │ ├── BookingServiceTest.java
│ │ └── DateCheckValidatorTest.java
│ └── resources/
│ └── contract.json
├── branding/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── BrandingApplication.java
│ │ │ │ ├── BrandingController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── db/
│ │ │ │ ├── BrandingDB.java
│ │ │ │ ├── InsertSql.java
│ │ │ │ └── UpdateSql.java
│ │ │ ├── model/
│ │ │ │ ├── db/
│ │ │ │ │ ├── Address.java
│ │ │ │ │ ├── Branding.java
│ │ │ │ │ ├── Contact.java
│ │ │ │ │ └── Map.java
│ │ │ │ └── service/
│ │ │ │ ├── BrandingResult.java
│ │ │ │ └── Token.java
│ │ │ ├── requests/
│ │ │ │ └── AuthRequests.java
│ │ │ └── service/
│ │ │ ├── BrandingService.java
│ │ │ ├── DatabaseScheduler.java
│ │ │ └── MethodArgumentNotValidExceptionHandler.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── db/
│ │ │ └── changelog/
│ │ │ └── db.changelog-master.yaml
│ │ ├── db.sql
│ │ └── seed.sql
│ └── test/
│ └── java/
│ └── com/
│ └── automationintesting/
│ ├── integration/
│ │ ├── BrandingServiceIT.java
│ │ ├── BrandingServiceIT.returnsBrandingData.approved.txt
│ │ └── BrandingServiceIT.updateBrandingData.approved.txt
│ └── unit/
│ └── service/
│ └── BrandingServiceTest.java
├── build_locally.cmd
├── build_locally.sh
├── docker-compose.yml
├── end-to-end-tests/
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ └── java/
│ │ ├── driverfactory/
│ │ │ └── DriverFactory.java
│ │ ├── models/
│ │ │ ├── Booking.java
│ │ │ ├── Contact.java
│ │ │ └── Room.java
│ │ └── pageobjects/
│ │ ├── BasePage.java
│ │ ├── BrandingPage.java
│ │ ├── HomePage.java
│ │ ├── LoginPage.java
│ │ ├── MessagePage.java
│ │ ├── NavPage.java
│ │ ├── ReportPage.java
│ │ ├── ReservationPage.java
│ │ ├── RoomListingPage.java
│ │ ├── RoomPage.java
│ │ └── SearchPage.java
│ └── test/
│ └── java/
│ ├── SmokeTest.java
│ └── TestSetup.java
├── message/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── MessageApplication.java
│ │ │ │ ├── MessageController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── db/
│ │ │ │ ├── InsertSql.java
│ │ │ │ └── MessageDB.java
│ │ │ ├── model/
│ │ │ │ ├── db/
│ │ │ │ │ ├── Count.java
│ │ │ │ │ ├── Message.java
│ │ │ │ │ ├── MessageSummary.java
│ │ │ │ │ └── Messages.java
│ │ │ │ ├── requests/
│ │ │ │ │ └── Token.java
│ │ │ │ └── service/
│ │ │ │ └── MessageResult.java
│ │ │ ├── requests/
│ │ │ │ └── AuthRequests.java
│ │ │ └── service/
│ │ │ ├── DatabaseScheduler.java
│ │ │ ├── MessageService.java
│ │ │ └── MethodArgumentNotValidExceptionHandler.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── db.sql
│ │ └── seed.sql
│ └── test/
│ └── java/
│ └── com/
│ └── automationintesting/
│ ├── integration/
│ │ ├── MessageEndpointsIT.createMessage.approved.txt
│ │ ├── MessageEndpointsIT.getCount.approved.txt
│ │ ├── MessageEndpointsIT.getMessage.approved.txt
│ │ ├── MessageEndpointsIT.getMessages.approved.txt
│ │ ├── MessageEndpointsIT.java
│ │ └── MessageEndpointsIT.markAsReadTest.approved.txt
│ └── unit/
│ ├── db/
│ │ ├── BaseTest.java
│ │ ├── MessageDBTest.java
│ │ └── MessageDBTest.testGetMessages.approved.txt
│ └── service/
│ └── MessageServiceTest.java
├── pom.xml
├── report/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── ReportApplication.java
│ │ │ │ ├── ReportController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── model/
│ │ │ │ ├── booking/
│ │ │ │ │ ├── Booking.java
│ │ │ │ │ ├── BookingDates.java
│ │ │ │ │ ├── BookingSummaries.java
│ │ │ │ │ ├── BookingSummary.java
│ │ │ │ │ └── Bookings.java
│ │ │ │ ├── report/
│ │ │ │ │ ├── Entry.java
│ │ │ │ │ └── Report.java
│ │ │ │ └── room/
│ │ │ │ ├── Room.java
│ │ │ │ └── Rooms.java
│ │ │ ├── requests/
│ │ │ │ ├── BookingRequests.java
│ │ │ │ └── RoomRequests.java
│ │ │ └── service/
│ │ │ └── ReportService.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ └── application.properties
│ └── test/
│ └── java/
│ └── com/
│ └── automationintesting/
│ ├── integration/
│ │ ├── BuildReportIT.java
│ │ ├── BuildReportIT.testReportCreation.approved.txt
│ │ └── BuildReportIT.testSpecificRoomReportCreation.approved.txt
│ └── unit/
│ └── service/
│ └── ReportServiceTest.java
├── room/
│ ├── Dockerfile
│ ├── README.md
│ ├── pom.xml
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── automationintesting/
│ │ │ ├── api/
│ │ │ │ ├── RoomApplication.java
│ │ │ │ ├── RoomController.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── db/
│ │ │ │ ├── InsertSql.java
│ │ │ │ ├── RoomDB.java
│ │ │ │ └── UpdateSql.java
│ │ │ ├── model/
│ │ │ │ ├── db/
│ │ │ │ │ ├── Room.java
│ │ │ │ │ └── Rooms.java
│ │ │ │ ├── request/
│ │ │ │ │ ├── Token.java
│ │ │ │ │ └── UnavailableRoom.java
│ │ │ │ └── service/
│ │ │ │ └── RoomResult.java
│ │ │ ├── requests/
│ │ │ │ ├── AuthRequests.java
│ │ │ │ └── BookingRequests.java
│ │ │ └── service/
│ │ │ ├── DatabaseScheduler.java
│ │ │ ├── MethodArgumentNotValidExceptionHandler.java
│ │ │ └── RoomService.java
│ │ └── resources/
│ │ ├── application-dev.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── db.sql
│ │ └── seed.sql
│ └── test/
│ └── java/
│ └── com/
│ └── automationintesting/
│ ├── integration/
│ │ └── RoomValidationIT.java
│ └── unit/
│ ├── examples/
│ │ ├── BaseTest.java
│ │ └── SqlTest.java
│ └── service/
│ └── RoomServiceTest.java
├── run_locally.cmd
└── run_locally.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/assets-build.yml
================================================
name: Assets Build
on:
push:
branches:
- trunk
paths:
- 'assets/**'
tags:
- '*'
pull_request:
paths:
- 'assets/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Node for JS build
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: assets/package-lock.json
# Build JS assets
- name: Install JS Dependencies
working-directory: ./assets
run: npm ci
- name: Test JS Assets
working-directory: ./assets
run: npm test
# Docker steps
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./assets
run: |
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(grep '"version":' package.json | sed 's/.*"version": "\(.*\)",/\1/').$(git rev-parse --short HEAD)
docker build -t mwinteringham/restfulbookerplatform_assets:$TAG .
docker push mwinteringham/restfulbookerplatform_assets:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
================================================
FILE: .github/workflows/auth-build.yml
================================================
name: Auth Service Build
on:
push:
branches:
- trunk
paths:
- 'auth/**'
tags:
- '*'
pull_request:
paths:
- 'auth/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Auth Service
working-directory: ./auth
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./auth
run: |
if [ -f target/restful-booker-platform-auth-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-auth-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_auth:$TAG .
docker push mwinteringham/restfulbookerplatform_auth:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Auth JAR file not found"
exit 1
fi
================================================
FILE: .github/workflows/booking-build.yml
================================================
name: Booking Service Build
on:
push:
branches:
- trunk
paths:
- 'booking/**'
tags:
- '*'
pull_request:
paths:
- 'booking/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Booking Service
working-directory: ./booking
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./booking
run: |
if [ -f target/restful-booker-platform-booking-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-booking-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_booking:$TAG .
docker push mwinteringham/restfulbookerplatform_booking:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Booking JAR file not found"
exit 1
fi
================================================
FILE: .github/workflows/branding-build.yml
================================================
name: Branding Service Build
on:
push:
branches:
- trunk
paths:
- 'branding/**'
tags:
- '*'
pull_request:
paths:
- 'branding/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Branding Service
working-directory: ./branding
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./branding
run: |
if [ -f target/restful-booker-platform-branding-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-branding-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_branding:$TAG .
docker push mwinteringham/restfulbookerplatform_branding:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Branding JAR file not found"
exit 1
fi
================================================
FILE: .github/workflows/e2e-tests.yml
================================================
name: E2E Tests
on:
workflow_run:
workflows:
- "Assets Build"
types:
- completed
branches:
- trunk
jobs:
e2e:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Run E2E Tests on Sauce Labs
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BROWSER: remote
TARGET: production
run: |
cd end-to-end-tests
mvn clean test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: end-to-end-tests/target/surefire-reports
================================================
FILE: .github/workflows/message-build.yml
================================================
name: Message Service Build
on:
push:
branches:
- trunk
paths:
- 'message/**'
tags:
- '*'
pull_request:
paths:
- 'message/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Message Service
working-directory: ./message
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./message
run: |
if [ -f target/restful-booker-platform-message-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-message-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_message:$TAG .
docker push mwinteringham/restfulbookerplatform_message:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Message JAR file not found"
exit 1
fi
================================================
FILE: .github/workflows/report-build.yml
================================================
name: Report Service Build
on:
push:
branches:
- trunk
paths:
- 'report/**'
tags:
- '*'
pull_request:
paths:
- 'report/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Report Service
working-directory: ./report
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./report
run: |
if [ -f target/restful-booker-platform-report-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-report-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_report:$TAG .
docker push mwinteringham/restfulbookerplatform_report:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Report JAR file not found"
exit 1
fi
================================================
FILE: .github/workflows/room-build.yml
================================================
name: Room Service Build
on:
push:
branches:
- trunk
paths:
- 'room/**'
tags:
- '*'
pull_request:
paths:
- 'room/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '26'
distribution: 'temurin'
cache: 'maven'
- name: Build Room Service
working-directory: ./room
run: mvn clean install -Drevision=$(git rev-parse --short HEAD)
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./room
run: |
if [ -f target/restful-booker-platform-room-*-exec.jar ]; then
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(ls target/restful-booker-platform-room-*-exec.jar | cut -d '-' -f 5 | cut -c1-11)
docker build -t mwinteringham/restfulbookerplatform_room:$TAG .
docker push mwinteringham/restfulbookerplatform_room:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV
else
echo "Room JAR file not found"
exit 1
fi
================================================
FILE: .gitignore
================================================
**/node_modules
**/.DS_Store
**/npm-debug.log
*.log
**/node
*.gz
**/*.received*
# IntelliJ
.idea
*.iml
# Java
target/
#VS Code
.project
*.project
.settings/
*.settings/
*.classpath
.vscode/
# ui
ui/public/js
# ApprovalTests
**/.approval_tests_temp/
================================================
FILE: .utilities/mocking/README.md
================================================
# Wiremock
Wiremock is a test double for Web APIs allowing you to create fake HTTP requests and responses that act like a real Web API.
## Using Wiremock
To start up Wiremock, navigate to this folder and run:
```
java -jar wiremock-standalone.jar --port {your port number}
```
This will start up Wiremock assuming nothing else is running on the port number you gave it
## Creating requests and responses
Wiremock-standalone can be programmed in two different ways. The first is creating .json mappings and adding them to the ```mappings folder```. When you start up Wiremock these mapping files will be loaded into Wiremock.
The other option is to programme 'over the wire', which means creating an HTTP request with your mapping details and sending it to Wiremock over HTTP.
To learn more, Wiremock has very well laid out documentation on how to use it (here)[http://wiremock.org/docs]
================================================
FILE: .utilities/mocking/mappings/branding.json
================================================
{
"request": {
"method": "GET",
"url": "/branding/"
},
"response": {
"status": 500,
"headers" : {
"Content-Type": "application/json;charset=UTF-8"
},
"body": "{\"name\":\"Shady Meadows B&B\",\"map\":{\"latitude\":52.6351204,\"longitude\":1.2733774},\"logoUrl\":\"https://www.mwtestconsultancy.co.uk/img/rbp-logo.png\",\"description\":\"Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.\",\"contact\":{\"name\":\"Shady Meadows B&B\",\"address\":\"The Old Farmhouse, Shady Street, Newfordburyshire, NE1 410S\",\"phone\":\"012345678901\",\"email\":\"fake@fakeemail.com\"}}"
}
}
================================================
FILE: .utilities/mocking/mappings/count.json
================================================
{
"request": {
"method": "GET",
"url": "/message/count"
},
"response": {
"status": 200,
"headers" : {
"Content-Type": "application/json;charset=UTF-8"
},
"body": "{\"count\": 10}"
}
}
================================================
FILE: .utilities/mocking/mappings/message.json
================================================
{
"request": {
"method": "GET",
"url": "/message/1"
},
"response": {
"status": 200,
"headers" : {
"Content-Type": "application/json;charset=UTF-8"
},
"body": "{\"name\" : \"Mark Winteringham\",\"email\" : \"mark@mwtestconsultancy.co.uk\",\"phone\" : \"01821 912812\",\"subject\" : \"Subject description here\",\"description\" : \"Lorem ipsum dolores est\"}"
}
}
================================================
FILE: .utilities/mocking/mappings/messages.json
================================================
{
"request": {
"method": "GET",
"url": "/message"
},
"response": {
"status": 200,
"headers" : {
"Content-Type": "application/json;charset=UTF-8"
},
"body": "{\"messages\" : [{\"id\" : 1,\"name\" : \"Mark Winteringham\",\"subject\" : \"Subject description here\"}, {\"id\" : 2, \"name\" : \"James Dean\",\"subject\" : \"Another description here\"}, {\"id\" : 3, \"name\" : \"Janet Samson\",\"subject\" : \"Lorem ipsum dolores est\"}]}"
}
}
================================================
FILE: .utilities/mocking/mappings/report.json
================================================
{
"request": {
"method": "GET",
"url": "/report/"
},
"response": {
"status": 200,
"headers" : {
"Vary": "Origin",
"Vary": "Access-Control-Request-Method",
"Vary": "Access-Control-Request-Headers",
"Access-Control-Allow-Origin": "http://localhost:3003",
"Access-Control-Allow-Credentials": "true",
"Content-Type": "application/json;charset=UTF-8",
"Transfer-Encoding": "chunked"
},
"body": "{\n\t\"report\": [{\n\t\t\"start\": \"2019-04-26\",\n\t\t\"end\": \"2019-04-29\",\n\t\t\"title\": \"James Dean - Room: 101\"\n\t}, {\n\t\t\"start\": \"2019-04-10\",\n\t\t\"end\": \"2019-04-13\",\n\t\t\"title\": \"Mark Winteringham - Room: 102\"\n\t}]\n}"
}
}
================================================
FILE: .utilities/mocking/mappings/validate.json
================================================
{
"request": {
"method": "POST",
"url": "/auth/validate"
},
"response": {
"status": 200,
"headers" : {
"X-Application-Context": "application:3004",
"Access-Control-Allow-Origin": "http://localhost:3003",
"Vary": "Origin",
"Access-Control-Allow-Credentials": "true",
"Content-Length": "0"
}
}
}
================================================
FILE: .utilities/mocking/wiremock-standalone.jar
================================================
[File too large to display: 11.0 MB]
================================================
FILE: .utilities/monitor/apimonitor.js
================================================
const http = require('http');
const https = require('https');
makeHttpRequest = (endpoint) => {
http.get(endpoint, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
if(response.statusCode !== 200){
process.stdout.write('.');
setTimeout(() => {
makeHttpRequest(endpoint);
}, 5000);
} else {
process.stdout.write('\n' + endpoint + ' ready ');
}
});
}).on('error', () => {
process.stdout.write('.')
setTimeout(() => {
makeHttpRequest(endpoint);
}, 5000);
});
}
makeHttpsRequest = (endpoint) => {
https.get(endpoint, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
if(response.statusCode !== 200){
process.stdout.write('.');
setTimeout(() => {
makeHttpsRequest(endpoint);
}, 5000);
} else {
process.stdout.write('\n' + endpoint + ' ready ');
}
});
}).on('error', () => {
process.stdout.write('.')
setTimeout(() => {
makeHttpsRequest(endpoint);
}, 5000);
});
}
exports.checkForLife = (protocol, endpoint) => {
if(protocol === 'https'){
makeHttpsRequest(endpoint);
} else if (protocol === 'http'){
makeHttpRequest(endpoint, (requestResult) => {
if(requestResult !== 200){
setTimeout(() => {
makeHttpRequest(endpoint)
}, 5000);
}
});
} else {
console.log("Protocol not recognised. I can only handle 'http' or 'https'")
}
}
================================================
FILE: .utilities/monitor/local_monitor.js
================================================
const apiMonitor = require('./apimonitor.js');
process.stdout.write("Waiting for RBP to turn on");
apiMonitor.checkForLife('http', 'http://localhost:3000/booking/actuator/health');
apiMonitor.checkForLife('http', 'http://localhost:3001/room/actuator/health');
apiMonitor.checkForLife('http', 'http://localhost:3002/branding/actuator/health');
apiMonitor.checkForLife('http', 'http://localhost:3003/');
apiMonitor.checkForLife('http', 'http://localhost:3004/auth/actuator/health');
apiMonitor.checkForLife('http', 'http://localhost:3005/report/actuator/health');
apiMonitor.checkForLife('http', 'http://localhost:3006/message/actuator/health');
================================================
FILE: .utilities/monitor/prod_monitor.js
================================================
const apiMonitor = require('./apimonitor.js');
process.stdout.write("Waiting for RBP to turn on");
apiMonitor.checkForLife('https', 'https://automationintesting.online/booking/actuator/health');
apiMonitor.checkForLife('https', 'https://automationintesting.online/room/actuator/health');
apiMonitor.checkForLife('https', 'https://automationintesting.online/branding/actuator/health');
apiMonitor.checkForLife('https', 'https://automationintesting.online/');
apiMonitor.checkForLife('https', 'https://automationintesting.online/auth/actuator/health');
apiMonitor.checkForLife('https', 'https://automationintesting.online/report/actuator/health');
apiMonitor.checkForLife('https', 'https://automationintesting.online/message/actuator/health');
================================================
FILE: .utilities/wirebridge/Dockerfile
================================================
FROM maven:3.5.2-jdk-8-alpine
ADD . /usr/local/wirebridge
WORKDIR /usr/local/report
COPY . ./
ENTRYPOINT java -jar Wirebridge-0.0.3.jar -D
================================================
FILE: .utilities/wirebridge/README.md
================================================
# Wirebridge
Wirebridge is a configurable API that helps teams abstract complex data creation tasks behind programmable HTTP requests.
It is currently being used with RBP as means to quickly create bookings and rooms. To find out more on how to create mappings for Wirebridge, check out its README [https://github.com/mwinteringham/wirebridge](https://github.com/mwinteringham/wirebridge)
## Setting up
To run Wirebridge, open up a terminal window and navigate to this folder and run:
```java -jar Wirebridge-0.0.1.jar```
You will see logging to show that Wirebridge is up and running.
## Using Wirebridge
Wirebridge has been configured with two mappings that you can make HTTP requests against to create a single Room or a single Booking per API call.
You can download the HTTP requests as a Postman collection here: [https://www.getpostman.com/collections/5805c3bde8c38353bea9](https://www.getpostman.com/collections/5805c3bde8c38353bea9)
================================================
FILE: .utilities/wirebridge/Wirebridge-0.0.3.jar
================================================
[File too large to display: 18.4 MB]
================================================
FILE: .utilities/wirebridge/mappings/add_booking.json
================================================
{
"request" : {
"method" : "POST",
"path" : "/booking",
"parameters" : ["roomid", "firstname", "lastname", "depositpaid", "checkin", "checkout"]
},
"sql" : {
"database" : "h2-booking",
"query" : "INSERT INTO BOOKINGS(roomid, firstname, lastname, depositpaid, checkin, checkout) VALUES(${roomid}, ${firstname}, ${lastname}, ${depositpaid}, ${checkin}, ${checkout});"
}
}
================================================
FILE: .utilities/wirebridge/mappings/add_room.json
================================================
{
"request" : {
"method" : "POST",
"path" : "/room",
"parameters" : ["room_name", "type", "beds", "accessible", "details"]
},
"sql" : {
"database" : "h2-room",
"query" : "INSERT INTO ROOMS(room_name, type, beds, accessible, details) VALUES(${room_name}, ${type}, ${beds}, ${accessible}, ${details});"
}
}
================================================
FILE: .utilities/wirebridge/mappings/config.json
================================================
{
"databases" : [{
"name" : "h2-booking",
"host" : "booking:9090",
"database" : "mem:rbp",
"username" : "user",
"password" : "password",
"driver" : "jdbc:h2:tcp"
},{
"name" : "h2-room",
"host" : "room:9091",
"database" : "mem:rbp",
"username" : "user",
"password" : "password",
"driver" : "jdbc:h2:tcp"
}]
}
================================================
FILE: .utilities/wirebridge/mappings/query_booking.json
================================================
{
"request" : {
"method" : "POST",
"path" : "/booking/query",
"parameters" : ["roomid", "firstname", "lastname", "depositpaid", "checkin", "checkout"]
},
"sql" : {
"database" : "h2-booking",
"query" : "SELECT * FROM BOOKINGS WHERE roomid = ${roomid} AND firstname = ${firstname} AND lastname = ${lastname} AND depositpaid = ${depositpaid} AND checkin = ${checkin} AND checkout = ${checkout};"
}
}
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
# restful-booker-platform
A platform of web services that forms a Bed and Breakfast booking system. The platforms primary purpose is for training others on how to explore and test web service platforms as well as strategise and implement automation in testing strategies.
## Requirements
RBP is currently known to work with the following requirements:
- JDK 26 or higher (Tested with JDK 26)
- Maven 3.9.14
- Node 24.14.1
- NPM 11.11.0
## Building locally
Assuming you have the above requirements in place, to get started open a terminal/command line window and follow these instructions:
1. Clone/Download the repository
2. Navigate into the restful-booker-platform root folder
3. Run either ```bash build_locally.sh``` for Linux or Mac or ```build_locally.cmd``` on Windows to build RBP and get it running (It may take a while on the first run as it downloads dependencies)
4. Navigate to http://localhost:3003 to access the site
## Running locally
Assuming you have successfully built the application at least once, you can now run the app without having to rebuild the whole application.
### Mac / Linux
1. To run without end-to-end checks run: ```run_locally.sh```
2. To run with end-to-end checks run: ```run_locally.sh -e true```
### Windows
1. To run without end-to-end checks run: ```run_locally.cmd```
2. To run with end-to-end checks run: ```run_locally.cmd true```
### Login
The user login details are:
* Username: admin
* Password: password
## Development
### API details
The details on running checks, building APIs and additional details on documentation for development can be found in READMEs inside each of the API folders.
================================================
FILE: assets/.gitignore
================================================
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
================================================
FILE: assets/Dockerfile
================================================
FROM node:24 AS base
# Install dependencies only when needed
FROM base AS deps
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
RUN npm ci
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Next.js collects anonymous telemetry data about general usage.
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV BOOKING_API=http://rbp-booking:3000
ENV ROOM_API=http://rbp-room:3001
ENV BRANDING_API=http://rbp-branding:3002
ENV AUTH_API=http://rbp-auth:3004
ENV MESSAGE_API=http://rbp-message:3006
ENV REPORT_API=http://rbp-report:3005
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
RUN mkdir -p /app/.next/cache && chown -R nextjs:nodejs /app/.next
USER nextjs
EXPOSE 80
ENV PORT=80
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
================================================
FILE: assets/README.md
================================================
# Restful-booker-assets
The assets API is responsible for serving the UI assets to a browser to give users easy access to the restful-booker-platform.
## Building and running
To run the assets service first run ```npm install``` before running ```npm run dev``` to start up the service in development mode. Please note the UI will fail if dependent APIs aren't running.
## Running checks
Run ```npm test``` to run the unit checks for this service.
================================================
FILE: assets/next.config.js
================================================
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
output: 'standalone',
async rewrites() {
return [
{
source: '/api/room/:path*',
destination: `http://rbp-room:3001/room/:path*`
},
{
source: '/api/branding/:path*',
destination: `http://rbp-branding:3002/branding/:path*`
},
{
source: '/api/auth/:path*',
destination: `http://rbp-auth:3004/auth/:path*`
},
{
source: '/api/report/:path*',
destination: `http://rbp-report:3005/report/:path*`
},
{
source: '/api/message/:path*',
destination: `http://rbp-message:3006/message/:path*`
},
{
source: '/api/booking/:path*',
destination: `http://rbp-booking:3000/booking/:path*`
}
];
}
};
module.exports = nextConfig;
================================================
FILE: assets/package.json
================================================
{
"name": "restful-booker-platform-assets",
"version": "2.2",
"private": true,
"scripts": {
"dev": "next dev -p 3003",
"build": "next build",
"start": "next start -p 3003",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watchAll"
},
"dependencies": {
"fetch-retry": "^6.0.0",
"next": "16.2.2",
"react": "19.2.4",
"react-dom": "19.2.4"
},
"devDependencies": {
"@babel/core": "7.29.0",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-transform-runtime": "7.29.0",
"@babel/preset-env": "7.29.2",
"@babel/preset-react": "7.28.5",
"@emotion/babel-plugin": "11.13.5",
"@emotion/styled": "11.14.1",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/react": "16.3.2",
"@types/jest": "30.0.0",
"@types/node": "25.5.2",
"@types/react": "19.2.14",
"@types/react-big-calendar": "1.16.3",
"@types/react-dom": "19.2.3",
"@types/react-modal": "3.16.3",
"axios": "1.14.0",
"babel-core": "6.26.3",
"babel-jest": "30.3.0",
"babel-loader": "10.1.1",
"babel-plugin-add-react-displayname": "0.0.5",
"babel-plugin-dynamic-import-node": "2.3.3",
"css-loader": "7.1.4",
"debug": "~4.4.3",
"emotion": "11.0.0",
"eslint": "10.2.0",
"eslint-config-next": "16.2.2",
"file-loader": "6.2.0",
"history": "5.3.0",
"html-loader": "5.1.0",
"html-webpack-plugin": "5.6.6",
"identity-obj-proxy": "3.0.0",
"isomorphic-fetch": "3.0.0",
"jest": "30.3.0",
"jest-environment-jsdom": "30.3.0",
"moment": "2.30.1",
"moment-timezone": "0.6.1",
"morgan": "1.10.1",
"nock": "14.0.11",
"node-fetch": "3.3.2",
"node-sass": "9.0.0",
"pigeon-maps": "0.22.1",
"pigeon-marker": "0.3.4",
"query-string": "9.3.1",
"react": "19.2.4",
"react-big-calendar": "1.19.4",
"react-datepicker": "9.1.0",
"react-dom": "19.2.4",
"react-modal": "3.16.3",
"react-router-dom": "7.14.0",
"react-spinners": "0.17.0",
"react-tooltip": "5.30.0",
"reactjs-popup": "2.0.6",
"sass-loader": "16.0.7",
"style-loader": "4.0.0",
"ts-jest": "29.4.9",
"typescript": "6.0.2",
"universal-cookie": "8.1.0",
"url-loader": "4.1.1",
"validate.js": "0.13.1",
"webpack": "5.105.4",
"webpack-cli": "7.0.2",
"webpack-dev-server": "5.2.3"
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>/src/__tests__/jest.setup.ts"
],
"testMatch": [
"**/tests/**/*-test.ts?(x)",
"**/?(*.)(spec|test).ts?(x)"
],
"testEnvironment": "jsdom",
"transform": {
".+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "tsconfig.test.json"
}
]
},
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
}
}
}
================================================
FILE: assets/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.automationintesting</groupId>
<artifactId>restful-booker-platform-assets</artifactId>
<version>2.2.${revision}</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>SNAPSHOT</revision>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<?m2e execute onConfiguration,onIncremental?>
<id>npm install</id>
<goals>
<goal>exec</goal>
</goals>
<phase>initialize</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm run test</id>
<goals>
<goal>exec</goal>
</goals>
<phase>test</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>test</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>exec</goal>
</goals>
<phase>install</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
================================================
FILE: assets/src/__tests__/Branding.test.tsx
================================================
import React from 'react';
import BrandingForm from '../components/admin/Branding';
import ReactModal from 'react-modal';
import { render, fireEvent, waitFor } from '@testing-library/react';
const brandingData = {
name: 'Shady Meadows B&B',
map: {
latitude: 52.6351204,
longitude: 1.2733774
},
directions: 'Take the first left after the big tree, then follow the road until you see the sign.',
logoUrl: 'https://www.mwtestconsultancy.co.uk/img/rbp-logo.png',
description: 'Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.',
contact: {
name: 'Shady Meadows B&B',
phone: '0123456789',
email: 'fake@fakeemail.com'
},
address: {
line1: '123 Fake Street',
line2: 'Fake Town',
postTown: 'Fake Town',
county: 'Fake County',
postCode: 'FA1 2KE'
}
};
describe('Branding Component', () => {
beforeEach(() => {
jest.clearAllMocks();
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(brandingData)
}));
});
test('Branding page renders', async () => {
const { asFragment, findByDisplayValue } = render(
<BrandingForm />
);
await findByDisplayValue("52.6351204");
expect(asFragment()).toMatchSnapshot();
});
test('Branding page shows modal on success', async () => {
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(brandingData)
}))
.mockImplementationOnce(() => Promise.resolve({
ok: true
}));
ReactModal.setAppElement(document.createElement('div'));
const { getByText, getByPlaceholderText } = render(
<BrandingForm />
);
fireEvent.change(getByPlaceholderText('Enter B&B name'), { target: { value: 'Updated Room' } });
fireEvent.click(getByText('Submit'));
await waitFor(() => expect(getByText('Branding updated!')).toBeInTheDocument());
});
test('Branding page shows errors', async () => {
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(brandingData)
}))
.mockImplementationOnce(() => Promise.resolve({
ok: false,
json: () => Promise.resolve({
fieldErrors: ["Phone should not be blank"]
})
}));
const { getByText, findByText } = render(
<BrandingForm />
);
fireEvent.click(getByText('Submit'));
await findByText('Phone should not be blank');
expect(getByText('Phone should not be blank')).toBeInTheDocument();
});
});
================================================
FILE: assets/src/__tests__/Footer.test.tsx
================================================
import React from 'react';
import { render, screen } from '@testing-library/react';
import Footer from '../components/Footer';
import '@testing-library/jest-dom';
// Mock Next.js Link component
jest.mock('next/link', () => {
return ({ children, href }: { children: React.ReactNode, href: string }) => {
return <a href={href}>{children}</a>;
};
});
// Mock the package.json import
jest.mock('../../package.json', () => ({
version: '2.0.0'
}));
describe('Footer Component', () => {
const mockBranding = {
name: 'Test B&B',
logoUrl: '/logo.png',
description: 'A lovely place to stay',
map: {
latitude: 51.5074,
longitude: -0.1278
},
directions: 'Turn left, then right',
contact: {
name: 'John Doe',
phone: '123-456-7890',
email: 'john@example.com'
},
address: {
line1: '123 Test Street',
line2: 'Test Village',
postTown: 'Testington',
county: 'Testshire',
postCode: 'TE1 1ST'
}
};
it('renders the B&B name correctly', () => {
render(<Footer branding={mockBranding} />);
expect(screen.getByText('Test B&B')).toBeInTheDocument();
});
it('renders the B&B description correctly', () => {
render(<Footer branding={mockBranding} />);
expect(screen.getByText('A lovely place to stay')).toBeInTheDocument();
});
it('renders the contact information correctly', () => {
render(<Footer branding={mockBranding} />);
// Check for address
const addressText = `${mockBranding.address.line1}, ${mockBranding.address.line2}, ${mockBranding.address.postTown}, ${mockBranding.address.county}, ${mockBranding.address.postCode}`;
expect(screen.getByText(addressText)).toBeInTheDocument();
// Check for phone
expect(screen.getByText(mockBranding.contact.phone)).toBeInTheDocument();
// Check for email
expect(screen.getByText(mockBranding.contact.email)).toBeInTheDocument();
});
it('renders quick links section correctly', () => {
render(<Footer branding={mockBranding} />);
expect(screen.getByText('Quick Links')).toBeInTheDocument();
expect(screen.getByText('Home')).toBeInTheDocument();
expect(screen.getByText('Rooms')).toBeInTheDocument();
expect(screen.getByText('Booking')).toBeInTheDocument();
expect(screen.getByText('Contact')).toBeInTheDocument();
});
it('renders version number and copyright info', () => {
render(<Footer branding={mockBranding} />);
// Check for version
expect(screen.getByText(/restful-booker-platform v/)).toBeInTheDocument();
// Check for copyright year range
expect(screen.getByText(/©\s+2019-26/)).toBeInTheDocument();
// Check for creator
expect(screen.getByText('Mark Winteringham')).toBeInTheDocument();
});
it('renders policy and admin links', () => {
render(<Footer branding={mockBranding} />);
// Get links by their text content
const cookieLink = screen.getByText('Cookie-Policy');
const privacyLink = screen.getByText('Privacy-Policy');
const adminLink = screen.getByText('Admin panel');
// Check if links have correct href
expect(cookieLink).toHaveAttribute('href', '/cookie');
expect(privacyLink).toHaveAttribute('href', '/privacy');
expect(adminLink).toHaveAttribute('href', '/admin');
});
});
================================================
FILE: assets/src/__tests__/HomeNav.test.tsx
================================================
import React from 'react';
import { render, screen } from '@testing-library/react';
import HomeNav from '../components/HomeNav';
import '@testing-library/jest-dom';
describe('HomeNav Component', () => {
const mockBranding = {
name: 'Test B&B',
logoUrl: '/logo.png',
description: 'A lovely place to stay',
map: {
latitude: 51.5074,
longitude: -0.1278
},
directions: 'Turn left, then right',
contact: {
name: 'John Doe',
phone: '123-456-7890',
email: 'john@example.com'
},
address: {
line1: '123 Test Street',
line2: 'Test Village',
postTown: 'Testington',
county: 'Testshire',
postCode: 'TE1 1ST'
}
};
it('renders the B&B name correctly', () => {
render(<HomeNav branding={mockBranding} />);
expect(screen.getByText('Test B&B')).toBeInTheDocument();
});
it('renders all navigation links', () => {
render(<HomeNav branding={mockBranding} />);
const navLinks = [
{ text: 'Rooms', href: '/#rooms' },
{ text: 'Booking', href: '/#booking' },
{ text: 'Amenities', href: '/#amenities' },
{ text: 'Location', href: '/#location' },
{ text: 'Contact', href: '/#contact' },
{ text: 'Admin', href: '/admin' }
];
navLinks.forEach(link => {
const element = screen.getByText(link.text);
expect(element).toBeInTheDocument();
expect(element.closest('a')).toHaveAttribute('href', link.href);
});
});
it('contains the navbar toggler button for mobile views', () => {
render(<HomeNav branding={mockBranding} />);
const togglerButton = screen.getByRole('button');
expect(togglerButton).toBeInTheDocument();
expect(togglerButton).toHaveAttribute('data-bs-toggle', 'collapse');
expect(togglerButton).toHaveAttribute('data-bs-target', '#navbarNav');
});
it('has the correct Bootstrap classes for styling', () => {
render(<HomeNav branding={mockBranding} />);
const navbar = screen.getByRole('navigation');
expect(navbar).toHaveClass('navbar');
expect(navbar).toHaveClass('navbar-expand-lg');
expect(navbar).toHaveClass('navbar-light');
expect(navbar).toHaveClass('bg-white');
expect(navbar).toHaveClass('shadow-sm');
expect(navbar).toHaveClass('sticky-top');
});
it('contains the brand link that points to homepage', () => {
render(<HomeNav branding={mockBranding} />);
const brandLink = screen.getByText('Test B&B').closest('a');
expect(brandLink).toHaveAttribute('href', '/');
expect(brandLink).toHaveClass('navbar-brand');
});
});
================================================
FILE: assets/src/__tests__/HotelContact.test.tsx
================================================
import React from 'react';
import HotelContact from '../components/home/HotelContact';
import { render, fireEvent, waitFor, act, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
const message = {
name: 'Mark',
email: 'email@test.com',
phone: '018392391183',
subject: 'I want to book a room',
description: 'And I want a bottle of wine with the booking',
};
const contactDetails = {
name: 'Another B&B',
address: 'Somewhere else',
phone: '99999999999',
email: 'another@fakeemail.com'
};
describe('HotelContact Component', () => {
beforeEach(() => {
jest.resetAllMocks();
});
test('renders the contact form correctly', () => {
const { getByTestId, getByText } = render(
<HotelContact contactDetails={contactDetails} />
);
expect(getByText('Send Us a Message')).toBeInTheDocument();
expect(getByTestId('ContactName')).toBeInTheDocument();
expect(getByTestId('ContactEmail')).toBeInTheDocument();
expect(getByTestId('ContactPhone')).toBeInTheDocument();
expect(getByTestId('ContactSubject')).toBeInTheDocument();
expect(getByTestId('ContactDescription')).toBeInTheDocument();
expect(getByText('Submit')).toBeInTheDocument();
});
test('updates form values when user inputs data', async () => {
const { getByTestId } = render(
<HotelContact contactDetails={contactDetails} />
);
await act(async () => {
fireEvent.change(getByTestId('ContactName'), { target: { value: message.name } });
fireEvent.change(getByTestId('ContactEmail'), { target: { value: message.email } });
fireEvent.change(getByTestId('ContactPhone'), { target: { value: message.phone } });
fireEvent.change(getByTestId('ContactSubject'), { target: { value: message.subject } });
fireEvent.change(getByTestId('ContactDescription'), { target: { value: message.description } });
});
expect(getByTestId('ContactName')).toHaveValue(message.name);
expect(getByTestId('ContactEmail')).toHaveValue(message.email);
expect(getByTestId('ContactPhone')).toHaveValue(message.phone);
expect(getByTestId('ContactSubject')).toHaveValue(message.subject);
expect(getByTestId('ContactDescription')).toHaveValue(message.description);
});
test('Contact form sends request to message API', async () => {
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
status: 201
}));
const { getByText, getByTestId } = render(
<HotelContact contactDetails={contactDetails} />
);
await act(async () => {
fireEvent.change(getByTestId('ContactName'), { target: { value: message.name } });
fireEvent.change(getByTestId('ContactEmail'), { target: { value: message.email } });
fireEvent.change(getByTestId('ContactPhone'), { target: { value: message.phone } });
fireEvent.change(getByTestId('ContactSubject'), { target: { value: message.subject } });
fireEvent.change(getByTestId('ContactDescription'), { target: { value: message.description } });
});
await act(async () => {
fireEvent.click(getByText('Submit'));
});
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith(
'/api/message',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(message)
}
);
});
});
test('shows success message after successful submission', async () => {
global.fetch = jest.fn().mockImplementationOnce(() =>
Promise.resolve({
ok: true,
status: 201
})
);
const { getByText, getByTestId } = render(
<HotelContact contactDetails={contactDetails} />
);
await act(async () => {
fireEvent.change(getByTestId('ContactName'), { target: { value: message.name } });
fireEvent.change(getByTestId('ContactEmail'), { target: { value: message.email } });
fireEvent.change(getByTestId('ContactPhone'), { target: { value: message.phone } });
fireEvent.change(getByTestId('ContactSubject'), { target: { value: message.subject } });
fireEvent.change(getByTestId('ContactDescription'), { target: { value: message.description } });
});
await act(async () => {
fireEvent.click(getByText('Submit'));
});
await waitFor(() => {
expect(getByText(`Thanks for getting in touch ${message.name}!`)).toBeInTheDocument();
expect(getByText('We\'ll get back to you about')).toBeInTheDocument();
expect(getByText(message.subject)).toBeInTheDocument();
expect(getByText('as soon as possible.')).toBeInTheDocument();
});
});
test('displays error message when API request fails', async () => {
const errorMessage = ['Name may not be blank', 'Email is required'];
global.fetch = jest.fn().mockImplementationOnce(() =>
Promise.resolve({
ok: false,
status: 400,
json: () => Promise.resolve(errorMessage)
})
);
const { getByText, getByTestId } = render(
<HotelContact contactDetails={contactDetails} />
);
await act(async () => {
fireEvent.change(getByTestId('ContactName'), { target: { value: '' } });
fireEvent.change(getByTestId('ContactEmail'), { target: { value: '' } });
});
await act(async () => {
fireEvent.click(getByText('Submit'));
});
await waitFor(() => {
expect(getByText('Name may not be blank')).toBeInTheDocument();
expect(getByText('Email is required')).toBeInTheDocument();
});
});
test('handles unexpected errors during form submission', async () => {
global.fetch = jest.fn().mockImplementationOnce(() => {
throw new Error('Network error');
});
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
const { getByText, getByTestId } = render(
<HotelContact contactDetails={contactDetails} />
);
await act(async () => {
fireEvent.change(getByTestId('ContactName'), { target: { value: message.name } });
});
await act(async () => {
fireEvent.click(getByText('Submit'));
});
await waitFor(() => {
expect(getByText('An unexpected error occurred. Please try again later.')).toBeInTheDocument();
expect(consoleSpy).toHaveBeenCalled();
});
consoleSpy.mockRestore();
});
});
================================================
FILE: assets/src/__tests__/HotelLogo.test.tsx
================================================
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import HotelLogo from '../components/home/HotelLogo';
describe('HotelLogo Component', () => {
const mockBranding = {
name: "Shady Meadows B&B",
description: "A delightful hotel located in the heart of the countryside",
logoUrl: "/images/logo.png",
directions: "Follow the signs to the hotel",
map: {
latitude: 52.1234,
longitude: -1.2345
},
contact: {
name: "John Smith",
phone: "01234 567890",
email: "info@shadymeadows.com"
},
address: {
line1: "The Shady Meadows",
line2: "123 Country Lane",
postTown: "Newtown",
county: "Countryside",
postCode: "NE12 3WD"
}
};
it('renders the welcome message with hotel name', () => {
render(<HotelLogo branding={mockBranding} />);
expect(screen.getByText(`Welcome to ${mockBranding.name}`)).toBeInTheDocument();
});
it('renders the hotel description', () => {
render(<HotelLogo branding={mockBranding} />);
expect(screen.getByText(mockBranding.description)).toBeInTheDocument();
});
it('renders the Book Now button', () => {
render(<HotelLogo branding={mockBranding} />);
const bookButton = screen.getByText('Book Now');
expect(bookButton).toBeInTheDocument();
expect(bookButton).toHaveAttribute('href', '#booking');
expect(bookButton).toHaveClass('btn', 'btn-primary', 'btn-lg');
});
it('applies the correct CSS classes to section and container elements', () => {
const { container } = render(<HotelLogo branding={mockBranding} />);
const heroSection = container.querySelector('.hero');
expect(heroSection).toHaveClass('py-5');
const heroContent = container.querySelector('.hero-content');
expect(heroContent).toHaveClass('col-lg-8', 'text-center', 'text-lg-start', 'py-5');
});
});
================================================
FILE: assets/src/__tests__/HotelMap.test.tsx
================================================
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import HotelMap from '../components/home/HotelMap';
// Mock the pigeon-maps library
jest.mock('pigeon-maps', () => ({
Map: ({ children }: { children: React.ReactNode }) => (
<div data-testid="mocked-map">{children}</div>
),
Marker: () => <div data-testid="mocked-marker"></div>
}));
describe('HotelMap Component', () => {
const mockBranding = {
name: 'Test B&B',
logoUrl: '/logo.png',
description: 'A lovely place to stay',
map: {
latitude: 51.5074,
longitude: -0.1278
},
directions: 'Turn left at the church, continue for half a mile',
contact: {
name: 'John Doe',
phone: '123-456-7890',
email: 'contact@testbandb.com'
},
address: {
line1: '123 Test Street',
line2: 'Test Area',
postTown: 'Testington',
county: 'Testshire',
postCode: 'TE1 1ST'
}
};
it('renders the location section with correct heading', () => {
render(<HotelMap branding={mockBranding} />);
expect(screen.getByText('Our Location')).toBeInTheDocument();
expect(screen.getByText(/Find us in the beautiful Testington countryside/)).toBeInTheDocument();
});
it('renders the address information correctly', () => {
render(<HotelMap branding={mockBranding} />);
const addressText = "123 Test Street, Test Area, Testington, Testshire, TE1 1ST";
expect(screen.getByText(addressText)).toBeInTheDocument();
});
it('displays contact phone and email', () => {
render(<HotelMap branding={mockBranding} />);
expect(screen.getByText('123-456-7890')).toBeInTheDocument();
expect(screen.getByText('contact@testbandb.com')).toBeInTheDocument();
});
it('renders directions information', () => {
render(<HotelMap branding={mockBranding} />);
expect(screen.getByText('Getting Here')).toBeInTheDocument();
expect(screen.getByText('Turn left at the church, continue for half a mile')).toBeInTheDocument();
});
it('renders the map component', () => {
render(<HotelMap branding={mockBranding} />);
expect(screen.getByTestId('mocked-map')).toBeInTheDocument();
expect(screen.getByTestId('mocked-marker')).toBeInTheDocument();
});
});
================================================
FILE: assets/src/__tests__/HotelRoomInfo.test.tsx
================================================
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import HotelRoomInfo from '../components/home/HotelRoomInfo';
describe('HotelRoomInfo Component', () => {
const mockRoom = {
roomid: 123,
roomName: "101",
type: "Single",
accessible: false,
image: "/images/room.jpg",
description: "A cozy single room with modern amenities",
features: ["WiFi", "TV", "Refreshments"],
roomPrice: 120
};
it('renders the room details correctly', () => {
render(<HotelRoomInfo roomDetails={mockRoom} />);
// Check room type and description
expect(screen.getByText('Single')).toBeInTheDocument();
expect(screen.getByText('A cozy single room with modern amenities')).toBeInTheDocument();
// Check price
expect(screen.getByText('£120', { exact: false })).toBeInTheDocument();
expect(screen.getByText('per night')).toBeInTheDocument();
});
it('renders features correctly', () => {
render(<HotelRoomInfo roomDetails={mockRoom} />);
// Check each feature is displayed
mockRoom.features.forEach(feature => {
expect(screen.getByText(feature)).toBeInTheDocument();
});
});
it('renders book now link with correct room ID', () => {
render(<HotelRoomInfo roomDetails={mockRoom} queryString=''/>);
const bookButton = screen.getByText('Book now');
expect(bookButton).toHaveAttribute('href', '/reservation/123');
});
it('appends query string to booking link when provided', () => {
const queryString = '?checkin=2025-04-20&checkout=2025-04-25';
render(<HotelRoomInfo roomDetails={mockRoom} queryString={queryString} />);
const bookButton = screen.getByText('Book now');
expect(bookButton).toHaveAttribute('href', `/reservation/123${queryString}`);
});
});
================================================
FILE: assets/src/__tests__/Message.test.tsx
================================================
import React from 'react';
import Message from '../components/admin/Message';
import { render, waitFor, screen, act } from '@testing-library/react';
const messageData = {
name: "Mark Winteringham",
email: "mark@mwtestconsultancy.co.uk",
phone: "01821 912812",
subject: "Subject description here",
description: "Lorem ipsum dolores est"
};
describe('Message Component', () => {
beforeEach(() => {
// Mock the GET request
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(messageData)
}))
// Mock the PUT request for marking as read
.mockImplementationOnce(() => Promise.resolve({
ok: true
}));
});
test('Message popup is populated with details', async () => {
await act(async () => {
render(<Message messageId={1} refreshMessageList={() => {}} closeMessage={() => {}} />);
});
await waitFor(() => {
const modalComponent = screen.getByTestId(/message/);
expect(modalComponent).toMatchSnapshot();
});
});
});
================================================
FILE: assets/src/__tests__/MessageList.test.tsx
================================================
import React from 'react';
import MessageList from '../components/admin/MessageList';
import { render, waitFor, fireEvent } from '@testing-library/react';
describe('MessageList Component', () => {
const mockMessages = {
messages: [
{
"id": 1,
"name": "Mark Winteringham",
"subject": "Subject description here",
"read": true
}, {
"id": 2,
"name": "James Dean",
"subject": "Another description here",
"read": false
}, {
"id": 3,
"name": "Janet Samson",
"subject": "Lorem ipsum dolores est",
"read": true
}
]
};
beforeEach(() => {
jest.clearAllMocks();
// Mock initial messages fetch
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(mockMessages)
}));
});
test('Renders the list of messages correctly', async () => {
const { asFragment, getByTestId } = render(<MessageList />);
await waitFor(() => expect(getByTestId(/messageDescription0/)).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
test('Deletes message when selected to delete', async () => {
// Mock delete request and subsequent messages fetch
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(mockMessages)
}))
.mockImplementationOnce(() => Promise.resolve({
ok: true
}))
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve({
messages: mockMessages.messages.slice(1)
})
}));
const { getByTestId } = render(<MessageList />);
await waitFor(() => fireEvent.click(getByTestId(/DeleteMessage0/)));
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith('/api/message/1', {
method: 'DELETE'
});
});
});
test('Clicking message shows message popup', async () => {
const messageDetails = {
name: "Mark Winteringham",
email: "mark@email.com",
phone: "01234556789",
subject: "Subject here",
description: "Lorem ipsum"
};
// Mock initial messages fetch and message details fetch
global.fetch = jest.fn()
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(mockMessages)
}))
.mockImplementationOnce(() => Promise.resolve({
ok: true,
json: () => Promise.resolve(messageDetails)
}));
const { asFragment, getByTestId } = render(<MessageList />);
await waitFor(() => { fireEvent.click(getByTestId(/message0/))});
expect(asFragment()).toMatchSnapshot();
});
});
================================================
FILE: assets/src/__tests__/Nav.test.tsx
================================================
import React from 'react';
import Nav from '../components/admin/Nav';
import { render } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
const mockUseNavigate = jest.fn();
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useNavigate: () => mockUseNavigate,
}));
describe('Nav Component', () => {
test('Nav bar renders', () => {
const { asFragment } = render(
<BrowserRouter>
<Nav setAuthenticate={() => {}} isAuthenticated={true} />
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
});
});
================================================
FILE: assets/src/__tests__/Notification.test.tsx
================================================
import React from 'react';
import Notification from '../components/admin/Notification';
import { render } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
describe('Notification Component', () => {
test('Notification renders plain inbox when no unread notifications', () => {
const { asFragment } = render(
<BrowserRouter>
<Notification setCount={() => {}} />
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
});
test('Notification renders alert inbox when there are unread notifications', () => {
const { asFragment } = render(
<BrowserRouter>
<Notification setCount={() => {}} count={34} />
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
});
});
================================================
FILE: assets/src/__tests__/Report.test.tsx
================================================
import React from 'react';
import Report from '../components/admin/Report';
import { render, waitFor, screen } from '@testing-library/react';
interface ReportItem {
start: string;
end: string;
title: string;
}
describe('Report Component', () => {
test('Multiple reports can be created in the Report component', async () => {
// Setup mock response
const mockReports: ReportItem[] = [
{
start: "2019-04-01",
end: "2019-04-03",
title: "101"
},
{
start: "2019-04-02",
end: "2019-04-04",
title: "102"
},
{
start: "2019-04-02",
end: "2019-04-04",
title: "103"
}
];
global.fetch = jest.fn().mockImplementationOnce(() =>
Promise.resolve({
ok: true,
json: () => Promise.resolve({ report: mockReports })
})
);
render(
<div id="root-container">
<Report defaultDate={new Date("2019-04-02")} />
</div>
);
// Wait for fetch mock to be called
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith('/api/report');
});
const items = await screen.findAllByText(/103/);
expect(items).toHaveLength(1);
});
});
================================================
FILE: assets/src/__tests__/RoomDetails.test.tsx
================================================
import React from 'react';
import RoomDetails from '../components/admin/RoomDetails';
import { Routes, Route, MemoryRouter } from 'react-router-dom';
import { render, waitFor, fireEvent } from '@testing-library/react';
interface RoomObject {
roomid: number;
roomName: string;
type: string;
accessible: boolean;
image: string;
description: string;
features: string[];
roomPrice: number;
featuresObject?: {
WiFi: boolean;
TV: boolean;
Radio: boolean;
Refreshments: boolean;
Safe: boolean;
Views: boolean;
[key: string]: boolean;
};
}
const roomObject: RoomObject = {
roomid: 1,
roomName: "101",
type: "Single",
accessible: true,
image: "https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg",
description: "Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante.",
features: ["TV, WiFi, Safe"],
roomPrice: 100,
featuresObject: {
WiFi: false,
TV: false,
Radio: false,
Refreshments: false,
Safe: false,
Views: false,
'TV, WiFi, Safe': true
}
};
describe('RoomDetails Component', () => {
beforeEach(() => {
jest.clearAllMocks();
// Mock the bookings endpoint by default
global.fetch = jest.fn()
.mockImplementation((url: string) => {
if (url.includes('/api/booking/')) {
return Promise.resolve({
ok: true,
json: () => Promise.resolve({ bookings: [] })
});
}
return Promise.resolve({
ok: true,
json: () => Promise.resolve(roomObject)
});
});
});
test('Room details component renders', async () => {
const { asFragment, getByText } = render(
<MemoryRouter initialEntries={['/admin/room/1']}>
<Routes>
<Route path="/admin/room/:id" element={<RoomDetails id="1" />} />
</Routes>
</MemoryRouter>
);
await waitFor(() => expect(getByText(/101/)).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
test('Room details switches into edit mode', async () => {
const { asFragment, getByText } = render(
<MemoryRouter initialEntries={['/admin/room/1']}>
<Routes>
<Route path="/admin/room/:id" element={<RoomDetails id="1" />} />
</Routes>
</MemoryRouter>
);
await waitFor(() => expect(getByText(/101/)).toBeInTheDocument());
fireEvent.click(getByText(/Edit/));
await waitFor(() => expect(getByText(/Update/)).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
test('Room details can be switched out of edit mode', async () => {
const mockFetch = jest.fn((input: RequestInfo | URL, init?: RequestInit) => {
return Promise.resolve({
ok: true,
json: () => Promise.resolve(roomObject),
status: 200,
headers: new Headers(),
} as Response);
});
global.fetch = mockFetch;
const { asFragment, getByText } = render(
<MemoryRouter initialEntries={['/admin/room/1']}>
<Routes>
<Route path="/admin/room/:id" element={<RoomDetails id="1" />} />
</Routes>
</MemoryRouter>
);
await waitFor(() => expect(getByText(/101/)).toBeInTheDocument());
fireEvent.click(getByText(/Edit/));
fireEvent.click(getByText(/Cancel/));
expect(asFragment()).toMatchSnapshot();
});
test('Room details can render validation errors', async () => {
const mockFetch = jest.fn((input: RequestInfo | URL, init?: RequestInit) => {
const url = input.toString();
if (url === '/api/room/1' && (!init || init.method === 'GET')) {
return Promise.resolve({
ok: true,
json: () => Promise.resolve(roomObject),
status: 200,
headers: new Headers(),
} as Response);
} else if (url === '/api/booking/1') {
return Promise.resolve({
ok: true,
json: () => Promise.resolve({ bookings: [] }),
status: 200,
headers: new Headers(),
} as Response);
} else if (url.includes('/api/room/1') && init?.method === 'PUT') {
return Promise.resolve({
ok: false,
json: () => Promise.resolve({
errorCode: 400,
errors: ["Type can only contain the room options Single, Double, Twin, Family or Suite"]
}),
status: 400,
headers: new Headers(),
} as Response);
}
// Default case
return Promise.resolve({
ok: false,
status: 404,
headers: new Headers(),
json: () => Promise.resolve({ error: "Not found" })
} as Response);
});
global.fetch = mockFetch;
const { asFragment, getByText } = render(
<MemoryRouter initialEntries={['/admin/room/1']}>
<Routes>
<Route path="/admin/room/:id" element={<RoomDetails id="1" />} />
</Routes>
</MemoryRouter>
);
await waitFor(() => expect(getByText(/101/)).toBeInTheDocument());
fireEvent.click(getByText(/Edit/));
fireEvent.click(getByText(/Update/));
await waitFor(() => expect(getByText(/Type can only contain the room options/)).toBeInTheDocument());
expect(asFragment()).toMatchSnapshot();
});
test('Room details can be submitted', async () => {
const mockFetch = jest.fn((input: RequestInfo | URL, init?: RequestInit) => {
return Promise.resolve({
ok: true,
json: () => Promise.resolve(roomObject),
status: 200,
headers: new Headers(),
} as Response);
});
global.fetch = mockFetch;
const { getByText } = render(
<MemoryRouter initialEntries={['/admin/room/1']}>
<Routes>
<Route path="/admin/room/:id" element={<RoomDetails id="1" />} />
</Routes>
</MemoryRouter>
);
await waitFor(() => expect(getByText(/101/)).toBeInTheDocument());
fireEvent.click(getByText(/Edit/));
fireEvent.click(getByText(/Update/));
await waitFor(() => {
expect(mockFetch).toHaveBeenCalledWith(
'/api/room/1',
{
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
...roomObject,
featuresObject: {
WiFi: false,
TV: false,
Radio: false,
Refreshments: false,
Safe: false,
Views: false,
'TV, WiFi, Safe': true
}
})
}
);
});
});
});
================================================
FILE: assets/src/__tests__/__snapshots__/Branding.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`Branding Component Branding page renders 1`] = `
<DocumentFragment>
<div
class="branding-form"
>
<h2>
B&B details
</h2>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Name
</span>
</div>
<input
class="form-control"
id="name"
placeholder="Enter B&B name"
type="text"
value="Shady Meadows B&B"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Logo
</span>
</div>
<input
class="form-control"
id="logoUrl"
placeholder="Enter image url"
type="text"
value="https://www.mwtestconsultancy.co.uk/img/rbp-logo.png"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-stretch"
>
<span
class="input-group-text"
>
Description
</span>
</div>
<textarea
class="form-control"
id="description"
rows="5"
>
Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.
</textarea>
</div>
<br />
<h2>
Map details
</h2>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Latitude
</span>
</div>
<input
class="form-control"
id="latitude"
placeholder="Enter Latitude"
type="text"
value="52.6351204"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Longitude
</span>
</div>
<input
class="form-control"
id="longitude"
placeholder="Enter Longitude"
type="text"
value="1.2733774"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-stretch"
>
<span
class="input-group-text"
>
Directions
</span>
</div>
<textarea
class="form-control"
id="directions"
rows="5"
>
Take the first left after the big tree, then follow the road until you see the sign.
</textarea>
</div>
<br />
<h2>
Contact details
</h2>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Name
</span>
</div>
<input
class="form-control"
id="contactName"
placeholder="Enter Contact Name"
type="text"
value="Shady Meadows B&B"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Phone
</span>
</div>
<input
class="form-control"
id="contactPhone"
placeholder="Enter Phone Number"
type="text"
value="0123456789"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Email
</span>
</div>
<input
class="form-control"
id="contactEmail"
placeholder="Enter Email Address"
type="email"
value="fake@fakeemail.com"
/>
</div>
<br />
<h2>
Address details
</h2>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Line 1
</span>
</div>
<input
class="form-control"
id="line1"
placeholder="Enter Address Line 1"
type="text"
value="123 Fake Street"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Line 2
</span>
</div>
<input
class="form-control"
id="line2"
placeholder="Enter Address Line 2"
type="text"
value="Fake Town"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Post Town
</span>
</div>
<input
class="form-control"
id="postTown"
placeholder="Enter Post Town"
type="text"
value="Fake Town"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
County
</span>
</div>
<input
class="form-control"
id="county"
placeholder="Enter County"
type="text"
value="Fake County"
/>
</div>
<div
class="input-group mb-3"
>
<div
class="input-group-prepend d-flex align-items-center"
>
<span
class="input-group-text"
>
Post Code
</span>
</div>
<input
class="form-control"
id="postCode"
placeholder="Enter Post Code"
type="text"
value="FA1 2KE"
/>
</div>
<br />
<button
class="btn btn-outline-primary"
id="updateBranding"
type="submit"
>
Submit
</button>
</div>
</DocumentFragment>
`;
================================================
FILE: assets/src/__tests__/__snapshots__/Message.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`Message Component Message popup is populated with details 1`] = `
<div
data-testid="message"
>
<div
class="form-row"
>
<div
class="col-10"
>
<p>
<span>
From:
</span>
Mark Winteringham
</p>
</div>
<div
class="col-2"
>
<p>
<span>
Phone:
</span>
01821 912812
</p>
</div>
</div>
<div
class="form-row"
>
<div
class="col-12"
>
<p>
<span>
Email:
</span>
mark@mwtestconsultancy.co.uk
</p>
</div>
</div>
<div
class="form-row"
>
<div
class="col-12"
>
<p>
<span>
Subject description here
</span>
</p>
</div>
</div>
<div
class="form-row"
>
<div
class="col-12"
>
<p>
Lorem ipsum dolores est
</p>
</div>
</div>
<div
class="form-row"
>
<div
class="col-12"
>
<button
class="btn btn-outline-primary"
>
Close
</button>
</div>
</div>
</div>
`;
================================================
FILE: assets/src/__tests__/__snapshots__/MessageList.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`MessageList Component Clicking message shows message popup 1`] = `
<DocumentFragment>
<div>
<div
class="messages"
>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
Name
</p>
</div>
<div
class="col-sm-9 rowHeader"
>
<p>
Subject
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div
class="row detail read-true"
id="message0"
>
<div
class="col-sm-2"
data-testid="message0"
>
<p>
Mark Winteringham
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription0"
>
<p>
Subject description here
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage0"
/>
</div>
</div>
<div
class="row detail read-false"
id="message1"
>
<div
class="col-sm-2"
data-testid="message1"
>
<p>
James Dean
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription1"
>
<p>
Another description here
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage1"
/>
</div>
</div>
<div
class="row detail read-true"
id="message2"
>
<div
class="col-sm-2"
data-testid="message2"
>
<p>
Janet Samson
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription2"
>
<p>
Lorem ipsum dolores est
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage2"
/>
</div>
</div>
</div>
</div>
</DocumentFragment>
`;
exports[`MessageList Component Renders the list of messages correctly 1`] = `
<DocumentFragment>
<div>
<div
class="messages"
>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
Name
</p>
</div>
<div
class="col-sm-9 rowHeader"
>
<p>
Subject
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div
class="row detail read-true"
id="message0"
>
<div
class="col-sm-2"
data-testid="message0"
>
<p>
Mark Winteringham
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription0"
>
<p>
Subject description here
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage0"
/>
</div>
</div>
<div
class="row detail read-false"
id="message1"
>
<div
class="col-sm-2"
data-testid="message1"
>
<p>
James Dean
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription1"
>
<p>
Another description here
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage1"
/>
</div>
</div>
<div
class="row detail read-true"
id="message2"
>
<div
class="col-sm-2"
data-testid="message2"
>
<p>
Janet Samson
</p>
</div>
<div
class="col-sm-9"
data-testid="messageDescription2"
>
<p>
Lorem ipsum dolores est
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-remove roomDelete"
data-testid="DeleteMessage2"
/>
</div>
</div>
</div>
</div>
</DocumentFragment>
`;
================================================
FILE: assets/src/__tests__/__snapshots__/Nav.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`Nav Component Nav bar renders 1`] = `
<DocumentFragment>
<nav
class="navbar navbar-expand-md navbar-dark bg-dark mb-4"
>
<div
class="container-fluid"
>
<a
class="navbar-brand"
href="/"
>
Restful Booker Platform Demo
</a>
<button
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
class="navbar-toggler"
data-target="#navbarSupportedContent"
data-toggle="collapse"
type="button"
>
<span
class="navbar-toggler-icon"
/>
</button>
<div
class="collapse navbar-collapse"
id="navbarSupportedContent"
>
<ul
class="navbar-nav mr-auto"
>
<li
class="nav-item"
>
<a
class="nav-link"
href="/admin/rooms"
>
Rooms
</a>
</li>
<li
class="nav-item"
>
<a
class="nav-link"
href="/admin/report"
id="reportLink"
>
Report
</a>
</li>
<li
class="nav-item"
>
<a
class="nav-link"
href="/admin/branding"
id="brandingLink"
>
Branding
</a>
</li>
<li
class="nav-item"
>
<a
class="nav-link"
href="/admin/message"
>
Messages
</a>
</li>
</ul>
<ul
class="navbar-nav ms-auto"
>
<li
class="nav-item"
>
<a
class="nav-link"
href="/"
id="frontPageLink"
>
Front Page
</a>
</li>
<li
class="nav-item"
>
<button
class="btn btn-outline-danger my-2 my-sm-0"
>
Logout
</button>
</li>
</ul>
</div>
</div>
</nav>
</DocumentFragment>
`;
================================================
FILE: assets/src/__tests__/__snapshots__/Notification.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`Notification Component Notification renders alert inbox when there are unread notifications 1`] = `
<DocumentFragment>
<a
class="nav-link"
data-discover="true"
href="/admin/messages"
>
<i
class="fa fa-inbox"
style="font-size: 1.5rem;"
>
<span
class="notification"
>
34
</span>
</i>
</a>
</DocumentFragment>
`;
exports[`Notification Component Notification renders plain inbox when no unread notifications 1`] = `
<DocumentFragment>
<a
class="nav-link"
data-discover="true"
href="/admin/messages"
>
<i
class="fa fa-inbox"
style="font-size: 1.5rem;"
/>
</a>
</DocumentFragment>
`;
================================================
FILE: assets/src/__tests__/__snapshots__/RoomDetails.test.tsx.snap
================================================
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`RoomDetails Component Room details can be switched out of edit mode 1`] = `
<DocumentFragment>
<div>
<div
class="room-details"
>
<div
class="row"
>
<div
class="col-sm-10"
>
<h2>
Room: 101
</h2>
</div>
<div
class="col-sm-2"
>
<button
class="btn btn-outline-primary float-sm-end"
type="button"
>
Edit
</button>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<p>
Type:
<span>
Single
</span>
</p>
</div>
<div
class="col-sm-6"
>
<p>
Description:
<span>
Aenean porttitor mauris sit amet lacinia molestie....
</span>
</p>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<p>
Accessible:
<span>
true
</span>
</p>
<p>
Features:
<span>
TV, WiFi, Safe
</span>
</p>
<p>
Room price:
<span>
100
</span>
</p>
</div>
<div
class="col-sm-6"
>
<p>
Image:
</p>
<img
alt="Room: 101 preview image"
src="https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg"
/>
</div>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
First name
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Last name
</p>
</div>
<div
class="col-sm-1 rowHeader"
>
<p>
Price
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Deposit paid?
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check in
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check out
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div />
</div>
</DocumentFragment>
`;
exports[`RoomDetails Component Room details can render validation errors 1`] = `
<DocumentFragment>
<div>
<div
class="room-details"
>
<div
class="row"
>
<div
class="col-sm-9"
>
<h2>
Room:
</h2>
<input
id="roomName"
type="text"
value="101"
/>
</div>
<div
class="col-sm-3"
>
<button
class="btn btn-outline-danger float-sm-end"
id="cancelEdit"
type="button"
>
Cancel
</button>
<button
class="btn btn-outline-primary float-sm-end"
id="update"
style="margin-right: 10px;"
type="button"
>
Update
</button>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="type"
>
Type:
</label>
<select
class="form-control"
id="type"
>
<option
value="Single"
>
Single
</option>
<option
value="Twin"
>
Twin
</option>
<option
value="Double"
>
Double
</option>
<option
value="Family"
>
Family
</option>
<option
value="Suite"
>
Suite
</option>
</select>
<label
class="editLabel"
for="accessible"
>
Accessible:
</label>
<select
class="form-control"
id="accessible"
>
<option
value="false"
>
false
</option>
<option
value="true"
>
true
</option>
</select>
<label
class="editLabel"
for="roomPrice"
>
Room price:
</label>
<input
class="form-control"
id="roomPrice"
type="text"
value="100"
/>
</div>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="description"
>
Description:
</label>
<textarea
aria-label="Description"
class="form-control"
id="description"
rows="5"
>
Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante.
</textarea>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<label
class="editLabel"
>
Room features:
</label>
<div
class="row"
>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="wifiCheckbox"
name="featureCheck"
type="checkbox"
value="WiFi"
/>
<label
class="form-check-label"
for="wifiCheckbox"
>
WiFi
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="tvCheckbox"
name="featureCheck"
type="checkbox"
value="TV"
/>
<label
class="form-check-label"
for="tvCheckbox"
>
TV
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="radioCheckbox"
name="featureCheck"
type="checkbox"
value="Radio"
/>
<label
class="form-check-label"
for="radioCheckbox"
>
Radio
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="refreshmentsCheckbox"
name="featureCheck"
type="checkbox"
value="Refreshments"
/>
<label
class="form-check-label"
for="refreshmentsCheckbox"
>
Refreshments
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="safeCheckbox"
name="featureCheck"
type="checkbox"
value="Safe"
/>
<label
class="form-check-label"
for="safeCheckbox"
>
Safe
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="viewsCheckbox"
name="featureCheck"
type="checkbox"
value="Views"
/>
<label
class="form-check-label"
for="viewsCheckbox"
>
Views
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
checked=""
class="form-check-input"
id="tv, wifi, safeCheckbox"
name="featureCheck"
type="checkbox"
value="TV, WiFi, Safe"
/>
<label
class="form-check-label"
for="tv, wifi, safeCheckbox"
>
TV, WiFi, Safe
</label>
</div>
</div>
</div>
</div>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="image"
>
Image:
</label>
<input
class="form-control"
id="image"
type="text"
value="https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg"
/>
</div>
</div>
<div
class="alert alert-danger"
style="margin-top: 15px;"
>
<p>
Type can only contain the room options Single, Double, Twin, Family or Suite
</p>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
First name
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Last name
</p>
</div>
<div
class="col-sm-1 rowHeader"
>
<p>
Price
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Deposit paid?
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check in
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check out
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div />
</div>
</DocumentFragment>
`;
exports[`RoomDetails Component Room details component renders 1`] = `
<DocumentFragment>
<div>
<div
class="room-details"
>
<div
class="row"
>
<div
class="col-sm-10"
>
<h2>
Room: 101
</h2>
</div>
<div
class="col-sm-2"
>
<button
class="btn btn-outline-primary float-sm-end"
type="button"
>
Edit
</button>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<p>
Type:
<span>
Single
</span>
</p>
</div>
<div
class="col-sm-6"
>
<p>
Description:
<span>
Aenean porttitor mauris sit amet lacinia molestie....
</span>
</p>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<p>
Accessible:
<span>
true
</span>
</p>
<p>
Features:
<span>
TV, WiFi, Safe
</span>
</p>
<p>
Room price:
<span>
100
</span>
</p>
</div>
<div
class="col-sm-6"
>
<p>
Image:
</p>
<img
alt="Room: 101 preview image"
src="https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg"
/>
</div>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
First name
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Last name
</p>
</div>
<div
class="col-sm-1 rowHeader"
>
<p>
Price
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Deposit paid?
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check in
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check out
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div />
</div>
</DocumentFragment>
`;
exports[`RoomDetails Component Room details switches into edit mode 1`] = `
<DocumentFragment>
<div>
<div
class="room-details"
>
<div
class="row"
>
<div
class="col-sm-9"
>
<h2>
Room:
</h2>
<input
id="roomName"
type="text"
value="101"
/>
</div>
<div
class="col-sm-3"
>
<button
class="btn btn-outline-danger float-sm-end"
id="cancelEdit"
type="button"
>
Cancel
</button>
<button
class="btn btn-outline-primary float-sm-end"
id="update"
style="margin-right: 10px;"
type="button"
>
Update
</button>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="type"
>
Type:
</label>
<select
class="form-control"
id="type"
>
<option
value="Single"
>
Single
</option>
<option
value="Twin"
>
Twin
</option>
<option
value="Double"
>
Double
</option>
<option
value="Family"
>
Family
</option>
<option
value="Suite"
>
Suite
</option>
</select>
<label
class="editLabel"
for="accessible"
>
Accessible:
</label>
<select
class="form-control"
id="accessible"
>
<option
value="false"
>
false
</option>
<option
value="true"
>
true
</option>
</select>
<label
class="editLabel"
for="roomPrice"
>
Room price:
</label>
<input
class="form-control"
id="roomPrice"
type="text"
value="100"
/>
</div>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="description"
>
Description:
</label>
<textarea
aria-label="Description"
class="form-control"
id="description"
rows="5"
>
Aenean porttitor mauris sit amet lacinia molestie. In posuere accumsan aliquet. Maecenas sit amet nisl massa. Interdum et malesuada fames ac ante.
</textarea>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-6"
>
<label
class="editLabel"
>
Room features:
</label>
<div
class="row"
>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="wifiCheckbox"
name="featureCheck"
type="checkbox"
value="WiFi"
/>
<label
class="form-check-label"
for="wifiCheckbox"
>
WiFi
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="tvCheckbox"
name="featureCheck"
type="checkbox"
value="TV"
/>
<label
class="form-check-label"
for="tvCheckbox"
>
TV
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="radioCheckbox"
name="featureCheck"
type="checkbox"
value="Radio"
/>
<label
class="form-check-label"
for="radioCheckbox"
>
Radio
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="refreshmentsCheckbox"
name="featureCheck"
type="checkbox"
value="Refreshments"
/>
<label
class="form-check-label"
for="refreshmentsCheckbox"
>
Refreshments
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="safeCheckbox"
name="featureCheck"
type="checkbox"
value="Safe"
/>
<label
class="form-check-label"
for="safeCheckbox"
>
Safe
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
class="form-check-input"
id="viewsCheckbox"
name="featureCheck"
type="checkbox"
value="Views"
/>
<label
class="form-check-label"
for="viewsCheckbox"
>
Views
</label>
</div>
</div>
<div
class="col-4"
>
<div
class="form-check form-check-inline"
>
<input
checked=""
class="form-check-input"
id="tv, wifi, safeCheckbox"
name="featureCheck"
type="checkbox"
value="TV, WiFi, Safe"
/>
<label
class="form-check-label"
for="tv, wifi, safeCheckbox"
>
TV, WiFi, Safe
</label>
</div>
</div>
</div>
</div>
<div
class="col-sm-6"
>
<label
class="editLabel"
for="image"
>
Image:
</label>
<input
class="form-control"
id="image"
type="text"
value="https://www.mwtestconsultancy.co.uk/img/testim/room2.jpg"
/>
</div>
</div>
</div>
<div
class="row"
>
<div
class="col-sm-2 rowHeader"
>
<p>
First name
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Last name
</p>
</div>
<div
class="col-sm-1 rowHeader"
>
<p>
Price
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Deposit paid?
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check in
</p>
</div>
<div
class="col-sm-2 rowHeader"
>
<p>
Check out
</p>
</div>
<div
class="col-sm-1"
/>
</div>
<div />
</div>
</DocumentFragment>
`;
================================================
FILE: assets/src/__tests__/examples/__snapshots__/contract-test.tsx.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Rooms list component 1`] = `
{
"asFragment": [Function],
"baseElement": <body>
<div>
<div
class="detail booking-1"
>
<div
class="row"
>
<div
class="col-sm-2"
>
<p>
James
</p>
</div>
<div
class="col-sm-2"
>
<p>
Dean
</p>
</div>
<div
class="col-sm-1"
>
<p>
0
</p>
</div>
<div
class="col-sm-2"
>
<p>
true
</p>
</div>
<div
class="col-sm-2"
>
<p>
2022-02-01
</p>
</div>
<div
class="col-sm-2"
>
<p>
2022-02-05
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-pencil bookingEdit"
style="padding-right: 10px;"
/>
<span
class="fa fa-trash bookingDelete"
/>
</div>
</div>
</div>
</div>
</body>,
"container": <div>
<div
class="detail booking-1"
>
<div
class="row"
>
<div
class="col-sm-2"
>
<p>
James
</p>
</div>
<div
class="col-sm-2"
>
<p>
Dean
</p>
</div>
<div
class="col-sm-1"
>
<p>
0
</p>
</div>
<div
class="col-sm-2"
>
<p>
true
</p>
</div>
<div
class="col-sm-2"
>
<p>
2022-02-01
</p>
</div>
<div
class="col-sm-2"
>
<p>
2022-02-05
</p>
</div>
<div
class="col-sm-1"
>
<span
class="fa fa-pencil bookingEdit"
style="padding-right: 10px;"
/>
<span
class="fa fa-trash bookingDelete"
/>
</div>
</div>
</div>
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;
================================================
FILE: assets/src/__tests__/examples/contract-test.tsx
================================================
import React from 'react';
import {
render,
fireEvent,
cleanup
} from '@testing-library/react';
import BookingListing from '../../components/admin/BookingListing';
import contract from './contract.json';
test('Rooms list component', () => {
const booking = render(
<BookingListing booking={contract} isAuthenticated={true} />
);
expect(booking).toMatchSnapshot();
});
================================================
FILE: assets/src/__tests__/examples/contract.json
================================================
{
"bookingid": 1,
"roomid": 1,
"firstname": "James",
"lastname": "Dean",
"depositpaid": true,
"bookingdates": {
"checkin": "2022-02-01",
"checkout": "2022-02-05"
}
}
================================================
FILE: assets/src/__tests__/examples/home-page-test.tsx
================================================
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import RoomListings from '../../components/admin/RoomListings';
import { findByText, render } from '@testing-library/react';
// Mock fetch
global.fetch = jest.fn(() =>
Promise.resolve({
ok: true,
json: () => Promise.resolve({
rooms: [
{
roomid: 1,
roomName: "202",
type: "Single",
accessible: true,
image: "string",
description: "string",
features: ["string"],
roomPrice: 0
}
]
})
})
) as jest.Mock;
test('Rooms list component', async () => {
const { asFragment, findByText } = render(
<BrowserRouter>
<RoomListings />
</BrowserRouter>
);
await findByText("string");
expect(asFragment()).toMatchSnapshot();
});
// Check suggestions...
//
// Check creation of components are consistent
// Check state changes in components that use isAuthorised
// Check BookingListings populates with BookingListing components
================================================
FILE: assets/src/__tests__/examples/task-analysis-test.tsx
================================================
import React from 'react';
import LoginComponent from '../../components/admin/Login';
import { render, fireEvent, waitFor } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
test('Login component is created', () => {
const { asFragment } = render(
<BrowserRouter>
<LoginComponent />
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
});
test('Login component sends correct payload', async () => {
// Mock the fetch response
global.fetch = jest.fn(() =>
Promise.resolve({
ok: true,
json: () => Promise.resolve({ token: '123ABC' })
})
) as jest.Mock;
const { getByTestId } = render(
<BrowserRouter>
<LoginComponent setAuthenticate={() => {}} />
</BrowserRouter>
);
// Fill in the LoginComponent form fields and submit it
fireEvent.change(getByTestId('username'), { target: { value: 'admin' } });
fireEvent.change(getByTestId('password'), { target: { value: 'password' } });
fireEvent.click(getByTestId('submit'));
// Check if fetch was called with the correct payload
await waitFor(() => expect(fetch).toHaveBeenCalledWith(
'http://localhost/auth/login',
{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"username": "admin",
"password": "password"
})
}
));
});
================================================
FILE: assets/src/__tests__/jest.setup.ts
================================================
import '@testing-library/jest-dom';
const util = require('util');
const { TextEncoder, TextDecoder } = util;
Object.assign(global, { TextDecoder, TextEncoder });
// Set up window.TextEncoder/TextDecoder
if (typeof window !== 'undefined') {
window.TextEncoder = TextEncoder;
window.TextDecoder = TextDecoder;
}
// Mock fetch
global.fetch = jest.fn(() =>
Promise.resolve({
ok: true,
json: () => Promise.resolve({})
})
) as jest.Mock;
================================================
FILE: assets/src/app/admin/branding/page.tsx
================================================
'use client';
import React, { Suspense } from 'react';
import dynamic from 'next/dynamic';
import Loading from '@/components/admin/Loading';
// Dynamically import the Branding component
const Branding = dynamic(
() => import('@/components/admin/Branding'),
{
loading: () => <Loading />,
ssr: false
}
);
export default function BrandingPage() {
return (
<Suspense fallback={<Loading />}>
<Branding />
</Suspense>
);
}
================================================
FILE: assets/src/app/admin/layout.tsx
================================================
'use client';
import React, { useEffect, useState } from 'react';
import { usePathname, useRouter } from 'next/navigation';
import Cookies from 'universal-cookie';
import Nav from '@/components/admin/Nav';
import Loading from '@/components/admin/Loading';
// API function to validate authentication
async function postValidation(cookies: Cookies): Promise<boolean> {
try {
const token = cookies.get('token');
if (!token) return false;
const response = await fetch('/api/auth/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ token }),
});
return response.ok;
} catch (error) {
console.error('Error validating authentication:', error);
return false;
}
}
export default function AdminLayout({
children,
}: {
children: React.ReactNode;
}) {
const [isAuthenticated, setAuthenticate] = useState<boolean | null>(null);
const router = useRouter();
const pathname = usePathname();
useEffect(() => {
const cookies = new Cookies();
const validateAuth = async () => {
const isValid = await postValidation(cookies);
setAuthenticate(isValid);
// Redirect to login if not authenticated and not already on login page
if (!isValid && pathname !== '/admin') {
router.push('/admin');
}
};
validateAuth();
}, [pathname, router]);
if (isAuthenticated === null) {
return (
<div>
<Nav
setAuthenticate={setAuthenticate}
isAuthenticated={isAuthenticated}
/>
<Loading />
</div>
);
}
return (
<div>
<Nav
setAuthenticate={setAuthenticate}
isAuthenticated={isAuthenticated}
/>
<div className="container">
{children}
</div>
</div>
);
}
================================================
FILE: assets/src/app/admin/message/page.tsx
================================================
'use client';
import React, { Suspense } from 'react';
import dynamic from 'next/dynamic';
import Loading from '@/components/admin/Loading';
// Dynamically import the MessageList component
const MessageList = dynamic(
() => import('@/components/admin/MessageList'),
{
loading: () => <Loading />,
ssr: false
}
);
export default function MessagesPage() {
return (
<Suspense fallback={<Loading />}>
<MessageList />
</Suspense>
);
}
================================================
FILE: assets/src/app/admin/page.tsx
================================================
'use client';
import React, { useEffect, useState } from 'react';
import Login from '@/components/admin/Login';
import Cookies from 'universal-cookie';
export default function AdminPage() {
const [isAuthenticated, setAuthenticate] = useState<boolean | null>(null);
useEffect(() => {
const cookies = new Cookies();
const token = cookies.get('token');
if (token) {
// Validate token
const validateToken = async () => {
try {
const response = await fetch('/api/auth/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ token }),
});
if (response.ok) {
setAuthenticate(true);
window.location.href = '/admin/rooms';
} else {
setAuthenticate(false);
}
} catch (error) {
console.error('Error validating token:', error);
setAuthenticate(false);
}
};
validateToken();
} else {
setAuthenticate(false);
}
}, []);
if (isAuthenticated === null) {
return <div>Loading...</div>;
}
return (
<div>
<Login setAuthenticate={setAuthenticate} />
</div>
);
}
================================================
FILE: assets/src/app/admin/report/page.tsx
================================================
'use client';
import React, { Suspense } from 'react';
import dynamic from 'next/dynamic';
import Loading from '@/components/admin/Loading';
// Dynamically import the Report component
const Report = dynamic(
() => import('@/components/admin/Report'),
{
loading: () => <Loading />,
ssr: false
}
);
export default function ReportPage() {
return (
<Suspense fallback={<Loading />}>
<Report defaultDate={new Date()} />
</Suspense>
);
}
================================================
FILE: assets/src/app/admin/room/[id]/page.tsx
================================================
'use client';
import React, { Suspense } from 'react';
import dynamic from 'next/dynamic';
import Loading from '@/components/admin/Loading';
// Dynamically import the RoomDetails component
const RoomDetails = dynamic(
() => import('@/components/admin/RoomDetails'),
{
loading: () => <Loading />,
ssr: false
}
);
export default function RoomDetailsPage({params}: {params: Promise<{ id: string }>}) {
// Use React.use() to unwrap the params Promise before accessing its properties
const unwrappedParams = React.use(params);
const { id } = unwrappedParams;
return (
<Suspense fallback={<Loading />}>
<RoomDetails id={id} />
</Suspense>
);
}
================================================
FILE: assets/src/app/admin/rooms/page.tsx
================================================
'use client';
import React, { Suspense } from 'react';
import dynamic from 'next/dynamic';
import Loading from '@/components/admin/Loading';
// Dynamically import the RoomListings component
const RoomListings = dynamic(
() => import('@/components/admin/RoomListings'),
{
loading: () => <Loading />,
ssr: false
}
);
export default function RoomsPage() {
return (
<Suspense fallback={<Loading />}>
<RoomListings />
</Suspense>
);
}
================================================
FILE: assets/src/app/api/auth/login/route.ts
================================================
import { NextResponse } from 'next/server';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export async function POST(request: Request) {
try {
const { username, password } = await request.json();
// Forward the login request to the auth service
const authApi = process.env.AUTH_API || 'http://localhost:3004';
const response = await fetch(`${authApi}/auth/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ username, password }),
});
if (!response.ok) {
return NextResponse.json(
{ error: 'Invalid credentials' },
{ status: 401 }
);
}
try {
// Extract the token from the set-cookie header
const cookieHeader = response.headers.get('set-cookie');
if (!cookieHeader) {
return NextResponse.json(
{ error: 'No token found in response' },
{ status: 401 }
);
}
// Extract the token from the set-cookie header
const tokenMatch = cookieHeader.match(/token=([^;]+)/);
if (!tokenMatch) {
return NextResponse.json(
{ error: 'No token found in response' },
{ status: 401 }
);
}
const token = tokenMatch[1];
return NextResponse.json({ token });
} catch (parseError) {
return NextResponse.json(
{ error: 'Invalid token format from auth service' },
{ status: 500 }
);
}
} catch (error) {
console.error('Error during login:', error);
return NextResponse.json(
{ error: 'An unexpected error occurred' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/auth/logout/route.ts
================================================
import { NextResponse } from 'next/server';
export async function POST(request: Request) {
try {
// Parse the request body to get the token
const { token } = await request.json();
if (!token) {
return NextResponse.json({ message: 'Token is required' }, { status: 400 });
}
// Here you would typically handle the actual logout logic
// For example, invalidate the token on the server, clear sessions, etc.
// Return a success response
return NextResponse.json({ success: true });
} catch (error) {
console.error('Logout error:', error);
return NextResponse.json({ message: 'Failed to logout' }, { status: 500 });
}
}
================================================
FILE: assets/src/app/api/auth/validate/route.ts
================================================
import { NextResponse } from 'next/server';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export async function POST(request: Request) {
try {
const { token } = await request.json();
if (!token) {
return NextResponse.json(
{ error: 'No token provided' },
{ status: 401 }
);
}
// Forward the validation request to the auth service
const authApi = process.env.AUTH_API || 'http://localhost:3004';
const response = await fetch(`${authApi}/auth/validate`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': `token=${token}`
},
body: JSON.stringify({ token })
});
if (!response.ok) {
return NextResponse.json(
{ error: 'Invalid token' },
{ status: response.status }
);
}
return NextResponse.json({ valid: true });
} catch (error) {
console.error('Error validating token:', error);
return NextResponse.json(
{ error: 'An unexpected error occurred' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/booking/[id]/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export async function PUT(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
const body = await request.json();
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${bookingApi}/booking/${id}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Cookie': `token=${token.value}`
},
body: JSON.stringify(body),
});
if (!response.ok) {
try {
const errorData = await response.json();
return NextResponse.json(
{ errors: errorData.fieldErrors || ['Failed to update booking'] },
{ status: response.status }
);
} catch (e) {
return NextResponse.json(
{ error: 'Failed to update booking' },
{ status: response.status }
);
}
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error updating booking:', error);
return NextResponse.json(
{ error: 'Failed to update booking' },
{ status: 500 }
);
}
}
export async function DELETE(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${bookingApi}/booking/${id}`, {
method: 'DELETE',
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
throw new Error(`Failed to delete booking: ${response.status}`);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error deleting booking:', error);
return NextResponse.json(
{ error: 'Failed to delete booking' },
{ status: 500 }
);
}
}
export async function GET(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${bookingApi}/booking/${id}`, {
method: 'GET',
headers: {
'Accept': '*/*',
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
const errorData = await response.json().catch(() => ({
error: `Failed to fetch booking: ${response.status}`
}));
return NextResponse.json(
errorData,
{ status: response.status }
);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching booking:', error);
return NextResponse.json(
{ error: 'Failed to fetch booking' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/booking/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../utils/fetch-retry';
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url);
const roomid = searchParams.get('roomid');
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
if (!roomid) {
return NextResponse.json(
{ error: 'Room ID is required' },
{ status: 400 }
);
}
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
const response = await fetch(`${bookingApi}/booking/?roomid=${roomid}`, {
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
throw new Error(`Failed to fetch bookings: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data || []);
} catch (error) {
console.error('Error fetching bookings:', error);
return NextResponse.json([], { status: 500 });
}
}
export async function POST(request: Request) {
try {
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
const response = await fetch(`${bookingApi}/booking/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(await request.json())
});
if (!response.ok) {
try {
const errorData = await response.json();
return NextResponse.json(
{ errors: errorData.fieldErrors || ['Failed to create booking'] },
{ status: response.status }
);
} catch (e) {
return NextResponse.json(
{ error: 'Failed to create booking' },
{ status: response.status }
);
}
}
const data = await response.json();
return NextResponse.json(data.booking || [], { status: response.status});
} catch (error) {
console.error('Error fetching bookings:', error);
return NextResponse.json([], { status: 500 });
}
}
================================================
FILE: assets/src/app/api/booking/summary/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url);
const roomid = searchParams.get('roomid');
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
if (!roomid) {
return NextResponse.json(
{ error: 'Room ID is required' },
{ status: 400 }
);
}
const bookingApi = process.env.BOOKING_API || 'http://localhost:3000';
const response = await fetch(`${bookingApi}/booking/summary?roomid=${roomid}`, {
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
throw new Error(`Failed to fetch booking summary: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data || {});
} catch (error) {
console.error('Error fetching booking summary:', error);
return NextResponse.json(
{ error: 'Failed to fetch booking summary' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/branding/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../utils/fetch-retry';
export const dynamic = 'force-dynamic'
// Server-side API route that proxies requests to the branding service
export async function GET() {
try {
const brandingApi = process.env.BRANDING_API || 'http://localhost:3002';
const response = await fetch(`${brandingApi}/branding/`, {
next: {
revalidate: 60, // Cache for 60 seconds
tags: ['branding'] // Add a cache tag
}
});
if (!response.ok) {
throw new Error(`Failed to fetch branding: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching branding:', error);
return NextResponse.json(
{ error: 'Failed to fetch branding' },
{ status: 500 }
);
}
}
export async function PUT(request: Request) {
try {
const brandingApi = process.env.BRANDING_API || 'http://localhost:3002';
const body = await request.json();
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${brandingApi}/branding/`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Cookie': `token=${token.value}`
},
body: JSON.stringify(body),
});
if (response.status !== 202) {
const errorData = await response.json();
return NextResponse.json(
errorData,
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error updating branding:', error);
return NextResponse.json(
{ errors: ['An unexpected error occurred'] },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/message/[id]/read/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../../../utils/fetch-retry';
export async function PUT(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
const response = await fetch(`${messageApi}/message/${id}/read`, {
method: 'PUT',
headers: {
'Cookie': `token=${token.value}`
}
});
if( response.status !== 202) {
throw new Error(`Failed to mark message as read: ${response.status}`);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error marking message as read:', error);
return NextResponse.json(
{ error: 'Failed to mark message as read' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/message/[id]/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export async function GET(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${messageApi}/message/${id}`, {
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
errorData,
{ status: response.status }
);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching message:', error);
return NextResponse.json(
{ error: 'Failed to fetch message' },
{ status: 500 }
);
}
}
export async function PUT(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${messageApi}/message/${id}/read`, {
method: 'PUT',
headers: {
'Cookie': `token=${token.value}`
}
});
if (response.status !== 202) {
const errorData = await response.json();
return NextResponse.json(
errorData,
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error marking message as read:', error);
return NextResponse.json(
{ error: 'Failed to mark message as read' },
{ status: 500 }
);
}
}
export async function DELETE(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
// Get the token from cookies
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const response = await fetch(`${messageApi}/message/${id}`, {
method: 'DELETE',
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
errorData,
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error deleting message:', error);
return NextResponse.json(
{ error: 'Failed to delete message' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/message/count/route.ts
================================================
import { NextResponse } from 'next/server';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export const dynamic = 'force-dynamic'
export async function GET(request: Request) {
try {
// Get the original URL and headers
const url = request.url;
const headers = Object.fromEntries(request.headers);
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
// Make the request with explicit no-cache headers
const response = await fetch(`${messageApi}/message/count`, {
cache: 'no-store',
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache, no-store, must-revalidate',
'User-Agent': 'NextJS-Direct-Test/1.0'
}
});
const rawText = await response.text();
try {
const data = JSON.parse(rawText);
return NextResponse.json({
count: data.count
});
} catch (e) {
return NextResponse.json({
count: 0,
error: 'JSON parse error',
rawText: rawText
});
}
} catch (error) {
return NextResponse.json({ count: 0, error: error });
}
}
================================================
FILE: assets/src/app/api/message/route.ts
================================================
import { NextResponse } from 'next/server';
import { fetchWithRetry as fetch } from '../../../utils/fetch-retry';
export async function GET() {
try {
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
const response = await fetch(`${messageApi}/message/`, {
headers : {
'Content-type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`Failed to fetch messages: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching messages:', error);
return NextResponse.json([], { status: 500 });
}
}
export async function POST(request: Request) {
try {
const messageApi = process.env.MESSAGE_API || 'http://localhost:3006';
const body = await request.json();
const response = await fetch(`${messageApi}/message/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
if (response.status !== 201) {
const errorData = await response.json();
return NextResponse.json(
errorData.fieldErrors,
{ status: response.status }
);
} else {
return NextResponse.json({ success: true });
}
} catch (error) {
console.error('Error creating message:', error);
return NextResponse.json(
{ error: 'Failed to create message' },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/report/room/[roomid]/route.ts
================================================
import { NextResponse } from 'next/server';
import { fetchWithRetry as fetch } from '../../../../../utils/fetch-retry';
export async function GET(
request: Request,
{ params }: { params: Promise<{ roomid: string }> }
) {
try {
const { roomid } = await params;
// Forward the request to the report service
const reportApi = process.env.REPORT_API || 'http://localhost:3005';
const response = await fetch(`${reportApi}/report/room/${roomid}`);
if (!response.ok) {
throw new Error(`Failed to fetch room report: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data.report || []);
} catch (error) {
console.error('Error fetching room report:', error);
return NextResponse.json([], { status: 500 });
}
}
================================================
FILE: assets/src/app/api/report/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../utils/fetch-retry';
export const dynamic = 'force-dynamic'
export async function GET() {
try {
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ error: 'Authentication required' },
{ status: 401 }
);
}
const reportApi = process.env.REPORT_API || 'http://localhost:3005';
const response = await fetch(`${reportApi}/report/`, {
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
throw new Error(`Failed to fetch report: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching report:', error);
return NextResponse.json([], { status: 500 });
}
}
================================================
FILE: assets/src/app/api/room/[id]/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';
export async function GET(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const roomApi = process.env.ROOM_API || 'http://localhost:3001';
const response = await fetch(`${roomApi}/room/${id}`);
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
errorData,
{ status: response.status }
);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching room:', error);
return NextResponse.json([], { status: 500 });
}
}
export async function DELETE(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const roomApi = process.env.ROOM_API || 'http://localhost:3001';
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ errors: ['Authentication required'] },
{ status: 401 }
);
}
const response = await fetch(`${roomApi}/room/${id}`, {
method: 'DELETE',
headers: {
'Cookie': `token=${token.value}`
}
});
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
{ errors: errorData.errors || ['Failed to delete room'] },
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error deleting room:', error);
return NextResponse.json(
{ errors: ['An unexpected error occurred'] },
{ status: 500 }
);
}
}
export async function PUT(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const roomApi = process.env.ROOM_API || 'http://localhost:3001';
const body = await request.json();
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ errors: ['Authentication required'] },
{ status: 401 }
);
}
const response = await fetch(`${roomApi}/room/${id}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Cookie': `token=${token.value}`
},
body: JSON.stringify(body),
});
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
{ errors: errorData.fieldErrors || ['Failed to update room'] },
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error updating room:', error);
return NextResponse.json(
{ errors: ['An unexpected error occurred'] },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/api/room/route.ts
================================================
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { fetchWithRetry as fetch } from '../../../utils/fetch-retry';
// Server-side API route that proxies requests to the room service
export async function GET(request: Request) {
try {
const { searchParams } = new URL(request.url);
const checkin = searchParams.get('checkin');
const checkout = searchParams.get('checkout');
const roomApi = process.env.ROOM_API || 'http://localhost:3001';
// Build the URL based on whether date parameters are provided
let apiUrl = `${roomApi}/room/`;
if (checkin && checkout) {
apiUrl = `${roomApi}/room/?checkin=${checkin}&checkout=${checkout}`;
}
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error(`Failed to fetch rooms: ${response.status}`);
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error('Error fetching rooms:', error);
return NextResponse.json([], { status: 500 });
}
}
export async function POST(
request: Request,
) {
try {
const roomApi = process.env.ROOM_API || 'http://localhost:3001';
const body = await request.json();
const cookieStore = await cookies();
const token = cookieStore.get('token');
if (!token) {
return NextResponse.json(
{ errors: ['Authentication required'] },
{ status: 401 }
);
}
const response = await fetch(`${roomApi}/room/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Cookie': `token=${token.value}`
},
body: JSON.stringify(body),
});
if (!response.ok) {
const errorData = await response.json();
return NextResponse.json(
{ errors: errorData.fieldErrors || ['Failed to create room'] },
{ status: response.status }
);
}
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error creating room:', error);
return NextResponse.json(
{ errors: ['An unexpected error occurred'] },
{ status: 500 }
);
}
}
================================================
FILE: assets/src/app/cookie/page.tsx
================================================
'use client';
import React, { useState, useEffect } from 'react';
import Footer from '@/components/Footer';
import { Branding } from '@/types/branding';
export default function CookiePolicy() {
const [branding, setBranding] = useState<Branding | null>(null);
useEffect(() => {
const fetchBranding = async () => {
const response = await fetch('/api/branding');
const data = await response.json();
setBranding(data);
};
fetchBranding();
}, []);
if (!branding) {
return (
<div className="container-fluid text-center p-5">
<div className="spinner-border" role="status">
<span className="visually-hidden"></span>
</div>
</div>
)
}
return (
<>
<div className="container">
<div className="row">
<div className="col-sm-12">
<h1>Cookie Policy</h1>
<p>BY CONTINUING TO USE OUR SITE AND SERVICES, YOU ARE AGREEING TO THE USE OF COOKIES AND SIMILAR TECHNOLOGIES FOR THE PURPOSES WE DESCRIBE IN THIS PRIVACY POLICY. IF YOU DO NOT ACCEPT THE USE OF COOKIES AND SIMILAR TECHNOLOGIES, DO NOT USE THIS SITE.</p>
<h2>What is a cookie?</h2>
<p>A cookie is a simple text file that is stored on your computer or mobile device by a website's server. Each cookie is unique to your web browser. It will contain some anonymous information such as a unique identifier and the site name and some digits and numbers.</p>
<p>Most websites you visit use cookies to improve your user experience by allowing the website to 'remember' you, either for the duration of your visit (using a 'session cookie') or for repeat visits (using a 'persistent cookie').</p>
<p>Cookies may be set by the website you are visiting ('first party cookies') or they may be set by other websites who run content on the page you are viewing ('third party cookies').</p>
<h2>What do cookies do?</h2>
<p>Cookies have lots of different jobs, like letting you navigate between pages efficiently, storing your preferences, and improving your experience of a website. Cookies make the interaction between you and the website faster and easier. If a website doesn't use cookies, it will think you are a new visitor every time you move to a new page on the site, for example, even after you "log in," if you move to another page it won't recognise you and it won't be able to keep you logged in.</p>
<h2>How does Automation in Testing Online use cookies?</h2>
<p>Automation in Testing Online uses different types of cookies to enhance and improve your experience.</p>
<p>Automation in Testing Online uses cookies for:</p>
<table className="table table-bordered">
<tbody>
<tr><th>Category of Use</th><th>Description</th></tr>
<tr><td>Security</td><td>We use cookies to enable and support our security features, for example: to authenticate Members, prevent fraudulent use of login credentials, and protect Member data from unauthorized parties.</td></tr>
<tr><td>Session State</td><td>We collect information about how our Users and Members use and interact with the Site. This may include the pages Members visit most often and when and where Members get error messages. We use these "session state cookies" to help us improve our Site and Services. Blocking or deleting these cookies will not prevent the Site from working. Analytics These cookies help us learn how our Site performs in different locations. We use cookies to understand and improve our Services and features.</td></tr>
</tbody>
</table>
<h2>What third-party cookies does Automation in Testing Online use?</h2>
<p>Trusted partners like Cloudflare, and analytics companies like Google Analytics may also place cookies on your device. Please read our partners' privacy policies (linked below) to ensure that you're comfortable with how they use cookies. We've also provided links to opt out of their services, if you'd like.</p>
<ul>
<li><a href="https://www.cloudflare.com/privacypolicy/" target="_blank" re
gitextract_ivlqm7kd/ ├── .github/ │ └── workflows/ │ ├── assets-build.yml │ ├── auth-build.yml │ ├── booking-build.yml │ ├── branding-build.yml │ ├── e2e-tests.yml │ ├── message-build.yml │ ├── report-build.yml │ └── room-build.yml ├── .gitignore ├── .utilities/ │ ├── mocking/ │ │ ├── README.md │ │ ├── mappings/ │ │ │ ├── branding.json │ │ │ ├── count.json │ │ │ ├── message.json │ │ │ ├── messages.json │ │ │ ├── report.json │ │ │ └── validate.json │ │ └── wiremock-standalone.jar │ ├── monitor/ │ │ ├── apimonitor.js │ │ ├── local_monitor.js │ │ └── prod_monitor.js │ └── wirebridge/ │ ├── Dockerfile │ ├── README.md │ ├── Wirebridge-0.0.3.jar │ └── mappings/ │ ├── add_booking.json │ ├── add_room.json │ ├── config.json │ └── query_booking.json ├── LICENSE ├── README.md ├── assets/ │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── next.config.js │ ├── package.json │ ├── pom.xml │ ├── src/ │ │ ├── __tests__/ │ │ │ ├── Branding.test.tsx │ │ │ ├── Footer.test.tsx │ │ │ ├── HomeNav.test.tsx │ │ │ ├── HotelContact.test.tsx │ │ │ ├── HotelLogo.test.tsx │ │ │ ├── HotelMap.test.tsx │ │ │ ├── HotelRoomInfo.test.tsx │ │ │ ├── Message.test.tsx │ │ │ ├── MessageList.test.tsx │ │ │ ├── Nav.test.tsx │ │ │ ├── Notification.test.tsx │ │ │ ├── Report.test.tsx │ │ │ ├── RoomDetails.test.tsx │ │ │ ├── __snapshots__/ │ │ │ │ ├── Branding.test.tsx.snap │ │ │ │ ├── Message.test.tsx.snap │ │ │ │ ├── MessageList.test.tsx.snap │ │ │ │ ├── Nav.test.tsx.snap │ │ │ │ ├── Notification.test.tsx.snap │ │ │ │ └── RoomDetails.test.tsx.snap │ │ │ ├── examples/ │ │ │ │ ├── __snapshots__/ │ │ │ │ │ └── contract-test.tsx.snap │ │ │ │ ├── contract-test.tsx │ │ │ │ ├── contract.json │ │ │ │ ├── home-page-test.tsx │ │ │ │ └── task-analysis-test.tsx │ │ │ └── jest.setup.ts │ │ ├── app/ │ │ │ ├── admin/ │ │ │ │ ├── branding/ │ │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ ├── message/ │ │ │ │ │ └── page.tsx │ │ │ │ ├── page.tsx │ │ │ │ ├── report/ │ │ │ │ │ └── page.tsx │ │ │ │ ├── room/ │ │ │ │ │ └── [id]/ │ │ │ │ │ └── page.tsx │ │ │ │ └── rooms/ │ │ │ │ └── page.tsx │ │ │ ├── api/ │ │ │ │ ├── auth/ │ │ │ │ │ ├── login/ │ │ │ │ │ │ └── route.ts │ │ │ │ │ ├── logout/ │ │ │ │ │ │ └── route.ts │ │ │ │ │ └── validate/ │ │ │ │ │ └── route.ts │ │ │ │ ├── booking/ │ │ │ │ │ ├── [id]/ │ │ │ │ │ │ └── route.ts │ │ │ │ │ ├── route.ts │ │ │ │ │ └── summary/ │ │ │ │ │ └── route.ts │ │ │ │ ├── branding/ │ │ │ │ │ └── route.ts │ │ │ │ ├── message/ │ │ │ │ │ ├── [id]/ │ │ │ │ │ │ ├── read/ │ │ │ │ │ │ │ └── route.ts │ │ │ │ │ │ └── route.ts │ │ │ │ │ ├── count/ │ │ │ │ │ │ └── route.ts │ │ │ │ │ └── route.ts │ │ │ │ ├── report/ │ │ │ │ │ ├── room/ │ │ │ │ │ │ └── [roomid]/ │ │ │ │ │ │ └── route.ts │ │ │ │ │ └── route.ts │ │ │ │ └── room/ │ │ │ │ ├── [id]/ │ │ │ │ │ └── route.ts │ │ │ │ └── route.ts │ │ │ ├── cookie/ │ │ │ │ └── page.tsx │ │ │ ├── globals.css │ │ │ ├── layout.tsx │ │ │ ├── page.tsx │ │ │ ├── privacy/ │ │ │ │ └── page.tsx │ │ │ └── reservation/ │ │ │ └── [id]/ │ │ │ └── page.tsx │ │ ├── components/ │ │ │ ├── Footer.tsx │ │ │ ├── HomeNav.tsx │ │ │ ├── admin/ │ │ │ │ ├── AdminBooking.tsx │ │ │ │ ├── BookingListing.tsx │ │ │ │ ├── BookingListings.tsx │ │ │ │ ├── Branding.tsx │ │ │ │ ├── Loading.tsx │ │ │ │ ├── Login.tsx │ │ │ │ ├── Message.tsx │ │ │ │ ├── MessageList.tsx │ │ │ │ ├── Nav.tsx │ │ │ │ ├── Notification.tsx │ │ │ │ ├── Report.tsx │ │ │ │ ├── RoomDetails.tsx │ │ │ │ ├── RoomForm.tsx │ │ │ │ ├── RoomListing.tsx │ │ │ │ └── RoomListings.tsx │ │ │ ├── home/ │ │ │ │ ├── Availability.tsx │ │ │ │ ├── HotelContact.tsx │ │ │ │ ├── HotelLogo.tsx │ │ │ │ ├── HotelMap.tsx │ │ │ │ └── HotelRoomInfo.tsx │ │ │ └── reservation/ │ │ │ ├── BookingForm.tsx │ │ │ ├── Breadcrumb.tsx │ │ │ ├── RoomDetails.tsx │ │ │ └── SimilarRooms.tsx │ │ ├── styles/ │ │ │ └── reservations.css │ │ ├── types/ │ │ │ ├── availability.d.ts │ │ │ ├── booking.d.ts │ │ │ ├── branding.d.ts │ │ │ ├── react-big-calendar.d.ts │ │ │ └── room.d.ts │ │ └── utils/ │ │ ├── fetch-retry.ts │ │ └── iconUtils.ts │ ├── tsconfig.json │ └── tsconfig.test.json ├── auth/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── AuthApplication.java │ │ │ │ ├── AuthController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── db/ │ │ │ │ └── AuthDB.java │ │ │ ├── model/ │ │ │ │ ├── Auth.java │ │ │ │ ├── Decision.java │ │ │ │ └── Token.java │ │ │ └── service/ │ │ │ ├── AuthService.java │ │ │ ├── DatabaseScheduler.java │ │ │ └── RandomString.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── db.sql │ │ └── seed.sql │ └── test/ │ └── java/ │ └── com/ │ └── automationintesting/ │ ├── integration/ │ │ ├── AuthIntegrationTest.java │ │ └── example/ │ │ └── TaskAnalysisIntegrationTest.java │ └── unit/ │ ├── db/ │ │ ├── AuthDBTest.java │ │ └── BaseTest.java │ ├── example/ │ │ └── TaskAnalysisTest.java │ └── service/ │ └── AuthServiceTest.java ├── booking/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── BookingApplication.java │ │ │ │ ├── BookingController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── db/ │ │ │ │ ├── BookingDB.java │ │ │ │ ├── InsertSql.java │ │ │ │ └── UpdateSql.java │ │ │ ├── model/ │ │ │ │ ├── db/ │ │ │ │ │ ├── AvailableRoom.java │ │ │ │ │ ├── Booking.java │ │ │ │ │ ├── BookingDates.java │ │ │ │ │ ├── BookingSummaries.java │ │ │ │ │ ├── BookingSummary.java │ │ │ │ │ ├── Bookings.java │ │ │ │ │ ├── CreatedBooking.java │ │ │ │ │ ├── Message.java │ │ │ │ │ └── Token.java │ │ │ │ └── service/ │ │ │ │ └── BookingResult.java │ │ │ ├── requests/ │ │ │ │ ├── AuthRequests.java │ │ │ │ └── MessageRequests.java │ │ │ └── service/ │ │ │ ├── BookingService.java │ │ │ ├── DatabaseScheduler.java │ │ │ ├── DateCheckValidator.java │ │ │ ├── MessageBuilder.java │ │ │ └── MethodArgumentNotValidExceptionHandler.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── db.sql │ │ └── seed.sql │ └── test/ │ ├── java/ │ │ └── com/ │ │ └── automationintesting/ │ │ ├── integration/ │ │ │ ├── BookingDateConflictIT.java │ │ │ ├── BookingValidationIT.java │ │ │ ├── GetBookingIT.java │ │ │ ├── MessageRequestIT.java │ │ │ └── examples/ │ │ │ ├── BookingIntegrationIT.java │ │ │ └── ContractIT.java │ │ └── unit/ │ │ ├── BaseTest.java │ │ ├── db/ │ │ │ └── DateConflictTest.java │ │ ├── examples/ │ │ │ └── SqlTest.java │ │ ├── model/ │ │ │ └── MessageBuilderTest.java │ │ └── service/ │ │ ├── BookingServiceTest.java │ │ └── DateCheckValidatorTest.java │ └── resources/ │ └── contract.json ├── branding/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── BrandingApplication.java │ │ │ │ ├── BrandingController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── db/ │ │ │ │ ├── BrandingDB.java │ │ │ │ ├── InsertSql.java │ │ │ │ └── UpdateSql.java │ │ │ ├── model/ │ │ │ │ ├── db/ │ │ │ │ │ ├── Address.java │ │ │ │ │ ├── Branding.java │ │ │ │ │ ├── Contact.java │ │ │ │ │ └── Map.java │ │ │ │ └── service/ │ │ │ │ ├── BrandingResult.java │ │ │ │ └── Token.java │ │ │ ├── requests/ │ │ │ │ └── AuthRequests.java │ │ │ └── service/ │ │ │ ├── BrandingService.java │ │ │ ├── DatabaseScheduler.java │ │ │ └── MethodArgumentNotValidExceptionHandler.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── db/ │ │ │ └── changelog/ │ │ │ └── db.changelog-master.yaml │ │ ├── db.sql │ │ └── seed.sql │ └── test/ │ └── java/ │ └── com/ │ └── automationintesting/ │ ├── integration/ │ │ ├── BrandingServiceIT.java │ │ ├── BrandingServiceIT.returnsBrandingData.approved.txt │ │ └── BrandingServiceIT.updateBrandingData.approved.txt │ └── unit/ │ └── service/ │ └── BrandingServiceTest.java ├── build_locally.cmd ├── build_locally.sh ├── docker-compose.yml ├── end-to-end-tests/ │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ └── java/ │ │ ├── driverfactory/ │ │ │ └── DriverFactory.java │ │ ├── models/ │ │ │ ├── Booking.java │ │ │ ├── Contact.java │ │ │ └── Room.java │ │ └── pageobjects/ │ │ ├── BasePage.java │ │ ├── BrandingPage.java │ │ ├── HomePage.java │ │ ├── LoginPage.java │ │ ├── MessagePage.java │ │ ├── NavPage.java │ │ ├── ReportPage.java │ │ ├── ReservationPage.java │ │ ├── RoomListingPage.java │ │ ├── RoomPage.java │ │ └── SearchPage.java │ └── test/ │ └── java/ │ ├── SmokeTest.java │ └── TestSetup.java ├── message/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── MessageApplication.java │ │ │ │ ├── MessageController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── db/ │ │ │ │ ├── InsertSql.java │ │ │ │ └── MessageDB.java │ │ │ ├── model/ │ │ │ │ ├── db/ │ │ │ │ │ ├── Count.java │ │ │ │ │ ├── Message.java │ │ │ │ │ ├── MessageSummary.java │ │ │ │ │ └── Messages.java │ │ │ │ ├── requests/ │ │ │ │ │ └── Token.java │ │ │ │ └── service/ │ │ │ │ └── MessageResult.java │ │ │ ├── requests/ │ │ │ │ └── AuthRequests.java │ │ │ └── service/ │ │ │ ├── DatabaseScheduler.java │ │ │ ├── MessageService.java │ │ │ └── MethodArgumentNotValidExceptionHandler.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── db.sql │ │ └── seed.sql │ └── test/ │ └── java/ │ └── com/ │ └── automationintesting/ │ ├── integration/ │ │ ├── MessageEndpointsIT.createMessage.approved.txt │ │ ├── MessageEndpointsIT.getCount.approved.txt │ │ ├── MessageEndpointsIT.getMessage.approved.txt │ │ ├── MessageEndpointsIT.getMessages.approved.txt │ │ ├── MessageEndpointsIT.java │ │ └── MessageEndpointsIT.markAsReadTest.approved.txt │ └── unit/ │ ├── db/ │ │ ├── BaseTest.java │ │ ├── MessageDBTest.java │ │ └── MessageDBTest.testGetMessages.approved.txt │ └── service/ │ └── MessageServiceTest.java ├── pom.xml ├── report/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── ReportApplication.java │ │ │ │ ├── ReportController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── model/ │ │ │ │ ├── booking/ │ │ │ │ │ ├── Booking.java │ │ │ │ │ ├── BookingDates.java │ │ │ │ │ ├── BookingSummaries.java │ │ │ │ │ ├── BookingSummary.java │ │ │ │ │ └── Bookings.java │ │ │ │ ├── report/ │ │ │ │ │ ├── Entry.java │ │ │ │ │ └── Report.java │ │ │ │ └── room/ │ │ │ │ ├── Room.java │ │ │ │ └── Rooms.java │ │ │ ├── requests/ │ │ │ │ ├── BookingRequests.java │ │ │ │ └── RoomRequests.java │ │ │ └── service/ │ │ │ └── ReportService.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ └── application.properties │ └── test/ │ └── java/ │ └── com/ │ └── automationintesting/ │ ├── integration/ │ │ ├── BuildReportIT.java │ │ ├── BuildReportIT.testReportCreation.approved.txt │ │ └── BuildReportIT.testSpecificRoomReportCreation.approved.txt │ └── unit/ │ └── service/ │ └── ReportServiceTest.java ├── room/ │ ├── Dockerfile │ ├── README.md │ ├── pom.xml │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── automationintesting/ │ │ │ ├── api/ │ │ │ │ ├── RoomApplication.java │ │ │ │ ├── RoomController.java │ │ │ │ └── SwaggerConfig.java │ │ │ ├── db/ │ │ │ │ ├── InsertSql.java │ │ │ │ ├── RoomDB.java │ │ │ │ └── UpdateSql.java │ │ │ ├── model/ │ │ │ │ ├── db/ │ │ │ │ │ ├── Room.java │ │ │ │ │ └── Rooms.java │ │ │ │ ├── request/ │ │ │ │ │ ├── Token.java │ │ │ │ │ └── UnavailableRoom.java │ │ │ │ └── service/ │ │ │ │ └── RoomResult.java │ │ │ ├── requests/ │ │ │ │ ├── AuthRequests.java │ │ │ │ └── BookingRequests.java │ │ │ └── service/ │ │ │ ├── DatabaseScheduler.java │ │ │ ├── MethodArgumentNotValidExceptionHandler.java │ │ │ └── RoomService.java │ │ └── resources/ │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── db.sql │ │ └── seed.sql │ └── test/ │ └── java/ │ └── com/ │ └── automationintesting/ │ ├── integration/ │ │ └── RoomValidationIT.java │ └── unit/ │ ├── examples/ │ │ ├── BaseTest.java │ │ └── SqlTest.java │ └── service/ │ └── RoomServiceTest.java ├── run_locally.cmd └── run_locally.sh
SYMBOL INDEX (1001 symbols across 205 files)
FILE: assets/next.config.js
method rewrites (line 5) | async rewrites() {
FILE: assets/src/__tests__/Report.test.tsx
type ReportItem (line 5) | interface ReportItem {
FILE: assets/src/__tests__/RoomDetails.test.tsx
type RoomObject (line 6) | interface RoomObject {
FILE: assets/src/app/admin/branding/page.tsx
function BrandingPage (line 16) | function BrandingPage() {
FILE: assets/src/app/admin/layout.tsx
function postValidation (line 10) | async function postValidation(cookies: Cookies): Promise<boolean> {
function AdminLayout (line 30) | function AdminLayout({
FILE: assets/src/app/admin/message/page.tsx
function MessagesPage (line 16) | function MessagesPage() {
FILE: assets/src/app/admin/page.tsx
function AdminPage (line 7) | function AdminPage() {
FILE: assets/src/app/admin/report/page.tsx
function ReportPage (line 16) | function ReportPage() {
FILE: assets/src/app/admin/room/[id]/page.tsx
function RoomDetailsPage (line 16) | function RoomDetailsPage({params}: {params: Promise<{ id: string }>}) {
FILE: assets/src/app/admin/rooms/page.tsx
function RoomsPage (line 16) | function RoomsPage() {
FILE: assets/src/app/api/auth/login/route.ts
function POST (line 4) | async function POST(request: Request) {
FILE: assets/src/app/api/auth/logout/route.ts
function POST (line 3) | async function POST(request: Request) {
FILE: assets/src/app/api/auth/validate/route.ts
function POST (line 4) | async function POST(request: Request) {
FILE: assets/src/app/api/booking/[id]/route.ts
function PUT (line 5) | async function PUT(
function DELETE (line 59) | async function DELETE(
function GET (line 99) | async function GET(
FILE: assets/src/app/api/booking/route.ts
function GET (line 5) | async function GET(request: Request) {
function POST (line 46) | async function POST(request: Request) {
FILE: assets/src/app/api/booking/summary/route.ts
function GET (line 4) | async function GET(request: Request) {
FILE: assets/src/app/api/branding/route.ts
function GET (line 8) | async function GET() {
function PUT (line 33) | async function PUT(request: Request) {
FILE: assets/src/app/api/message/[id]/read/route.ts
function PUT (line 5) | async function PUT(
FILE: assets/src/app/api/message/[id]/route.ts
function GET (line 5) | async function GET(
function PUT (line 49) | async function PUT(
function DELETE (line 93) | async function DELETE(
FILE: assets/src/app/api/message/count/route.ts
function GET (line 6) | async function GET(request: Request) {
FILE: assets/src/app/api/message/route.ts
function GET (line 4) | async function GET() {
function POST (line 27) | async function POST(request: Request) {
FILE: assets/src/app/api/report/room/[roomid]/route.ts
function GET (line 4) | async function GET(
FILE: assets/src/app/api/report/route.ts
function GET (line 7) | async function GET() {
FILE: assets/src/app/api/room/[id]/route.ts
function GET (line 5) | async function GET(
function DELETE (line 31) | async function DELETE(
function PUT (line 74) | async function PUT(
FILE: assets/src/app/api/room/route.ts
function GET (line 6) | async function GET(request: Request) {
function POST (line 34) | async function POST(
FILE: assets/src/app/cookie/page.tsx
function CookiePolicy (line 8) | function CookiePolicy() {
FILE: assets/src/app/layout.tsx
function RootLayout (line 10) | function RootLayout({
FILE: assets/src/app/page.tsx
function Home (line 13) | function Home() {
FILE: assets/src/app/privacy/page.tsx
function PrivacyPolicy (line 8) | function PrivacyPolicy() {
FILE: assets/src/app/reservation/[id]/page.tsx
function Reservation (line 18) | function Reservation({params}: {params: Promise<{ id: string }>}) {
FILE: assets/src/components/Footer.tsx
type FooterProps (line 7) | interface FooterProps {
FILE: assets/src/components/HomeNav.tsx
type NavProps (line 5) | interface NavProps {
FILE: assets/src/components/admin/AdminBooking.tsx
type AdminBookingProps (line 7) | interface AdminBookingProps {
type Room (line 16) | interface Room {
FILE: assets/src/components/admin/BookingListing.tsx
type BookingListingProps (line 13) | interface BookingListingProps {
FILE: assets/src/components/admin/BookingListings.tsx
type BookingListingsProps (line 5) | interface BookingListingsProps {
FILE: assets/src/components/admin/Login.tsx
type LoginProps (line 4) | interface LoginProps {
FILE: assets/src/components/admin/Message.tsx
type MessageProps (line 4) | interface MessageProps {
type MessageDetails (line 10) | interface MessageDetails {
FILE: assets/src/components/admin/MessageList.tsx
type MessageProps (line 4) | interface MessageProps {
FILE: assets/src/components/admin/Nav.tsx
type NavProps (line 6) | interface NavProps {
FILE: assets/src/components/admin/Notification.tsx
type NotificationProps (line 4) | interface NotificationProps {
FILE: assets/src/components/admin/Report.tsx
type ReportProps (line 8) | interface ReportProps {
type BookingDates (line 12) | interface BookingDates {
type ReportEvent (line 18) | interface ReportEvent {
FILE: assets/src/components/admin/RoomDetails.tsx
type RoomDetailsProps (line 4) | interface RoomDetailsProps {
type RoomState (line 8) | interface RoomState {
FILE: assets/src/components/admin/RoomForm.tsx
type RoomFormProps (line 3) | interface RoomFormProps {
type RoomData (line 7) | interface RoomData {
FILE: assets/src/components/admin/RoomListing.tsx
type RoomListingProps (line 5) | interface RoomListingProps {
FILE: assets/src/components/home/Availability.tsx
function Availability (line 18) | function Availability() {
FILE: assets/src/components/home/HotelContact.tsx
type ContactDetails (line 4) | interface ContactDetails {
type HotelContactProps (line 11) | interface HotelContactProps {
type ContactForm (line 15) | interface ContactForm {
FILE: assets/src/components/home/HotelLogo.tsx
type HotelLogoProps (line 4) | interface HotelLogoProps {
FILE: assets/src/components/home/HotelMap.tsx
type HotelMapProps (line 8) | interface HotelMapProps {
FILE: assets/src/components/home/HotelRoomInfo.tsx
type HotelRoomInfoProps (line 5) | interface HotelRoomInfoProps {
FILE: assets/src/components/reservation/BookingForm.tsx
type RoomDetailsProps (line 10) | interface RoomDetailsProps {
type Event (line 14) | interface Event {
FILE: assets/src/components/reservation/Breadcrumb.tsx
type BreadcrumbProps (line 4) | interface BreadcrumbProps {
FILE: assets/src/components/reservation/RoomDetails.tsx
type RoomDetailsProps (line 6) | interface RoomDetailsProps {
FILE: assets/src/components/reservation/SimilarRooms.tsx
type SimilarRoomsProps (line 3) | interface SimilarRoomsProps {
FILE: assets/src/types/availability.d.ts
type Availability (line 1) | interface Availability {
FILE: assets/src/types/booking.d.ts
type Booking (line 1) | interface Booking {
FILE: assets/src/types/branding.d.ts
type Branding (line 1) | interface Branding {
FILE: assets/src/types/react-big-calendar.d.ts
type Event (line 4) | interface Event {
type SlotInfo (line 12) | interface SlotInfo {
type CalendarProps (line 19) | interface CalendarProps {
FILE: assets/src/types/room.d.ts
type Room (line 1) | interface Room {
FILE: auth/src/main/java/com/automationintesting/api/AuthApplication.java
class AuthApplication (line 7) | @SpringBootApplication
method main (line 11) | public static void main(String[] args) {
FILE: auth/src/main/java/com/automationintesting/api/AuthController.java
class AuthController (line 19) | @RestController
method createToken (line 25) | @RequestMapping(value = "/login", method = RequestMethod.POST)
method validateToken (line 41) | @RequestMapping(value = "/validate", method = RequestMethod.POST)
method clearToken (line 48) | @RequestMapping(value = "/logout", method = RequestMethod.POST)
FILE: auth/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 10) | @Configuration
method openAPI (line 13) | @Bean
method publicApi (line 19) | @Bean
FILE: auth/src/main/java/com/automationintesting/db/AuthDB.java
class AuthDB (line 21) | @Component
method AuthDB (line 32) | public AuthDB() throws SQLException, IOException {
method insertToken (line 56) | public Boolean insertToken(Token token) throws SQLException {
method queryToken (line 62) | public Token queryToken(Token token) throws SQLException {
method deleteToken (line 76) | public Boolean deleteToken(Token token) throws SQLException {
method queryCredentials (line 84) | public Boolean queryCredentials(Auth auth) throws SQLException {
method executeSqlFile (line 95) | private void executeSqlFile(String filename) throws IOException, SQLEx...
method resetDB (line 108) | public void resetDB() throws SQLException, IOException {
FILE: auth/src/main/java/com/automationintesting/model/Auth.java
class Auth (line 5) | public class Auth {
method Auth (line 12) | public Auth(String username, String password) {
method Auth (line 17) | public Auth() {
method getUsername (line 20) | public String getUsername() {
method getPassword (line 24) | public String getPassword() {
FILE: auth/src/main/java/com/automationintesting/model/Decision.java
class Decision (line 5) | public class Decision {
method Decision (line 11) | public Decision(HttpStatus httpStatus) {
method Decision (line 15) | public Decision(HttpStatus httpStatus, Token token) {
method getStatus (line 20) | public HttpStatus getStatus() {
method getToken (line 24) | public Token getToken() {
FILE: auth/src/main/java/com/automationintesting/model/Token.java
class Token (line 9) | public class Token {
method Token (line 14) | public Token(){
method Token (line 18) | public Token(String token) {
method Token (line 24) | public Token(String token, Date expiry){
method getToken (line 29) | public String getToken() {
method setToken (line 33) | public void setToken(String token) {
method getPreparedStatement (line 37) | public PreparedStatement getPreparedStatement(Connection connection) t...
method createExpiryTimestamp (line 47) | private Date createExpiryTimestamp() {
FILE: auth/src/main/java/com/automationintesting/service/AuthService.java
class AuthService (line 17) | @Service
method beginDbScheduler (line 23) | @EventListener(ApplicationReadyEvent.class)
method verify (line 29) | public HttpStatus verify(Token token) throws SQLException {
method deleteToken (line 39) | public HttpStatus deleteToken(Token token) throws SQLException {
method queryCredentials (line 49) | public Decision queryCredentials(Auth auth) throws SQLException {
FILE: auth/src/main/java/com/automationintesting/service/DatabaseScheduler.java
class DatabaseScheduler (line 11) | public class DatabaseScheduler {
method DatabaseScheduler (line 17) | public DatabaseScheduler() {
method startScheduler (line 25) | public void startScheduler(AuthDB authDB, TimeUnit timeUnit){
method getResetCount (line 47) | public int getResetCount() {
method stepScheduler (line 51) | public void stepScheduler() {
FILE: auth/src/main/java/com/automationintesting/service/RandomString.java
class RandomString (line 8) | public class RandomString {
method nextString (line 13) | public String nextString() {
method RandomString (line 33) | public RandomString(int length, Random random, String symbols) {
method RandomString (line 44) | public RandomString(int length, Random random) {
method RandomString (line 51) | public RandomString(int length) {
method RandomString (line 58) | public RandomString() {
FILE: auth/src/main/resources/db.sql
type TOKENS (line 1) | CREATE TABLE IF NOT EXISTS TOKENS ( tokenid int NOT NULL AUTO_INCREMENT,...
type ACCOUNTS (line 2) | CREATE TABLE IF NOT EXISTS ACCOUNTS ( accountid int NOT NULL AUTO_INCREM...
FILE: auth/src/test/java/com/automationintesting/integration/AuthIntegrationTest.java
class AuthIntegrationTest (line 18) | @ExtendWith(SpringExtension.class)
method createToken (line 25) | @BeforeEach
method testValidateEndpoint (line 37) | @Test
method testLogoutEndpoint (line 47) | @Test
FILE: auth/src/test/java/com/automationintesting/integration/example/TaskAnalysisIntegrationTest.java
class TaskAnalysisIntegrationTest (line 19) | @ExtendWith(SpringExtension.class)
method testLoginAPIEndpoint (line 26) | @Test
FILE: auth/src/test/java/com/automationintesting/unit/db/AuthDBTest.java
class AuthDBTest (line 12) | public class AuthDBTest extends BaseTest {
method testStoreToken (line 14) | @Test
method testQueryTokenExists (line 23) | @Test
method testRemovingToken (line 33) | @Test
method testQueryCredentials (line 43) | @Test
method testQueryMissingCredentials (line 52) | @Test
FILE: auth/src/test/java/com/automationintesting/unit/db/BaseTest.java
class BaseTest (line 9) | public class BaseTest {
method createRoomDB (line 15) | @BeforeAll
FILE: auth/src/test/java/com/automationintesting/unit/example/TaskAnalysisTest.java
class TaskAnalysisTest (line 13) | public class TaskAnalysisTest {
method testTokenCreation (line 17) | @Test
FILE: auth/src/test/java/com/automationintesting/unit/service/AuthServiceTest.java
class AuthServiceTest (line 22) | public class AuthServiceTest {
method initialiseMocks (line 31) | @BeforeEach
method testValidateCredentials (line 36) | @Test
method testInvalidCredentials (line 48) | @Test
method testErrorVerifyingCredentials (line 58) | @Test
method testTokenPositiveVerification (line 69) | @Test
method testTokenNegativeVerification (line 79) | @Test
method testClearingToken (line 89) | @Test
method testUnableToClearToken (line 99) | @Test
FILE: booking/src/main/java/com/automationintesting/api/BookingApplication.java
class BookingApplication (line 9) | @SpringBootApplication
method main (line 13) | public static void main(String[] args) {
FILE: booking/src/main/java/com/automationintesting/api/BookingController.java
class BookingController (line 17) | @RestController
method getBookings (line 23) | @RequestMapping(value = "/", method = RequestMethod.GET)
method checkUnavailability (line 30) | @RequestMapping(value = "/unavailable", method = RequestMethod.GET)
method createBooking (line 37) | @RequestMapping(value = "/", method = RequestMethod.POST)
method getBooking (line 44) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.GET)
method deleteBooking (line 51) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.DELETE)
method updateBooking (line 58) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.PUT)
method getSummaries (line 65) | @RequestMapping(value = "/summary", method = RequestMethod.GET)
FILE: booking/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 9) | @Configuration
method openAPI (line 12) | @Bean
method publicApi (line 18) | @Bean
FILE: booking/src/main/java/com/automationintesting/db/BookingDB.java
class BookingDB (line 24) | @Component
method BookingDB (line 36) | public BookingDB() throws SQLException, IOException {
method create (line 60) | public CreatedBooking create(Booking booking) throws SQLException {
method queryBookingsById (line 83) | public List<Booking> queryBookingsById(String roomid) throws SQLExcept...
method query (line 95) | public Booking query(int id) throws SQLException {
method delete (line 105) | public Boolean delete(int bookingid) throws SQLException {
method update (line 113) | public CreatedBooking update(int id, Booking booking) throws SQLExcept...
method resetDB (line 132) | public void resetDB() throws SQLException, IOException {
method checkForBookingConflict (line 142) | public Boolean checkForBookingConflict(Booking bookingToCheck) throws ...
method queryAllBookings (line 175) | public List<Booking> queryAllBookings() throws SQLException {
method queryBookingSummariesById (line 187) | public List<BookingSummary> queryBookingSummariesById(String roomid) t...
method queryByDate (line 199) | public List<AvailableRoom> queryByDate(LocalDate checkin, LocalDate ch...
method executeSqlFile (line 225) | private void executeSqlFile(String filename) throws IOException, SQLEx...
FILE: booking/src/main/java/com/automationintesting/db/InsertSql.java
class InsertSql (line 9) | public class InsertSql {
method InsertSql (line 13) | public InsertSql(Connection connection, Booking booking) throws SQLExc...
method getPreparedStatement (line 26) | public PreparedStatement getPreparedStatement() {
FILE: booking/src/main/java/com/automationintesting/db/UpdateSql.java
class UpdateSql (line 9) | public class UpdateSql {
method UpdateSql (line 13) | UpdateSql(Connection connection, int id, Booking booking) throws SQLEx...
method getPreparedStatement (line 25) | public PreparedStatement getPreparedStatement() {
FILE: booking/src/main/java/com/automationintesting/model/db/AvailableRoom.java
class AvailableRoom (line 3) | public class AvailableRoom {
method AvailableRoom (line 7) | public AvailableRoom(int roomid) {
method getRoomid (line 11) | public int getRoomid() {
method setRoomid (line 15) | public void setRoomid(int roomid) {
method toString (line 19) | @Override
FILE: booking/src/main/java/com/automationintesting/model/db/Booking.java
class Booking (line 14) | @Entity
method Booking (line 49) | public Booking(int bookingid, int roomid, String firstname, String las...
method Booking (line 58) | public Booking(int bookingid, int roomid, String firstname, String las...
method Booking (line 69) | public Booking(ResultSet result) throws SQLException {
method Booking (line 78) | public Booking() {
method getFirstname (line 81) | public String getFirstname() {
method getLastname (line 85) | public String getLastname() {
method isDepositpaid (line 89) | public boolean isDepositpaid() {
method getBookingDates (line 93) | public BookingDates getBookingDates() {
method getRoomid (line 97) | public int getRoomid() {
method getBookingid (line 101) | public int getBookingid() {
method getEmail (line 105) | public Optional<String> getEmail() {
method getPhone (line 109) | public Optional<String> getPhone() {
method setFirstname (line 113) | public void setFirstname(String firstname) {
method setLastname (line 117) | public void setLastname(String lastname) {
method setDepositpaid (line 121) | public void setDepositpaid(boolean depositpaid) {
method setBookingDates (line 125) | public void setBookingDates(BookingDates bookingDates) {
method setRoomid (line 129) | public void setRoomid(int roomid) {
method setBookingid (line 133) | public void setBookingid(int bookingid) {
method setEmail (line 137) | public void setEmail(String email) {
method setPhone (line 141) | public void setPhone(String phone) {
method toString (line 145) | @Override
class BookingBuilder (line 157) | public static class BookingBuilder {
method setBookingid (line 169) | public BookingBuilder setBookingid(int bookingid){
method setRoomid (line 175) | public BookingBuilder setRoomid(int roomid){
method setFirstname (line 181) | public BookingBuilder setFirstname(String firstname) {
method setLastname (line 187) | public BookingBuilder setLastname(String lastname) {
method setDepositpaid (line 193) | public BookingBuilder setDepositpaid(boolean depositpaid) {
method setCheckin (line 199) | public BookingBuilder setCheckin(LocalDate checkin) {
method setCheckout (line 205) | public BookingBuilder setCheckout(LocalDate checkout) {
method setEmail (line 211) | public BookingBuilder setEmail(String email) {
method setPhone (line 217) | public BookingBuilder setPhone(String phone) {
method build (line 223) | public Booking build(){
FILE: booking/src/main/java/com/automationintesting/model/db/BookingDates.java
class BookingDates (line 9) | @Entity
method BookingDates (line 20) | public BookingDates() {
method BookingDates (line 23) | public BookingDates(LocalDate checkin, LocalDate checkout) {
method getCheckin (line 28) | public LocalDate getCheckin() {
method setCheckin (line 32) | public void setCheckin(LocalDate checkin) {
method getCheckout (line 36) | public LocalDate getCheckout() {
method setCheckout (line 40) | public void setCheckout(LocalDate checkout) {
method toString (line 44) | @Override
FILE: booking/src/main/java/com/automationintesting/model/db/BookingSummaries.java
class BookingSummaries (line 7) | public class BookingSummaries {
method BookingSummaries (line 12) | public BookingSummaries(List<BookingSummary> bookings) {
method BookingSummaries (line 16) | public BookingSummaries() {
method getBookings (line 19) | public List<BookingSummary> getBookings() {
method setBookings (line 23) | public void setBookings(List<BookingSummary> bookings) {
FILE: booking/src/main/java/com/automationintesting/model/db/BookingSummary.java
class BookingSummary (line 6) | public class BookingSummary {
method BookingSummary (line 10) | public BookingSummary() {
method BookingSummary (line 13) | public BookingSummary(BookingDates bookingDates) {
method BookingSummary (line 17) | public BookingSummary(ResultSet result) throws SQLException {
method getBookingDates (line 21) | public BookingDates getBookingDates() {
method setBookingDates (line 25) | public void setBookingDates(BookingDates bookingDates) {
FILE: booking/src/main/java/com/automationintesting/model/db/Bookings.java
class Bookings (line 7) | public class Bookings {
method Bookings (line 12) | public Bookings(List<Booking> bookings) {
method Bookings (line 16) | public Bookings() {
method getBookings (line 19) | public List<Booking> getBookings() {
method setBookings (line 23) | public void setBookings(List<Booking> bookings) {
FILE: booking/src/main/java/com/automationintesting/model/db/CreatedBooking.java
class CreatedBooking (line 5) | public class CreatedBooking {
method CreatedBooking (line 13) | public CreatedBooking(int bookingid, Booking booking) {
method CreatedBooking (line 18) | public CreatedBooking() {
method getBookingid (line 21) | public int getBookingid() {
method setBookingid (line 25) | public void setBookingid(int bookingid) {
method getBooking (line 29) | public Booking getBooking() {
method setBooking (line 33) | public void setBooking(Booking booking) {
method toString (line 37) | @Override
FILE: booking/src/main/java/com/automationintesting/model/db/Message.java
class Message (line 7) | @Entity
method Message (line 25) | public Message() {
method Message (line 28) | public Message(String name, String email, String phone, String subject...
method getName (line 36) | public String getName() {
method getEmail (line 40) | public String getEmail() {
method getPhone (line 44) | public String getPhone() {
method getSubject (line 48) | public String getSubject() {
method getDescription (line 52) | public String getDescription() {
method setName (line 56) | public void setName(String name) {
method setEmail (line 60) | public void setEmail(String email) {
method setPhone (line 64) | public void setPhone(String phone) {
method setSubject (line 68) | public void setSubject(String subject) {
method setDescription (line 72) | public void setDescription(String description) {
method toString (line 76) | @Override
FILE: booking/src/main/java/com/automationintesting/model/db/Token.java
class Token (line 5) | public class Token {
method Token (line 10) | public Token() {
method Token (line 13) | public Token(String token) {
method getToken (line 17) | public String getToken() {
method setToken (line 21) | public void setToken(String token) {
FILE: booking/src/main/java/com/automationintesting/model/service/BookingResult.java
class BookingResult (line 11) | public class BookingResult {
method BookingResult (line 23) | public BookingResult(Booking booking, HttpStatus result) {
method BookingResult (line 28) | public BookingResult(CreatedBooking createdBooking, HttpStatus result) {
method BookingResult (line 33) | public BookingResult(Bookings bookings, HttpStatus result){
method BookingResult (line 38) | public BookingResult(List<AvailableRoom> availableRooms, HttpStatus re...
method BookingResult (line 43) | public BookingResult(HttpStatus result) {
method getStatus (line 47) | public HttpStatus getStatus() {
method getBooking (line 51) | public Booking getBooking() {
method getCreatedBooking (line 55) | public CreatedBooking getCreatedBooking() {
method getBookings (line 59) | public Bookings getBookings() {
method getAvailableRooms (line 63) | public List<AvailableRoom> getAvailableRooms() {
FILE: booking/src/main/java/com/automationintesting/requests/AuthRequests.java
class AuthRequests (line 10) | public class AuthRequests {
method AuthRequests (line 14) | public AuthRequests() {
method postCheckAuth (line 22) | public boolean postCheckAuth(String tokenValue){
FILE: booking/src/main/java/com/automationintesting/requests/MessageRequests.java
class MessageRequests (line 10) | public class MessageRequests {
method MessageRequests (line 14) | public MessageRequests() {
method postMessage (line 22) | public boolean postMessage(Message message){
FILE: booking/src/main/java/com/automationintesting/service/BookingService.java
class BookingService (line 21) | @Service
method BookingService (line 30) | public BookingService() {
method beginDbScheduler (line 36) | @EventListener(ApplicationReadyEvent.class)
method getBookings (line 42) | public BookingResult getBookings(Optional<String> roomId, String token...
method getIndividualBooking (line 58) | public BookingResult getIndividualBooking(int bookingId, String token)...
method deleteBooking (line 71) | public HttpStatus deleteBooking(int bookingid, String token) throws SQ...
method updateBooking (line 83) | public BookingResult updateBooking(int bookingId, Booking bookingToUpd...
method createBooking (line 105) | public BookingResult createBooking(Booking bookingToCreate) throws SQL...
method getBookingSummaries (line 126) | public BookingSummaries getBookingSummaries(String roomId) throws SQLE...
method checkUnavailability (line 134) | public BookingResult checkUnavailability(LocalDate checkin, LocalDate ...
FILE: booking/src/main/java/com/automationintesting/service/DatabaseScheduler.java
class DatabaseScheduler (line 11) | public class DatabaseScheduler {
method DatabaseScheduler (line 17) | public DatabaseScheduler() {
method startScheduler (line 25) | public void startScheduler(BookingDB bookingDB, TimeUnit timeUnit){
method getResetCount (line 47) | public int getResetCount() {
method stepScheduler (line 51) | public void stepScheduler() {
FILE: booking/src/main/java/com/automationintesting/service/DateCheckValidator.java
class DateCheckValidator (line 7) | public class DateCheckValidator {
method isValid (line 9) | public boolean isValid(BookingDates dateBooking) {
FILE: booking/src/main/java/com/automationintesting/service/MessageBuilder.java
class MessageBuilder (line 6) | public class MessageBuilder {
method build (line 8) | public Message build(Booking booking) {
FILE: booking/src/main/java/com/automationintesting/service/MethodArgumentNotValidExceptionHandler.java
class MethodArgumentNotValidExceptionHandler (line 15) | @ControllerAdvice
method handleMethodArgumentNotValidException (line 18) | @ExceptionHandler(MethodArgumentNotValidException.class)
class Error (line 35) | public static class Error{
method Error (line 41) | public Error(HttpStatus status, String message, List<String> fieldEr...
method getErrorCode (line 48) | public int getErrorCode() {
method setErrorCode (line 52) | public void setErrorCode(int errorCode) {
method getError (line 56) | public String getError() {
method setError (line 60) | public void setError(String error) {
method getErrorMessage (line 64) | public String getErrorMessage() {
method setErrorMessage (line 68) | public void setErrorMessage(String errorMessage) {
method getFieldErrors (line 72) | public List<String> getFieldErrors() {
method setFieldErrors (line 76) | public void setFieldErrors(List<String> fieldErrors) {
FILE: booking/src/main/resources/db.sql
type BOOKINGS (line 1) | CREATE TABLE BOOKINGS ( bookingid int NOT NULL AUTO_INCREMENT, roomid in...
FILE: booking/src/test/java/com/automationintesting/integration/BookingDateConflictIT.java
class BookingDateConflictIT (line 19) | @ExtendWith(SpringExtension.class)
method testBookingConflict (line 24) | @Test
method testBookingDatesInvalid (line 59) | @Test
FILE: booking/src/test/java/com/automationintesting/integration/BookingValidationIT.java
class BookingValidationIT (line 16) | @ExtendWith(SpringExtension.class)
method testPostValidation (line 21) | @Test
method testPutValidation (line 37) | @Test
FILE: booking/src/test/java/com/automationintesting/integration/GetBookingIT.java
class GetBookingIT (line 23) | @ExtendWith(SpringExtension.class)
method setupRestito (line 30) | @BeforeEach
method stopServer (line 37) | @AfterEach
method getValidBooking (line 45) | @Test
method getInvalidBooking (line 54) | @Test
method getQueryAvailableRoomsByDate (line 63) | @Test
method getEmptyQueryAvailableRoomsByDate (line 74) | @Test
method getPartialQueryAvailableRoomsByDate (line 87) | @Test
FILE: booking/src/test/java/com/automationintesting/integration/MessageRequestIT.java
class MessageRequestIT (line 28) | @ExtendWith(SpringExtension.class)
method setupRestito (line 35) | @BeforeEach
method stopServer (line 42) | @AfterEach
method testSendingToMessageAPI (line 47) | @Test
FILE: booking/src/test/java/com/automationintesting/integration/examples/BookingIntegrationIT.java
class BookingIntegrationIT (line 30) | @ExtendWith(SpringExtension.class)
method setupRestito (line 39) | @BeforeEach
method stopServer (line 52) | @AfterEach
method testCreateBooking (line 60) | @Test
FILE: booking/src/test/java/com/automationintesting/integration/examples/ContractIT.java
class ContractIT (line 31) | @ExtendWith(SpringExtension.class)
method setupRestito (line 39) | @BeforeEach
method stopServer (line 46) | @AfterEach
method checkAuthContract (line 56) | @Test
FILE: booking/src/test/java/com/automationintesting/unit/BaseTest.java
class BaseTest (line 9) | public class BaseTest {
method createBookingDb (line 24) | @BeforeAll
FILE: booking/src/test/java/com/automationintesting/unit/db/DateConflictTest.java
class DateConflictTest (line 17) | public class DateConflictTest extends BaseTest {
method resetDb (line 19) | @BeforeEach
method testBookingWithNoConflict (line 24) | @Test
method testConflictingBooking (line 43) | @Test
method testPartialConflict (line 77) | @Test
method testConflictForSpecificRoom (line 111) | @Test
method testNoConflictForOverlapOnCheckoutCheckinDate (line 144) | @Test
method testNoConflictIfReturnedBookingIsSameRoom (line 177) | @Test
FILE: booking/src/test/java/com/automationintesting/unit/examples/SqlTest.java
class SqlTest (line 21) | public class SqlTest extends BaseTest {
method resetDb (line 30) | @BeforeEach
method testQuerySql (line 55) | @Test
method testCreateSql (line 71) | @Test
method testDeleteSql (line 88) | @Test
method testUpdateSql (line 96) | @Test
method testQueryByDateSql (line 113) | @Test
FILE: booking/src/test/java/com/automationintesting/unit/model/MessageBuilderTest.java
class MessageBuilderTest (line 14) | public class MessageBuilderTest {
method messageBuiltFromBookingTest (line 16) | @Test
FILE: booking/src/test/java/com/automationintesting/unit/service/BookingServiceTest.java
class BookingServiceTest (line 32) | public class BookingServiceTest {
method initialiseMocks (line 47) | @BeforeEach
method returnAllBookingsTest (line 52) | @Test
method returnBookingsByRoomIdTest (line 69) | @Test
method returnSpecificBookingTest (line 85) | @Test
method returnBookingNotFoundTest (line 98) | @Test
method deleteBookingTest (line 109) | @Test
method deleteBookingNotFoundTest (line 119) | @Test
method updateBookingTest (line 129) | @Test
method updateBookingNotFoundTest (line 145) | @Test
method updateBookingDatesTest (line 160) | @Test
method updateBookingBadDatesTest (line 172) | @Test
method createBookingTest (line 183) | @Test
method createBookingDateConflictTest (line 195) | @Test
method createBookingDateInvalidTest (line 206) | @Test
method queryBookingsByDateTest (line 216) | @Test
method createGenericBooking (line 234) | private Booking createGenericBooking() {
FILE: booking/src/test/java/com/automationintesting/unit/service/DateCheckValidatorTest.java
class DateCheckValidatorTest (line 12) | public class DateCheckValidatorTest {
method setup (line 17) | @BeforeEach
method invalidIfDatesNotProvided (line 23) | @Test
method invalidIfCheckinAfterCheckout (line 30) | @Test
method invalidIfCheckinAndCheckoutSameDay (line 40) | @Test
method validIfCheckinBeforeCheckout (line 50) | @Test
FILE: branding/src/main/java/com/automationintesting/api/BrandingApplication.java
class BrandingApplication (line 7) | @SpringBootApplication
method main (line 11) | public static void main(String[] args) {
FILE: branding/src/main/java/com/automationintesting/api/BrandingController.java
class BrandingController (line 13) | @RestController
method getBranding (line 19) | @RequestMapping(value = "/", method = RequestMethod.GET)
method updateBranding (line 26) | @RequestMapping(value = "/", method = RequestMethod.PUT)
FILE: branding/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 9) | @Configuration
method openAPI (line 12) | @Bean
method publicApi (line 18) | @Bean
FILE: branding/src/main/java/com/automationintesting/db/BrandingDB.java
class BrandingDB (line 22) | @Component
method BrandingDB (line 32) | public BrandingDB() throws SQLException, IOException {
method update (line 56) | public Branding update(Branding branding) throws SQLException {
method queryBranding (line 72) | public Branding queryBranding() throws SQLException {
method resetDB (line 93) | public void resetDB() throws SQLException, IOException {
method executeSqlFile (line 103) | private void executeSqlFile(String filename) throws IOException, SQLEx...
FILE: branding/src/main/java/com/automationintesting/db/InsertSql.java
class InsertSql (line 9) | public class InsertSql {
method InsertSql (line 13) | InsertSql(Connection connection, Branding branding) throws SQLException {
method getPreparedStatement (line 33) | public PreparedStatement getPreparedStatement() {
FILE: branding/src/main/java/com/automationintesting/db/UpdateSql.java
class UpdateSql (line 9) | public class UpdateSql {
method UpdateSql (line 13) | UpdateSql(Connection connection, Branding branding) throws SQLException {
method getPreparedStatement (line 33) | public PreparedStatement getPreparedStatement() {
FILE: branding/src/main/java/com/automationintesting/model/db/Address.java
class Address (line 10) | public class Address {
method Address (line 37) | public Address() {}
method Address (line 39) | public Address(String line1, String line2, String postTown, String cou...
method Address (line 47) | public Address(ResultSet result) throws SQLException {
method getLine1 (line 55) | public String getLine1() {
method setLine1 (line 59) | public void setLine1(String line1) {
method getLine2 (line 63) | public String getLine2() {
method setLine2 (line 67) | public void setLine2(String line2) {
method getPostTown (line 71) | public String getPostTown() {
method setPostTown (line 75) | public void setPostTown(String postTown) {
method getCounty (line 79) | public String getCounty() {
method setCounty (line 83) | public void setCounty(String county) {
method getPostCode (line 87) | public String getPostCode() {
method setPostCode (line 91) | public void setPostCode(String postCode) {
method toString (line 95) | @Override
FILE: branding/src/main/java/com/automationintesting/model/db/Branding.java
class Branding (line 15) | @Entity
method Branding (line 55) | public Branding() {}
method Branding (line 57) | public Branding(String name, Map map, String directions, String logoUr...
method Branding (line 67) | public Branding(ResultSet result) throws SQLException {
method getName (line 77) | public String getName() {
method getMap (line 81) | public Map getMap() {
method getLogoUrl (line 85) | public String getLogoUrl() {
method getDirections (line 89) | public String getDirections() {
method getDescription (line 93) | public String getDescription() {
method getContact (line 97) | public Contact getContact() {
method getAddress (line 101) | public Address getAddress() {
method setName (line 105) | public void setName(String name) {
method setMap (line 109) | public void setMap(Map map) {
method setLogoUrl (line 113) | public void setLogoUrl(String logoUrl) {
method setDescription (line 117) | public void setDescription(String description) {
method setContact (line 121) | public void setContact(Contact contact) {
method setDirections (line 125) | public void setDirections(String directions) {
method setAddress (line 129) | public void setAddress(Address address) {
method toString (line 133) | @Override
class BrandingBuilder (line 146) | public static class BrandingBuilder {
method setName (line 155) | public BrandingBuilder setName(String name) {
method setMap (line 161) | public BrandingBuilder setMap(Map map) {
method setLogoUrl (line 167) | public BrandingBuilder setLogoUrl(String logoUrl) {
method setDirections (line 173) | public BrandingBuilder setDirections(String directions) {
method setDescription (line 179) | public BrandingBuilder setDescription(String description) {
method setContact (line 185) | public BrandingBuilder setContact(Contact contact) {
method setAddress (line 191) | public BrandingBuilder setAddress(Address address) {
method build (line 197) | public Branding build(){
FILE: branding/src/main/java/com/automationintesting/model/db/Contact.java
class Contact (line 10) | @Entity
method Contact (line 32) | public Contact(String name, String phone, String email) {
method Contact (line 38) | public Contact(ResultSet result) throws SQLException {
method Contact (line 44) | public Contact() {}
method getName (line 46) | public String getName() {
method getPhone (line 50) | public String getPhone() {
method getEmail (line 54) | public String getEmail() {
method setName (line 58) | public void setName(String name) {
method setPhone (line 62) | public void setPhone(String phone) {
method setEmail (line 66) | public void setEmail(String email) {
method toString (line 70) | @Override
FILE: branding/src/main/java/com/automationintesting/model/db/Map.java
class Map (line 10) | @Entity
method Map (line 20) | public Map() {}
method Map (line 22) | public Map(double latitude, double longitude) {
method Map (line 27) | public Map(ResultSet result) throws SQLException {
method getLatitude (line 32) | public double getLatitude() {
method getLongitude (line 36) | public double getLongitude() {
method setLatitude (line 40) | public void setLatitude(double latitude) {
method setLongitude (line 44) | public void setLongitude(double longitude) {
method toString (line 48) | @Override
FILE: branding/src/main/java/com/automationintesting/model/service/BrandingResult.java
class BrandingResult (line 6) | public class BrandingResult {
method BrandingResult (line 11) | public BrandingResult(HttpStatus httpStatus, Branding branding) {
method BrandingResult (line 16) | public BrandingResult(HttpStatus httpStatus) {
method getHttpStatus (line 20) | public HttpStatus getHttpStatus() {
method setHttpStatus (line 24) | public void setHttpStatus(HttpStatus httpStatus) {
method getBranding (line 28) | public Branding getBranding() {
method setBranding (line 32) | public void setBranding(Branding branding) {
FILE: branding/src/main/java/com/automationintesting/model/service/Token.java
class Token (line 5) | public class Token {
method Token (line 10) | public Token() {
method Token (line 13) | public Token(String token) {
method getToken (line 17) | public String getToken() {
method setToken (line 21) | public void setToken(String token) {
FILE: branding/src/main/java/com/automationintesting/requests/AuthRequests.java
class AuthRequests (line 10) | public class AuthRequests {
method AuthRequests (line 14) | public AuthRequests() {
method postCheckAuth (line 22) | public boolean postCheckAuth(String tokenValue){
FILE: branding/src/main/java/com/automationintesting/service/BrandingService.java
class BrandingService (line 16) | @Service
method BrandingService (line 23) | public BrandingService() {
method beginDbScheduler (line 27) | @EventListener(ApplicationReadyEvent.class)
method getBrandingDetails (line 33) | public Branding getBrandingDetails() throws SQLException {
method updateBrandingDetails (line 37) | public BrandingResult updateBrandingDetails(Branding branding, String ...
FILE: branding/src/main/java/com/automationintesting/service/DatabaseScheduler.java
class DatabaseScheduler (line 11) | public class DatabaseScheduler {
method DatabaseScheduler (line 17) | public DatabaseScheduler() {
method startScheduler (line 25) | public void startScheduler(BrandingDB brandingDB, TimeUnit timeUnit){
FILE: branding/src/main/java/com/automationintesting/service/MethodArgumentNotValidExceptionHandler.java
class MethodArgumentNotValidExceptionHandler (line 15) | @ControllerAdvice
method handleMethodArgumentNotValidException (line 18) | @ExceptionHandler(MethodArgumentNotValidException.class)
class Error (line 35) | public static class Error{
method Error (line 41) | public Error(HttpStatus status, String message, List<String> fieldEr...
method getErrorCode (line 48) | public int getErrorCode() {
method setErrorCode (line 52) | public void setErrorCode(int errorCode) {
method getError (line 56) | public String getError() {
method setError (line 60) | public void setError(String error) {
method getErrorMessage (line 64) | public String getErrorMessage() {
method setErrorMessage (line 68) | public void setErrorMessage(String errorMessage) {
method getFieldErrors (line 72) | public List<String> getFieldErrors() {
method setFieldErrors (line 76) | public void setFieldErrors(List<String> fieldErrors) {
FILE: branding/src/main/resources/db.sql
type BRANDINGS (line 1) | CREATE TABLE BRANDINGS ( brandingid int NOT NULL AUTO_INCREMENT, name va...
FILE: branding/src/test/java/com/automationintesting/integration/BrandingServiceIT.java
class BrandingServiceIT (line 27) | @ExtendWith(SpringExtension.class)
method setupRestito (line 34) | @BeforeEach
method stopServer (line 41) | @AfterEach
method returnsBrandingData (line 49) | @Test
method updateBrandingData (line 58) | @Test
method testPutValidation (line 80) | @Test
FILE: branding/src/test/java/com/automationintesting/unit/service/BrandingServiceTest.java
class BrandingServiceTest (line 24) | public class BrandingServiceTest {
method initialiseMocks (line 36) | @BeforeEach
method queryBrandingTest (line 41) | @Test
method updateBrandingTest (line 54) | @Test
method updateBrandingFailedTest (line 72) | @Test
FILE: end-to-end-tests/src/main/java/driverfactory/DriverFactory.java
class DriverFactory (line 15) | public class DriverFactory
method create (line 19) | public WebDriver create() {
method prepareChromeDriver (line 35) | private WebDriver prepareChromeDriver(){
method prepareRemoteDriver (line 41) | private WebDriver prepareRemoteDriver(){
FILE: end-to-end-tests/src/main/java/models/Booking.java
class Booking (line 3) | public class Booking {
method Booking (line 9) | public Booking(String firstname, String lastname, String totalPrice) {
method getFirstname (line 15) | public String getFirstname() {
method getLastname (line 19) | public String getLastname() {
method getTotalPrice (line 23) | public String getTotalPrice() {
FILE: end-to-end-tests/src/main/java/models/Contact.java
class Contact (line 5) | public class Contact
method Contact (line 17) | public Contact() {
method Contact (line 20) | public Contact(String name, String phone, String email) {
method getName (line 26) | public String getName() {
method setName (line 30) | public void setName(String name) {
method getPhone (line 34) | public String getPhone() {
method setPhone (line 38) | public void setPhone(String phone) {
method getEmail (line 42) | public String getEmail() {
method setEmail (line 46) | public void setEmail(String email) {
FILE: end-to-end-tests/src/main/java/models/Room.java
class Room (line 10) | public class Room
method Room (line 18) | public Room() {
method Room (line 21) | public Room(String number, String type, String beds, String accessible...
method getNumber (line 29) | public String getNumber() {
method setNumber (line 33) | public void setNumber(String number) {
method getType (line 37) | public String getType() {
method setType (line 41) | public void setType(String type) {
method getBeds (line 45) | public String getBeds() {
method setBeds (line 49) | public void setBeds(String beds) {
method getAccessible (line 53) | public String getAccessible() {
method setAccessible (line 57) | public void setAccessible(String accessible) {
method getDetails (line 61) | public String getDetails() {
method setDetails (line 65) | public void setDetails(String details) {
FILE: end-to-end-tests/src/main/java/pageobjects/BasePage.java
class BasePage (line 6) | public class BasePage
method BasePage (line 10) | public BasePage(WebDriver driver)
FILE: end-to-end-tests/src/main/java/pageobjects/BrandingPage.java
class BrandingPage (line 8) | public class BrandingPage extends BasePage {
method BrandingPage (line 13) | public BrandingPage(WebDriver driver) {
method getNameValue (line 17) | public String getNameValue() throws InterruptedException {
FILE: end-to-end-tests/src/main/java/pageobjects/HomePage.java
class HomePage (line 15) | public class HomePage extends BasePage {
method HomePage (line 29) | public HomePage(WebDriver driver) {
method clickOpenBookingForm (line 33) | public void clickOpenBookingForm() throws InterruptedException {
method clickSubmitBooking (line 40) | public void clickSubmitBooking() {
method bookingFormErrorsExist (line 45) | public Boolean bookingFormErrorsExist() {
FILE: end-to-end-tests/src/main/java/pageobjects/LoginPage.java
class LoginPage (line 8) | public class LoginPage extends BasePage
method LoginPage (line 19) | public LoginPage(WebDriver driver)
method populateUsername (line 24) | public LoginPage populateUsername(String username)
method populatePassword (line 30) | public LoginPage populatePassword(String password)
method clickLogin (line 36) | public RoomListingPage clickLogin()
FILE: end-to-end-tests/src/main/java/pageobjects/MessagePage.java
class MessagePage (line 11) | public class MessagePage extends BasePage {
method MessagePage (line 16) | public MessagePage(WebDriver driver) {
method getMessages (line 20) | public List<WebElement> getMessages() {
FILE: end-to-end-tests/src/main/java/pageobjects/NavPage.java
class NavPage (line 9) | public class NavPage extends BasePage {
method NavPage (line 29) | public NavPage(WebDriver driver) {
method getDivNavBar (line 33) | public WebElement getDivNavBar() {
method clickReport (line 37) | public void clickReport() {
method clickBranding (line 41) | public void clickBranding() {
method clickNotification (line 45) | public void clickNotification() {
method clickFrontPage (line 49) | public void clickFrontPage() {
FILE: end-to-end-tests/src/main/java/pageobjects/ReportPage.java
class ReportPage (line 8) | public class ReportPage extends BasePage{
method ReportPage (line 13) | public ReportPage(WebDriver driver) {
method reportExists (line 17) | public Boolean reportExists() {
FILE: end-to-end-tests/src/main/java/pageobjects/ReservationPage.java
class ReservationPage (line 8) | public class ReservationPage extends BasePage {
method ReservationPage (line 13) | public ReservationPage(WebDriver driver) {
method bookingFormExists (line 17) | public Boolean bookingFormExists() {
FILE: end-to-end-tests/src/main/java/pageobjects/RoomListingPage.java
class RoomListingPage (line 14) | public class RoomListingPage extends BasePage {
method RoomListingPage (line 40) | public RoomListingPage(WebDriver driver){
method populateRoomName (line 46) | public void populateRoomName(String roomName) throws InterruptedExcept...
method clickCreateRoom (line 51) | public void clickCreateRoom() throws InterruptedException {
method roomCount (line 57) | public int roomCount() throws InterruptedException {
method clickFirstRoom (line 62) | public void clickFirstRoom() {
method checkWifi (line 66) | public void checkWifi() {
method checkSafe (line 70) | public void checkSafe() {
method checkRadio (line 74) | public void checkRadio() {
method roomFormExists (line 78) | public Boolean roomFormExists() {
method setRoomPrice (line 82) | public void setRoomPrice(String price) throws InterruptedException {
FILE: end-to-end-tests/src/main/java/pageobjects/RoomPage.java
class RoomPage (line 11) | public class RoomPage extends BasePage {
method RoomPage (line 40) | public RoomPage(WebDriver driver) {
method populateFirstname (line 44) | public void populateFirstname(String firstname) throws InterruptedExce...
method populateLastname (line 49) | public void populateLastname(String lastname) throws InterruptedExcept...
method populateTotalPrice (line 54) | public void populateTotalPrice(String totalPrice) throws InterruptedEx...
method clickCreateBooking (line 59) | public void clickCreateBooking() throws InterruptedException {
method getBookingCount (line 65) | public int getBookingCount() throws InterruptedException {
method populateCheckin (line 70) | public void populateCheckin(String checkInDate) throws InterruptedExce...
method populateCheckout (line 76) | public void populateCheckout(String checkOutDate) throws InterruptedEx...
FILE: end-to-end-tests/src/main/java/pageobjects/SearchPage.java
class SearchPage (line 11) | public class SearchPage extends BasePage {
method SearchPage (line 16) | public SearchPage(WebDriver driver) {
method getSearchResults (line 20) | public List<WebElement> getSearchResults() {
FILE: end-to-end-tests/src/test/java/SmokeTest.java
class SmokeTest (line 12) | public class SmokeTest extends TestSetup {
method logIntoApplication (line 14) | @BeforeEach
method authSmokeTest (line 24) | @Test
method roomSmokeTest (line 31) | @Test
method bookingSmokeTest (line 48) | @Test
method reportSmokeTest (line 60) | @Test
method brandingSmokeTest (line 70) | @Test
method messageSmokeTest (line 81) | @Test
FILE: end-to-end-tests/src/test/java/TestSetup.java
class TestSetup (line 13) | public class TestSetup {
method SetUp (line 17) | @BeforeEach
method TearDown (line 23) | @AfterEach
method navigateToApplication (line 28) | void navigateToApplication(){
FILE: message/src/main/java/com/automationintesting/api/MessageApplication.java
class MessageApplication (line 7) | @SpringBootApplication
method main (line 11) | public static void main(String[] args) {
FILE: message/src/main/java/com/automationintesting/api/MessageController.java
class MessageController (line 16) | @RestController
method getMessages (line 22) | @RequestMapping(value = "/", method = RequestMethod.GET)
method getCount (line 29) | @RequestMapping(value = "/count", method = RequestMethod.GET)
method getMessage (line 36) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.GET)
method createMessage (line 43) | @RequestMapping(value = "/", method = RequestMethod.POST)
method deleteMessage (line 50) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.DELETE)
method markAsRead (line 57) | @RequestMapping(value = "/{id:[0-9]*}/read", method = RequestMethod.PUT)
FILE: message/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 9) | @Configuration
method openAPI (line 12) | @Bean
method publicApi (line 18) | @Bean
FILE: message/src/main/java/com/automationintesting/db/InsertSql.java
class InsertSql (line 9) | public class InsertSql {
method InsertSql (line 13) | InsertSql(Connection connection, Message message) throws SQLException {
method getPreparedStatement (line 24) | public PreparedStatement getPreparedStatement() {
FILE: message/src/main/java/com/automationintesting/db/MessageDB.java
class MessageDB (line 23) | @Component
method MessageDB (line 37) | public MessageDB() throws SQLException, IOException {
method create (line 61) | public Message create(Message message) throws SQLException {
method resetDB (line 81) | public void resetDB() throws SQLException, IOException {
method query (line 91) | public Message query(int id) throws SQLException {
method delete (line 101) | public Boolean delete(int messageId) throws SQLException {
method queryMessages (line 109) | public List<MessageSummary> queryMessages() throws SQLException {
method markAsRead (line 122) | public void markAsRead(int messageId) throws SQLException {
method getUnreadCount (line 129) | public int getUnreadCount() throws SQLException {
method executeSqlFile (line 137) | private void executeSqlFile(String filename) throws IOException, SQLEx...
FILE: message/src/main/java/com/automationintesting/model/db/Count.java
class Count (line 5) | public class Count {
method Count (line 10) | public Count(int count) {
method getCount (line 14) | public int getCount() {
method toString (line 18) | @Override
FILE: message/src/main/java/com/automationintesting/model/db/Message.java
class Message (line 10) | @Entity
method Message (line 45) | public Message() {
method Message (line 48) | public Message(String name, String email, String phone, String subject...
method Message (line 56) | public Message(ResultSet result) throws SQLException {
method getMessageid (line 65) | public int getMessageid() {
method getName (line 69) | public String getName() {
method getEmail (line 73) | public String getEmail() {
method getPhone (line 77) | public String getPhone() {
method getSubject (line 81) | public String getSubject() {
method getDescription (line 85) | public String getDescription() {
method setMessageid (line 89) | public void setMessageid(int messageid) {
method setName (line 93) | public void setName(String name) {
method setEmail (line 97) | public void setEmail(String email) {
method setPhone (line 101) | public void setPhone(String phone) {
method setSubject (line 105) | public void setSubject(String subject) {
method setDescription (line 109) | public void setDescription(String description) {
method toString (line 113) | @Override
FILE: message/src/main/java/com/automationintesting/model/db/MessageSummary.java
class MessageSummary (line 8) | public class MessageSummary {
method MessageSummary (line 22) | public MessageSummary(ResultSet resultSet) throws SQLException {
method MessageSummary (line 29) | public MessageSummary(int id, String name, String subject, boolean rea...
method getId (line 36) | public int getId() {
method getName (line 40) | public String getName() {
method getSubject (line 44) | public String getSubject() {
method isRead (line 48) | public boolean isRead() {
method toString (line 52) | @Override
FILE: message/src/main/java/com/automationintesting/model/db/Messages.java
class Messages (line 7) | public class Messages {
method Messages (line 12) | public Messages(List<MessageSummary> messages) {
method getMessages (line 16) | public List<MessageSummary> getMessages() {
method toString (line 20) | @Override
FILE: message/src/main/java/com/automationintesting/model/requests/Token.java
class Token (line 5) | public class Token {
method Token (line 10) | public Token() {
method Token (line 13) | public Token(String token) {
method getToken (line 17) | public String getToken() {
method setToken (line 21) | public void setToken(String token) {
FILE: message/src/main/java/com/automationintesting/model/service/MessageResult.java
class MessageResult (line 6) | public class MessageResult {
method MessageResult (line 12) | public MessageResult(HttpStatus httpStatus, Message message) {
method MessageResult (line 17) | public MessageResult(HttpStatus httpStatus) {
method getHttpStatus (line 21) | public HttpStatus getHttpStatus() {
method getMessage (line 25) | public Message getMessage() {
FILE: message/src/main/java/com/automationintesting/requests/AuthRequests.java
class AuthRequests (line 10) | public class AuthRequests {
method AuthRequests (line 14) | public AuthRequests() {
method postCheckAuth (line 22) | public boolean postCheckAuth(String tokenValue){
FILE: message/src/main/java/com/automationintesting/service/DatabaseScheduler.java
class DatabaseScheduler (line 11) | public class DatabaseScheduler {
method DatabaseScheduler (line 17) | public DatabaseScheduler() {
method startScheduler (line 25) | public void startScheduler(MessageDB messageDB, TimeUnit timeUnit){
method getResetCount (line 46) | public int getResetCount() {
method stepScheduler (line 50) | public void stepScheduler() {
FILE: message/src/main/java/com/automationintesting/service/MessageService.java
class MessageService (line 18) | @Service
method MessageService (line 26) | public MessageService() {
method beginDbScheduler (line 30) | @EventListener(ApplicationReadyEvent.class)
method getMessages (line 36) | public Messages getMessages() throws SQLException {
method getCount (line 40) | public Count getCount() throws SQLException {
method getSpecificMessage (line 46) | public MessageResult getSpecificMessage(int messageId) throws SQLExcep...
method createMessage (line 56) | public Message createMessage(Message messageToCreate) throws SQLExcept...
method deleteMessage (line 62) | public MessageResult deleteMessage(int messageId, String token) throws...
method markAsRead (line 74) | public HttpStatus markAsRead(int messageId, String token) throws SQLEx...
FILE: message/src/main/java/com/automationintesting/service/MethodArgumentNotValidExceptionHandler.java
class MethodArgumentNotValidExceptionHandler (line 15) | @ControllerAdvice
method handleMethodArgumentNotValidException (line 18) | @ExceptionHandler(MethodArgumentNotValidException.class)
class Error (line 35) | public static class Error{
method Error (line 41) | public Error(HttpStatus status, String message, List<String> fieldEr...
method getErrorCode (line 48) | public int getErrorCode() {
method setErrorCode (line 52) | public void setErrorCode(int errorCode) {
method getError (line 56) | public String getError() {
method setError (line 60) | public void setError(String error) {
method getErrorMessage (line 64) | public String getErrorMessage() {
method setErrorMessage (line 68) | public void setErrorMessage(String errorMessage) {
method getFieldErrors (line 72) | public List<String> getFieldErrors() {
method setFieldErrors (line 76) | public void setFieldErrors(List<String> fieldErrors) {
FILE: message/src/main/resources/db.sql
type MESSAGES (line 1) | CREATE TABLE MESSAGES ( messageid int NOT NULL AUTO_INCREMENT, name varc...
FILE: message/src/test/java/com/automationintesting/integration/MessageEndpointsIT.java
class MessageEndpointsIT (line 24) | @ExtendWith(SpringExtension.class)
method setupRestito (line 31) | @BeforeEach
method stopServer (line 38) | @AfterEach
method createMessage (line 46) | @Test
method getMessage (line 59) | @Test
method getMessages (line 67) | @Test
method getCount (line 75) | @Test
method deleteMessage (line 83) | @Test
method validationTest (line 101) | @Test
method markAsReadTest (line 112) | @Test
FILE: message/src/test/java/com/automationintesting/unit/db/BaseTest.java
class BaseTest (line 9) | public class BaseTest {
method createMessageDb (line 24) | @BeforeAll
FILE: message/src/test/java/com/automationintesting/unit/db/MessageDBTest.java
class MessageDBTest (line 17) | public class MessageDBTest extends BaseTest {
method resetDB (line 21) | @BeforeEach
method testQueryMessage (line 36) | @Test
method testCreateMessage (line 45) | @Test
method testDeleteMessage (line 60) | @Test
method testGetMessages (line 67) | @Test
method testReadCount (line 82) | @Test
method testMarkAsRead (line 89) | @Test
FILE: message/src/test/java/com/automationintesting/unit/service/MessageServiceTest.java
class MessageServiceTest (line 27) | public class MessageServiceTest {
method initialiseMocks (line 39) | @BeforeEach
method getMessagesTest (line 44) | @Test
method getCountTest (line 58) | @Test
method getMessageTest (line 67) | @Test
method getMessageNotFoundTest (line 79) | @Test
method createMessageTest (line 88) | @Test
method deleteMessageTest (line 99) | @Test
method deleteMessageNotFoundTest (line 109) | @Test
method deleteMessageNotAuthenticatedTest (line 119) | @Test
method markMessageAsReadTest (line 128) | @Test
method markMessageAsReadNotAuthenticated (line 138) | @Test
FILE: report/src/main/java/com/automationintesting/api/ReportApplication.java
class ReportApplication (line 10) | @SpringBootApplication
method started (line 14) | @PostConstruct
method main (line 19) | public static void main(String[] args) {
FILE: report/src/main/java/com/automationintesting/api/ReportController.java
class ReportController (line 10) | @RestController
method getAllRoomReports (line 16) | @RequestMapping(value = "/", method = RequestMethod.GET)
method getSpecificRoomReport (line 23) | @RequestMapping(value = "/room/{id:[0-9]*}", method = RequestMethod.GET)
FILE: report/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 9) | @Configuration
method openAPI (line 12) | @Bean
method publicApi (line 18) | @Bean
FILE: report/src/main/java/com/automationintesting/model/booking/Booking.java
class Booking (line 5) | public class Booking {
method Booking (line 20) | public Booking(int bookingid, int roomid, String firstname, String las...
method Booking (line 29) | public Booking() {
method getFirstname (line 32) | public String getFirstname() {
method getLastname (line 36) | public String getLastname() {
method isDepositpaid (line 40) | public boolean isDepositpaid() {
method getBookingDates (line 44) | public BookingDates getBookingDates() {
method getRoomid (line 48) | public int getRoomid() {
method setFirstname (line 52) | public void setFirstname(String firstname) {
method setLastname (line 56) | public void setLastname(String lastname) {
method setDepositpaid (line 60) | public void setDepositpaid(boolean depositpaid) {
method setBookingDates (line 64) | public void setBookingDates(BookingDates bookingDates) {
method setRoomid (line 68) | public void setRoomid(int roomId) {
method toString (line 72) | @Override
FILE: report/src/main/java/com/automationintesting/model/booking/BookingDates.java
class BookingDates (line 9) | public class BookingDates {
method BookingDates (line 19) | public BookingDates() {
method BookingDates (line 22) | public BookingDates(Date checkin, Date checkout) {
method getCheckin (line 27) | public Date getCheckin() {
method setCheckin (line 31) | public void setCheckin(Date checkin) {
method getCheckout (line 35) | public Date getCheckout() {
method setCheckout (line 39) | public void setCheckout(Date checkout) {
method toString (line 43) | @Override
FILE: report/src/main/java/com/automationintesting/model/booking/BookingSummaries.java
class BookingSummaries (line 7) | public class BookingSummaries {
method BookingSummaries (line 12) | public BookingSummaries(List<BookingSummary> bookings) {
method BookingSummaries (line 16) | public BookingSummaries() {
method getBookings (line 19) | public List<BookingSummary> getBookings() {
method setBookings (line 23) | public void setBookings(List<BookingSummary> bookings) {
FILE: report/src/main/java/com/automationintesting/model/booking/BookingSummary.java
class BookingSummary (line 3) | public class BookingSummary {
method BookingSummary (line 7) | public BookingSummary() {
method BookingSummary (line 10) | public BookingSummary(BookingDates bookingDates) {
method getBookingDates (line 14) | public BookingDates getBookingDates() {
method setBookingDates (line 18) | public void setBookingDates(BookingDates bookingDates) {
FILE: report/src/main/java/com/automationintesting/model/booking/Bookings.java
class Bookings (line 7) | public class Bookings {
method Bookings (line 12) | public Bookings() {
method Bookings (line 15) | public Bookings(List<Booking> bookings) {
method getBookings (line 19) | public List<Booking> getBookings() {
method setBookings (line 23) | public void setBookings(List<Booking> bookings) {
method toString (line 27) | @Override
FILE: report/src/main/java/com/automationintesting/model/report/Entry.java
class Entry (line 9) | public class Entry {
method Entry (line 22) | public Entry(Date start, Date end, String title) {
method getStart (line 28) | public Date getStart() {
method setStart (line 32) | public void setStart(Date start) {
method getEnd (line 36) | public Date getEnd() {
method setEnd (line 40) | public void setEnd(Date end) {
method getTitle (line 44) | public String getTitle() {
method setTitle (line 48) | public void setTitle(String title) {
method toString (line 52) | @Override
FILE: report/src/main/java/com/automationintesting/model/report/Report.java
class Report (line 7) | public class Report {
method Report (line 12) | public Report(List<Entry> report) {
method getReport (line 16) | public List<Entry> getReport() {
method setReport (line 20) | public void setReport(List<Entry> report) {
method toString (line 24) | @Override
FILE: report/src/main/java/com/automationintesting/model/room/Room.java
class Room (line 8) | public class Room {
method Room (line 25) | public Room() {
method Room (line 28) | public Room(int roomid, String roomName, String type, int beds, boolea...
method getRoomid (line 36) | public int getRoomid() {
method setRoomid (line 40) | public void setRoomid(int roomid) {
method getRoomName (line 44) | public String getRoomName() {
method setRoomName (line 48) | public void setRoomName(String roomName) {
method getType (line 52) | public String getType() {
method setType (line 56) | public void setType(String type) {
method getBeds (line 60) | public int getBeds() {
method setBeds (line 64) | public void setBeds(int beds) {
method isAccessible (line 68) | public boolean isAccessible() {
method setAccessible (line 72) | public void setAccessible(boolean accessible) {
method getDetails (line 76) | public String getDetails() {
method setDetails (line 80) | public void setDetails(String details) {
method getBookings (line 84) | public List<Booking> getBookings() {
method setBookings (line 88) | public void setBookings(List<Booking> bookings) {
method toString (line 92) | @Override
FILE: report/src/main/java/com/automationintesting/model/room/Rooms.java
class Rooms (line 7) | public class Rooms {
method Rooms (line 12) | public Rooms(List<Room> roomList) {
method Rooms (line 16) | public Rooms() {
method getRooms (line 19) | public List<Room> getRooms() {
method setRooms (line 23) | public void setRooms(List<Room> rooms) {
method toString (line 27) | @Override
FILE: report/src/main/java/com/automationintesting/requests/BookingRequests.java
class BookingRequests (line 8) | public class BookingRequests {
method BookingRequests (line 12) | public BookingRequests() {
method getBookings (line 20) | public Bookings getBookings(int roomId, String token){
method getBookingSummaries (line 31) | public BookingSummaries getBookingSummaries(int roomId){
FILE: report/src/main/java/com/automationintesting/requests/RoomRequests.java
class RoomRequests (line 7) | public class RoomRequests {
method RoomRequests (line 11) | public RoomRequests() {
method searchForRooms (line 19) | public Rooms searchForRooms(){
method searchForSpecificRoom (line 25) | public Room searchForSpecificRoom(String id){
FILE: report/src/main/java/com/automationintesting/service/ReportService.java
class ReportService (line 17) | @Service
method ReportService (line 23) | public ReportService() {
method getAllRoomsReport (line 28) | public Report getAllRoomsReport(String token) {
method getSpecificRoomReport (line 44) | public Report getSpecificRoomReport(int roomId) {
FILE: report/src/test/java/com/automationintesting/integration/BuildReportIT.java
class BuildReportIT (line 21) | @ExtendWith(SpringExtension.class)
method setupRestito (line 30) | @BeforeEach
method stopServer (line 53) | @AfterEach
method testReportCreation (line 63) | @Test
method testSpecificRoomReportCreation (line 72) | @Test
FILE: report/src/test/java/com/automationintesting/unit/service/ReportServiceTest.java
class ReportServiceTest (line 24) | public class ReportServiceTest {
method initialiseMocks (line 36) | @BeforeEach
method getAllRoomReportTest (line 80) | @Test
method getSpecificRoomReportTest (line 87) | @Test
FILE: room/src/main/java/com/automationintesting/api/RoomApplication.java
class RoomApplication (line 7) | @SpringBootApplication
method main (line 11) | public static void main(String[] args) {
FILE: room/src/main/java/com/automationintesting/api/RoomController.java
class RoomController (line 16) | @RestController
method getRooms (line 22) | @RequestMapping(value = "/", method = RequestMethod.GET)
method getRoom (line 35) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.GET)
method createRoom (line 42) | @RequestMapping(value = "/", method = RequestMethod.POST)
method deleteRoom (line 49) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.DELETE)
method updateRoom (line 56) | @RequestMapping(value = "/{id:[0-9]*}", method = RequestMethod.PUT)
FILE: room/src/main/java/com/automationintesting/api/SwaggerConfig.java
class SwaggerConfig (line 9) | @Configuration
method openAPI (line 12) | @Bean
method publicApi (line 18) | @Bean
FILE: room/src/main/java/com/automationintesting/db/InsertSql.java
class InsertSql (line 10) | public class InsertSql {
method InsertSql (line 14) | InsertSql(Connection connection, Room room) throws SQLException {
method getPreparedStatement (line 30) | public PreparedStatement getPreparedStatement() {
FILE: room/src/main/java/com/automationintesting/db/RoomDB.java
class RoomDB (line 20) | @Component
method RoomDB (line 32) | public RoomDB() throws SQLException, IOException {
method create (line 56) | public Room create(Room room) throws SQLException {
method query (line 79) | public Room query(int id) throws SQLException {
method delete (line 89) | public Boolean delete(int bookingid) throws SQLException {
method update (line 97) | public Room update(int id, Room room) throws SQLException {
method queryRooms (line 117) | public List<Room> queryRooms() throws SQLException {
method seedDB (line 130) | public void seedDB() throws IOException, SQLException {
method executeSqlFile (line 140) | private void executeSqlFile(String filename) throws IOException, SQLEx...
FILE: room/src/main/java/com/automationintesting/db/UpdateSql.java
class UpdateSql (line 10) | public class UpdateSql {
method UpdateSql (line 14) | UpdateSql(Connection connection, int id, Room room) throws SQLException {
method getPreparedStatement (line 31) | public PreparedStatement getPreparedStatement() {
FILE: room/src/main/java/com/automationintesting/model/db/Room.java
class Room (line 11) | @Entity
method Room (line 44) | public Room() {
method Room (line 47) | public Room(String roomName, String type, boolean accessible, String i...
method Room (line 57) | public Room(int roomid, String roomName, String type, boolean accessib...
method Room (line 68) | public Room(ResultSet result) throws SQLException {
method getRoomid (line 87) | public int getRoomid() {
method setRoomid (line 91) | public void setRoomid(int roomid) {
method getRoomName (line 95) | public String getRoomName() {
method setRoomName (line 99) | public void setRoomName(String roomName) {
method getType (line 103) | public String getType() {
method setType (line 107) | public void setType(String type) {
method isAccessible (line 111) | public boolean isAccessible() {
method setAccessible (line 115) | public void setAccessible(boolean accessible) {
method getDescription (line 119) | public String getDescription() {
method setDescription (line 123) | public void setDescription(String details) {
method getImage (line 127) | public String getImage() {
method setImage (line 131) | public void setImage(String image) {
method getFeatures (line 135) | public String[] getFeatures() {
method setFeatures (line 139) | public void setFeatures(String[] features) {
method getRoomPrice (line 143) | public int getRoomPrice() {
method setRoomPrice (line 147) | public void setRoomPrice(int roomPrice) {
method toString (line 151) | @Override
class RoomBuilder (line 165) | public static class RoomBuilder {
method setRoomName (line 175) | public RoomBuilder setRoomName(String roomName) {
method setType (line 181) | public RoomBuilder setType(String type) {
method setAccessible (line 187) | public RoomBuilder setAccessible(boolean accessible) {
method setImage (line 193) | public RoomBuilder setImage(String image) {
method setDescription (line 199) | public RoomBuilder setDescription(String description) {
method setFeatures (line 205) | public RoomBuilder setFeatures(String[] features) {
method setRoomPrice (line 211) | public RoomBuilder setRoomPrice(int roomPrice) {
method build (line 217) | public Room build(){
FILE: room/src/main/java/com/automationintesting/model/db/Rooms.java
class Rooms (line 7) | public class Rooms {
method Rooms (line 12) | public Rooms(List<Room> rooms) {
method Rooms (line 16) | public Rooms() {
method getRooms (line 19) | public List<Room> getRooms() {
method setRooms (line 23) | public void setRooms(List<Room> rooms) {
method toString (line 27) | @Override
FILE: room/src/main/java/com/automationintesting/model/request/Token.java
class Token (line 5) | public class Token {
method Token (line 10) | public Token() {
method Token (line 13) | public Token(String token) {
method getToken (line 17) | public String getToken() {
method setToken (line 21) | public void setToken(String token) {
FILE: room/src/main/java/com/automationintesting/model/request/UnavailableRoom.java
class UnavailableRoom (line 5) | public class UnavailableRoom {
method UnavailableRoom (line 10) | public UnavailableRoom(int roomid) {
method getRoomid (line 14) | public int getRoomid() {
method setRoomid (line 18) | public void setRoomid(int roomid) {
method UnavailableRoom (line 22) | public UnavailableRoom() {
method toString (line 25) | @Override
FILE: room/src/main/java/com/automationintesting/model/service/RoomResult.java
class RoomResult (line 6) | public class RoomResult {
method RoomResult (line 12) | public RoomResult(HttpStatus httpStatus, Room room) {
method RoomResult (line 17) | public RoomResult(HttpStatus httpStatus) {
method getHttpStatus (line 21) | public HttpStatus getHttpStatus() {
method getRoom (line 25) | public Room getRoom() {
FILE: room/src/main/java/com/automationintesting/requests/AuthRequests.java
class AuthRequests (line 10) | public class AuthRequests {
method AuthRequests (line 14) | public AuthRequests() {
method postCheckAuth (line 22) | public boolean postCheckAuth(String tokenValue){
FILE: room/src/main/java/com/automationintesting/requests/BookingRequests.java
class BookingRequests (line 10) | public class BookingRequests {
method BookingRequests (line 14) | public BookingRequests() {
method getUnavailableRooms (line 22) | public List<UnavailableRoom> getUnavailableRooms(String checkInDate, S...
FILE: room/src/main/java/com/automationintesting/service/DatabaseScheduler.java
class DatabaseScheduler (line 12) | @Component
method DatabaseScheduler (line 19) | public DatabaseScheduler() {
method startScheduler (line 27) | public void startScheduler(RoomDB roomDB, TimeUnit timeUnit){
method getResetCount (line 49) | public int getResetCount() {
method stepScheduler (line 53) | public void stepScheduler() {
FILE: room/src/main/java/com/automationintesting/service/MethodArgumentNotValidExceptionHandler.java
class MethodArgumentNotValidExceptionHandler (line 15) | @ControllerAdvice
method handleMethodArgumentNotValidException (line 18) | @ExceptionHandler(MethodArgumentNotValidException.class)
class Error (line 35) | public static class Error{
method Error (line 41) | public Error(HttpStatus status, String message, List<String> fieldEr...
method getErrorCode (line 48) | public int getErrorCode() {
method setErrorCode (line 52) | public void setErrorCode(int errorCode) {
method getError (line 56) | public String getError() {
method setError (line 60) | public void setError(String error) {
method getErrorMessage (line 64) | public String getErrorMessage() {
method setErrorMessage (line 68) | public void setErrorMessage(String errorMessage) {
method getFieldErrors (line 72) | public List<String> getFieldErrors() {
method setFieldErrors (line 76) | public void setFieldErrors(List<String> fieldErrors) {
FILE: room/src/main/java/com/automationintesting/service/RoomService.java
class RoomService (line 20) | @Service
method RoomService (line 30) | @Autowired
method beginDbScheduler (line 36) | @EventListener(ApplicationReadyEvent.class)
method getRooms (line 42) | public Rooms getRooms() throws SQLException {
method getSpecificRoom (line 46) | public RoomResult getSpecificRoom(int roomId) throws SQLException {
method createRoom (line 56) | public RoomResult createRoom(Room roomToCreate, String token) throws S...
method deleteRoom (line 66) | public RoomResult deleteRoom(int roomId, String token) throws SQLExcep...
method updateRoom (line 78) | public RoomResult updateRoom(int roomId, Room roomToUpdate, String tok...
method getUnavailableRooms (line 92) | public Rooms getUnavailableRooms(String checkin, String checkout) thro...
FILE: room/src/main/resources/db.sql
type ROOMS (line 1) | CREATE TABLE ROOMS ( roomid int NOT NULL AUTO_INCREMENT, room_name varch...
FILE: room/src/test/java/com/automationintesting/integration/RoomValidationIT.java
class RoomValidationIT (line 23) | @ExtendWith(SpringExtension.class)
method setupRestito (line 30) | @BeforeEach
method stopServer (line 37) | @AfterEach
method testPostValidation (line 45) | @Test
method testPutValidation (line 58) | @Test
method testGetRooms (line 72) | @Test
method testRoomAvailability (line 83) | @Test
FILE: room/src/test/java/com/automationintesting/unit/examples/BaseTest.java
class BaseTest (line 9) | public class BaseTest {
method createRoomDB (line 24) | @BeforeAll
FILE: room/src/test/java/com/automationintesting/unit/examples/SqlTest.java
class SqlTest (line 15) | public class SqlTest extends BaseTest {
method resetDB (line 24) | @BeforeEach
method testQueryRoom (line 48) | @Test
method testDeleteRoom (line 64) | @Test
method testQueryRooms (line 71) | @Test
method testCreateRoom (line 80) | @Test
method testUpdateRoom (line 97) | @Test
FILE: room/src/test/java/com/automationintesting/unit/service/RoomServiceTest.java
class RoomServiceTest (line 26) | public class RoomServiceTest {
method initialiseMocks (line 41) | @BeforeEach
method getRoomsTest (line 46) | @Test
method getSpecificRoomTest (line 60) | @Test
method getSpecificRoomNotFoundTest (line 72) | @Test
method createRoomTest (line 81) | @Test
method createRoomNotAuthorisedTest (line 94) | @Test
method deleteRoomTest (line 105) | @Test
method deleteRoomNotFoundTest (line 115) | @Test
method deleteRoomNotAuthenticatedTest (line 125) | @Test
method updateRoomTest (line 134) | @Test
method updateRoomNotFoundTest (line 147) | @Test
method updateRoomNotAuthorisedTest (line 159) | @Test
method getAvailableRoomsTest (line 170) | @Test
Condensed preview — 332 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (715K chars).
[
{
"path": ".github/workflows/assets-build.yml",
"chars": 1964,
"preview": "name: Assets Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'assets/**'\n tags:\n - '*'\n pull_"
},
{
"path": ".github/workflows/auth-build.yml",
"chars": 1981,
"preview": "name: Auth Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'auth/**'\n tags:\n - '*'\n p"
},
{
"path": ".github/workflows/booking-build.yml",
"chars": 2010,
"preview": "name: Booking Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'booking/**'\n tags:\n - '"
},
{
"path": ".github/workflows/branding-build.yml",
"chars": 2021,
"preview": "name: Branding Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'branding/**'\n tags:\n -"
},
{
"path": ".github/workflows/e2e-tests.yml",
"chars": 898,
"preview": "name: E2E Tests\n\non:\n workflow_run:\n workflows:\n - \"Assets Build\"\n types:\n - completed\n branches:\n "
},
{
"path": ".github/workflows/message-build.yml",
"chars": 2018,
"preview": "name: Message Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'message/**'\n tags:\n - '"
},
{
"path": ".github/workflows/report-build.yml",
"chars": 1999,
"preview": "name: Report Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'report/**'\n tags:\n - '*'"
},
{
"path": ".github/workflows/room-build.yml",
"chars": 1977,
"preview": "name: Room Service Build\n\non:\n push:\n branches:\n - trunk\n paths:\n - 'room/**'\n tags:\n - '*'\n p"
},
{
"path": ".gitignore",
"chars": 253,
"preview": "**/node_modules\n**/.DS_Store\n**/npm-debug.log\n*.log\n**/node\n*.gz\n**/*.received*\n\n# IntelliJ\n.idea\n*.iml\n\n# Java\ntarget/\n"
},
{
"path": ".utilities/mocking/README.md",
"chars": 895,
"preview": "# Wiremock\n\nWiremock is a test double for Web APIs allowing you to create fake HTTP requests and responses that act like"
},
{
"path": ".utilities/mocking/mappings/branding.json",
"chars": 842,
"preview": "{\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"/branding/\"\n },\n \"response\": {\n \"status\": 500,\n \"headers\" : {\n"
},
{
"path": ".utilities/mocking/mappings/count.json",
"chars": 222,
"preview": "{\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"/message/count\"\n },\n \"response\": {\n \"status\": 200,\n \"headers\" "
},
{
"path": ".utilities/mocking/mappings/message.json",
"chars": 424,
"preview": "{\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"/message/1\"\n },\n \"response\": {\n \"status\": 200,\n "
},
{
"path": ".utilities/mocking/mappings/messages.json",
"chars": 503,
"preview": "{\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"/message\"\n },\n \"response\": {\n \"status\": 200,\n \"h"
},
{
"path": ".utilities/mocking/mappings/report.json",
"chars": 724,
"preview": "{\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"/report/\"\n },\n \"response\": {\n \"status\": 200,\n \"headers\" : {\n "
},
{
"path": ".utilities/mocking/mappings/validate.json",
"chars": 352,
"preview": "{\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"/auth/validate\"\n },\n \"response\": {\n \"status\": 200,\n \"headers\""
},
{
"path": ".utilities/monitor/apimonitor.js",
"chars": 1675,
"preview": "const http = require('http');\nconst https = require('https');\n\nmakeHttpRequest = (endpoint) => {\n http.get(endpoint, (r"
},
{
"path": ".utilities/monitor/local_monitor.js",
"chars": 646,
"preview": "const apiMonitor = require('./apimonitor.js');\n\nprocess.stdout.write(\"Waiting for RBP to turn on\");\n\napiMonitor.checkFor"
},
{
"path": ".utilities/monitor/prod_monitor.js",
"chars": 743,
"preview": "const apiMonitor = require('./apimonitor.js');\n\nprocess.stdout.write(\"Waiting for RBP to turn on\");\n\napiMonitor.checkFor"
},
{
"path": ".utilities/wirebridge/Dockerfile",
"chars": 142,
"preview": "FROM maven:3.5.2-jdk-8-alpine\n\nADD . /usr/local/wirebridge\n\nWORKDIR /usr/local/report\n\nCOPY . ./\n\nENTRYPOINT java -jar W"
},
{
"path": ".utilities/wirebridge/README.md",
"chars": 949,
"preview": "# Wirebridge\n\nWirebridge is a configurable API that helps teams abstract complex data creation tasks behind programmable"
},
{
"path": ".utilities/wirebridge/mappings/add_booking.json",
"chars": 398,
"preview": "{\n \"request\" : {\n \"method\" : \"POST\",\n \"path\" : \"/booking\",\n \"parameters\" : [\"roomid\", \"firstname\", \"lastname\","
},
{
"path": ".utilities/wirebridge/mappings/add_room.json",
"chars": 333,
"preview": "{\n \"request\" : {\n \"method\" : \"POST\",\n \"path\" : \"/room\",\n \"parameters\" : [\"room_name\", \"type\", \"beds\", \"accessi"
},
{
"path": ".utilities/wirebridge/mappings/config.json",
"chars": 362,
"preview": "{\n \"databases\" : [{\n \"name\" : \"h2-booking\",\n \"host\" : \"booking:9090\",\n \"database\" : \"mem:rbp\",\n \"username\" "
},
{
"path": ".utilities/wirebridge/mappings/query_booking.json",
"chars": 425,
"preview": "{\n \"request\" : {\n \"method\" : \"POST\",\n \"path\" : \"/booking/query\",\n \"parameters\" : [\"roomid\", \"firstname\", \"last"
},
{
"path": "LICENSE",
"chars": 35149,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 1656,
"preview": "# restful-booker-platform\nA platform of web services that forms a Bed and Breakfast booking system. The platforms primar"
},
{
"path": "assets/.gitignore",
"chars": 304,
"preview": "# dependencies\n/node_modules\n/.pnp\n.pnp.js\n.yarn/install-state.gz\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# produ"
},
{
"path": "assets/Dockerfile",
"chars": 1161,
"preview": "FROM node:24 AS base\n\n# Install dependencies only when needed\nFROM base AS deps\nWORKDIR /app\n\n# Copy package files\nCOPY "
},
{
"path": "assets/README.md",
"chars": 453,
"preview": "# Restful-booker-assets\n\nThe assets API is responsible for serving the UI assets to a browser to give users easy access "
},
{
"path": "assets/next.config.js",
"chars": 879,
"preview": "/** @type {import('next').NextConfig} */\nconst nextConfig = {\n reactStrictMode: false,\n output: 'standalone',\n async "
},
{
"path": "assets/package.json",
"chars": 2882,
"preview": "{\n \"name\": \"restful-booker-platform-assets\",\n \"version\": \"2.2\",\n \"private\": true,\n \"scripts\": {\n \"dev\": \"next dev"
},
{
"path": "assets/pom.xml",
"chars": 2754,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "assets/src/__tests__/Branding.test.tsx",
"chars": 2863,
"preview": "import React from 'react';\nimport BrandingForm from '../components/admin/Branding';\nimport ReactModal from 'react-modal'"
},
{
"path": "assets/src/__tests__/Footer.test.tsx",
"chars": 3343,
"preview": "import React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport Footer from '../components/Fo"
},
{
"path": "assets/src/__tests__/HomeNav.test.tsx",
"chars": 2609,
"preview": "import React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport HomeNav from '../components/H"
},
{
"path": "assets/src/__tests__/HotelContact.test.tsx",
"chars": 6430,
"preview": "import React from 'react';\nimport HotelContact from '../components/home/HotelContact';\nimport { render, fireEvent, waitF"
},
{
"path": "assets/src/__tests__/HotelLogo.test.tsx",
"chars": 1948,
"preview": "import React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom';\n"
},
{
"path": "assets/src/__tests__/HotelMap.test.tsx",
"chars": 2322,
"preview": "import React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom';\n"
},
{
"path": "assets/src/__tests__/HotelRoomInfo.test.tsx",
"chars": 1848,
"preview": "import React from 'react';\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom';\n"
},
{
"path": "assets/src/__tests__/Message.test.tsx",
"chars": 1085,
"preview": "import React from 'react';\nimport Message from '../components/admin/Message';\nimport { render, waitFor, screen, act } fr"
},
{
"path": "assets/src/__tests__/MessageList.test.tsx",
"chars": 2793,
"preview": "import React from 'react';\nimport MessageList from '../components/admin/MessageList';\nimport { render, waitFor, fireEven"
},
{
"path": "assets/src/__tests__/Nav.test.tsx",
"chars": 610,
"preview": "import React from 'react';\nimport Nav from '../components/admin/Nav';\nimport { render } from '@testing-library/react';\ni"
},
{
"path": "assets/src/__tests__/Notification.test.tsx",
"chars": 780,
"preview": "import React from 'react';\nimport Notification from '../components/admin/Notification';\nimport { render } from '@testing"
},
{
"path": "assets/src/__tests__/Report.test.tsx",
"chars": 1228,
"preview": "import React from 'react';\nimport Report from '../components/admin/Report';\nimport { render, waitFor, screen } from '@te"
},
{
"path": "assets/src/__tests__/RoomDetails.test.tsx",
"chars": 6655,
"preview": "import React from 'react';\nimport RoomDetails from '../components/admin/RoomDetails';\nimport { Routes, Route, MemoryRout"
},
{
"path": "assets/src/__tests__/__snapshots__/Branding.test.tsx.snap",
"chars": 6533,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Branding Component Branding page renders 1`] = `\n"
},
{
"path": "assets/src/__tests__/__snapshots__/Message.test.tsx.snap",
"chars": 1189,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Message Component Message popup is populated with"
},
{
"path": "assets/src/__tests__/__snapshots__/MessageList.test.tsx.snap",
"chars": 4717,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`MessageList Component Clicking message shows mess"
},
{
"path": "assets/src/__tests__/__snapshots__/Nav.test.tsx.snap",
"chars": 2320,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Nav Component Nav bar renders 1`] = `\n<DocumentFr"
},
{
"path": "assets/src/__tests__/__snapshots__/Notification.test.tsx.snap",
"chars": 764,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`Notification Component Notification renders alert"
},
{
"path": "assets/src/__tests__/__snapshots__/RoomDetails.test.tsx.snap",
"chars": 22588,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`RoomDetails Component Room details can be switche"
},
{
"path": "assets/src/__tests__/examples/__snapshots__/contract-test.tsx.snap",
"chars": 4076,
"preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Rooms list component 1`] = `\n{\n \"asFragment\": [Function],\n \"baseE"
},
{
"path": "assets/src/__tests__/examples/contract-test.tsx",
"chars": 402,
"preview": "import React from 'react';\nimport {\n render,\n fireEvent,\n cleanup\n} from '@testing-library/react';\nimport Booki"
},
{
"path": "assets/src/__tests__/examples/contract.json",
"chars": 187,
"preview": "{\n \"bookingid\": 1,\n \"roomid\": 1,\n \"firstname\": \"James\",\n \"lastname\": \"Dean\",\n \"depositpaid\": true,\n \"bookingdates\""
},
{
"path": "assets/src/__tests__/examples/home-page-test.tsx",
"chars": 1060,
"preview": "import React from 'react';\nimport { BrowserRouter } from 'react-router-dom';\nimport RoomListings from '../../components/"
},
{
"path": "assets/src/__tests__/examples/task-analysis-test.tsx",
"chars": 1580,
"preview": "import React from 'react';\nimport LoginComponent from '../../components/admin/Login';\nimport { render, fireEvent, waitFo"
},
{
"path": "assets/src/__tests__/jest.setup.ts",
"chars": 452,
"preview": "import '@testing-library/jest-dom';\n\nconst util = require('util');\nconst { TextEncoder, TextDecoder } = util;\n\nObject.as"
},
{
"path": "assets/src/app/admin/branding/page.tsx",
"chars": 453,
"preview": "'use client';\n\nimport React, { Suspense } from 'react';\nimport dynamic from 'next/dynamic';\nimport Loading from '@/compo"
},
{
"path": "assets/src/app/admin/layout.tsx",
"chars": 1862,
"preview": "'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { usePathname, useRouter } from 'next/navigati"
},
{
"path": "assets/src/app/admin/message/page.tsx",
"chars": 464,
"preview": "'use client';\n\nimport React, { Suspense } from 'react';\nimport dynamic from 'next/dynamic';\nimport Loading from '@/compo"
},
{
"path": "assets/src/app/admin/page.tsx",
"chars": 1294,
"preview": "'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport Login from '@/components/admin/Login';\nimport "
},
{
"path": "assets/src/app/admin/report/page.tsx",
"chars": 468,
"preview": "'use client';\n\nimport React, { Suspense } from 'react';\nimport dynamic from 'next/dynamic';\nimport Loading from '@/compo"
},
{
"path": "assets/src/app/admin/room/[id]/page.tsx",
"chars": 681,
"preview": "'use client';\n\nimport React, { Suspense } from 'react';\nimport dynamic from 'next/dynamic';\nimport Loading from '@/compo"
},
{
"path": "assets/src/app/admin/rooms/page.tsx",
"chars": 466,
"preview": "'use client';\n\nimport React, { Suspense } from 'react';\nimport dynamic from 'next/dynamic';\nimport Loading from '@/compo"
},
{
"path": "assets/src/app/api/auth/login/route.ts",
"chars": 1705,
"preview": "import { NextResponse } from 'next/server';\nimport { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';\n\nex"
},
{
"path": "assets/src/app/api/auth/logout/route.ts",
"chars": 747,
"preview": "import { NextResponse } from 'next/server';\n\nexport async function POST(request: Request) {\n try {\n // Parse t"
},
{
"path": "assets/src/app/api/auth/validate/route.ts",
"chars": 1098,
"preview": "import { NextResponse } from 'next/server';\nimport { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';\n\nex"
},
{
"path": "assets/src/app/api/booking/[id]/route.ts",
"chars": 3763,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/booking/route.ts",
"chars": 2223,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/booking/summary/route.ts",
"chars": 1412,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\n\nexport async function GET(request: "
},
{
"path": "assets/src/app/api/branding/route.ts",
"chars": 2040,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/message/[id]/read/route.ts",
"chars": 1135,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/message/[id]/route.ts",
"chars": 3358,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/message/count/route.ts",
"chars": 1148,
"preview": "import { NextResponse } from 'next/server';\nimport { fetchWithRetry as fetch } from '../../../../utils/fetch-retry';\n\nex"
},
{
"path": "assets/src/app/api/message/route.ts",
"chars": 1518,
"preview": "import { NextResponse } from 'next/server';\nimport { fetchWithRetry as fetch } from '../../../utils/fetch-retry';\n\nexpor"
},
{
"path": "assets/src/app/api/report/room/[roomid]/route.ts",
"chars": 807,
"preview": "import { NextResponse } from 'next/server';\nimport { fetchWithRetry as fetch } from '../../../../../utils/fetch-retry';\n"
},
{
"path": "assets/src/app/api/report/route.ts",
"chars": 975,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/room/[id]/route.ts",
"chars": 3485,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/api/room/route.ts",
"chars": 2183,
"preview": "import { NextResponse } from 'next/server';\nimport { cookies } from 'next/headers';\nimport { fetchWithRetry as fetch } f"
},
{
"path": "assets/src/app/cookie/page.tsx",
"chars": 6036,
"preview": "'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport Footer from '@/components/Footer';\n\nimport { B"
},
{
"path": "assets/src/app/globals.css",
"chars": 3128,
"preview": ".detail:hover {\n background-color: #ddd;\n}\n\n.detail p, .detail span {\n display: table-cell;\n display: table-cell;\n l"
},
{
"path": "assets/src/app/layout.tsx",
"chars": 1853,
"preview": "import type { Metadata } from 'next'\nimport './globals.css'\nimport Script from 'next/script'\n\nexport const metadata: Met"
},
{
"path": "assets/src/app/page.tsx",
"chars": 1391,
"preview": "'use client';\n\nimport React, { useState, useEffect } from \"react\";\nimport HomeNav from \"@/components/HomeNav\";\nimport Fo"
},
{
"path": "assets/src/app/privacy/page.tsx",
"chars": 9188,
"preview": "'use client';\n\nimport React from 'react';\nimport { useState, useEffect } from 'react';\nimport Footer from '@/components/"
},
{
"path": "assets/src/app/reservation/[id]/page.tsx",
"chars": 2289,
"preview": "\n'use client';\n\nimport React from 'react';\nimport { useState, useEffect } from 'react';\nimport { useSearchParams } from "
},
{
"path": "assets/src/components/Footer.tsx",
"chars": 2944,
"preview": "import React from \"react\";\nimport Link from \"next/link\";\nimport { Branding } from \"@/types/branding\";\n\nimport packageJso"
},
{
"path": "assets/src/components/HomeNav.tsx",
"chars": 1714,
"preview": "\nimport React from 'react';\nimport { Branding } from \"@/types/branding\";\n\ninterface NavProps {\n branding: Branding;\n}"
},
{
"path": "assets/src/components/admin/AdminBooking.tsx",
"chars": 5793,
"preview": "import React, { useEffect, useState } from 'react';\nimport ReactModal from 'react-modal';\nimport moment from 'moment';\n\n"
},
{
"path": "assets/src/components/admin/BookingListing.tsx",
"chars": 5578,
"preview": "import React, { useEffect, useState } from 'react';\nimport DatePicker from 'react-datepicker';\nimport moment from 'momen"
},
{
"path": "assets/src/components/admin/BookingListings.tsx",
"chars": 1075,
"preview": "import React, { useEffect, useState } from 'react';\nimport BookingListing from './BookingListing';\nimport { Booking } fr"
},
{
"path": "assets/src/components/admin/Branding.tsx",
"chars": 9981,
"preview": "import React, { useEffect, useState } from 'react';\nimport ReactModal from 'react-modal';\nimport { Branding as BrandingT"
},
{
"path": "assets/src/components/admin/Loading.tsx",
"chars": 315,
"preview": "import React from 'react';\n\nconst Loading: React.FC = () => {\n return (\n <div className=\"text-center mt-5\">\n <d"
},
{
"path": "assets/src/components/admin/Login.tsx",
"chars": 2665,
"preview": "import React, { useState } from 'react';\nimport Cookies from 'universal-cookie';\n\ninterface LoginProps {\n setAuthentica"
},
{
"path": "assets/src/components/admin/Message.tsx",
"chars": 2930,
"preview": "import React, { useEffect, useState } from 'react';\nimport ReactModal from 'react-modal';\n\ninterface MessageProps {\n me"
},
{
"path": "assets/src/components/admin/MessageList.tsx",
"chars": 2722,
"preview": "import React, { useEffect, useState } from 'react';\nimport Message from './Message';\n\ninterface MessageProps {\n id: num"
},
{
"path": "assets/src/components/admin/Nav.tsx",
"chars": 4091,
"preview": "import React, { useState } from 'react';\nimport Link from 'next/link';\nimport { usePathname } from 'next/navigation';\nim"
},
{
"path": "assets/src/components/admin/Notification.tsx",
"chars": 646,
"preview": "import React, { useEffect } from 'react';\nimport { Link } from 'react-router-dom';\n\ninterface NotificationProps {\n setC"
},
{
"path": "assets/src/components/admin/Report.tsx",
"chars": 2070,
"preview": "import React, { useEffect, useState } from 'react';\nimport { Calendar, momentLocalizer } from 'react-big-calendar';\nimpo"
},
{
"path": "assets/src/components/admin/RoomDetails.tsx",
"chars": 9257,
"preview": "import React, { useEffect, useState } from 'react';\nimport BookingListings from './BookingListings';\n\ninterface RoomDeta"
},
{
"path": "assets/src/components/admin/RoomForm.tsx",
"chars": 8120,
"preview": "import React, { useState } from 'react';\n\ninterface RoomFormProps {\n updateRooms: () => void;\n}\n\ninterface RoomData {\n "
},
{
"path": "assets/src/components/admin/RoomListing.tsx",
"chars": 2259,
"preview": "import React from 'react';\n\nimport { Room } from '@/types/room';\n\ninterface RoomListingProps {\n details: Room;\n update"
},
{
"path": "assets/src/components/admin/RoomListings.tsx",
"chars": 1255,
"preview": "import React, { useEffect, useState } from 'react';\nimport RoomListing from './RoomListing';\nimport RoomForm from './Roo"
},
{
"path": "assets/src/components/home/Availability.tsx",
"chars": 4936,
"preview": "'use client';\n\nimport React, { useState, useEffect } from \"react\";\nimport DatePicker from \"react-datepicker\";\nimport mom"
},
{
"path": "assets/src/components/home/HotelContact.tsx",
"chars": 8475,
"preview": "import React, { useState } from 'react';\nimport { JSX } from 'react';\n\ninterface ContactDetails {\n name?: string;\n add"
},
{
"path": "assets/src/components/home/HotelLogo.tsx",
"chars": 774,
"preview": "import React from 'react';\nimport { Branding } from '@/types/branding';\n\ninterface HotelLogoProps {\n branding: Branding"
},
{
"path": "assets/src/components/home/HotelMap.tsx",
"chars": 3217,
"preview": "import React from 'react';\nimport { Map, Marker } from 'pigeon-maps';\nimport { Branding } from '@/types/branding';\n\ncons"
},
{
"path": "assets/src/components/home/HotelRoomInfo.tsx",
"chars": 1456,
"preview": "import React from 'react';\nimport { Room } from '@/types/room';\nimport { translateIcon } from \"../../utils/iconUtils\";\n\n"
},
{
"path": "assets/src/components/reservation/BookingForm.tsx",
"chars": 13866,
"preview": "import React, { useState, useEffect } from \"react\";\nimport { useSearchParams } from \"next/navigation\";\nimport { Calendar"
},
{
"path": "assets/src/components/reservation/Breadcrumb.tsx",
"chars": 755,
"preview": "\nimport React from 'react';\n\ninterface BreadcrumbProps {\n roomType: string;\n}\n\nconst Breadcrumb: React.FC<BreadcrumbP"
},
{
"path": "assets/src/components/reservation/RoomDetails.tsx",
"chars": 5006,
"preview": "import React from 'react';\n\nimport { Room as RoomType } from \"@/types/room\";\nimport { translateIcon } from \"@/utils/icon"
},
{
"path": "assets/src/components/reservation/SimilarRooms.tsx",
"chars": 2533,
"preview": "import React, { useEffect } from 'react';\n\ninterface SimilarRoomsProps {\n id : number;\n queryString: string;\n}\n\nco"
},
{
"path": "assets/src/styles/reservations.css",
"chars": 224,
"preview": "/* Minimal custom CSS */\n.hero-image {\n height: 400px;\n object-fit: cover;\n}\n \n.amenity-icon {\n font-size: 1.5rem;\n "
},
{
"path": "assets/src/types/availability.d.ts",
"chars": 72,
"preview": "export interface Availability {\n checkIn: Date;\n checkOut: Date;\n}"
},
{
"path": "assets/src/types/booking.d.ts",
"chars": 261,
"preview": "export interface Booking {\n bookingid?: number;\n roomid: number;\n firstname: string;\n lastname: string;\n "
},
{
"path": "assets/src/types/branding.d.ts",
"chars": 422,
"preview": "export interface Branding {\n name: string;\n description: string;\n logoUrl: string;\n directions: string;\n "
},
{
"path": "assets/src/types/react-big-calendar.d.ts",
"chars": 1524,
"preview": "declare module 'react-big-calendar' {\n import { ComponentType } from 'react';\n \n export interface Event {\n title: "
},
{
"path": "assets/src/types/room.d.ts",
"chars": 203,
"preview": "export interface Room {\n roomid: number;\n roomName: string;\n type: string;\n accessible: boolean;\n image: "
},
{
"path": "assets/src/utils/fetch-retry.ts",
"chars": 315,
"preview": "import fetchRetry from 'fetch-retry';\n\nexport const fetchWithRetry = fetchRetry(global.fetch, {\n retries: 5,\n retryDel"
},
{
"path": "assets/src/utils/iconUtils.ts",
"chars": 448,
"preview": "/**\n * Translates a feature name to its corresponding Bootstrap icon name\n * @param feature The feature name to translat"
},
{
"path": "assets/tsconfig.json",
"chars": 775,
"preview": "{\n \"compilerOptions\": {\n \"rootDir\": \".\",\n \"target\": \"es2025\",\n \"lib\": [\n \"dom\",\n \"dom.iterable\",\n "
},
{
"path": "assets/tsconfig.test.json",
"chars": 91,
"preview": "{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"jsx\": \"react\"\n }\n }"
},
{
"path": "auth/Dockerfile",
"chars": 386,
"preview": "FROM eclipse-temurin:26-jre-alpine\n\nWORKDIR /app\n\n# Use the executable JAR\nCOPY target/restful-booker-platform-auth-*-ex"
},
{
"path": "auth/README.md",
"chars": 958,
"preview": "# Restful-booker-auth\n\nAuth is responsbile for creating, verifying and destroying tokens that are used by other services"
},
{
"path": "auth/pom.xml",
"chars": 4508,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "auth/src/main/java/com/automationintesting/api/AuthApplication.java",
"chars": 446,
"preview": "package com.automationintesting.api;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot"
},
{
"path": "auth/src/main/java/com/automationintesting/api/AuthController.java",
"chars": 2039,
"preview": "package com.automationintesting.api;\n\nimport com.automationintesting.model.Auth;\nimport com.automationintesting.model.De"
},
{
"path": "auth/src/main/java/com/automationintesting/api/SwaggerConfig.java",
"chars": 671,
"preview": "package com.automationintesting.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.servers.S"
},
{
"path": "auth/src/main/java/com/automationintesting/db/AuthDB.java",
"chars": 3857,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.Auth;\nimport com.automationintesting.model.Tok"
},
{
"path": "auth/src/main/java/com/automationintesting/model/Auth.java",
"chars": 499,
"preview": "package com.automationintesting.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class Auth {\n\n "
},
{
"path": "auth/src/main/java/com/automationintesting/model/Decision.java",
"chars": 523,
"preview": "package com.automationintesting.model;\n\nimport org.springframework.http.HttpStatus;\n\npublic class Decision {\n\n privat"
},
{
"path": "auth/src/main/java/com/automationintesting/model/Token.java",
"chars": 1291,
"preview": "package com.automationintesting.model;\n\nimport java.sql.Connection;\nimport java.sql.Date;\nimport java.sql.PreparedStatem"
},
{
"path": "auth/src/main/java/com/automationintesting/service/AuthService.java",
"chars": 2038,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.db.AuthDB;\nimport com.automationintesting.model"
},
{
"path": "auth/src/main/java/com/automationintesting/service/DatabaseScheduler.java",
"chars": 1561,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.db.AuthDB;\nimport org.slf4j.Logger;\nimport org."
},
{
"path": "auth/src/main/java/com/automationintesting/service/RandomString.java",
"chars": 1569,
"preview": "package com.automationintesting.service;\n\nimport java.security.SecureRandom;\nimport java.util.Locale;\nimport java.util.O"
},
{
"path": "auth/src/main/resources/application-dev.properties",
"chars": 133,
"preview": "database.schedule=false\n\nspringdoc.swagger-ui.config-url=/auth/v3/api-docs/swagger-config\nspringdoc.swagger-ui.url=/auth"
},
{
"path": "auth/src/main/resources/application-prod.properties",
"chars": 277,
"preview": "#HoneyComb\nhoneycomb.beeline.enabled=true\nhoneycomb.beeline.service-name=rbp-auth\nhoneycomb.beeline.dataset=rbp-auth-dat"
},
{
"path": "auth/src/main/resources/application.properties",
"chars": 185,
"preview": "logging.file.name=auth.log\n\nserver.port = 3004\n\nserver.servlet.context-path=/auth\n\nmanagement.endpoints.web.exposure.inc"
},
{
"path": "auth/src/main/resources/db.sql",
"chars": 283,
"preview": "CREATE TABLE IF NOT EXISTS TOKENS ( tokenid int NOT NULL AUTO_INCREMENT, token varchar(255), expiry TIMESTAMP, primary k"
},
{
"path": "auth/src/main/resources/seed.sql",
"chars": 71,
"preview": "INSERT INTO ACCOUNTS (username, password) VALUES ('admin', 'password');"
},
{
"path": "auth/src/test/java/com/automationintesting/integration/AuthIntegrationTest.java",
"chars": 1913,
"preview": "package com.automationintesting.integration;\n\nimport com.automationintesting.api.AuthApplication;\nimport com.automationi"
},
{
"path": "auth/src/test/java/com/automationintesting/integration/example/TaskAnalysisIntegrationTest.java",
"chars": 2358,
"preview": "package com.automationintesting.integration.example;\n\nimport com.automationintesting.api.AuthApplication;\nimport com.aut"
},
{
"path": "auth/src/test/java/com/automationintesting/unit/db/AuthDBTest.java",
"chars": 1589,
"preview": "package com.automationintesting.unit.db;\n\nimport com.automationintesting.model.Auth;\nimport com.automationintesting.mode"
},
{
"path": "auth/src/test/java/com/automationintesting/unit/db/BaseTest.java",
"chars": 633,
"preview": "package com.automationintesting.unit.db;\n\nimport com.automationintesting.db.AuthDB;\nimport org.junit.jupiter.api.BeforeA"
},
{
"path": "auth/src/test/java/com/automationintesting/unit/example/TaskAnalysisTest.java",
"chars": 1249,
"preview": "package com.automationintesting.unit.example;\n\nimport com.automationintesting.model.Token;\nimport com.automationintestin"
},
{
"path": "auth/src/test/java/com/automationintesting/unit/service/AuthServiceTest.java",
"chars": 3375,
"preview": "package com.automationintesting.unit.service;\n\nimport com.automationintesting.db.AuthDB;\nimport com.automationintesting."
},
{
"path": "booking/Dockerfile",
"chars": 449,
"preview": "FROM eclipse-temurin:26-jre-alpine\n\nWORKDIR /app\n\n# Use the executable JAR\nCOPY target/restful-booker-platform-booking-*"
},
{
"path": "booking/README.md",
"chars": 1320,
"preview": "# Restful-booker-booking\n\nBooking is responsible for creating, reading, updating and deleting booking data from the data"
},
{
"path": "booking/pom.xml",
"chars": 4843,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "booking/src/main/java/com/automationintesting/api/BookingApplication.java",
"chars": 543,
"preview": "package com.automationintesting.api;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot"
},
{
"path": "booking/src/main/java/com/automationintesting/api/BookingController.java",
"chars": 3607,
"preview": "package com.automationintesting.api;\n\nimport com.automationintesting.model.db.*;\nimport com.automationintesting.model.se"
},
{
"path": "booking/src/main/java/com/automationintesting/api/SwaggerConfig.java",
"chars": 676,
"preview": "package com.automationintesting.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.servers.S"
},
{
"path": "booking/src/main/java/com/automationintesting/db/BookingDB.java",
"chars": 8523,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.AvailableRoom;\nimport com.automationintesti"
},
{
"path": "booking/src/main/java/com/automationintesting/db/InsertSql.java",
"chars": 1095,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.Booking;\n\nimport java.sql.Connection;\nimpor"
},
{
"path": "booking/src/main/java/com/automationintesting/db/UpdateSql.java",
"chars": 1087,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.Booking;\n\nimport java.sql.Connection;\nimpor"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/AvailableRoom.java",
"chars": 455,
"preview": "package com.automationintesting.model.db;\n\npublic class AvailableRoom {\n\n private int roomid;\n\n public AvailableRo"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/Booking.java",
"chars": 6104,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jac"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/BookingDates.java",
"chars": 1071,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport jakarta.persist"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/BookingSummaries.java",
"chars": 541,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport java.util.List;"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/BookingSummary.java",
"chars": 706,
"preview": "package com.automationintesting.model.db;\n\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\n\npublic class Bookin"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/Bookings.java",
"chars": 489,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport java.util.List;"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/CreatedBooking.java",
"chars": 904,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class CreatedBo"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/Message.java",
"chars": 1750,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport jakarta.persist"
},
{
"path": "booking/src/main/java/com/automationintesting/model/db/Token.java",
"chars": 398,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class Token {\n\n"
},
{
"path": "booking/src/main/java/com/automationintesting/model/service/BookingResult.java",
"chars": 1595,
"preview": "package com.automationintesting.model.service;\n\nimport com.automationintesting.model.db.AvailableRoom;\nimport com.automa"
},
{
"path": "booking/src/main/java/com/automationintesting/requests/AuthRequests.java",
"chars": 1322,
"preview": "package com.automationintesting.requests;\n\nimport com.automationintesting.model.db.Token;\nimport org.springframework.htt"
},
{
"path": "booking/src/main/java/com/automationintesting/requests/MessageRequests.java",
"chars": 1287,
"preview": "package com.automationintesting.requests;\n\nimport com.automationintesting.model.db.Message;\nimport org.springframework.h"
},
{
"path": "booking/src/main/java/com/automationintesting/service/BookingService.java",
"chars": 5213,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.db.BookingDB;\nimport com.automationintesting.mo"
},
{
"path": "booking/src/main/java/com/automationintesting/service/DatabaseScheduler.java",
"chars": 1573,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.db.BookingDB;\nimport org.slf4j.Logger;\nimport o"
},
{
"path": "booking/src/main/java/com/automationintesting/service/DateCheckValidator.java",
"chars": 485,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.model.db.BookingDates;\n\nimport java.time.LocalD"
},
{
"path": "booking/src/main/java/com/automationintesting/service/MessageBuilder.java",
"chars": 726,
"preview": "package com.automationintesting.service;\n\nimport com.automationintesting.model.db.Booking;\nimport com.automationintestin"
},
{
"path": "booking/src/main/java/com/automationintesting/service/MethodArgumentNotValidExceptionHandler.java",
"chars": 2591,
"preview": "package com.automationintesting.service;\n\nimport org.springframework.http.HttpStatus;\nimport org.springframework.validat"
},
{
"path": "booking/src/main/resources/application-dev.properties",
"chars": 139,
"preview": "database.schedule=false\n\nspringdoc.swagger-ui.config-url=/booking/v3/api-docs/swagger-config\nspringdoc.swagger-ui.url=/b"
},
{
"path": "booking/src/main/resources/application-prod.properties",
"chars": 289,
"preview": "#HoneyComb\nhoneycomb.beeline.enabled=true\nhoneycomb.beeline.service-name=rbp-booking\nhoneycomb.beeline.dataset=rbp-booki"
},
{
"path": "booking/src/main/resources/application.properties",
"chars": 191,
"preview": "logging.file.name=booking.log\n\nserver.port = 3000\n\nserver.servlet.context-path=/booking\n\nmanagement.endpoints.web.exposu"
},
{
"path": "booking/src/main/resources/db.sql",
"chars": 197,
"preview": "CREATE TABLE BOOKINGS ( bookingid int NOT NULL AUTO_INCREMENT, roomid int, firstname varchar(255), lastname varchar(255)"
},
{
"path": "booking/src/main/resources/seed.sql",
"chars": 447,
"preview": "INSERT INTO BOOKINGS (roomid, firstname, lastname, depositpaid, checkin, checkout) VALUES (1, 'James', 'Dean', true, '20"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/BookingDateConflictIT.java",
"chars": 3191,
"preview": "package com.automationintesting.integration;\n\nimport com.automationintesting.api.BookingApplication;\nimport com.automati"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/BookingValidationIT.java",
"chars": 1858,
"preview": "package com.automationintesting.integration;\n\nimport com.automationintesting.api.BookingApplication;\nimport com.automati"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/GetBookingIT.java",
"chars": 3386,
"preview": "package com.automationintesting.integration;\n\nimport com.automationintesting.api.BookingApplication;\nimport com.xebialab"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/MessageRequestIT.java",
"chars": 2372,
"preview": "package com.automationintesting.integration;\n\nimport java.time.LocalDate;\nimport java.time.Month;\n\nimport org.approvalte"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/examples/BookingIntegrationIT.java",
"chars": 5051,
"preview": "package com.automationintesting.integration.examples;\n\nimport com.automationintesting.api.BookingApplication;\nimport com"
},
{
"path": "booking/src/test/java/com/automationintesting/integration/examples/ContractIT.java",
"chars": 3064,
"preview": "package com.automationintesting.integration.examples;\n\nimport com.automationintesting.api.BookingApplication;\nimport com"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/BaseTest.java",
"chars": 1168,
"preview": "package com.automationintesting.unit;\n\nimport com.automationintesting.db.BookingDB;\nimport org.junit.jupiter.api.BeforeA"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/db/DateConflictTest.java",
"chars": 7115,
"preview": "package com.automationintesting.unit.db;\n\nimport com.automationintesting.model.db.Booking;\nimport com.automationintestin"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/examples/SqlTest.java",
"chars": 5448,
"preview": "package com.automationintesting.unit.examples;\n\nimport com.automationintesting.model.db.AvailableRoom;\nimport com.automa"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/model/MessageBuilderTest.java",
"chars": 1449,
"preview": "package com.automationintesting.unit.model;\n\nimport com.automationintesting.model.db.Booking;\nimport com.automationintes"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/service/BookingServiceTest.java",
"chars": 9550,
"preview": "package com.automationintesting.unit.service;\n\nimport com.automationintesting.db.BookingDB;\nimport com.automationintesti"
},
{
"path": "booking/src/test/java/com/automationintesting/unit/service/DateCheckValidatorTest.java",
"chars": 1917,
"preview": "package com.automationintesting.unit.service;\n\nimport com.automationintesting.model.db.BookingDates;\nimport com.automati"
},
{
"path": "booking/src/test/resources/contract.json",
"chars": 187,
"preview": "{\n \"bookingid\": 1,\n \"roomid\": 1,\n \"firstname\": \"James\",\n \"lastname\": \"Dean\",\n \"depositpaid\": true,\n \"bookingdates\""
},
{
"path": "branding/Dockerfile",
"chars": 422,
"preview": "FROM eclipse-temurin:26-jre-alpine\n\nWORKDIR /app\n\n# Use the executable JAR\nCOPY target/restful-booker-platform-branding-"
},
{
"path": "branding/README.md",
"chars": 1317,
"preview": "# Restful-booker-branding\n\nBranding is responsible for reading and updating branding data from the database to share wit"
},
{
"path": "branding/pom.xml",
"chars": 5112,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "branding/src/main/java/com/automationintesting/api/BrandingApplication.java",
"chars": 454,
"preview": "package com.automationintesting.api;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot"
},
{
"path": "branding/src/main/java/com/automationintesting/api/BrandingController.java",
"chars": 1232,
"preview": "package com.automationintesting.api;\n\nimport com.automationintesting.model.db.Branding;\nimport com.automationintesting.m"
},
{
"path": "branding/src/main/java/com/automationintesting/api/SwaggerConfig.java",
"chars": 678,
"preview": "package com.automationintesting.api;\n\nimport io.swagger.v3.oas.models.OpenAPI;\nimport io.swagger.v3.oas.models.servers.S"
},
{
"path": "branding/src/main/java/com/automationintesting/db/BrandingDB.java",
"chars": 3743,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.Branding;\nimport org.h2.jdbcx.JdbcDataSourc"
},
{
"path": "branding/src/main/java/com/automationintesting/db/InsertSql.java",
"chars": 1776,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.Branding;\n\nimport java.sql.Connection;\nimpo"
},
{
"path": "branding/src/main/java/com/automationintesting/db/UpdateSql.java",
"chars": 1795,
"preview": "package com.automationintesting.db;\n\nimport com.automationintesting.model.db.Branding;\n\nimport java.sql.Connection;\nimpo"
},
{
"path": "branding/src/main/java/com/automationintesting/model/db/Address.java",
"chars": 2712,
"preview": "package com.automationintesting.model.db;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport jakarta.validati"
}
]
// ... and 132 more files (download for full content)
About this extraction
This page contains the full source code of the mwinteringham/restful-booker-platform GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 332 files (30.1 MB), approximately 159.2k tokens, and a symbol index with 1001 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.