Back to overview
Maintenance
Update to customer details
Apr 23 at 11:00am AEST
–
Apr 23 at 12:00pm AEST
Affected services
api.dev.co-pr.com
Resolved
Apr 23 at 11:00am AEST
- Moved CustomerDetailsSchema: The Mongoose schema for CustomerDetails has been moved to an exported constant to improve code organization and facilitate reuse.
- Modified ArchivedCustomerSchema: A new Mongoose schema, ArchivedCustomerSchema, has been created. This schema is largely based on CustomerDetailsSchema but with the unique constraint on the email field removed to allow for potential duplicate archived entries.
- Added archiving constants: New constants related to customer details archiving, such as collection names, have been added to logger.constants.ts.
- Added archiveCustomerDetails method: A new method, archiveCustomerDetails, has been implemented. This method takes a customer details document as input and creates a corresponding document in the archived_customers collection.
- Updated deleteCustomerDetails method: The deleteCustomerDetails method has been modified to first call archiveCustomerDetails. Only upon successful creation of the archived record will the original customer details be deleted from the customer_details collection.
Affected services