openapi: 3.0.0
info:
  title: Apalis Auth Microservice API
  version: 1.0.0
  description: Complete REST API documentation for Apalis authentication microservice with 116 endpoints
  contact:
    name: Apalis Team
    email: suman.nectarbits@gmail.com

servers:
  - url: https://apalisauth.on-demand-app.com/api/v1
    description: Production

tags:
  - name: Public
    description: No authentication required
  - name: Customer
    description: Customer authentication and management
  - name: Driver
    description: Driver operations
  - name: Admin
    description: Administrative operations
  - name: Business
    description: Business operations
  - name: Notifications
    description: Notification management

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        data:
          type: object

    ApiError:
      type: object
      properties:
        code:
          type: integer
        error:
          type: string
        errors:
          type: object

    User:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        mobile_no:
          type: string
        profile_picture:
          type: string
        language:
          type: string
          enum: [en, fr]
        status:
          type: string
          enum: [active, locked, suspended]
        wallet_amount:
          type: number

    Driver:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        mobile_no:
          type: string
        status:
          type: string
          enum: [pending, in_training, active, locked, suspended]
        login_code:
          type: string

    AuthResponse:
      type: object
      properties:
        access_token:
          type: string
        token_type:
          type: string
        expires_in:
          type: integer
        user:
          $ref: '#/components/schemas/User'

    Address:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum: [home, work, other]
        address_line1:
          type: string
        address_line2:
          type: string
        city:
          type: string
        lat:
          type: string
        long:
          type: string
        is_default:
          type: boolean

    Vehicle:
      type: object
      properties:
        id:
          type: integer
        vehicle_type:
          type: integer
          enum: [1, 2, 3]
        brand_id:
          type: integer
        model_id:
          type: integer
        name:
          type: string
        color:
          type: string
        fuel_type_id:
          type: integer

    Brand:
      type: object
      properties:
        id:
          type: integer
        name_en:
          type: string
        name_fr:
          type: string
        vehicle_type:
          type: integer
        status:
          type: string

    Model:
      type: object
      properties:
        id:
          type: integer
        brand_id:
          type: integer
        name_en:
          type: string
        name_fr:
          type: string
        status:
          type: string

    WalletTransaction:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum: [credit, debit]
        amount:
          type: number
        description:
          type: string

    Notification:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        message:
          type: string
        is_read:
          type: boolean

