diff --git a/src/app/project/model.go b/src/app/project/model.go index 0697f4341777157d9bd2e8a1290fedcf8e5ba0b8..e3bbfbcfabbc96580d4e01e3d3c033cc96b736ec 100644 --- a/src/app/project/model.go +++ b/src/app/project/model.go @@ -15,10 +15,18 @@ type Project struct { // The omitempty tag excludes this field if it's empty during insertion 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") // This allows users to reference projects with meaningful IDs 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") // This is what users see in the interface as the project title Name string `bson:"name" json:"name"` @@ -57,6 +65,10 @@ type ProjectToCreate struct { // Validation ensures this field is not empty 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 // Validation ensures this field is not empty Name string `json:"name" hvalidate:"required"` @@ -85,6 +97,10 @@ type ProjectToUpdate struct { // This field is populated from the URL parameter 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 // Users can change the display name of their projects Name string `json:"name" hvalidate:"required"` @@ -108,6 +124,7 @@ type ProjectToUpdate struct { func (p *Project) ToUpdate() *ProjectToUpdate { return &ProjectToUpdate{ ID: p.ID, // Preserve the project identifier + Shortcut: p.Shortcut, // Current shortcut as default Name: p.Name, // Current name as default Description: p.Description, // Current description as default StartDate: p.StartDate, // Current start date as default @@ -140,10 +157,18 @@ type RequirementSummary struct { // Used for linking to detailed requirement views 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 // Generated automatically if not provided (e.g., "REQ-abc123") 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 // This field comes from the requirement parsing and validation process Condition string `bson:"condition" json:"condition"`