Update API documentation to reflect customer authorization changes

- Changed tags from "Customers-Mobile" to "Customers-Authorization" in Swagger documentation for customer logout and profile retrieval endpoints.
- Updated the Company entity to replace CustomerID with OwnerCustomerID to better represent ownership.
- Removed obsolete customer assignment methods and related forms from the company domain, streamlining the codebase.
- Adjusted customer forms to include CompanyID instead of CompanyName for better consistency in customer management.
- Enhanced Swagger documentation to accurately reflect the new structure and authorization details for customer-related endpoints.
This commit is contained in:
n.nakhostin
2025-08-11 16:24:28 +03:30
parent 1e998b365e
commit 566fa07574
12 changed files with 41 additions and 270 deletions
+8 -10
View File
@@ -24,11 +24,11 @@ const (
)
// Customer represents a customer in the tender management system
// A customer can have an associated company for login purposes
type Customer struct {
mongo.Model
Type CustomerType `bson:"type" json:"type"`
Status CustomerStatus `bson:"status" json:"status"`
CompanyID *string `bson:"company_id,omitempty" json:"company_id,omitempty"`
Type CustomerType `bson:"type" json:"type"`
Status CustomerStatus `bson:"status" json:"status"`
// Individual customer fields
FirstName *string `bson:"first_name,omitempty" json:"first_name,omitempty"`
@@ -40,8 +40,8 @@ type Customer struct {
Phone *string `bson:"phone,omitempty" json:"phone,omitempty"`
Mobile *string `bson:"mobile,omitempty" json:"mobile,omitempty"`
// Company customer fields
CompanyName *string `bson:"company_name,omitempty" json:"company_name,omitempty"`
// Company customer fields (for when customer represents a company)
CompanyID *string `bson:"company_id,omitempty" json:"company_id,omitempty"`
RegistrationNumber *string `bson:"registration_number,omitempty" json:"registration_number,omitempty"`
TaxID *string `bson:"tax_id,omitempty" json:"tax_id,omitempty"`
Industry *string `bson:"industry,omitempty" json:"industry,omitempty"`
@@ -63,7 +63,7 @@ type Customer struct {
IsCompliant bool `bson:"is_compliant" json:"is_compliant"`
ComplianceNotes *string `bson:"compliance_notes,omitempty" json:"compliance_notes,omitempty"`
// Preferences and settings
// Settings
Language string `bson:"language" json:"language"` // Default: "en"
Currency string `bson:"currency" json:"currency"` // Default: "USD"
Timezone string `bson:"timezone" json:"timezone"` // Default: "UTC"
@@ -131,14 +131,13 @@ type CustomerResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
CompanyID *string `json:"company_id,omitempty"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
FullName *string `json:"full_name,omitempty"`
Email string `json:"email"`
Phone *string `json:"phone,omitempty"`
Mobile *string `json:"mobile,omitempty"`
CompanyName *string `json:"company_name,omitempty"`
CompanyID *string `json:"company_id,omitempty"`
RegistrationNumber *string `json:"registration_number,omitempty"`
TaxID *string `json:"tax_id,omitempty"`
Industry *string `json:"industry,omitempty"`
@@ -167,7 +166,6 @@ func (c *Customer) ToResponse() *CustomerResponse {
ID: c.ID,
Type: string(c.Type),
Status: string(c.Status),
CompanyID: c.CompanyID,
FirstName: c.FirstName,
LastName: c.LastName,
FullName: c.FullName,
@@ -175,7 +173,7 @@ func (c *Customer) ToResponse() *CustomerResponse {
Email: c.Email,
Phone: c.Phone,
Mobile: c.Mobile,
CompanyName: c.CompanyName,
CompanyID: c.CompanyID,
RegistrationNumber: c.RegistrationNumber,
TaxID: c.TaxID,
Industry: c.Industry,