paths:
  /register:
    post:
      tags: [Public]
      summary: Register customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [first_name, last_name, email, mobile_no, language, id_token]
              properties:
                first_name:
                  type: string
                last_name:
                  type: string
                email:
                  type: string
                mobile_no:
                  type: string
                password:
                  type: string
                language:
                  enum: [en, fr]
                profile_picture:
                  type: string
                provider:
                  enum: [google, apple]
                id_token:
                  type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - properties:
                      data:
                        $ref: '#/components/schemas/AuthResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'

  /send-otp:
    post:
      tags: [Public]
      summary: Send OTP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [type]
              properties:
                email:
                  type: string
                mobile_no:
                  type: string
                type:
                  enum: [login, forgot_password, change_password, registration, delete_account, change_email, change_mobile_no]
      responses:
        '200':
          description: OTP sent

  /verify-otp:
    post:
      tags: [Public]
      summary: Verify OTP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [otp, type]
      responses:
        '200':
          description: OTP verified

  /login:
    post:
      tags: [Public]
      summary: Customer login
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [type]
      responses:
        '200':
          description: Login successful

  /forgot-password:
    post:
      tags: [Public]
      summary: Request password reset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Reset link sent

  /reset-password:
    post:
      tags: [Public]
      summary: Reset password
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Password reset

  /user-exists:
    post:
      tags: [Public]
      summary: Check user existence
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Result

  /send-verify-email:
    post:
      tags: [Public]
      summary: Send email verification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Email sent

  /user/detail/{id}:
    get:
      tags: [Public]
      summary: Get user details
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: User details

  /brands:
    get:
      tags: [Public]
      summary: List brands
      responses:
        '200':
          description: Brands list

  /brands/{id}:
    get:
      tags: [Public]
      summary: Get brand
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Brand details

  /models:
    get:
      tags: [Public]
      summary: List models
      responses:
        '200':
          description: Models list

  /models/{id}:
    get:
      tags: [Public]
      summary: Get model
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Model details

  /notifications:
    post:
      tags: [Public]
      summary: Create notification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '201':
          description: Notification created

  /drivers/get-by-ids:
    post:
      tags: [Public]
      summary: Get drivers by IDs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Drivers list

  /driver/detail/{id}:
    get:
      tags: [Public]
      summary: Get driver details
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Driver details

  /driver/{id}/detail:
    get:
      tags: [Public]
      summary: Get driver data
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Driver data

  /driver/{id}/update-location:
    post:
      tags: [Public]
      summary: Update driver location
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [latitude, longitude]
              properties:
                latitude:
                  type: number
                longitude:
                  type: number
      responses:
        '200':
          description: Location updated

  /vehicle/detail/{id}:
    get:
      tags: [Public]
      summary: Get vehicle details
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicle details

  /business-vehicle/{id}:
    get:
      tags: [Public]
      summary: Get business vehicle
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicle details

  /drivers/by-radius:
    post:
      tags: [Public]
      summary: Get drivers by radius
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Drivers list

  /drivers/by-delivery-zone:
    post:
      tags: [Public]
      summary: Get drivers by delivery zone
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Drivers list

  /cms:
    get:
      tags: [Public]
      summary: Get CMS content
      responses:
        '200':
          description: CMS content

  /add-device:
    post:
      tags: [Public]
      summary: Add device info
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Device added

  /device-infos:
    get:
      tags: [Public]
      summary: Get device infos
      responses:
        '200':
          description: Device information

  /drivers/get-drivers-names:
    post:
      tags: [Public]
      summary: Get driver names
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Driver names

  /customers/get-customers-names:
    post:
      tags: [Public]
      summary: Get customer names
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Customer names

  /customers/total-count:
    get:
      tags: [Public]
      summary: Get total customer count
      responses:
        '200':
          description: Total count

  /users/upgrade-tier:
    post:
      tags: [Public]
      summary: Upgrade user tier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Tier upgraded

  /complete-referrals:
    post:
      tags: [Public]
      summary: Complete referral
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Referral completed

  /logout:
    post:
      tags: [Customer]
      summary: Logout
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Logout successful
        '401':
          description: Unauthorized

  /me:
    get:
      tags: [Customer]
      summary: Get current user
      security:
        - BearerAuth: []
      responses:
        '200':
          description: User profile
        '401':
          description: Unauthorized

  /update-profile:
    post:
      tags: [Customer]
      summary: Update profile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [first_name, last_name, language]
      responses:
        '200':
          description: Profile updated
        '401':
          description: Unauthorized

  /update-mobile-no:
    post:
      tags: [Customer]
      summary: Update mobile number
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [mobile_no]
      responses:
        '200':
          description: Mobile updated
        '401':
          description: Unauthorized

  /update-email:
    post:
      tags: [Customer]
      summary: Update email
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [email]
      responses:
        '200':
          description: Email updated
        '401':
          description: Unauthorized

  /delete-account:
    post:
      tags: [Customer]
      summary: Delete account
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Account deleted
        '401':
          description: Unauthorized

  /change-language:
    post:
      tags: [Customer]
      summary: Change language
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [language]
      responses:
        '200':
          description: Language changed
        '401':
          description: Unauthorized

  /refresh-token:
    get:
      tags: [Customer]
      summary: Refresh token
      security:
        - BearerAuth: []
      responses:
        '200':
          description: New token
        '401':
          description: Unauthorized

  /update-push-notification:
    post:
      tags: [Customer]
      summary: Update notification settings
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Settings updated
        '401':
          description: Unauthorized

  /customer-addresses:
    get:
      tags: [Customer]
      summary: List addresses
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Address list
        '401':
          description: Unauthorized
    post:
      tags: [Customer]
      summary: Create address
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [type, address_line1, city, lat, long]
      responses:
        '201':
          description: Address created
        '401':
          description: Unauthorized

  /customer-addresses/{id}:
    get:
      tags: [Customer]
      summary: Get address
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Address details
        '401':
          description: Unauthorized
    put:
      tags: [Customer]
      summary: Update address
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Address updated
        '401':
          description: Unauthorized
    delete:
      tags: [Customer]
      summary: Delete address
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Address deleted
        '401':
          description: Unauthorized

  /customer-addresses/{id}/make-default:
    post:
      tags: [Customer]
      summary: Make address default
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Default address set
        '401':
          description: Unauthorized

  /vehicles:
    get:
      tags: [Customer]
      summary: List vehicles
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Vehicle list
        '401':
          description: Unauthorized
    post:
      tags: [Customer]
      summary: Create vehicle
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [vehicle_type, name, fuel_type_id, color]
      responses:
        '201':
          description: Vehicle created
        '401':
          description: Unauthorized

  /vehicles/{id}:
    get:
      tags: [Customer]
      summary: Get vehicle
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicle details
        '401':
          description: Unauthorized
    put:
      tags: [Customer]
      summary: Update vehicle
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Vehicle updated
        '401':
          description: Unauthorized
    delete:
      tags: [Customer]
      summary: Delete vehicle
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicle deleted
        '401':
          description: Unauthorized

  /driver/{id}/get-lat-long:
    get:
      tags: [Customer]
      summary: Get driver location
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Location data
        '401':
          description: Unauthorized

  /wallet-transactions:
    get:
      tags: [Customer]
      summary: List transactions
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Transactions list
        '401':
          description: Unauthorized

  /wallet-transactions/{id}:
    get:
      tags: [Customer]
      summary: Get transaction
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Transaction details
        '401':
          description: Unauthorized

  /wallet/refund:
    post:
      tags: [Customer]
      summary: Request refund
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Refund processed
        '401':
          description: Unauthorized

  /wallet/balance:
    get:
      tags: [Customer]
      summary: Get wallet balance
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Balance
        '401':
          description: Unauthorized

  /wallet/deduct:
    post:
      tags: [Customer]
      summary: Deduct from wallet
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [amount]
      responses:
        '200':
          description: Amount deducted
        '401':
          description: Unauthorized

  /driver/login:
    post:
      tags: [Driver]
      summary: Driver login
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [login_code]
      responses:
        '200':
          description: Login successful

  /driver/driver-logout:
    post:
      tags: [Driver]
      summary: Driver logout
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Logout successful
        '401':
          description: Unauthorized

  /driver/driver-refresh-token:
    get:
      tags: [Driver]
      summary: Refresh driver token
      security:
        - BearerAuth: []
      responses:
        '200':
          description: New token
        '401':
          description: Unauthorized

  /driver/get-profile:
    get:
      tags: [Driver]
      summary: Get driver profile
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Profile data
        '401':
          description: Unauthorized

  /driver/delete-account:
    post:
      tags: [Driver]
      summary: Delete driver account
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Account deleted
        '401':
          description: Unauthorized

  /driver/change-language:
    post:
      tags: [Driver]
      summary: Change language
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [language]
      responses:
        '200':
          description: Language changed
        '401':
          description: Unauthorized

  /driver/update-push-notification:
    post:
      tags: [Driver]
      summary: Update notifications
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Updated
        '401':
          description: Unauthorized

  /driver/update-lat-long:
    post:
      tags: [Driver]
      summary: Update location
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [latitude, longitude]
      responses:
        '200':
          description: Location updated
        '401':
          description: Unauthorized

  /driver/location/{id}/get-lat-long:
    get:
      tags: [Driver]
      summary: Get location by ID
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Location data
        '401':
          description: Unauthorized

  /driver/vehicles:
    get:
      tags: [Driver]
      summary: List driver vehicles
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Vehicles list
        '401':
          description: Unauthorized
    post:
      tags: [Driver]
      summary: Create driver vehicle
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [vehicle_type, name, fuel_type_id, color]
      responses:
        '201':
          description: Vehicle created
        '401':
          description: Unauthorized

  /driver/vehicles-add-order-qty:
    post:
      tags: [Driver]
      summary: Add order quantities
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [order_id, vehicles]
      responses:
        '200':
          description: Quantities added
        '401':
          description: Unauthorized

  /admin/users:
    get:
      tags: [Admin]
      summary: List users
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Users list
        '401':
          description: Unauthorized
    post:
      tags: [Admin]
      summary: Create user
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [first_name, last_name, email, mobile_no, password, language]
      responses:
        '201':
          description: User created
        '401':
          description: Unauthorized

  /admin/users/{id}:
    get:
      tags: [Admin]
      summary: Get user
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: User details
        '401':
          description: Unauthorized
    put:
      tags: [Admin]
      summary: Update user
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: User updated
        '401':
          description: Unauthorized
    delete:
      tags: [Admin]
      summary: Delete user
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: User deleted
        '401':
          description: Unauthorized

  /admin/users/{id}/change-status:
    post:
      tags: [Admin]
      summary: Change user status
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [status]
      responses:
        '200':
          description: Status changed
        '401':
          description: Unauthorized

  /admin/users/{id}/addresses:
    get:
      tags: [Admin]
      summary: Get user addresses
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Addresses list
        '401':
          description: Unauthorized

  /admin/users/{id}/vehicles:
    get:
      tags: [Admin]
      summary: Get user vehicles
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicles list
        '401':
          description: Unauthorized

  /admin/users/{id}/app-lock-enabled:
    post:
      tags: [Admin]
      summary: Enable app lock
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: App lock updated
        '401':
          description: Unauthorized

  /admin/drivers:
    get:
      tags: [Admin]
      summary: List drivers
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Drivers list
        '401':
          description: Unauthorized
    post:
      tags: [Admin]
      summary: Create driver
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [first_name, last_name, email, mobile_no]
      responses:
        '201':
          description: Driver created
        '401':
          description: Unauthorized

  /admin/drivers/{id}:
    get:
      tags: [Admin]
      summary: Get driver
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Driver details
        '401':
          description: Unauthorized
    put:
      tags: [Admin]
      summary: Update driver
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Driver updated
        '401':
          description: Unauthorized
    delete:
      tags: [Admin]
      summary: Delete driver
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Driver deleted
        '401':
          description: Unauthorized

  /admin/drivers/{id}/change-status:
    post:
      tags: [Admin]
      summary: Change driver status
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [status]
      responses:
        '200':
          description: Status changed
        '401':
          description: Unauthorized

  /admin/drivers/regenerate-login-code:
    post:
      tags: [Admin]
      summary: Regenerate login code
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [driver_id]
      responses:
        '200':
          description: Code regenerated
        '401':
          description: Unauthorized

  /admin/brands:
    get:
      tags: [Admin]
      summary: List brands
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Brands list
        '401':
          description: Unauthorized
    post:
      tags: [Admin]
      summary: Create brand
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name_en, name_fr, vehicle_type, status]
      responses:
        '201':
          description: Brand created
        '401':
          description: Unauthorized

  /admin/brands/{id}:
    get:
      tags: [Admin]
      summary: Get brand
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Brand details
        '401':
          description: Unauthorized
    put:
      tags: [Admin]
      summary: Update brand
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Brand updated
        '401':
          description: Unauthorized
    delete:
      tags: [Admin]
      summary: Delete brand
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Brand deleted
        '401':
          description: Unauthorized

  /admin/models:
    get:
      tags: [Admin]
      summary: List models
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Models list
        '401':
          description: Unauthorized
    post:
      tags: [Admin]
      summary: Create model
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [brand_id, name_en, name_fr, status]
      responses:
        '201':
          description: Model created
        '401':
          description: Unauthorized

  /admin/models/{id}:
    get:
      tags: [Admin]
      summary: Get model
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Model details
        '401':
          description: Unauthorized
    put:
      tags: [Admin]
      summary: Update model
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Model updated
        '401':
          description: Unauthorized
    delete:
      tags: [Admin]
      summary: Delete model
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Model deleted
        '401':
          description: Unauthorized

  /admin/notification-message-templates:
    get:
      tags: [Admin]
      summary: List templates
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Templates list
        '401':
          description: Unauthorized
    post:
      tags: [Admin]
      summary: Store templates
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [templates]
      responses:
        '201':
          description: Templates stored
        '401':
          description: Unauthorized

  /admin/notification-message-templates/{id}:
    get:
      tags: [Admin]
      summary: Get template
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Template details
        '401':
          description: Unauthorized

  /admin/driver/{id}/get-lat-long:
    get:
      tags: [Admin]
      summary: Get driver location
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Location data
        '401':
          description: Unauthorized

  /admin/available-driver-list:
    get:
      tags: [Admin]
      summary: List available drivers
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Drivers list
        '401':
          description: Unauthorized

  /admin/wallet-transactions:
    get:
      tags: [Admin]
      summary: List wallet transactions
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Transactions list
        '401':
          description: Unauthorized

  /admin/wallet/balance:
    get:
      tags: [Admin]
      summary: Get wallet balance
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Balance data
        '401':
          description: Unauthorized

  /admin/dashboard/user-driver-summary:
    get:
      tags: [Admin]
      summary: Get dashboard summary
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Summary data
        '401':
          description: Unauthorized

  /admin/referral/history:
    get:
      tags: [Admin]
      summary: Get referral history
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Referral history
        '401':
          description: Unauthorized

  /admin/report/customers:
    get:
      tags: [Admin]
      summary: Get customer report
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Customer report
        '401':
          description: Unauthorized

  /admin/report/driver-performance:
    get:
      tags: [Admin]
      summary: Get driver performance report
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Performance report
        '401':
          description: Unauthorized

  /admin/report/referral-details:
    get:
      tags: [Admin]
      summary: Get referral report
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Referral report
        '401':
          description: Unauthorized

  /business/vehicles:
    get:
      tags: [Business]
      summary: List vehicles
      responses:
        '200':
          description: Vehicles list
    post:
      tags: [Business]
      summary: Create vehicle
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [vehicle_type, name, fuel_type_id, color]
      responses:
        '201':
          description: Vehicle created

  /business/vehicles/{id}:
    get:
      tags: [Business]
      summary: Get vehicle
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Vehicle details
    put:
      tags: [Business]
      summary: Update vehicle
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Vehicle updated

  /business/business-vehicles:
    get:
      tags: [Business]
      summary: Get business vehicles
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Vehicles list
        '401':
          description: Unauthorized

  /business/business-vehicles-count:
    get:
      tags: [Business]
      summary: Get vehicles count
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Count data
        '401':
          description: Unauthorized

  /notifications (all-authenticated):
    get:
      tags: [Notifications]
      summary: List notifications
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Notifications list
        '401':
          description: Unauthorized

  /notifications/read-all:
    post:
      tags: [Notifications]
      summary: Mark all as read
      security:
        - BearerAuth: []
      responses:
        '200':
          description: All marked
        '401':
          description: Unauthorized

  /notifications/{id}/read:
    post:
      tags: [Notifications]
      summary: Mark as read
      security:
        - BearerAuth: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Marked as read
        '401':
          description: Unauthorized

  /notifications/mark-read:
    post:
      tags: [Notifications]
      summary: Mark multiple as read
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [notification_ids]
      responses:
        '200':
          description: Marked as read
        '401':
          description: Unauthorized
