From aab83a0cf27930619270396050c5e1345c7aad03 Mon Sep 17 00:00:00 2001 From: caydyan Date: Sun, 14 Jun 2026 07:29:17 +0800 Subject: [PATCH] Remove persisted bounty summary column --- db/config.go | 7 ++++ db/structs.go | 4 +- db/structs_test.go | 34 ++++++++++++++++ db/test_config.go | 2 + docker/dummy-data/paid-bounties.sql | 62 ++++++++++++++--------------- handlers/bounties.go | 7 ---- handlers/bounty.go | 2 +- handlers/features_test.go | 2 +- mocks/Database.go | 58 ++++++++++++++++++++++++++- 9 files changed, 135 insertions(+), 43 deletions(-) create mode 100644 db/structs_test.go diff --git a/db/config.go b/db/config.go index 18c2fa672..e6809c05e 100644 --- a/db/config.go +++ b/db/config.go @@ -111,6 +111,7 @@ func InitDB() { db.AutoMigrate(&BountyStakeProcess{}) DB.MigrateTablesWithOrgUuid() + DB.DropLegacyBountySummaryColumn() DB.MigrateOrganizationToWorkspace() people := DB.GetAllPeople() @@ -272,6 +273,12 @@ func (db database) MigrateTablesWithOrgUuid() { } } +func (db database) DropLegacyBountySummaryColumn() { + if db.db.Migrator().HasTable(&Bounty{}) && db.db.Migrator().HasColumn(&Bounty{}, "one_sentence_summary") { + db.db.Migrator().DropColumn(&Bounty{}, "one_sentence_summary") + } +} + func (db database) MigrateOrganizationToWorkspace() { if (db.db.Migrator().HasTable(&Organization{}) && !db.db.Migrator().HasTable("workspaces")) { db.db.Migrator().RenameTable(&Organization{}, "workspaces") diff --git a/db/structs.go b/db/structs.go index 1c7c9c8a3..38e2080a2 100644 --- a/db/structs.go +++ b/db/structs.go @@ -399,7 +399,7 @@ type Bounty struct { WantedType string `json:"wanted_type"` Deliverables string `json:"deliverables"` GithubDescription bool `json:"github_description"` - OneSentenceSummary string `json:"one_sentence_summary"` + OneSentenceSummary string `gorm:"-" json:"one_sentence_summary"` EstimatedSessionLength string `json:"estimated_session_length"` EstimatedCompletionDate string `json:"estimated_completion_date"` Created int64 `json:"created"` @@ -446,7 +446,7 @@ type NewBounty struct { WantedType string `json:"wanted_type"` Deliverables string `json:"deliverables"` GithubDescription bool `json:"github_description"` - OneSentenceSummary string `json:"one_sentence_summary"` + OneSentenceSummary string `gorm:"-" json:"one_sentence_summary"` EstimatedSessionLength string `json:"estimated_session_length"` EstimatedCompletionDate string `json:"estimated_completion_date"` Created int64 `json:"created"` diff --git a/db/structs_test.go b/db/structs_test.go new file mode 100644 index 000000000..525744d72 --- /dev/null +++ b/db/structs_test.go @@ -0,0 +1,34 @@ +package db + +import ( + "sync" + "testing" + + "gorm.io/gorm/schema" +) + +func TestBountySummaryIsNotPersisted(t *testing.T) { + models := []struct { + name string + value interface{} + }{ + {name: "Bounty", value: &Bounty{}}, + {name: "NewBounty", value: &NewBounty{}}, + } + + for _, model := range models { + t.Run(model.name, func(t *testing.T) { + parsed, err := schema.Parse(model.value, &sync.Map{}, schema.NamingStrategy{}) + if err != nil { + t.Fatalf("parse schema: %v", err) + } + + if field := parsed.LookUpField("OneSentenceSummary"); field == nil || field.DBName != "" { + t.Fatalf("OneSentenceSummary should not be mapped to a database column, got %#v", field) + } + if field := parsed.LookUpField("one_sentence_summary"); field != nil { + t.Fatalf("one_sentence_summary should not be mapped to database field %q", field.Name) + } + }) + } +} diff --git a/db/test_config.go b/db/test_config.go index 996259d49..8c4f2b033 100644 --- a/db/test_config.go +++ b/db/test_config.go @@ -95,6 +95,8 @@ func InitTestDB() { db.AutoMigrate(&ChatWorkflowStatus{}) db.AutoMigrate(&BountyStakeProcess{}) + TestDB.DropLegacyBountySummaryColumn() + people := TestDB.GetAllPeople() for _, p := range people { if p.Uuid == "" { diff --git a/docker/dummy-data/paid-bounties.sql b/docker/dummy-data/paid-bounties.sql index 7051913ed..436137ce9 100644 --- a/docker/dummy-data/paid-bounties.sql +++ b/docker/dummy-data/paid-bounties.sql @@ -3,7 +3,7 @@ INSERT INTO bounty ( owner_id, paid, show, completed, type, award, assigned_hours, bounty_expires, commitment_fee, price, title, tribe, assignee, ticket_url, workspace_uuid, feature_uuid, description, wanted_type, - deliverables, github_description, one_sentence_summary, + deliverables, github_description, estimated_session_length, estimated_completion_date, created, updated, assigned_date, completion_date, mark_as_paid_date, paid_date, coding_languages, phase_uuid, phase_priority, @@ -15,7 +15,7 @@ INSERT INTO bounty ( '2023-12-15', 5000, 150000, 'Implement Authentication System', 'backend-tribe', 'developer_1', 'https://github.com/org/repo/issues/1', 'workspace-uuid-123', '', 'Implement a secure authentication system with JWT tokens', 'backend', - 'Working JWT authentication with refresh tokens', true, 'Add secure authentication to API', + 'Working JWT authentication with refresh tokens', true, '3 days', '2023-11-25', EXTRACT(EPOCH FROM (NOW() - INTERVAL '28 days'))::bigint, NOW() - INTERVAL '26 days', @@ -30,7 +30,7 @@ INSERT INTO bounty ( '2023-12-20', 2000, 75000, 'Fix Database Connection Leaks', 'backend-tribe', 'developer_1', 'https://github.com/org/repo/issues/2', 'workspace-uuid-123', '', 'Fix connection pool issues causing memory leaks', 'backend', - 'Optimized connection handling with proper resource cleanup', true, 'Solve database connection leaks', + 'Optimized connection handling with proper resource cleanup', true, '1 day', '2023-11-22', EXTRACT(EPOCH FROM (NOW() - INTERVAL '26 days'))::bigint, NOW() - INTERVAL '24 days', @@ -45,7 +45,7 @@ INSERT INTO bounty ( '2023-12-25', 3000, 95000, 'Performance Optimization for API', 'backend-tribe', 'developer_1', 'https://github.com/org/repo/issues/3', 'workspace-uuid-456', '', 'Optimize API response time by implementing caching', 'backend', - 'Redis caching layer implementation with cache invalidation', true, 'Make API faster with caching', + 'Redis caching layer implementation with cache invalidation', true, '2 days', '2023-11-28', EXTRACT(EPOCH FROM (NOW() - INTERVAL '24 days'))::bigint, NOW() - INTERVAL '22 days', @@ -62,7 +62,7 @@ INSERT INTO bounty ( '2023-12-18', 6000, 180000, 'Build Real-time Chat Module', 'frontend-tribe', 'developer_2', 'https://github.com/org/repo/issues/4', 'workspace-uuid-789', '', 'Create a WebSocket-based real-time chat system', 'fullstack', - 'Working chat system with message persistence', true, 'Add real-time chat functionality', + 'Working chat system with message persistence', true, '4 days', '2023-11-26', EXTRACT(EPOCH FROM (NOW() - INTERVAL '22 days'))::bigint, NOW() - INTERVAL '20 days', @@ -77,7 +77,7 @@ INSERT INTO bounty ( '2023-12-22', 1500, 65000, 'Fix Cross-browser Compatibility Issues', 'frontend-tribe', 'developer_2', 'https://github.com/org/repo/issues/5', 'workspace-uuid-123', '', 'Resolve rendering issues in Safari and Firefox', 'frontend', - 'Working UI across all major browsers', true, 'Fix browser compatibility bugs', + 'Working UI across all major browsers', true, '1 day', '2023-11-24', EXTRACT(EPOCH FROM (NOW() - INTERVAL '20 days'))::bigint, NOW() - INTERVAL '18 days', @@ -94,7 +94,7 @@ INSERT INTO bounty ( '2023-12-30', 7500, 225000, 'Design and Implement Admin Dashboard', 'design-tribe', 'developer_3', 'https://github.com/org/repo/issues/6', 'workspace-uuid-456', '', 'Create an intuitive admin dashboard with analytics', 'frontend', - 'Fully functional admin dashboard with charts and data visualization', true, 'Build comprehensive admin interface', + 'Fully functional admin dashboard with charts and data visualization', true, '5 days', '2023-12-01', EXTRACT(EPOCH FROM (NOW() - INTERVAL '18 days'))::bigint, NOW() - INTERVAL '16 days', @@ -109,7 +109,7 @@ INSERT INTO bounty ( '2023-12-28', 4000, 120000, 'Implement Dark Mode Support', 'design-tribe', 'developer_3', 'https://github.com/org/repo/issues/7', 'workspace-uuid-789', '', 'Add dark mode support with theme switching', 'frontend', - 'Toggleable light/dark themes with persistent user preference', true, 'Add dark mode to the application', + 'Toggleable light/dark themes with persistent user preference', true, '3 days', '2023-11-30', EXTRACT(EPOCH FROM (NOW() - INTERVAL '16 days'))::bigint, NOW() - INTERVAL '14 days', @@ -126,7 +126,7 @@ INSERT INTO bounty ( '2023-12-25', 10000, 300000, 'Build Machine Learning Recommendation Engine', 'data-tribe', 'developer_4', 'https://github.com/org/repo/issues/8', 'workspace-uuid-123', '', 'Implement ML-based content recommendation system', 'backend', - 'Working recommendation API with training pipeline', true, 'Add smart content recommendations', + 'Working recommendation API with training pipeline', true, '7 days', '2023-12-02', EXTRACT(EPOCH FROM (NOW() - INTERVAL '14 days'))::bigint, NOW() - INTERVAL '12 days', @@ -143,7 +143,7 @@ INSERT INTO bounty ( '2023-12-15', 2500, 85000, 'Fix Payment Processing Issues', 'payment-tribe', 'developer_5', 'https://github.com/org/repo/issues/9', 'workspace-uuid-456', '', 'Resolve payment gateway integration issues', 'backend', - 'Reliable payment processing with proper error handling', true, 'Fix recurring payment failures', + 'Reliable payment processing with proper error handling', true, '2 days', '2023-11-25', EXTRACT(EPOCH FROM (NOW() - INTERVAL '13 days'))::bigint, NOW() - INTERVAL '11 days', @@ -158,7 +158,7 @@ INSERT INTO bounty ( '2023-12-20', 7000, 210000, 'Implement Subscription Management System', 'payment-tribe', 'developer_5', 'https://github.com/org/repo/issues/10', 'workspace-uuid-789', '', 'Build a system to manage user subscriptions and billing', 'fullstack', - 'Complete subscription management with billing history', true, 'Add subscription management capabilities', + 'Complete subscription management with billing history', true, '5 days', '2023-11-28', EXTRACT(EPOCH FROM (NOW() - INTERVAL '12 days'))::bigint, NOW() - INTERVAL '10 days', @@ -175,7 +175,7 @@ INSERT INTO bounty ( '2023-12-22', 8000, 240000, 'Create Interactive Data Visualization Dashboard', 'analytics-tribe', 'developer_6', 'https://github.com/org/repo/issues/11', 'workspace-uuid-123', '', 'Build interactive charts and data visualizations', 'frontend', - 'Real-time data visualization dashboard with filtering capabilities', true, 'Add interactive data visualizations', + 'Real-time data visualization dashboard with filtering capabilities', true, '6 days', '2023-11-30', EXTRACT(EPOCH FROM (NOW() - INTERVAL '10 days'))::bigint, NOW() - INTERVAL '8 days', @@ -192,7 +192,7 @@ INSERT INTO bounty ( '2023-12-28', 5000, 150000, 'Optimize Database Queries', 'backend-tribe', 'developer_7', 'https://github.com/org/repo/issues/12', 'workspace-uuid-456', '', 'Improve database query performance for analytics dashboard', 'backend', - 'Optimized queries with proper indexing strategy', true, 'Speed up slow database queries', + 'Optimized queries with proper indexing strategy', true, '4 days', '2023-12-03', EXTRACT(EPOCH FROM (NOW() - INTERVAL '9 days'))::bigint, NOW() - INTERVAL '7 days', @@ -207,7 +207,7 @@ INSERT INTO bounty ( '2023-12-30', 6000, 180000, 'Implement API Rate Limiting', 'security-tribe', 'developer_7', 'https://github.com/org/repo/issues/13', 'workspace-uuid-789', '', 'Add rate limiting to protect API endpoints from abuse', 'backend', - 'Configurable rate limiting with proper response headers', true, 'Protect API from excessive usage', + 'Configurable rate limiting with proper response headers', true, '4 days', '2023-12-05', EXTRACT(EPOCH FROM (NOW() - INTERVAL '8 days'))::bigint, NOW() - INTERVAL '6 days', @@ -224,7 +224,7 @@ INSERT INTO bounty ( '2023-12-20', 3500, 105000, 'Fix Mobile Responsiveness Issues', 'frontend-tribe', 'developer_8', 'https://github.com/org/repo/issues/14', 'workspace-uuid-123', '', 'Resolve UI layout problems on mobile devices', 'frontend', - 'Fully responsive UI across all screen sizes', true, 'Fix mobile UI bugs', + 'Fully responsive UI across all screen sizes', true, '3 days', '2023-11-26', EXTRACT(EPOCH FROM (NOW() - INTERVAL '7 days'))::bigint, NOW() - INTERVAL '5 days', @@ -239,7 +239,7 @@ INSERT INTO bounty ( '2023-12-25', 7500, 225000, 'Implement Multi-language Support', 'frontend-tribe', 'developer_8', 'https://github.com/org/repo/issues/15', 'workspace-uuid-456', '', 'Add internationalization and localization support', 'fullstack', - 'UI and content translation for multiple languages', true, 'Make application support multiple languages', + 'UI and content translation for multiple languages', true, '5 days', '2023-12-01', EXTRACT(EPOCH FROM (NOW() - INTERVAL '6 days'))::bigint, NOW() - INTERVAL '4 days', @@ -254,7 +254,7 @@ INSERT INTO bounty ( '2023-12-28', 4000, 120000, 'Improve Accessibility Compliance', 'frontend-tribe', 'developer_8', 'https://github.com/org/repo/issues/16', 'workspace-uuid-789', '', 'Enhance application to meet WCAG 2.1 AA standards', 'frontend', - 'Fully accessible UI with screen reader support', true, 'Make app accessible to all users', + 'Fully accessible UI with screen reader support', true, '3 days', '2023-12-03', EXTRACT(EPOCH FROM (NOW() - INTERVAL '5 days'))::bigint, NOW() - INTERVAL '3 days', @@ -272,7 +272,7 @@ INSERT INTO bounty ( owner_id, paid, show, completed, type, award, assigned_hours, bounty_expires, commitment_fee, price, title, tribe, assignee, ticket_url, workspace_uuid, feature_uuid, description, wanted_type, - deliverables, github_description, one_sentence_summary, + deliverables, github_description, estimated_session_length, estimated_completion_date, created, updated, assigned_date, completion_date, mark_as_paid_date, paid_date, coding_languages, phase_uuid, phase_priority, @@ -283,7 +283,7 @@ INSERT INTO bounty ( '2023-12-15', 9000, 270000, 'Build Microservice Architecture', 'architecture-tribe', 'developer_1', 'https://github.com/org/repo/issues/17', 'workspace-uuid-789', '', 'Refactor monolith into microservices architecture', 'backend', - 'Working microservices with service discovery and API gateway', true, 'Modernize application architecture', + 'Working microservices with service discovery and API gateway', true, '6 days', '2023-12-05', EXTRACT(EPOCH FROM (NOW() - INTERVAL '25 days'))::bigint, NOW() - INTERVAL '23 days', @@ -298,7 +298,7 @@ INSERT INTO bounty ( '2023-12-20', 4500, 135000, 'Implement OAuth2 Authentication', 'security-tribe', 'developer_1', 'https://github.com/org/repo/issues/18', 'workspace-uuid-123', '', 'Add OAuth2 support for third-party authentication', 'backend', - 'Working OAuth2 integration with multiple providers', true, 'Add social login functionality', + 'Working OAuth2 integration with multiple providers', true, '3 days', '2023-11-28', EXTRACT(EPOCH FROM (NOW() - INTERVAL '23 days'))::bigint, NOW() - INTERVAL '21 days', @@ -314,7 +314,7 @@ INSERT INTO bounty ( owner_id, paid, show, completed, type, award, assigned_hours, bounty_expires, commitment_fee, price, title, tribe, assignee, ticket_url, workspace_uuid, feature_uuid, description, wanted_type, - deliverables, github_description, one_sentence_summary, + deliverables, github_description, estimated_session_length, estimated_completion_date, created, updated, assigned_date, completion_date, mark_as_paid_date, paid_date, coding_languages, phase_uuid, phase_priority, @@ -325,7 +325,7 @@ INSERT INTO bounty ( '2023-12-22', 7000, 210000, 'Create Interactive Form Builder', 'frontend-tribe', 'developer_2', 'https://github.com/org/repo/issues/19', 'workspace-uuid-456', '', 'Build a drag-and-drop form builder with validation', 'frontend', - 'Working form builder with custom validation rules', true, 'Add form builder functionality', + 'Working form builder with custom validation rules', true, '5 days', '2023-11-30', EXTRACT(EPOCH FROM (NOW() - INTERVAL '19 days'))::bigint, NOW() - INTERVAL '17 days', @@ -340,7 +340,7 @@ INSERT INTO bounty ( '2023-12-25', 3500, 105000, 'Implement Lazy Loading for Images', 'performance-tribe', 'developer_2', 'https://github.com/org/repo/issues/20', 'workspace-uuid-789', '', 'Add lazy loading to improve initial page load time', 'frontend', - 'Optimized image loading with placeholder support', true, 'Improve image loading performance', + 'Optimized image loading with placeholder support', true, '2 days', '2023-12-01', EXTRACT(EPOCH FROM (NOW() - INTERVAL '17 days'))::bigint, NOW() - INTERVAL '15 days', @@ -356,7 +356,7 @@ INSERT INTO bounty ( owner_id, paid, show, completed, type, award, assigned_hours, bounty_expires, commitment_fee, price, title, tribe, assignee, ticket_url, workspace_uuid, feature_uuid, description, wanted_type, - deliverables, github_description, one_sentence_summary, + deliverables, github_description, estimated_session_length, estimated_completion_date, created, updated, assigned_date, completion_date, mark_as_paid_date, paid_date, coding_languages, phase_uuid, phase_priority, @@ -367,7 +367,7 @@ INSERT INTO bounty ( '2023-12-30', 12500, 375000, 'Build CI/CD Pipeline', 'devops-tribe', 'developer_3', 'https://github.com/org/repo/issues/21', 'workspace-uuid-123', '', 'Implement automated CI/CD pipeline for deployment', 'devops', - 'Working pipeline with testing, building and deployment', true, 'Automate the deployment process', + 'Working pipeline with testing, building and deployment', true, '8 days', '2023-12-10', EXTRACT(EPOCH FROM (NOW() - INTERVAL '15 days'))::bigint, NOW() - INTERVAL '13 days', @@ -382,7 +382,7 @@ INSERT INTO bounty ( '2023-12-15', 3000, 90000, 'Fix Memory Leaks in Frontend', 'performance-tribe', 'developer_4', 'https://github.com/org/repo/issues/22', 'workspace-uuid-456', '', 'Resolve memory leaks in React components', 'frontend', - 'Optimized components with no memory leaks', true, 'Fix application memory issues', + 'Optimized components with no memory leaks', true, '2 days', '2023-11-25', EXTRACT(EPOCH FROM (NOW() - INTERVAL '13 days'))::bigint, NOW() - INTERVAL '11 days', @@ -397,7 +397,7 @@ INSERT INTO bounty ( '2023-12-28', 10000, 300000, 'Implement Notifications System', 'backend-tribe', 'developer_5', 'https://github.com/org/repo/issues/23', 'workspace-uuid-789', '', 'Build real-time notification system with multiple channels', 'fullstack', - 'Working notifications via WebSocket, email, and mobile push', true, 'Add comprehensive notification capabilities', + 'Working notifications via WebSocket, email, and mobile push', true, '7 days', '2023-12-05', EXTRACT(EPOCH FROM (NOW() - INTERVAL '11 days'))::bigint, NOW() - INTERVAL '9 days', @@ -412,7 +412,7 @@ INSERT INTO bounty ( '2023-12-20', 6000, 180000, 'Implement Content Delivery Network', 'infrastructure-tribe', 'developer_6', 'https://github.com/org/repo/issues/24', 'workspace-uuid-123', '', 'Set up CDN for static assets to improve load times', 'devops', - 'Working CDN integration with proper cache configuration', true, 'Speed up content delivery globally', + 'Working CDN integration with proper cache configuration', true, '4 days', '2023-11-30', EXTRACT(EPOCH FROM (NOW() - INTERVAL '9 days'))::bigint, NOW() - INTERVAL '7 days', @@ -427,7 +427,7 @@ INSERT INTO bounty ( '2023-12-25', 9000, 270000, 'Build Analytics Dashboard', 'data-tribe', 'developer_7', 'https://github.com/org/repo/issues/25', 'workspace-uuid-456', '', 'Create a dashboard to visualize user behavior analytics', 'fullstack', - 'Interactive analytics dashboard with filtering capabilities', true, 'Add analytics visualization capabilities', + 'Interactive analytics dashboard with filtering capabilities', true, '6 days', '2023-12-03', EXTRACT(EPOCH FROM (NOW() - INTERVAL '7 days'))::bigint, NOW() - INTERVAL '5 days', @@ -442,7 +442,7 @@ INSERT INTO bounty ( '2023-12-18', 4000, 120000, 'Fix SEO Issues', 'marketing-tribe', 'developer_8', 'https://github.com/org/repo/issues/26', 'workspace-uuid-789', '', 'Resolve SEO problems and improve search engine ranking', 'frontend', - 'Improved SEO with proper meta tags and structured data', true, 'Boost search engine visibility', + 'Improved SEO with proper meta tags and structured data', true, '3 days', '2023-11-28', EXTRACT(EPOCH FROM (NOW() - INTERVAL '6 days'))::bigint, NOW() - INTERVAL '4 days', @@ -457,7 +457,7 @@ INSERT INTO bounty ( '2023-12-30', 12500, 375000, 'Setup a Rust Rocket Web Server', 'rust-server', '0430a9b0f2a0bad383b1b3a1989571b90f7486a86629e040c603f6f9ecec857505fd2b1279ccce579dbe59cc88d8d49b7543bd62051b1417cafa6bb2e4fd011d30', 'https://github.com/org/repo/issues/21', 'workspace-uuid-123', '', 'We need an Http Server the web and mobile app can connect', 'backend', - 'Setup Unit and Integration test', true, 'Setup the Backend Server', + 'Setup Unit and Integration test', true, '8 days', '2023-12-10', EXTRACT(EPOCH FROM (NOW() - INTERVAL '15 days'))::bigint, NOW() - INTERVAL '13 days', diff --git a/handlers/bounties.go b/handlers/bounties.go index 455f7c68f..0d06fac2b 100644 --- a/handlers/bounties.go +++ b/handlers/bounties.go @@ -191,13 +191,6 @@ func MigrateBounties(w http.ResponseWriter, r *http.Request) { migrateBountyFinal.GithubDescription = GithuDescription } - OneSentenceSummary, ok15 := migrateBounty["one_sentence_summary"].(string) - if !ok15 { - migrateBountyFinal.OneSentenceSummary = "" - } else { - migrateBountyFinal.OneSentenceSummary = OneSentenceSummary - } - EstimatedSessionLength, ok16 := migrateBounty["estimated_session_length"].(string) if !ok16 { migrateBountyFinal.EstimatedSessionLength = "" diff --git a/handlers/bounty.go b/handlers/bounty.go index aeba337e0..7eec6369b 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -829,7 +829,7 @@ func (h *bountyHandler) GenerateBountyResponse(bounties []db.NewBounty) []db.Bou WantedType: bounty.WantedType, Deliverables: bounty.Deliverables, GithubDescription: bounty.GithubDescription, - OneSentenceSummary: bounty.OneSentenceSummary, + OneSentenceSummary: bounty.Title, EstimatedSessionLength: bounty.EstimatedSessionLength, EstimatedCompletionDate: bounty.EstimatedCompletionDate, OrgUuid: bounty.WorkspaceUuid, diff --git a/handlers/features_test.go b/handlers/features_test.go index 553d73f29..ad17e4006 100644 --- a/handlers/features_test.go +++ b/handlers/features_test.go @@ -2800,7 +2800,7 @@ func TestGetBountiesByFeatureAndPhaseUuid(t *testing.T) { WantedType: "", Deliverables: "", GithubDescription: false, - OneSentenceSummary: "", + OneSentenceSummary: "test-bounty", EstimatedSessionLength: "", EstimatedCompletionDate: "", Created: 0, diff --git a/mocks/Database.go b/mocks/Database.go index 5c98b7f66..15f0a18b8 100644 --- a/mocks/Database.go +++ b/mocks/Database.go @@ -5696,6 +5696,62 @@ func (_c *Database_GetBountyByCreated_Call) RunAndReturn(run func(uint) (db.NewB return _c } +// GetBountyByUnlockCode provides a mock function with given fields: code +func (_m *Database) GetBountyByUnlockCode(code string) (db.NewBounty, error) { + ret := _m.Called(code) + + if len(ret) == 0 { + panic("no return value specified for GetBountyByUnlockCode") + } + + var r0 db.NewBounty + var r1 error + if rf, ok := ret.Get(0).(func(string) (db.NewBounty, error)); ok { + return rf(code) + } + if rf, ok := ret.Get(0).(func(string) db.NewBounty); ok { + r0 = rf(code) + } else { + r0 = ret.Get(0).(db.NewBounty) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(code) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Database_GetBountyByUnlockCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBountyByUnlockCode' +type Database_GetBountyByUnlockCode_Call struct { + *mock.Call +} + +// GetBountyByUnlockCode is a helper method to define mock.On call +// - code string +func (_e *Database_Expecter) GetBountyByUnlockCode(code interface{}) *Database_GetBountyByUnlockCode_Call { + return &Database_GetBountyByUnlockCode_Call{Call: _e.mock.On("GetBountyByUnlockCode", code)} +} + +func (_c *Database_GetBountyByUnlockCode_Call) Run(run func(code string)) *Database_GetBountyByUnlockCode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Database_GetBountyByUnlockCode_Call) Return(_a0 db.NewBounty, _a1 error) *Database_GetBountyByUnlockCode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Database_GetBountyByUnlockCode_Call) RunAndReturn(run func(string) (db.NewBounty, error)) *Database_GetBountyByUnlockCode_Call { + _c.Call.Return(run) + return _c +} + // GetBountyById provides a mock function with given fields: id func (_m *Database) GetBountyById(id string) ([]db.NewBounty, error) { ret := _m.Called(id) @@ -18423,4 +18479,4 @@ func (_c *Database_DeleteBountyStakeProcess_Call) Return(_a0 error) *Database_De func (_c *Database_DeleteBountyStakeProcess_Call) RunAndReturn(run func(uuid.UUID) error) *Database_DeleteBountyStakeProcess_Call { _c.Call.Return(run) return _c -} \ No newline at end of file +}