Jean Jacques Avril 4b47da3673
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
refactor: improve handling of optional CustomerID in project models and DTOs
2025-04-01 15:48:43 +00:00

29 lines
1.1 KiB
Go

package dto
import (
"time"
"github.com/timetracker/backend/internal/types"
)
type ProjectDto struct {
ID string `json:"id" example:"01HGW2BBG0000000000000000"`
CreatedAt time.Time `json:"createdAt" example:"2024-01-01T00:00:00Z"`
UpdatedAt time.Time `json:"updatedAt" example:"2024-01-01T00:00:00Z"`
LastEditorID string `json:"lastEditorID" example:"01HGW2BBG0000000000000000"`
Name string `json:"name" example:"Time Tracking App"`
CustomerID *string `json:"customerId,omitempty" example:"01HGW2BBG0000000000000000"`
}
type ProjectCreateDto struct {
Name string `json:"name" example:"Time Tracking App"`
CustomerID *string `json:"customerId" example:"01HGW2BBG0000000000000000"`
}
type ProjectUpdateDto struct {
CreatedAt *time.Time `json:"createdAt" example:"2024-01-01T00:00:00Z"`
UpdatedAt *time.Time `json:"updatedAt" example:"2024-01-01T00:00:00Z"`
Name *string `json:"name" example:"Time Tracking App"`
CustomerID types.Nullable[string] `json:"customerId" example:"01HGW2BBG0000000000000000"`
}