# ---------------------------------------------------------------------------------------------
# DO NOT EDIT THIS FILE, INSTEAD CREATE THE FILE "local.yaml" AND ADD YOUR SETTINGS IN THERE.
# See https://www.kimai.org/documentation/local-yaml.html
#
# Be aware that this file is YAML format and the indentation is important.
# Each config level needs to be indented with 4 additional spaces.
# ---------------------------------------------------------------------------------------------
kimai:

# --------------------------------------------------------------------------------
# AUTHENTICATION
# --------------------------------------------------------------------------------
#    user:
#        registration: false
#        password_reset: true
# --------------------------------------------------------------------------------


# --------------------------------------------------------------------------------
# TIME-TRACKING
# --------------------------------------------------------------------------------
    timesheet:

        # Allows to render timesheet descriptions with markdown
        # This setting can be changed through the Administration screen
        # markdown_content: false

        # Configures the duration drop-down select.
        # null = use rounding rules, 0 = deactivate, every other number is used as minute/step increment
        # duration_increment: ~

        # Configures the minute select for begin and end date-time.
        # null = use rounding rules, every number > 0 is used as minute/step increment
        # time_increment: ~

        # The time-tracking mode that should be used.
        # mode: default

        # The default time to pre-fill the "create timesheet" form (in some cases).
        # This setting is only respected by some time-tracking modes and not in all situations.
        #
        # Accepted formats, see
        # - https://www.php.net/manual/en/datetime.formats.php
        # - https://www.php.net/manual/en/datetime.formats.time.php
        # default_begin: now

        # Rounding rules are used to round the begin & end dates and the duration for timesheet records.
        # The "default" rule will round "begin" down and "end" up to the full minute, the "duration" will not be rounded.
        # rounding:
        #    default:
        #        days: ['monday','tuesday','wednesday','thursday','friday','saturday','sunday']
        #        begin: 1
        #        end: 1
        #        duration: 0
        #        mode: default

        # If you want to apply different hourly rates for specific weekdays, you can uncomment the "rates" configuration.
        # The "weekend" rule will add 50% to each timesheet entry that will be recorded on "saturdays" or "sundays".
        # rates:
        #    weekend:
        #        days: ['saturday','sunday']
        #        factor: 1.5

        # If you want to limit the max. active entries per user, you can do it here.
        # The hard_limit is used to detect how many active records are allowed per user:
        # - by default a user can only have one active time-record: it is automatically stopped when a new one is started
        # - when hard_limit is > 1 and the user is trying to start a new entry after reaching the limit, a warning is shown
        #   and the user has to stop an active entry first
        # active_entries:
        #    hard_limit: 3
# --------------------------------------------------------------------------------


