time-tracker/backend/docs/swagger.yaml

2464 lines
63 KiB
YAML

basePath: /api
definitions:
dto.ActivityCreateDto:
properties:
billingRate:
type: number
name:
type: string
type: object
dto.ActivityDto:
properties:
billingRate:
type: number
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.ActivityUpdateDto:
properties:
billingRate:
type: number
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.CompanyCreateDto:
properties:
name:
type: string
type: object
dto.CompanyDto:
properties:
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.CompanyUpdateDto:
properties:
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.CustomerCreateDto:
properties:
companyId:
type: integer
name:
type: string
type: object
dto.CustomerDto:
properties:
companyId:
type: integer
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.CustomerUpdateDto:
properties:
companyId:
type: integer
createdAt:
type: string
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.LoginDto:
properties:
email:
type: string
password:
type: string
type: object
dto.ProjectCreateDto:
properties:
customerId:
type: integer
name:
type: string
type: object
dto.ProjectDto:
properties:
createdAt:
type: string
customerId:
type: integer
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.ProjectUpdateDto:
properties:
createdAt:
type: string
customerId:
type: integer
id:
type: string
lastEditorID:
type: string
name:
type: string
updatedAt:
type: string
type: object
dto.TimeEntryCreateDto:
properties:
activityId:
type: integer
billable:
description: Percentage (0-100)
type: integer
description:
type: string
end:
type: string
projectId:
type: integer
start:
type: string
userId:
type: integer
type: object
dto.TimeEntryDto:
properties:
activityId:
type: integer
billable:
description: Percentage (0-100)
type: integer
createdAt:
type: string
description:
type: string
end:
type: string
id:
type: string
lastEditorID:
type: string
projectId:
type: integer
start:
type: string
updatedAt:
type: string
userId:
type: integer
type: object
dto.TimeEntryUpdateDto:
properties:
activityId:
type: integer
billable:
description: Percentage (0-100)
type: integer
createdAt:
type: string
description:
type: string
end:
type: string
id:
type: string
lastEditorID:
type: string
projectId:
type: integer
start:
type: string
updatedAt:
type: string
userId:
type: integer
type: object
dto.TokenDto:
properties:
token:
type: string
user:
$ref: '#/definitions/dto.UserDto'
type: object
dto.UserCreateDto:
properties:
companyId:
type: integer
email:
type: string
hourlyRate:
type: number
password:
type: string
role:
type: string
type: object
dto.UserDto:
properties:
companyId:
type: integer
createdAt:
type: string
email:
type: string
hourlyRate:
type: number
id:
type: string
lastEditorID:
type: string
role:
type: string
updatedAt:
type: string
type: object
dto.UserUpdateDto:
properties:
companyId:
type: integer
createdAt:
type: string
email:
type: string
hourlyRate:
type: number
id:
type: string
lastEditorID:
type: string
password:
type: string
role:
type: string
updatedAt:
type: string
type: object
utils.ErrorInfo:
properties:
code:
type: string
message:
type: string
type: object
utils.Response:
properties:
data: {}
error:
$ref: '#/definitions/utils.ErrorInfo'
success:
type: boolean
type: object
host: localhost:8080
info:
contact: {}
description: This is a simple time tracker API.
title: Time Tracker API
version: "1.0"
paths:
/:
get:
description: Get a hello message
operationId: hello
produces:
- text/plain
responses:
"200":
description: Hello from the Time Tracker Backend!
schema:
type: string
summary: Say hello
/activities:
get:
consumes:
- application/json
description: Get a list of all activities
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.ActivityDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all activities
tags:
- activities
post:
consumes:
- application/json
description: Create a new activity
parameters:
- description: Activity data
in: body
name: activity
required: true
schema:
$ref: '#/definitions/dto.ActivityCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ActivityDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new activity
tags:
- activities
/activities/{id}:
delete:
consumes:
- application/json
description: Delete an activity by its ID
parameters:
- description: Activity ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete an activity
tags:
- activities
get:
consumes:
- application/json
description: Get an activity by its ID
parameters:
- description: Activity ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ActivityDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get activity by ID
tags:
- activities
put:
consumes:
- application/json
description: Update an existing activity
parameters:
- description: Activity ID
in: path
name: id
required: true
type: string
- description: Activity data
in: body
name: activity
required: true
schema:
$ref: '#/definitions/dto.ActivityUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ActivityDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update an activity
tags:
- activities
/auth/login:
post:
consumes:
- application/json
description: Authenticate a user and get a JWT token
parameters:
- description: Login credentials
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/dto.LoginDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.TokenDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
summary: Login
tags:
- auth
/auth/me:
get:
consumes:
- application/json
description: Get the currently authenticated user
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.UserDto'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get current user
tags:
- auth
/companies:
get:
consumes:
- application/json
description: Get a list of all companies
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.CompanyDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all companies
tags:
- companies
post:
consumes:
- application/json
description: Create a new company
parameters:
- description: Company data
in: body
name: company
required: true
schema:
$ref: '#/definitions/dto.CompanyCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CompanyDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new company
tags:
- companies
/companies/{id}:
delete:
consumes:
- application/json
description: Delete a company by its ID
parameters:
- description: Company ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete a company
tags:
- companies
get:
consumes:
- application/json
description: Get a company by its ID
parameters:
- description: Company ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CompanyDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get company by ID
tags:
- companies
put:
consumes:
- application/json
description: Update an existing company
parameters:
- description: Company ID
in: path
name: id
required: true
type: string
- description: Company data
in: body
name: company
required: true
schema:
$ref: '#/definitions/dto.CompanyUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CompanyDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update a company
tags:
- companies
/customers:
get:
consumes:
- application/json
description: Get a list of all customers
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.CustomerDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all customers
tags:
- customers
post:
consumes:
- application/json
description: Create a new customer
parameters:
- description: Customer data
in: body
name: customer
required: true
schema:
$ref: '#/definitions/dto.CustomerCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CustomerDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new customer
tags:
- customers
/customers/{id}:
delete:
consumes:
- application/json
description: Delete a customer by its ID
parameters:
- description: Customer ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete a customer
tags:
- customers
get:
consumes:
- application/json
description: Get a customer by its ID
parameters:
- description: Customer ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CustomerDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get customer by ID
tags:
- customers
put:
consumes:
- application/json
description: Update an existing customer
parameters:
- description: Customer ID
in: path
name: id
required: true
type: string
- description: Customer data
in: body
name: customer
required: true
schema:
$ref: '#/definitions/dto.CustomerUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.CustomerDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update a customer
tags:
- customers
/customers/company/{companyId}:
get:
consumes:
- application/json
description: Get a list of customers for a specific company
parameters:
- description: Company ID
in: path
name: companyId
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.CustomerDto'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get customers by company ID
tags:
- customers
/projects:
get:
consumes:
- application/json
description: Get a list of all projects
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.ProjectDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all projects
tags:
- projects
post:
consumes:
- application/json
description: Create a new project
parameters:
- description: Project data
in: body
name: project
required: true
schema:
$ref: '#/definitions/dto.ProjectCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ProjectDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new project
tags:
- projects
/projects/{id}:
delete:
consumes:
- application/json
description: Delete a project by its ID
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete a project
tags:
- projects
get:
consumes:
- application/json
description: Get a project by its ID
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ProjectDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get project by ID
tags:
- projects
put:
consumes:
- application/json
description: Update an existing project
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Project data
in: body
name: project
required: true
schema:
$ref: '#/definitions/dto.ProjectUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.ProjectDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update a project
tags:
- projects
/projects/customer/{customerId}:
get:
consumes:
- application/json
description: Get a list of projects for a specific customer
parameters:
- description: Customer ID
in: path
name: customerId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.ProjectDto'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get projects by customer ID
tags:
- projects
/projects/with-customers:
get:
consumes:
- application/json
description: Get a list of all projects with their associated customer information
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.ProjectDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all projects with customer information
tags:
- projects
/time-entries:
get:
consumes:
- application/json
description: Get a list of all time entries
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.TimeEntryDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all time entries
tags:
- time-entries
post:
consumes:
- application/json
description: Create a new time entry
parameters:
- description: Time Entry data
in: body
name: timeEntry
required: true
schema:
$ref: '#/definitions/dto.TimeEntryCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.TimeEntryDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new time entry
tags:
- time-entries
/time-entries/{id}:
delete:
consumes:
- application/json
description: Delete a time entry by its ID
parameters:
- description: Time Entry ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete a time entry
tags:
- time-entries
get:
consumes:
- application/json
description: Get a time entry by its ID
parameters:
- description: Time Entry ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.TimeEntryDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get time entry by ID
tags:
- time-entries
put:
consumes:
- application/json
description: Update an existing time entry
parameters:
- description: Time Entry ID
in: path
name: id
required: true
type: string
- description: Time Entry data
in: body
name: timeEntry
required: true
schema:
$ref: '#/definitions/dto.TimeEntryUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.TimeEntryDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update a time entry
tags:
- time-entries
/time-entries/me:
get:
consumes:
- application/json
description: Get a list of time entries for the currently authenticated user
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.TimeEntryDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get current user's time entries
tags:
- time-entries
/time-entries/project/{projectId}:
get:
consumes:
- application/json
description: Get a list of time entries for a specific project
parameters:
- description: Project ID
in: path
name: projectId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.TimeEntryDto'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get time entries by project ID
tags:
- time-entries
/time-entries/range:
get:
consumes:
- application/json
description: Get a list of time entries within a specific date range
parameters:
- description: Start date (ISO 8601 format)
in: query
name: start
required: true
type: string
- description: End date (ISO 8601 format)
in: query
name: end
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.TimeEntryDto'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get time entries by date range
tags:
- time-entries
/time-entries/user/{userId}:
get:
consumes:
- application/json
description: Get a list of time entries for a specific user
parameters:
- description: User ID
in: path
name: userId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.TimeEntryDto'
type: array
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get time entries by user ID
tags:
- time-entries
/users:
get:
consumes:
- application/json
description: Get a list of all users
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
items:
$ref: '#/definitions/dto.UserDto'
type: array
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get all users
tags:
- users
post:
consumes:
- application/json
description: Create a new user
parameters:
- description: User data
in: body
name: user
required: true
schema:
$ref: '#/definitions/dto.UserCreateDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.UserDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Create a new user
tags:
- users
/users/{id}:
delete:
consumes:
- application/json
description: Delete a user by their ID
parameters:
- description: User ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/utils.Response'
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Delete a user
tags:
- users
get:
consumes:
- application/json
description: Get a user by their ID
parameters:
- description: User ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.UserDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Get user by ID
tags:
- users
put:
consumes:
- application/json
description: Update an existing user
parameters:
- description: User ID
in: path
name: id
required: true
type: string
- description: User data
in: body
name: user
required: true
schema:
$ref: '#/definitions/dto.UserUpdateDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
data:
$ref: '#/definitions/dto.UserDto'
type: object
"400":
description: Bad Request
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"401":
description: Unauthorized
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"404":
description: Not Found
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
"500":
description: Internal Server Error
schema:
allOf:
- $ref: '#/definitions/utils.Response'
- properties:
error:
$ref: '#/definitions/utils.ErrorInfo'
type: object
security:
- BearerAuth: []
summary: Update a user
tags:
- users
securityDefinitions:
BearerAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"