mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
Add holiday management functionality with CRUD operations
- Implement HolidaysController for managing holidays - Create Holiday model with validation for recurrence types - Add holiday form and views for creating, editing, and listing holidays - Integrate holiday checks into customer appointment scheduling - Update locale file for holiday-related labels and error messages - Add migration for holidays table - Update plugin version and add holidays to admin menu
This commit is contained in:
1 parent
9a8787c3da
commit
167e956457
12 files changed
+407
-9
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#The MIT License (MIT)
|
||||
#
|
||||
#Copyright (c) 2026 rick barrette
|
||||
#
|
||||
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
class CreateHolidays < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :holidays do |t|
|
||||
t.string :name, null: false
|
||||
|
||||
# Use date instead of datetime since holidays are full days
|
||||
t.date :exact_date
|
||||
|
||||
# For recurring logic
|
||||
t.boolean :is_recurring, default: false
|
||||
|
||||
# "fixed" (same date every year) or "dynamic" (e.g., 1st Monday)
|
||||
t.string :recurrence_type
|
||||
|
||||
# Fields for dynamic recurring holidays (Labor Day)
|
||||
t.integer :month # e.g., 9 (September)
|
||||
t.integer :day_of_week # e.g., 1 (Monday)
|
||||
t.integer :week_of_month # e.g., 1 (First week)
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user