Skip to main content
Version: RK Auto

Service Management

Author(s)

  • Amarnath Garai
  • Sanket Mal
  • ...

Last Updated Date

[2026-02-20]


SRS References

  • 2.1.2
  • 2.1.3

Version History

VersionDateChangesAuthor
1.02026-01-13Initial draft (Extracted from Booking)Amarnath Garai , Sanket Mal

Feature Overview

Objective The objective of this feature is to enable administrators to manage the catalog of vehicle services offered. This includes creating new services, updating pricing and durations, and retrieving service lists for customers.

Scope This feature covers:

  • Creation of new service offerings
  • Updating existing services
  • Retrieving services with filters (Category, Availability)
  • Service suggestions for customers

Data Models

SQL Data Models

CREATE TABLE IF NOT EXISTS servicemaster (
serviceid UUID PRIMARY KEY DEFAULT gen_random_uuid(),

servicecode VARCHAR(50) NOT NULL UNIQUE,
servicename VARCHAR(150) NOT NULL UNIQUE,
servicedescription TEXT,
servicecategory VARCHAR(20), -- ('Maintenance', 'Repair', 'Inspection', 'Diagnostic', 'Detailing', 'Customization', 'Emergency')

estimatedduration INTERVAL,
baseprice NUMERIC(10,2),

serviceavailablein VARCHAR(20), -- ('Van', 'ServiceCenter', 'Both')

isactive BOOLEAN NOT NULL DEFAULT TRUE,

createdat TIMESTAMP NOT NULL DEFAULT NOW(),
updatedat TIMESTAMP NOT NULL DEFAULT NOW()
);

Enums

public enum ServiceCategory
{
Maintenance = 1, // Oil change, filter replacement, routine service
Repair = 2, // Brake repair, engine repair, parts replacement
Inspection = 3, // Safety inspection, pre-purchase inspection
Diagnostic = 4, // Electrical diagnostic, engine diagnostic
Detailing = 5, // Cleaning, polishing, interior detailing
Customization = 6, // Modifications, upgrades, accessories
Emergency = 7 // Roadside assistance, towing, urgent repairs
}

public enum ServiceAvailableIn
{
Van = 1,
ServiceCenter,
Both
}

C# Models

public record ServiceMasterResponse
{
public Guid ServiceId { get; init; }
public string ServiceCode { get; init; } = string.Empty;
public string ServiceName { get; init; } = string.Empty;
public ServiceCategory ServiceCategory { get; init; }
public string? ServiceDescription { get; init; }
public TimeSpan? EstimatedDuration { get; init; }
public required decimal BasePrice { get; init; }
public ServiceAvailableIn ServiceAvailableIn { get; init; }
public bool IsActive { get; init; }
public DateTime CreatedAt { get; init; }
public DateTime UpdatedAt { get; init; }
}

public record CreateServiceMaster
{
public required string ServiceName { get; init; }
public required ServiceCategory ServiceCategory { get; init; }
public string? ServiceDescription { get; init; }
public TimeSpan EstimatedDuration { get; init; }
public required decimal BasePrice { get; init; }
public ServiceAvailableIn ServiceAvailableIn { get; init; } = ServiceAvailableIn.Both;
public bool IsActive { get; init; } = true;
}

public record UpdateServiceMaster
{
public string? ServiceName { get; set; }
public ServiceCategory? ServiceCategory { get; set; }
public string? ServiceDescription { get; set; }
public TimeSpan? EstimatedDuration { get; set; }
public decimal? BasePrice { get; set; }
public ServiceAvailableIn? ServiceAvailableIn { get; set; }
public bool? IsActive { get; set; }
}

public record GetServicesFilter
{
public ServiceAvailableIn? ServiceAvailableIn { get; init; }
public string? SearchKeyword { get; init; }
public ServiceCategory? ServiceCategory { get; init; }

// Paging
public int RowsPerPage { get; init; } = 10;
public int PageNumber { get; init; } = 1;
}

public record ServiceSuggestionRequest
{
public ServiceAvailableIn? ServiceAvailableIn { get; init; }
public ServiceCategory? ServiceCategory { get; init; }
}

public record CommonResponse
{
public int Status { get; init; }
public string? Message { get; init; }
}

