Refactor customer domain to use string IDs and integrate MongoDB ORM

- Updated Customer entity to embed MongoDB model and replace uuid.UUID with string for ID fields.
- Modified repository methods to accept string IDs instead of uuid.UUID, enhancing compatibility with MongoDB.
- Refactored service and handler methods to align with the new ID type, ensuring consistent usage across customer management functionality.
- Improved response handling in CustomerResponse to directly use string IDs.
- Streamlined index creation in the customer repository using the MongoDB ORM for better maintainability.
- Added new forms for customer suspension and updated validation rules.
- Enhanced Swagger documentation for customer-related endpoints to reflect changes in ID handling and request structures.
This commit is contained in:
n.nakhostin
2025-08-11 14:01:36 +03:30
parent 08cf927294
commit ce4f7e83d3
6 changed files with 604 additions and 618 deletions
+6 -1
View File
@@ -99,13 +99,18 @@ type UpdateCustomerStatusForm struct {
Status string `json:"status" valid:"required,in(active|inactive|suspended|pending)"`
}
// UpdateCustomerVerificationForm represents the form for updating customer verification
// UpdateCustomerVerificationForm represents the form for updating customer verification status
type UpdateCustomerVerificationForm struct {
IsVerified bool `json:"is_verified"`
IsCompliant bool `json:"is_compliant"`
ComplianceNotes *string `json:"compliance_notes,omitempty" valid:"optional,length(0|1000)"`
}
// SuspendCustomerForm represents the form for suspending a customer
type SuspendCustomerForm struct {
Reason string `json:"reason" valid:"required,length(10|500)"`
}
// AddressForm represents the form for customer address
type AddressForm struct {
Street string `json:"street" valid:"required,length(5|200)"`