feat: Add TypeScript type generation and update DTOs to use string for IDs

This commit is contained in:
2025-03-12 06:38:41 +00:00
parent 016078c1c3
commit 0379ea4ae4
4 changed files with 45 additions and 55 deletions
+38 -21
View File
@@ -24,6 +24,24 @@ export interface ActivityUpdateDto {
billingRate?: number /* float64 */;
}
//////////
// source: auth_dto.go
/**
* LoginDto represents the login request
*/
export interface LoginDto {
email: string;
password: string;
}
/**
* TokenDto represents the response after successful authentication
*/
export interface TokenDto {
token: string;
user: UserDto;
}
//////////
// source: company_dto.go
@@ -54,11 +72,11 @@ export interface CustomerDto {
updatedAt: string;
lastEditorID: string;
name: string;
companyId: number /* int */;
companyId: string;
}
export interface CustomerCreateDto {
name: string;
companyId: number /* int */;
companyId: string;
}
export interface CustomerUpdateDto {
id: string;
@@ -66,7 +84,7 @@ export interface CustomerUpdateDto {
updatedAt?: string;
lastEditorID?: string;
name?: string;
companyId?: number /* int */;
companyId?: string;
}
//////////
@@ -78,11 +96,11 @@ export interface ProjectDto {
updatedAt: string;
lastEditorID: string;
name: string;
customerId: number /* int */;
customerId: string;
}
export interface ProjectCreateDto {
name: string;
customerId: number /* int */;
customerId: string;
}
export interface ProjectUpdateDto {
id: string;
@@ -90,7 +108,7 @@ export interface ProjectUpdateDto {
updatedAt?: string;
lastEditorID?: string;
name?: string;
customerId?: number /* int */;
customerId?: string;
}
//////////
@@ -101,18 +119,18 @@ export interface TimeEntryDto {
createdAt: string;
updatedAt: string;
lastEditorID: string;
userId: number /* int */;
projectId: number /* int */;
activityId: number /* int */;
userId: string;
projectId: string;
activityId: string;
start: string;
end: string;
description: string;
billable: number /* int */; // Percentage (0-100)
}
export interface TimeEntryCreateDto {
userId: number /* int */;
projectId: number /* int */;
activityId: number /* int */;
userId: string;
projectId: string;
activityId: string;
start: string;
end: string;
description: string;
@@ -123,9 +141,9 @@ export interface TimeEntryUpdateDto {
createdAt?: string;
updatedAt?: string;
lastEditorID?: string;
userId?: number /* int */;
projectId?: number /* int */;
activityId?: number /* int */;
userId?: string;
projectId?: string;
activityId?: string;
start?: string;
end?: string;
description?: string;
@@ -141,16 +159,15 @@ export interface UserDto {
updatedAt: string;
lastEditorID: string;
email: string;
password: string; // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
role: string;
companyId: number /* int */;
companyId: string;
hourlyRate: number /* float64 */;
}
export interface UserCreateDto {
email: string;
password: string; // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
password: string;
role: string;
companyId: number /* int */;
companyId: string;
hourlyRate: number /* float64 */;
}
export interface UserUpdateDto {
@@ -159,8 +176,8 @@ export interface UserUpdateDto {
updatedAt?: string;
lastEditorID?: string;
email?: string;
password?: string; // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
password?: string;
role?: string;
companyId?: number /* int */;
companyId?: string;
hourlyRate?: number /* float64 */;
}