Update company entity and repository for document file ID handling
continuous-integration/drone/push Build is passing

- Modified the `DocumentFileIDs` field in the `Company` struct to ensure it is always persisted in BSON format, enhancing data consistency.
- Implemented logic in the `Update` method of the `companyRepository` to clear document file IDs when the slice is empty, ensuring accurate database updates.
- Added logging for errors encountered while clearing document file IDs, improving error tracking and debugging capabilities.

This update enhances the management of document file IDs within the company domain, ensuring proper handling and persistence in the database.
This commit is contained in:
Mazyar
2026-06-22 23:38:57 +03:30
parent 3ba33459e8
commit 992d41374f
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ type Company struct {
Email *string `bson:"email,omitempty" json:"email,omitempty"`
// File references stored in GridFS
DocumentFileIDs []string `bson:"document_file_ids,omitempty" json:"document_file_ids,omitempty"`
DocumentFileIDs []string `bson:"document_file_ids" json:"document_file_ids,omitempty"`
// Tags for categorization and search
Tags *CompanyTags `bson:"tags,omitempty" json:"tags,omitempty"`