# --------------------------------------------------------------------------------
# PERMISSIONS
# --------------------------------------------------------------------------------
    permissions:
        # mapping a "set name" to an array of "permission names"
        sets:
            ACTIVITIES: ['view_activity','create_activity','edit_activity','budget_activity','time_activity','delete_activity','permissions_activity']
            ACTIVITIES_ALL_TEAMLEAD: ['view_teamlead_activity','edit_teamlead_activity','budget_teamlead_activity','time_teamlead_activity','permissions_teamlead_activity']
            ACTIVITIES_ALL_TEAM: ['view_team_activity','edit_team_activity','budget_team_activity','time_team_activity']
            ACTIVITIES_TEAMLEAD: ['view_teamlead_activity','create_activity','edit_teamlead_activity','budget_teamlead_activity','time_teamlead_activity']
            PROJECTS: ['view_project','create_project','edit_project','budget_project','time_project','delete_project','permissions_project','comments_project','details_project']
            PROJECTS_ALL_TEAMLEAD: ['view_teamlead_project','edit_teamlead_project','budget_teamlead_project','time_teamlead_project','permissions_teamlead_project','comments_teamlead_project','details_teamlead_project']
            PROJECTS_ALL_TEAM: ['view_team_project','edit_team_project','budget_team_project','time_team_project','comments_team_project','details_team_project']
            PROJECTS_TEAMLEAD: ['view_teamlead_project','budget_teamlead_project','time_teamlead_project','comments_teamlead_project','details_teamlead_project']
            CUSTOMERS: ['view_customer','create_customer','edit_customer','budget_customer','time_customer','delete_customer','permissions_customer','comments_customer','details_customer']
            CUSTOMERS_ALL_TEAMLEAD: ['view_teamlead_customer','edit_teamlead_customer','budget_teamlead_customer','time_teamlead_customer','permissions_teamlead_customer','comments_teamlead_customer','details_teamlead_customer']
            CUSTOMERS_ALL_TEAM: ['view_team_customer','edit_team_customer','budget_team_customer','time_team_customer','comments_team_customer','details_team_customer']
            CUSTOMERS_TEAMLEAD: ['view_teamlead_customer','budget_teamlead_customer','time_teamlead_customer','comments_teamlead_customer','details_teamlead_customer']
            INVOICE: ['view_invoice','create_invoice']
            INVOICE_ADMIN: ['manage_invoice_template']
            INVOICE_ALL: ['delete_invoice']
            TIMESHEET: ['view_own_timesheet','start_own_timesheet','stop_own_timesheet','create_own_timesheet','edit_own_timesheet','export_own_timesheet','delete_own_timesheet','weekly_own_timesheet']
            TIMESHEET_OTHER: ['view_other_timesheet','start_other_timesheet','stop_other_timesheet','create_other_timesheet','edit_other_timesheet','export_other_timesheet','delete_other_timesheet']
            PROFILE: ['view_own_profile','edit_own_profile','password_own_profile','preferences_own_profile','api-token_own_profile']
            PROFILE_OTHER: ['view_other_profile','edit_other_profile','password_other_profile','roles_other_profile','preferences_other_profile','api-token_other_profile','teams_other_profile','supervisor_other_profile']
            TAGS: ['view_tag','manage_tag','create_tag','delete_tag']
            USER: ['view_user','create_user','delete_user','role_permissions']
            RATE: ['view_rate_own_timesheet','edit_rate_own_timesheet']
            RATE_OTHER: ['view_rate_other_timesheet','edit_rate_other_timesheet']
            EXPORT: ['create_export','edit_export_own_timesheet','edit_export_other_timesheet']
            BILLABLE: ['edit_billable_own_timesheet','edit_billable_other_timesheet']
            TEAMS: ['view_team','create_team','edit_team','delete_team']
            LOCKDOWN: ['lockdown_grace_timesheet','lockdown_override_timesheet']
            REPORTING: ['view_reporting','view_other_reporting','project_reporting','customer_reporting']
            # permissions which are deactivated, as these features are hidden for now
            # brave users can try to activate them and be surprised what happens
            REGISTER_BETA: []
        # mapping a "role name" to an array of "set names"
        maps:
            ROLE_USER: ['TIMESHEET','PROFILE']
            ROLE_TEAMLEAD: ['ACTIVITIES_TEAMLEAD','PROJECTS_TEAMLEAD','CUSTOMERS_TEAMLEAD','TIMESHEET_OTHER','INVOICE','TIMESHEET','PROFILE','EXPORT','BILLABLE','TAGS','REPORTING']
            ROLE_ADMIN: ['ACTIVITIES','PROJECTS','CUSTOMERS','INVOICE','INVOICE_ADMIN','TIMESHEET','TIMESHEET_OTHER','PROFILE','TEAMS','RATE','RATE_OTHER','EXPORT','BILLABLE','TAGS','LOCKDOWN','REPORTING']
            ROLE_SUPER_ADMIN: ['ACTIVITIES','PROJECTS','CUSTOMERS','INVOICE','INVOICE_ADMIN','TIMESHEET','TIMESHEET_OTHER','PROFILE','PROFILE_OTHER','USER','TEAMS','RATE','RATE_OTHER','EXPORT','BILLABLE','TAGS','LOCKDOWN','REPORTING']
        # mapping a "role name" to an array of "permission names"
        roles:
            ROLE_USER: ['view_team_member','time_team_project','create_tag','view_reporting']
            ROLE_TEAMLEAD: ['view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile','view_team_member']
            ROLE_ADMIN: ['hourly-rate_own_profile','edit_exported_timesheet','teams_own_profile','view_team_member','view_all_data','contract_other_profile']
            ROLE_SUPER_ADMIN: ['hourly-rate_own_profile','hourly-rate_other_profile','roles_own_profile','supervisor_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet','teams_own_profile','view_team_member','upload_invoice_template','view_all_data','contract_other_profile']
# --------------------------------------------------------------------------------


# --------------------------------------------------------------------------------
# CALENDAR Configuration
# --------------------------------------------------------------------------------
#    calendar:
#        week_numbers: true
#        weekends: true
#        day_limit: 4
#        slot_duration: '00:30:00'
#        businessHours:
#            begin: '08:00'
#            end: '18:00'
#        visibleHours:
#            begin: '00:00'
#            end: '24:00'
#
#        # You can configure unlimited google calendars to display events for your company (e.g. holidays)
#        google:
#            api_key: 'your-restricted-google-api-key'
#            sources:
#                holidays:
#                    id: 'de.german#holiday@group.v.calendar.google.com'
#                    color: '#ccc'
# --------------------------------------------------------------------------------


# --------------------------------------------------------------------------------
# INVOICES
# --------------------------------------------------------------------------------
#   invoice:
#       # all files in these directories will be used as invoice documents (if supported by a renderer)
#       documents:
#           - 'var/invoices/'
#           - 'templates/invoice/renderer/'
#       # allow to upload twig templates as invoice documents
#       upload_twig: true
# --------------------------------------------------------------------------------


when@test:
    kimai:
        data_dir: '%kernel.project_dir%/tests/_data'
        permissions:
            roles:
                ROLE_ADMIN: ['contract_other_profile']
                ROLE_SUPER_ADMIN: ['contract_other_profile']
