Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b012ffc
feat: Refactor AppointmentService and AppointmentServiceImpl to use D…
ChamodiSandunika Oct 31, 2025
1f3da8a
feat: Add UnauthorizedAccessException for handling unauthorized acces…
ChamodiSandunika Oct 31, 2025
79382ec
feat: Implement InvalidStatusTransitionException for handling invalid…
ChamodiSandunika Oct 31, 2025
d980ad0
feat: Add GlobalExceptionHandler for centralized exception handling
ChamodiSandunika Oct 31, 2025
173e556
feat: Add ErrorResponse class for standardized error responses
ChamodiSandunika Oct 31, 2025
763e83e
feat: Add AppointmentNotFoundException for handling appointment not f…
ChamodiSandunika Oct 31, 2025
90daeba
feat: Add TimeSlotDto for managing appointment time slots
ChamodiSandunika Oct 31, 2025
613d73a
feat: Create StatusUpdateDto for updating appointment status
ChamodiSandunika Oct 31, 2025
40960d7
feat: Add ScheduleResponseDto for representing employee schedules
ChamodiSandunika Oct 31, 2025
d0abe9a
feat: Add ScheduleItemDto for representing appointment scheduling det…
ChamodiSandunika Oct 31, 2025
821e83c
feat: Add AvailabilityResponseDto for representing service availabili…
ChamodiSandunika Oct 31, 2025
ae23fbb
feat: Create AppointmentUpdateDto for updating appointment details
ChamodiSandunika Oct 31, 2025
69f3d65
feat: Add AppointmentResponseDto for representing appointment details
ChamodiSandunika Oct 31, 2025
80b530d
feat: Add AppointmentRequestDto for representing appointment requests
ChamodiSandunika Oct 31, 2025
6e155be
feat: Enhance AppointmentController with service integration and resp…
ChamodiSandunika Oct 31, 2025
e340bfb
Merge pull request #2 from TechTorque-2025/feat/appointmentService
RandithaK Nov 5, 2025
d059549
build: Update dependencies and project configuration
RandithaK Nov 5, 2025
f7d8887
feat: Add OpenAPI/Swagger configuration
RandithaK Nov 5, 2025
b9664a1
feat: Add comprehensive data seeder for development
RandithaK Nov 5, 2025
45e7918
refactor: Enhance Appointment entity
RandithaK Nov 5, 2025
89c206e
refactor: Restructure DTO package with proper request/response DTOs
RandithaK Nov 5, 2025
dcaa534
feat: Implement comprehensive appointment management endpoints
RandithaK Nov 5, 2025
0751125
feat: Add service type management controller
RandithaK Nov 5, 2025
416f899
feat: Add custom repository queries for appointment management
RandithaK Nov 5, 2025
9ef14a5
feat: Implement complete appointment business logic
RandithaK Nov 5, 2025
9bef23a
test: Update application tests
RandithaK Nov 5, 2025
0e6def4
docs: Add comprehensive documentation
RandithaK Nov 5, 2025
7f0762e
feat: Add supporting entities, repositories, and services for appoint…
RandithaK Nov 5, 2025
751cbc9
feat: Update DataSeeder with consistent user IDs and enhance Security…
RandithaK Nov 5, 2025
4b51c88
feat: Enhance appointment filtering and role-based access in services…
RandithaK Nov 6, 2025
b539538
Merge pull request #3 from TechTorque-2025/integration_bug_fixes
RandithaK Nov 6, 2025
db3650b
feat: Add GitHub Actions workflows for building, packaging, and deplo…
RandithaK Nov 8, 2025
45740a6
feat: Add Dockerfile for building and running the microservice
RandithaK Nov 8, 2025
f567fcc
Merge pull request #4 from TechTorque-2025/devOps
RandithaK Nov 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# .github/workflows/build.yml
name: Build and Package Service
on:
push:
branches:
- 'main'
- 'devOps'
- 'dev'
pull_request:
branches:
- 'main'
- 'devOps'
- 'dev'

permissions:
contents: read
packages: write

jobs:
build-test:
name: Install and Build (Tests Skipped)
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Build with Maven (Skip Tests)
run: mvn -B clean package -DskipTests --file appointment-service/pom.xml

- name: Upload Build Artifact (JAR)
uses: actions/upload-artifact@v4
with:
name: appointment-service-jar
path: appointment-service/target/*.jar

build-and-push-docker:
name: Build & Push Docker Image
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/devOps' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs: build-test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download JAR Artifact
uses: actions/download-artifact@v4
with:
name: appointment-service-jar
path: appointment-service/target/

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/techtorque-2025/appointment_service
tags: |
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
60 changes: 60 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Appointment_Service/.github/workflows/deploy.yml

name: Deploy Appointment Service to Kubernetes

on:
workflow_run:
workflows: ["Build and Package Service"]
types:
- completed
branches:
- 'main'
- 'devOps'

jobs:
deploy:
name: Deploy Appointment Service to Kubernetes
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Get Commit SHA
id: get_sha
run: |
echo "sha=$(echo ${{ github.event.workflow_run.head_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Checkout K8s Config Repo
uses: actions/checkout@v4
with:
repository: 'TechTorque-2025/k8s-config'
token: ${{ secrets.REPO_ACCESS_TOKEN }}
path: 'config-repo'
ref: 'main'

- name: Install kubectl
uses: azure/setup-kubectl@v3

- name: Install yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq

- name: Set Kubernetes context
uses: azure/k8s-set-context@v4
with:
kubeconfig: ${{ secrets.KUBE_CONFIG_DATA }}

- name: Update image tag in YAML
run: |
yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "ghcr.io/techtorque-2025/appointment_service:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/appointment-deployment.yaml

- name: Display file contents before apply
run: |
echo "--- Displaying k8s/services/appointment-deployment.yaml ---"
cat config-repo/k8s/services/appointment-deployment.yaml
echo "-----------------------------------------------------------"

- name: Deploy to Kubernetes
run: |
kubectl apply -f config-repo/k8s/services/appointment-deployment.yaml
kubectl rollout status deployment/appointment-deployment
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dockerfile for appointment-service

# --- Build Stage ---
# Use the official Maven image which contains the Java JDK
FROM maven:3.8-eclipse-temurin-17 AS build

# Set the working directory
WORKDIR /app

# Copy the pom.xml and download dependencies
COPY appointment-service/pom.xml .
RUN mvn -B dependency:go-offline

# Copy the rest of the source code and build the application
# Note: We copy the pom.xml *first* to leverage Docker layer caching.
COPY appointment-service/src ./src
RUN mvn -B clean package -DskipTests

# --- Run Stage ---
# Use a minimal JRE image for the final container
FROM eclipse-temurin:17-jre-jammy

# Set a working directory
WORKDIR /app

# Copy the built JAR from the 'build' stage
# The wildcard is used in case the version number is in the JAR name
COPY --from=build /app/target/*.jar app.jar

# Expose the port your application runs on
EXPOSE 8083

# The command to run your application
ENTRYPOINT ["java", "-jar", "app.jar"]
Loading
Loading