feat: Add create and update DTOs for Company, Customer, Project, Activity, User, and TimeEntry entities
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
package entities
|
||||
|
||||
import "github.com/oklog/ulid/v2"
|
||||
import (
|
||||
"github.com/oklog/ulid/v2"
|
||||
)
|
||||
|
||||
type Activity struct {
|
||||
ID ulid.ULID
|
||||
Name string
|
||||
BillingRate float64
|
||||
}
|
||||
|
||||
type ActivityUpdate struct {
|
||||
ID ulid.ULID
|
||||
Name *string
|
||||
BillingRate *float64
|
||||
}
|
||||
|
||||
type ActivityCreate struct {
|
||||
Name string
|
||||
BillingRate float64
|
||||
}
|
||||
|
||||
@@ -6,3 +6,12 @@ type Company struct {
|
||||
ID ulid.ULID
|
||||
Name string
|
||||
}
|
||||
|
||||
type CompanyCreate struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type CompanyUpdate struct {
|
||||
ID ulid.ULID
|
||||
Name *string
|
||||
}
|
||||
|
||||
@@ -7,3 +7,14 @@ type Customer struct {
|
||||
Name string
|
||||
CompanyID int
|
||||
}
|
||||
|
||||
type CustomerCreate struct {
|
||||
Name string
|
||||
CompanyID int
|
||||
}
|
||||
|
||||
type CustomerUpdate struct {
|
||||
ID ulid.ULID
|
||||
Name *string
|
||||
CompanyID *int
|
||||
}
|
||||
|
||||
@@ -7,3 +7,14 @@ type Project struct {
|
||||
Name string
|
||||
CustomerID int
|
||||
}
|
||||
|
||||
type ProjectCreate struct {
|
||||
Name string
|
||||
CustomerID int
|
||||
}
|
||||
|
||||
type ProjectUpdate struct {
|
||||
ID ulid.ULID
|
||||
Name *string
|
||||
CustomerID *int
|
||||
}
|
||||
|
||||
@@ -16,3 +16,24 @@ type TimeEntry struct {
|
||||
Description string
|
||||
Billable int // Percentage (0-100)
|
||||
}
|
||||
|
||||
type TimeEntryCreate struct {
|
||||
UserID int
|
||||
ProjectID int
|
||||
ActivityID int
|
||||
Start time.Time
|
||||
End time.Time
|
||||
Description string
|
||||
Billable int // Percentage (0-100)
|
||||
}
|
||||
|
||||
type TimeEntryUpdate struct {
|
||||
ID ulid.ULID
|
||||
UserID *int
|
||||
ProjectID *int
|
||||
ActivityID *int
|
||||
Start *time.Time
|
||||
End *time.Time
|
||||
Description *string
|
||||
Billable *int // Percentage (0-100)
|
||||
}
|
||||
|
||||
@@ -10,3 +10,20 @@ type User struct {
|
||||
CompanyID int
|
||||
HourlyRate float64
|
||||
}
|
||||
|
||||
type UserCreate struct {
|
||||
Username string
|
||||
Password string
|
||||
Role string
|
||||
CompanyID int
|
||||
HourlyRate float64
|
||||
}
|
||||
|
||||
type UserUpdate struct {
|
||||
ID ulid.ULID
|
||||
Username *string
|
||||
Password *string
|
||||
Role *string
|
||||
CompanyID *int
|
||||
HourlyRate *float64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user