Skip to content
Snippets Groups Projects
Commit 729eb886 authored by Alexander Kohler's avatar Alexander Kohler
Browse files

Projekt-Model um UUID und Kürzel-Felder erweitert

- UUID-Feld für eindeutige externe Projektidentifikation hinzugefügt
- Kürzel-Feld für benutzerdefinierte Projektabkürzungen (max 8 Zeichen)
- Felder in ProjectToCreate und ProjectToUpdate Strukturen integriert
parent 277aff95
No related branches found
No related tags found
1 merge request!4merge dev to main
...@@ -15,10 +15,18 @@ type Project struct { ...@@ -15,10 +15,18 @@ type Project struct {
// The omitempty tag excludes this field if it's empty during insertion // The omitempty tag excludes this field if it's empty during insertion
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
// UUID is a unique identifier for this project that can be used across systems
// Generated automatically when creating new projects for guaranteed uniqueness
UUID uuid.UUID `bson:"uuid" json:"uuid"`
// ProjectID is a human-readable unique identifier (e.g., "PRJ-2025-001") // ProjectID is a human-readable unique identifier (e.g., "PRJ-2025-001")
// This allows users to reference projects with meaningful IDs // This allows users to reference projects with meaningful IDs
ProjectID string `bson:"project_id" json:"projectId"` ProjectID string `bson:"project_id" json:"projectId"`
// Shortcut is a user-defined abbreviation for quick project reference
// Must be unique within the system and allows faster project identification
Shortcut string `bson:"shortcut" json:"shortcut"`
// Name is the display name of the project (e.g., "HARMONY Mobile") // Name is the display name of the project (e.g., "HARMONY Mobile")
// This is what users see in the interface as the project title // This is what users see in the interface as the project title
Name string `bson:"name" json:"name"` Name string `bson:"name" json:"name"`
...@@ -57,6 +65,10 @@ type ProjectToCreate struct { ...@@ -57,6 +65,10 @@ type ProjectToCreate struct {
// Validation ensures this field is not empty // Validation ensures this field is not empty
ProjectID string `json:"projectId" hvalidate:"required"` ProjectID string `json:"projectId" hvalidate:"required"`
// Shortcut is a user-defined abbreviation that must be unique (max 8 characters)
// Used for quick project identification and references
Shortcut string `json:"shortcut" hvalidate:"required,max8"`
// Name is required and serves as the display title // Name is required and serves as the display title
// Validation ensures this field is not empty // Validation ensures this field is not empty
Name string `json:"name" hvalidate:"required"` Name string `json:"name" hvalidate:"required"`
...@@ -85,6 +97,10 @@ type ProjectToUpdate struct { ...@@ -85,6 +97,10 @@ type ProjectToUpdate struct {
// This field is populated from the URL parameter // This field is populated from the URL parameter
ID primitive.ObjectID `bson:"_id" json:"id"` ID primitive.ObjectID `bson:"_id" json:"id"`
// Shortcut can be updated and must remain unique (max 8 characters)
// Users can change the project abbreviation for better organization
Shortcut string `json:"shortcut" hvalidate:"required,max=8"`
// Name can be updated and is required to be non-empty // Name can be updated and is required to be non-empty
// Users can change the display name of their projects // Users can change the display name of their projects
Name string `json:"name" hvalidate:"required"` Name string `json:"name" hvalidate:"required"`
...@@ -108,6 +124,7 @@ type ProjectToUpdate struct { ...@@ -108,6 +124,7 @@ type ProjectToUpdate struct {
func (p *Project) ToUpdate() *ProjectToUpdate { func (p *Project) ToUpdate() *ProjectToUpdate {
return &ProjectToUpdate{ return &ProjectToUpdate{
ID: p.ID, // Preserve the project identifier ID: p.ID, // Preserve the project identifier
Shortcut: p.Shortcut, // Current shortcut as default
Name: p.Name, // Current name as default Name: p.Name, // Current name as default
Description: p.Description, // Current description as default Description: p.Description, // Current description as default
StartDate: p.StartDate, // Current start date as default StartDate: p.StartDate, // Current start date as default
...@@ -140,10 +157,18 @@ type RequirementSummary struct { ...@@ -140,10 +157,18 @@ type RequirementSummary struct {
// Used for linking to detailed requirement views // Used for linking to detailed requirement views
ID primitive.ObjectID `bson:"_id" json:"id"` ID primitive.ObjectID `bson:"_id" json:"id"`
// UUID is a unique identifier for this requirement that can be used across systems
// Generated automatically when creating new requirements for guaranteed uniqueness
UUID uuid.UUID `bson:"uuid" json:"uuid"`
// RequirementID is a human-readable identifier for this requirement // RequirementID is a human-readable identifier for this requirement
// Generated automatically if not provided (e.g., "REQ-abc123") // Generated automatically if not provided (e.g., "REQ-abc123")
RequirementID string `bson:"requirement_id" json:"requirementId"` RequirementID string `bson:"requirement_id" json:"requirementId"`
// Shortcut is a user-defined abbreviation for quick requirement reference
// Must be unique within the project and allows faster requirement identification
Shortcut string `bson:"shortcut" json:"shortcut"`
// Condition describes the circumstances under which this requirement applies // Condition describes the circumstances under which this requirement applies
// This field comes from the requirement parsing and validation process // This field comes from the requirement parsing and validation process
Condition string `bson:"condition" json:"condition"` Condition string `bson:"condition" json:"condition"`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment