Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notification: remove DestType and Dest #4022

Merged
merged 21 commits into from
Jul 31, 2024
Merged

Conversation

mastercactapus
Copy link
Member

Description:
Removes the Dest struct and DestType type in favor of discrete params on the Message struct of DestID and Dest (gadb.DestV1).

- Changed notification.DestType to string for code simplicity
- Updated all related function signatures and usages
- Consolidated enable/disable SQL queries
- Updated methods to use destination-based enable/disable functions
- Simplified contact method parameters to use unified structure
- Simplified destination handling by using gadb.DestV1
- Removed redundant notification package dependency
- Introduced NewDestV1 constructor for gadb.DestV1
- Updated all IsKnownDest method signatures accordingly
- Migrate notification handling to use gadb.DestV1
- Update SQL queries to utilize unified UserContactMethod struct
- Simplify destination hash generation for consistency
- Ensure database functions properly handle unified structure for DestV1
Corrects the parameter used to fetch the original message status by using the destination's ID directly, ensuring accurate lookups.
- Remove `FormatDestValue` to simplify codebase
- Standardize usage of `gadb.DestV1` across notification types
- Clean up redundant imports and function code
- Update Slack and Twilio destination registration types
- Modify tests to use new destination type functions
- Use specific argument keys instead of general value for email, Slack, SMS, and webhook destinations
- Adjust logic for Slack direct messages to use user ID instead of channel ID
- Improve type checking for Twilio SMS destinations
- Updated Slack user group sender to use new destination argument methods
- Adjusted Twilio voice sender to utilize destination arguments
- Simplified test code by using new destination constructor functions

Rationale: Enhance code readability and maintainability by standardizing how destination attributes are accessed.
- Unified destination value handling across different modules for better code clarity and consistency
- Added function to convert contact methods to destination objects
- Removed redundant destination type formatting calls
- Replace generic notification types with specific Twilio and email types
- Adjust related throttle configuration and test functions to use strings instead of enums for destination types
- Replaced DestType instances with string type for simplicity
- Removed unnecessary type conversion methods and functions
- Updated tests and related imports to reflect string destination type usage
- Simplified message destination structure.
- Consolidated SQL queries to use coalesced `dest` field.
- Enhanced readability and maintainability of tests by using helper functions.
- Updated graphical logging to directly use `DestV1`.
- Updates the ProviderType field to string to ensure consistent log data formatting.
- Delete destcompat.go as it duplicates functionality
- Move necessary type definitions to desttype.go
- Replace DestHash with DestID for clarity
- Simplify destination generation by removing redundant dependencies
- Update tests and documentation to reflect changes
- Consolidate destination types into gadb package
@mastercactapus mastercactapus merged commit 78c0e68 into master Jul 31, 2024
7 checks passed
@mastercactapus mastercactapus deleted the rm-notif-desttype branch July 31, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants