refactor: Remove unused entity and datasource files; add AuthDto for authentication, simplification

This commit is contained in:
2025-03-10 09:47:44 +00:00
parent 3b0b2b4340
commit 7f275c774e
52 changed files with 1567 additions and 1059 deletions
+30
View File
@@ -0,0 +1,30 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type ActivityDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
Name string `json:"name"`
BillingRate float64 `json:"billingRate"`
}
type ActivityCreateDto struct {
Name string `json:"name"`
BillingRate float64 `json:"billingRate"`
}
type ActivityUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
Name *string `json:"name"`
BillingRate *float64 `json:"billingRate"`
}
+6
View File
@@ -0,0 +1,6 @@
package dto
type AuthDto struct {
Email string `json:"email"`
Password string `json:"password"`
}
+27
View File
@@ -0,0 +1,27 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type CompanyDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
Name string `json:"name"`
}
type CompanyCreateDto struct {
Name string `json:"name"`
}
type CompanyUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
Name *string `json:"name"`
}
+30
View File
@@ -0,0 +1,30 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type CustomerDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
Name string `json:"name"`
CompanyID int `json:"companyId"`
}
type CustomerCreateDto struct {
Name string `json:"name"`
CompanyID int `json:"companyId"`
}
type CustomerUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
Name *string `json:"name"`
CompanyID *int `json:"companyId"`
}
+30
View File
@@ -0,0 +1,30 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type ProjectDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
Name string `json:"name"`
CustomerID int `json:"customerId"`
}
type ProjectCreateDto struct {
Name string `json:"name"`
CustomerID int `json:"customerId"`
}
type ProjectUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
Name *string `json:"name"`
CustomerID *int `json:"customerId"`
}
+45
View File
@@ -0,0 +1,45 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type TimeEntryDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
UserID int `json:"userId"`
ProjectID int `json:"projectId"`
ActivityID int `json:"activityId"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Description string `json:"description"`
Billable int `json:"billable"` // Percentage (0-100)
}
type TimeEntryCreateDto struct {
UserID int `json:"userId"`
ProjectID int `json:"projectId"`
ActivityID int `json:"activityId"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Description string `json:"description"`
Billable int `json:"billable"` // Percentage (0-100)
}
type TimeEntryUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
UserID *int `json:"userId"`
ProjectID *int `json:"projectId"`
ActivityID *int `json:"activityId"`
Start *time.Time `json:"start"`
End *time.Time `json:"end"`
Description *string `json:"description"`
Billable *int `json:"billable"` // Percentage (0-100)
}
+38
View File
@@ -0,0 +1,38 @@
package dto
import (
"time"
"github.com/oklog/ulid/v2"
)
type UserDto struct {
ID ulid.ULID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastEditorID ulid.ULID `json:"lastEditorID"`
Email string `json:"email"`
Role string `json:"role"`
CompanyID int `json:"companyId"`
HourlyRate float64 `json:"hourlyRate"`
}
type UserCreateDto struct {
Email string `json:"email"`
Password string `json:"password"`
Role string `json:"role"`
CompanyID int `json:"companyId"`
HourlyRate float64 `json:"hourlyRate"`
}
type UserUpdateDto struct {
ID ulid.ULID `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
LastEditorID *ulid.ULID `json:"lastEditorID"`
Email *string `json:"email"`
Password *string `json:"password"`
Role *string `json:"role"`
CompanyID *int `json:"companyId"`
HourlyRate *float64 `json:"hourlyRate"`
}