Implement Issue #2: Scheduling & Publishing
Replaces stub schedule CRUD with full shift template + instance system. - DB: add shift_templates, shift_template_roles, shift_template_volunteers, shift_instances, shift_instance_volunteers tables - schedule package: ShiftTemplate and ShiftInstance models with store (generate, publish/unpublish, per-instance edits, volunteer confirmation) - API: shift-templates CRUD + shifts generate/publish/unpublish/update/confirm - Notifications sent on publish (FR-S04), unpublish (FR-S05), instance edit (FR-S09), and volunteer added mid-month (FR-S10) - Frontend: Schedules page with month navigation, template management, publish/unpublish controls, and per-shift edit/confirm - Tests: Go handler tests (14 cases) + React tests (11 cases) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,12 @@ func (s *Store) ListForVolunteer(ctx context.Context, volunteerID int64) ([]Noti
|
||||
return notifications, rows.Err()
|
||||
}
|
||||
|
||||
// CreateNotification satisfies the schedule.Notifier interface.
|
||||
func (s *Store) CreateNotification(ctx context.Context, volunteerID int64, message string) error {
|
||||
_, err := s.Create(ctx, volunteerID, message)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) MarkRead(ctx context.Context, id, volunteerID int64) (*Notification, error) {
|
||||
result, err := s.db.ExecContext(ctx,
|
||||
`UPDATE notifications SET read = 1 WHERE id = ? AND volunteer_id = ?`,
|
||||
|
||||
Reference in New Issue
Block a user