feat: Introduce base entity structure and update DTOs for Activity, Company, User, and TimeEntry
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export type BaseEntity = {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
lastEditorID: string;
|
||||
};
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
export interface ActivityDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
name: string;
|
||||
billingRate: number /* float64 */;
|
||||
}
|
||||
@@ -14,6 +17,9 @@ export interface ActivityCreateDto {
|
||||
}
|
||||
export interface ActivityUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
name?: string;
|
||||
billingRate?: number /* float64 */;
|
||||
}
|
||||
@@ -23,6 +29,9 @@ export interface ActivityUpdateDto {
|
||||
|
||||
export interface CompanyDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
name: string;
|
||||
}
|
||||
export interface CompanyCreateDto {
|
||||
@@ -30,6 +39,9 @@ export interface CompanyCreateDto {
|
||||
}
|
||||
export interface CompanyUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
@@ -38,6 +50,9 @@ export interface CompanyUpdateDto {
|
||||
|
||||
export interface CustomerDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
name: string;
|
||||
companyId: number /* int */;
|
||||
}
|
||||
@@ -47,6 +62,9 @@ export interface CustomerCreateDto {
|
||||
}
|
||||
export interface CustomerUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
name?: string;
|
||||
companyId?: number /* int */;
|
||||
}
|
||||
@@ -56,6 +74,9 @@ export interface CustomerUpdateDto {
|
||||
|
||||
export interface ProjectDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
name: string;
|
||||
customerId: number /* int */;
|
||||
}
|
||||
@@ -65,6 +86,9 @@ export interface ProjectCreateDto {
|
||||
}
|
||||
export interface ProjectUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
name?: string;
|
||||
customerId?: number /* int */;
|
||||
}
|
||||
@@ -74,6 +98,9 @@ export interface ProjectUpdateDto {
|
||||
|
||||
export interface TimeEntryDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
userId: number /* int */;
|
||||
projectId: number /* int */;
|
||||
activityId: number /* int */;
|
||||
@@ -93,6 +120,9 @@ export interface TimeEntryCreateDto {
|
||||
}
|
||||
export interface TimeEntryUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
userId?: number /* int */;
|
||||
projectId?: number /* int */;
|
||||
activityId?: number /* int */;
|
||||
@@ -107,6 +137,9 @@ export interface TimeEntryUpdateDto {
|
||||
|
||||
export interface UserDto {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastEditorID: string;
|
||||
username: string;
|
||||
password: string; // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
||||
role: string;
|
||||
@@ -122,6 +155,9 @@ export interface UserCreateDto {
|
||||
}
|
||||
export interface UserUpdateDto {
|
||||
id: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
lastEditorID?: string;
|
||||
username?: string;
|
||||
password?: string; // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
||||
role?: string;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export type ValueId<T = string> = string & { __valueId: T };
|
||||
|
||||
export type CustomerId = ValueId<"CustomerId">;
|
||||
export type ProjectId = ValueId<"ProjectId">;
|
||||
export type TimeEntryId = ValueId<"TimeEntryId">;
|
||||
export type CompanyId = ValueId<"CompanyId">;
|
||||
export type UserId = ValueId<"UserId">;
|
||||
export type RoleId = ValueId<"RoleId">;
|
||||
export type PermissionId = ValueId<"PermissionId">;
|
||||
Reference in New Issue
Block a user