mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
add break time entries and simplified time tracker ui
This commit is contained in:
@@ -16,6 +16,7 @@ export type Invitation = InvitationsIndexResponse['data'][0];
|
||||
|
||||
export type TimeEntryResponse = ZodiosResponseByAlias<SolidTimeApi, 'getTimeEntries'>;
|
||||
export type TimeEntry = TimeEntryResponse['data'][0];
|
||||
export type TimeEntryType = TimeEntry['type'];
|
||||
|
||||
export type CreateTimeEntryBody = ZodiosBodyByAlias<SolidTimeApi, 'createTimeEntry'>;
|
||||
|
||||
|
||||
@@ -319,6 +319,7 @@ const OrganizationResource = z
|
||||
employees_can_see_billable_rates: z.boolean(),
|
||||
employees_can_manage_tasks: z.boolean(),
|
||||
prevent_overlapping_time_entries: z.boolean(),
|
||||
breaks_enabled: z.boolean(),
|
||||
currency: z.string(),
|
||||
currency_symbol: z.string(),
|
||||
number_format: NumberFormat,
|
||||
@@ -336,6 +337,7 @@ const OrganizationUpdateRequest = z
|
||||
employees_can_see_billable_rates: z.boolean(),
|
||||
employees_can_manage_tasks: z.boolean(),
|
||||
prevent_overlapping_time_entries: z.boolean(),
|
||||
breaks_enabled: z.boolean(),
|
||||
number_format: NumberFormat,
|
||||
currency_format: CurrencyFormat,
|
||||
date_format: DateFormat,
|
||||
@@ -420,6 +422,7 @@ const TimeEntryAggregationType = z.enum([
|
||||
'billable',
|
||||
'description',
|
||||
'tag',
|
||||
'type',
|
||||
]);
|
||||
const TimeEntryAggregationTypeInterval = z.enum(['day', 'week', 'month', 'year']);
|
||||
const Weekday = z.enum([
|
||||
@@ -479,6 +482,7 @@ const DetailedReportResource = z
|
||||
active: z.union([z.boolean(), z.null()]),
|
||||
member_ids: z.union([z.array(z.string()), z.null()]),
|
||||
billable: z.union([z.boolean(), z.null()]),
|
||||
time_entry_type: z.union([z.enum(['work', 'break']), z.null()]),
|
||||
client_ids: z.union([z.array(z.string()), z.null()]),
|
||||
project_ids: z.union([z.array(z.string()), z.null()]),
|
||||
tag_ids: z.union([z.array(z.string()), z.null()]),
|
||||
@@ -631,6 +635,7 @@ const TaskUpdateRequest = z
|
||||
.passthrough();
|
||||
const start = z.union([z.string(), z.null()]).optional();
|
||||
const rounding_minutes = z.union([z.number(), z.null()]).optional();
|
||||
const TimeEntryType = z.enum(['work', 'break']);
|
||||
const TimeEntryResource = z
|
||||
.object({
|
||||
id: z.string(),
|
||||
@@ -644,6 +649,7 @@ const TimeEntryResource = z
|
||||
user_id: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
billable: z.boolean(),
|
||||
type: TimeEntryType,
|
||||
})
|
||||
.passthrough();
|
||||
const TimeEntryStoreRequest = z
|
||||
@@ -654,6 +660,7 @@ const TimeEntryStoreRequest = z
|
||||
start: z.string(),
|
||||
end: z.union([z.string(), z.null()]).optional(),
|
||||
billable: z.boolean(),
|
||||
type: TimeEntryType.optional(),
|
||||
description: z.union([z.string(), z.null()]).optional(),
|
||||
tags: z.union([z.array(z.string()), z.null()]).optional(),
|
||||
})
|
||||
@@ -667,6 +674,7 @@ const TimeEntryUpdateMultipleRequest = z
|
||||
project_id: z.union([z.string(), z.null()]),
|
||||
task_id: z.union([z.string(), z.null()]),
|
||||
billable: z.boolean(),
|
||||
type: TimeEntryType,
|
||||
description: z.union([z.string(), z.null()]),
|
||||
tags: z.union([z.array(z.string()), z.null()]),
|
||||
})
|
||||
@@ -682,6 +690,7 @@ const TimeEntryUpdateRequest = z
|
||||
start: z.string(),
|
||||
end: z.union([z.string(), z.null()]),
|
||||
billable: z.boolean(),
|
||||
type: TimeEntryType,
|
||||
description: z.union([z.string(), z.null()]),
|
||||
tags: z.union([z.array(z.string()), z.null()]),
|
||||
})
|
||||
@@ -774,6 +783,7 @@ export const schemas = {
|
||||
TaskUpdateRequest,
|
||||
start,
|
||||
rounding_minutes,
|
||||
TimeEntryType,
|
||||
TimeEntryResource,
|
||||
TimeEntryStoreRequest,
|
||||
TimeEntryUpdateMultipleRequest,
|
||||
@@ -3736,6 +3746,11 @@ Users with the permission `time-entries:view:own` can only use this en
|
||||
type: 'Query',
|
||||
schema: z.enum(['true', 'false']).optional(),
|
||||
},
|
||||
{
|
||||
name: 'type',
|
||||
type: 'Query',
|
||||
schema: TimeEntryType.optional(),
|
||||
},
|
||||
{
|
||||
name: 'limit',
|
||||
type: 'Query',
|
||||
@@ -3895,7 +3910,9 @@ Users with the permission `time-entries:view:own` can only use this en
|
||||
schema: z.string(),
|
||||
},
|
||||
],
|
||||
response: z.object({ success: z.string(), error: z.string() }).passthrough(),
|
||||
response: z
|
||||
.object({ success: z.array(z.string()), error: z.array(z.string()) })
|
||||
.passthrough(),
|
||||
errors: [
|
||||
{
|
||||
status: 401,
|
||||
@@ -4085,6 +4102,7 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
'billable',
|
||||
'description',
|
||||
'tag',
|
||||
'type',
|
||||
])
|
||||
.optional(),
|
||||
},
|
||||
@@ -4104,6 +4122,7 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
'billable',
|
||||
'description',
|
||||
'tag',
|
||||
'type',
|
||||
])
|
||||
.optional(),
|
||||
},
|
||||
@@ -4137,6 +4156,11 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
type: 'Query',
|
||||
schema: z.enum(['true', 'false']).optional(),
|
||||
},
|
||||
{
|
||||
name: 'type',
|
||||
type: 'Query',
|
||||
schema: TimeEntryType.optional(),
|
||||
},
|
||||
{
|
||||
name: 'fill_gaps_in_time_groups',
|
||||
type: 'Query',
|
||||
@@ -4277,6 +4301,7 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
'billable',
|
||||
'description',
|
||||
'tag',
|
||||
'type',
|
||||
]),
|
||||
},
|
||||
{
|
||||
@@ -4294,6 +4319,7 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
'billable',
|
||||
'description',
|
||||
'tag',
|
||||
'type',
|
||||
]),
|
||||
},
|
||||
{
|
||||
@@ -4331,6 +4357,11 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
type: 'Query',
|
||||
schema: z.enum(['true', 'false']).optional(),
|
||||
},
|
||||
{
|
||||
name: 'type',
|
||||
type: 'Query',
|
||||
schema: TimeEntryType.optional(),
|
||||
},
|
||||
{
|
||||
name: 'fill_gaps_in_time_groups',
|
||||
type: 'Query',
|
||||
@@ -4459,6 +4490,11 @@ If the group parameters are all set to `null` or are all missing, the
|
||||
type: 'Query',
|
||||
schema: z.enum(['true', 'false']).optional(),
|
||||
},
|
||||
{
|
||||
name: 'type',
|
||||
type: 'Query',
|
||||
schema: TimeEntryType.optional(),
|
||||
},
|
||||
{
|
||||
name: 'limit',
|
||||
type: 'Query',
|
||||
|
||||
Reference in New Issue
Block a user