feat: Introduce base entity structure and update DTOs for Activity, Company, User, and TimeEntry

This commit is contained in:
2025-03-09 20:28:46 +00:00
parent 9749d5658c
commit 837cd55a33
18 changed files with 255 additions and 54 deletions
+2
View File
@@ -13,6 +13,8 @@ This document provides an overview of the Time Tracking and Management System. F
- [Extensibility and Integrations](extensibility_integrations.md)
- [LLM Guidance](llm_guidance.md)
- [Roadmap](Roadmap.md)
- [Domain Types](domain_types.md)
- [DTOs](dtos.md)
## Code Examples
- [GORM Entities](code_examples/gorm_entities.go)
+34
View File
@@ -13,6 +13,40 @@ CREATE TABLE companies (
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
-- Go structs for creating and updating customers
-- type CustomerCreate struct {
-- Name string
-- CompanyID int
-- }
-- type CustomerUpdate struct {
-- ID ulid.ULID
-- Name *string
-- CompanyID *int
-- }
-- Go structs for creating and updating companies
-- type CompanyCreate struct {
-- Name string
-- }
-- type CompanyUpdate struct {
-- ID ulid.ULID
-- Name *string
-- }
-- Go structs for creating and updating activities
-- type ActivityCreate struct {
-- Name string
-- BillingRate float64
-- }
-- type ActivityUpdate struct {
-- ID ulid.ULID
-- Name *string
-- BillingRate *float64
-- }
-- Users and Roles
CREATE TABLE roles (
id SERIAL PRIMARY KEY,
+27
View File
@@ -0,0 +1,27 @@
# Domain Types
This document describes the domain types used in the Time Tracker application. Domain types represent the core business concepts and are used throughout the application.
## Activity
The `Activity` type represents a specific activity that can be tracked, such as "Development", "Meeting", or "Bug Fixing".
## Company
The `Company` type represents a tenant in the multi-tenant application. Each company has its own set of users, customers, projects, and activities.
## Customer
The `Customer` type represents a customer of a company.
## Project
The `Project` type represents a project for a specific customer.
## TimeEntry
The `TimeEntry` type represents a time booking for a specific user, project, and activity.
## User
The `User` type represents a user of the application. Each user belongs to a company and has a specific role.
+27
View File
@@ -0,0 +1,27 @@
# Data Transfer Objects (DTOs)
This document describes the Data Transfer Objects (DTOs) used in the Time Tracker application. DTOs are used to transfer data between the backend and frontend, and between different layers of the backend.
## ActivityDto
The `ActivityDto` type represents a specific activity that can be tracked, such as "Development", "Meeting", or "Bug Fixing". It is used to transfer activity data between the backend and frontend.
## CompanyDto
The `CompanyDto` type represents a tenant in the multi-tenant application. Each company has its own set of users, customers, projects, and activities. It is used to transfer company data between the backend and frontend.
## CustomerDto
The `CustomerDto` type represents a customer of a company. It is used to transfer customer data between the backend and frontend.
## ProjectDto
The `ProjectDto` type represents a project for a specific customer. It is used to transfer project data between the backend and frontend.
## TimeEntryDto
The `TimeEntryDto` type represents a time booking for a specific user, project, and activity. It is used to transfer time entry data between the backend and frontend.
## UserDto
The `UserDto` type represents a user of the application. Each user belongs to a company and has a specific role. It is used to transfer user data between the backend and frontend.