public record ServerPaginatedData<T>
{
public List<T> Data { get; init; } = [];
public int TotalNumber { get; init; }
public bool HasPreviousPage { get; init; }
public bool HasNextPage { get; init; }
public int TotalPages { get; init; }
public int PageNumber { get; init; }
public int RowsPerPage { get; init; }
}

API Endpoints

EndpointMethodParametersResponseResponse Status Codes
/servicePOSTCreateServiceMasterCommonResponse200, 400, 401, 403, 500
/servicesGETGetServicesFilterServerPaginatedData<ServiceMasterResponse>200, 401, 403, 500
/service/{serviceId}GETserviceIdServiceMasterResponse200, 401, 403, 404, 500
/service/{serviceId}PUTserviceId, UpdateServiceMasterCommonResponse200, 400, 401, 403, 404, 500
/service-suggestionsGETServiceSuggestionRequestList<ServiceMasterResponse>200, 401, 403, 500

1. Create Service

Endpoint: POST /service

Request Parameters:

{
"serviceName": "Premium Oil Change",
"serviceCategory": "Maintenance",
"serviceDescription": "Complete engine synthetic oil replacement",
"estimatedDuration": "01:00:00",
"basePrice": 49.99,
"serviceAvailableIn": "Both",
"isActive": true
}

Response (Success - 200):

{
"status": 200,
"message": "Service created successfully"
}

2. Get Services List

Endpoint: GET /services

Request Parameters:

{
"serviceAvailableIn": "Both",
"searchKeyword": "oil",
"serviceCategory": "Maintenance",
"rowsPerPage": 10,
"pageNumber": 1
}

Response (Success - 200):

{
"data": [
{
"serviceId": "550e8400-e29b-41d4-a716-446655440001",
"serviceCode": "OIL-001",
"serviceName": "Premium Oil Change",
"serviceCategory": "Maintenance",
"serviceDescription": "Complete engine synthetic oil replacement",
"estimatedDuration": "01:00:00",
"basePrice": 49.99,
"serviceAvailableIn": "Both",
"isActive": true,
"createdAt": "2026-01-13T10:30:00Z",
"updatedAt": "2026-01-13T10:30:00Z"
}
],
"totalNumber": 1,
"hasPreviousPage": false,
"hasNextPage": false,
"totalPages": 1,
"pageNumber": 1,
"rowsPerPage": 10
}

3. Get Service by ID

Endpoint: GET /service/{serviceId}

Request Parameters:

{
"serviceId": "550e8400-e29b-41d4-a716-446655440001"
}

Response (Success - 200):

{
"serviceId": "550e8400-e29b-41d4-a716-446655440001",
"serviceCode": "OIL-001",
"serviceName": "Premium Oil Change",
"serviceCategory": "Maintenance",
"serviceDescription": "Complete engine synthetic oil replacement",
"estimatedDuration": "01:00:00",
"basePrice": 49.99,
"serviceAvailableIn": "Both",
"isActive": true,
"createdAt": "2026-01-13T10:30:00Z",
"updatedAt": "2026-01-13T10:30:00Z"
}

4. Update Service by ID

Endpoint: PUT /service/{serviceId}

Request Parameters:

{
"serviceId": "550e8400-e29b-41d4-a716-446655440001",
"serviceName": "Ultra Premium Oil Change",
"serviceCategory": "Maintenance",
"serviceDescription": "Premium oil change service with highest-grade synthetic oil and filter replacement",
"estimatedDuration": "00:45:00",
"basePrice": 59.99,
"serviceAvailableIn": "Both",
"isActive": true
}

Response (Success - 200):

{
"status": 200,
"message": "Service master response updated successfully."
}

5. Get Service Suggestions

Endpoint: GET /service-suggestions

Request Parameters:

{
"serviceAvailableIn": "Van",
"serviceCategory": "Maintenance"
}

Response (Success - 200):

[
{
"serviceId": "550e8400-e29b-41d4-a716-446655440001",
"serviceCode": "OIL-001",
"serviceName": "Premium Oil Change",
"serviceCategory": "Maintenance",
"serviceDescription": "Complete engine synthetic oil replacement",
"estimatedDuration": "01:00:00",
"basePrice": 49.99,
"serviceAvailableIn": "Both",
"isActive": true,
"createdAt": "2026-01-13T10:30:00Z",
"updatedAt": "2026-01-13T10:30:00Z"
}
]