diff --git a/Api/Features/Tracking/TrackingController.cs b/Api/Features/Tracking/TrackingController.cs index 7243180..cc2d48b 100644 --- a/Api/Features/Tracking/TrackingController.cs +++ b/Api/Features/Tracking/TrackingController.cs @@ -1,10 +1,12 @@ using System.ComponentModel.DataAnnotations; using Application.ExternalDeps.AssignmentsApi; +using Application.Features.Tracking.CreateAwayWithMakeUpTimeEntry; using Application.Features.Tracking.CreateTaskEntry; using Application.Features.Tracking.CreateUnwellEntry; using Application.Features.Tracking.GetEntriesByPeriod; using Application.Features.Tracking.HardDeleteEntry; using Application.Features.Tracking.SoftDeleteEntry; +using Application.Features.Tracking.UpdateAwayWithMakeUpTimeEntry; using Application.Features.Tracking.UpdateTaskEntry; using Application.Features.Tracking.UpdateUnwellEntry; using Microsoft.AspNetCore.Authorization; @@ -52,6 +54,16 @@ [FromServices] CreateUnwellEntryHandler createUnwellEntryHandler return createUnwellEntryHandler.HandleAsync(createUnwellRequest); } + [EndpointSummary("Create an away with make up time entry")] + [RequiresPermission(UserClaimsProvider.CanManagePersonalTimeTracker)] + [HttpPost("away-with-make-up-time-entries")] + public Task CreateAwayWithMakeUpTimeEntryAsync( + [Required][FromBody] CreateAwayWithMakeUpTimeEntryRequest createAwayWithMakeUpTimeEntryRequest + ) + { + throw new NotImplementedException(); + } + [EndpointSummary("Update a task entry")] [RequiresPermission(UserClaimsProvider.CanManagePersonalTimeTracker)] [HttpPost("task-entries/{taskEntryId}")] @@ -76,6 +88,17 @@ [FromServices] UpdateUnwellEntryHandler updateUnwellEntryHandler return updateUnwellEntryHandler.HandleAsync(unwellEntryId, updateUnwellEntryRequest); } + [EndpointSummary("Update an away with make up time entry")] + [RequiresPermission(UserClaimsProvider.CanManagePersonalTimeTracker)] + [HttpPost("away-with-make-up-time-entries/{awayWithMakeUpTimeEntryId}")] + public Task UpdateAwayWithMakeUpTimeEntryAsync( + [Required][FromRoute] long awayWithMakeUpTimeEntryId, + [Required][FromBody] UpdateAwayWithMakeUpTimeEntryRequest updateAwayWithMakeUpTimeEntryRequest + ) + { + throw new NotImplementedException(); + } + [EndpointSummary("Get employee projects by period")] [RequiresPermission(UserClaimsProvider.CanManagePersonalTimeTracker)] [HttpGet("task-entries/projects")] diff --git a/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryRequest.cs b/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryRequest.cs new file mode 100644 index 0000000..0dd7e47 --- /dev/null +++ b/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryRequest.cs @@ -0,0 +1,18 @@ +using System.ComponentModel.DataAnnotations; + +namespace Application.Features.Tracking.CreateAwayWithMakeUpTimeEntry; + +public class CreateAwayWithMakeUpTimeEntryRequest +{ + [Required] + public required DateTime StartTime { get; set; } + + [Required] + public required DateTime EndTime { get; set; } + + [Required] + public required string Description { get; set; } + + [Required] + public required List MakeUpTimeList { get; set; } +} diff --git a/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryResponse.cs b/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryResponse.cs new file mode 100644 index 0000000..914aa0e --- /dev/null +++ b/Application/Features/Tracking/CreateAwayWithMakeUpTimeEntry/CreateAwayWithMakeUpTimeEntryResponse.cs @@ -0,0 +1,6 @@ +namespace Application.Features.Tracking.CreateAwayWithMakeUpTimeEntry; + +public class CreateAwayWithMakeUpTimeEntryResponse +{ + public required long NewAwayWithMakeUpTimeEntryId { get; set; } +} diff --git a/Application/Features/Tracking/UpdateAwayWithMakeUpTimeEntry/UpdateAwayWithMakeUpTimeEntryRequest.cs b/Application/Features/Tracking/UpdateAwayWithMakeUpTimeEntry/UpdateAwayWithMakeUpTimeEntryRequest.cs new file mode 100644 index 0000000..0321711 --- /dev/null +++ b/Application/Features/Tracking/UpdateAwayWithMakeUpTimeEntry/UpdateAwayWithMakeUpTimeEntryRequest.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace Application.Features.Tracking.UpdateAwayWithMakeUpTimeEntry; + +public class UpdateAwayWithMakeUpTimeEntryRequest +{ + public long Id { get; set; } + + [Required] + public required DateTime StartTime { get; set; } + + [Required] + public required DateTime EndTime { get; set; } + + [Required] + public required string Description { get; set; } + + [Required] + public required List MakeUpTimeList { get; set; } +} diff --git a/Application/SharedDtos/MakeUpTimeEntryDto.cs b/Application/SharedDtos/MakeUpTimeEntryDto.cs new file mode 100644 index 0000000..80c4c5e --- /dev/null +++ b/Application/SharedDtos/MakeUpTimeEntryDto.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +public class MakeUpTimeEntryDto +{ + [Required] + public required DateTime StartTime { get; set; } + + [Required] + public required DateTime EndTime { get; set; } +} diff --git a/README.md b/README.md index afe3044..6d53e14 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # inner-circle-time-api -[![coverage](https://img.shields.io/badge/e2e_coverage-27.66%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) -[![coverage](https://img.shields.io/badge/units_coverage-24.71%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) -[![coverage](https://img.shields.io/badge/integration_coverage-59.60%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) -[![coverage](https://img.shields.io/badge/full_coverage-93.95%25-forestgreen)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) +[![coverage](https://img.shields.io/badge/e2e_coverage-27.52%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) +[![coverage](https://img.shields.io/badge/units_coverage-24.59%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) +[![coverage](https://img.shields.io/badge/integration_coverage-59.30%25-crimson)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) +[![coverage](https://img.shields.io/badge/full_coverage-93.49%25-forestgreen)](https://github.com/TourmalineCore/inner-circle-time-api/actions/workflows/calculate-tests-coverage-on-pull-request.yml) This repo contains Inner Circle Time API. diff --git a/js-client/index.ts b/js-client/index.ts index 49f1a8f..5c4b819 100644 --- a/js-client/index.ts +++ b/js-client/index.ts @@ -10,6 +10,20 @@ * --------------------------------------------------------------- */ +export interface CreateAwayWithMakeUpTimeEntryRequest { + /** @format date-time */ + startTime: string; + /** @format date-time */ + endTime: string; + description: string; + makeUpTimeList: MakeUpTimeEntryDto[]; +} + +export interface CreateAwayWithMakeUpTimeEntryResponse { + /** @format int64 */ + newAwayWithMakeUpTimeEntryId: number; +} + export interface CreateTaskEntryRequest { title: string; /** @format date-time */ @@ -79,6 +93,13 @@ export interface GetPersonalReportResponse { unwellHours: number; } +export interface MakeUpTimeEntryDto { + /** @format date-time */ + startTime: string; + /** @format date-time */ + endTime: string; +} + export interface ProjectDto { /** @format int64 */ id: number; @@ -142,6 +163,17 @@ export interface UnwellEntryDto { type: EntryType; } +export interface UpdateAwayWithMakeUpTimeEntryRequest { + /** @format int64 */ + id?: number; + /** @format date-time */ + startTime: string; + /** @format date-time */ + endTime: string; + description: string; + makeUpTimeList: MakeUpTimeEntryDto[]; +} + export interface UpdateTaskEntryRequest { /** @format int64 */ id?: number; @@ -416,6 +448,27 @@ export class Api< ...params, }), + /** + * No description + * + * @tags Tracking + * @name TrackingCreateAwayWithMakeUpTimeEntry + * @summary Create an away with make up time entry + * @request POST:/api/tracking/away-with-make-up-time-entries + */ + trackingCreateAwayWithMakeUpTimeEntry: ( + data: CreateAwayWithMakeUpTimeEntryRequest, + params: RequestParams = {}, + ) => + this.request({ + path: `/api/tracking/away-with-make-up-time-entries`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + /** * No description * @@ -458,6 +511,28 @@ export class Api< ...params, }), + /** + * No description + * + * @tags Tracking + * @name TrackingUpdateAwayWithMakeUpTimeEntry + * @summary Update an away with make up time entry + * @request POST:/api/tracking/away-with-make-up-time-entries/{awayWithMakeUpTimeEntryId} + */ + trackingUpdateAwayWithMakeUpTimeEntry: ( + awayWithMakeUpTimeEntryId: number, + data: UpdateAwayWithMakeUpTimeEntryRequest, + params: RequestParams = {}, + ) => + this.request({ + path: `/api/tracking/away-with-make-up-time-entries/${awayWithMakeUpTimeEntryId}`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + /** * No description *