Projet

Général

Profil

PROD V(22) ACTUEL » 5_quiz_8_Heures de travail_v2.sql

Tarek AOUADI, 15/08/2025 18:06

 
1
use salarymarket;
2
-- 1) Quiz definition
3
INSERT INTO solution_quiz (id, quizCode, quiz_image, averagetime)
4
VALUES
5
  (8, 'quiz_8_Heures_de_travail', 'Questionnaire 8.png', 15);
6
-- 2) Quiz translations
7
INSERT INTO solution_quiz_translate (quizCode, title, description, short_description, languageId)
8
VALUES
9
  ('quiz_8_Heures_de_travail',
10
   'Questionnaire 8 – Heures de travail',
11
   'Étude des politiques et pratiques d’aménagement des heures de travail',
12
   'Étude des politiques et pratiques d’aménagement des heures de travail',
13
   2),
14
  ('quiz_8_Heures_de_travail',
15
   'Quiz 8 – Working Hours Policy Survey',
16
   'Survey of working hours and flexible work arrangements',
17
   'Survey of working hours and flexible work arrangements',
18
   1);
19
-- 3) Section
20
INSERT INTO solution_quiz_section (sectionCode, quizCode, section_order)
21
VALUES
22
  ('Working_Hours_Policy', 'quiz_8_Heures_de_travail', 1);
23
-- 4) Section translations
24
INSERT INTO solution_quiz_section_translate (sectionCode, title, languageId)
25
VALUES
26
  ('Working_Hours_Policy', 'Working Hours Policy', 1),
27
  ('Working_Hours_Policy', 'Politique d’aménagement des heures de travail', 2);
28
-- 5) Questions & chart types
29
INSERT INTO solution_quiz_section_questions
30
  (questionCode, sectionCode, quizCode, idparent, type, question_order, echartType)
31
VALUES
32
  ('Q8-WHP-1', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CM', 1, 'Bar'),
33
  ('Q8-WHP-2', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 2, 'Pie'),
34
  ('Q8-WHP-3', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 3, 'Pie'),
35
  ('Q8-WHP-4', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-3', 'CM', 4, 'Bar'),
36
  ('Q8-WHP-5', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 5, 'Pie'),
37
  ('Q8-WHP-6', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-5', 'CM', 6, 'Bar'),
38
  ('Q8-WHP-7', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-6', 'CU', 7, 'Pie'),
39
  ('Q8-WHP-8', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-6', 'CM', 8, 'Bar'),
40
  ('Q8-WHP-9', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-6', 'CM', 9, 'Pie'),
41
  ('Q8-WHP-10', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-6', 'CU', 10, 'Bar'),
42
  ('Q8-WHP-11', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 11, 'Pie'),
43
  ('Q8-WHP-12', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 12, 'Pie'),
44
  ('Q8-WHP-13', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-12', 'CM', 13, 'Bar'),
45
  ('Q8-WHP-14', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-12', 'CM', 14, 'Bar'),
46
  ('Q8-WHP-15', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', NULL, 'CU', 15, 'Pie'),
47
  ('Q8-WHP-16', 'Working_Hours_Policy', 'quiz_8_Heures_de_travail', 'Q8-WHP-15', 'CU', 16, 'Pie');
48
-- 6) Question translations (French & English)
49
INSERT INTO solution_quiz_section_questions_translate (questionCode, title, languageId)
50
VALUES
51
  ('Q8-WHP-1', 'Quels sont les lieux et endroits de travail autorisés par votre Entreprise ?', 2),
52
  ('Q8-WHP-1', 'What are the authorized workplaces and locations in your company?', 1),
53
  ('Q8-WHP-2', 'Quel est le régime horaire hebdomadaire adopté par votre Entreprise ?', 2),
54
  ('Q8-WHP-2', 'What is the weekly working hours regime adopted by your company?', 1),
55
  ('Q8-WHP-3', 'Les heures supplémentaires sont-elles autorisées dans votre entreprise ?', 2),
56
  ('Q8-WHP-3', 'Are overtime hours allowed in your company?', 1),
57
  ('Q8-WHP-4', 'Quels sont les postes éligibiles aux heures supplémentaires ?', 2),
58
  ('Q8-WHP-4', 'Which positions are eligible for overtime?', 1),
59
  ('Q8-WHP-5', 'Existe-t-il une politique formalisée de flexibilité des horaires dans votre Entreprise?', 2),
60
  ('Q8-WHP-5', 'Is there a formalized flexible hours policy in your company?', 1),
61
  ('Q8-WHP-6', 'Quels types d\'aménagements flexibles sont proposés ?', 2),
62
  ('Q8-WHP-6', 'What types of flexible arrangements are offered?', 1),
63
  ('Q8-WHP-7', 'Le Télétravail est-il applicable à l\'ensemble des collaborateurs de votre Entreprise ?', 2),
64
  ('Q8-WHP-7', 'Is telework applicable to all employees in your company?', 1),
65
  ('Q8-WHP-8', 'Quelles sont les catégories professionnelles concernées par le Télétravail ?', 2),
66
  ('Q8-WHP-8', 'Which professional categories are concerned by telework?', 1),
67
  ('Q8-WHP-9', 'La prise en charge des frais liés au télétravail est-elle prévue par votre politique interne ?', 2),
68
  ('Q8-WHP-9', 'Is the coverage of telework-related expenses provided for by your internal policy?', 1),
69
  ('Q8-WHP-10', 'Nombre de jours télétravaillables par semaine autorisés ?', 2),
70
  ('Q8-WHP-10', 'Number of teleworkable days per week allowed?', 1),
71
  ('Q8-WHP-11', 'Des horaires spécifiques sont-ils appliqués durant le mois de Ramadan ?', 2),
72
  ('Q8-WHP-11', 'Are specific hours applied during Ramadan?', 1),
73
  ('Q8-WHP-12', 'Est-ce que l\'organisation adopte une séance unique pendant l\'été?', 2),
74
  ('Q8-WHP-12', 'Does the organization adopt a single session during summer?', 1),
75
  ('Q8-WHP-13', 'A quelle heure commence la journée de travail en séance unique ?', 2),
76
  ('Q8-WHP-13', 'At what time does the single-session workday start?', 1),
77
  ('Q8-WHP-14', 'A quelle heure se termine la journée de travail en séance unique ?', 2),
78
  ('Q8-WHP-14', 'At what time does the single-session workday end?', 1),
79
  ('Q8-WHP-15', 'Votre organisation pratique-t-elle le travail alterné (Travail par shift)?', 2),
80
  ('Q8-WHP-15', 'Does your organization practice alternating work (shift work)?', 1),
81
  ('Q8-WHP-16', 'Combien de shifts de travail sont proposés au sein de votre organisation ?', 2),
82
  ('Q8-WHP-16', 'How many work shifts are offered in your organization?', 1);
83
-- 7) Only insert new items (with English names, standardized codes)
84
INSERT INTO solution_reponses_items (itemCode, itemName)
85
VALUES
86
  ('office', 'Office'),
87
  ('factory', 'Factory'),
88
  ('retail_site', 'Retail or Commercial Sites'),
89
  ('regime_48h', '48h regime'),
90
  ('regime_40h', '40h regime'),
91
  ('flexible_hours', 'Flexible hours'),
92
  ('hybrid_week', 'Hybrid work week'),
93
  ('part_time', 'Part-time work'),
94
  ('with_cap', 'Yes, with a defined cap'),
95
  ('without_cap', 'Yes, without a defined cap'),
96
  ('under_conditions', 'Under conditions (please specify)'),
97
  ('one_day', '1 day'),
98
  ('two_days', '2 days'),
99
  ('three_days', '3 days'),
100
  ('seven_h', '7am'),
101
  ('eight_h', '8am'),
102
  ('nine_h', '9am'),
103
  ('fourteen_h', '2pm'),
104
  ('fifteen_h', '3pm'),
105
  ('sixteen_h', '4pm'),
106
  ('two_shifts', '2 shifts'),
107
  ('three_shifts', '3 shifts'),
108
  ('telework', 'Telework');
109
-- 8) Translations for new items (add French for standardized codes if not present)
110
INSERT INTO solution_quiz_question_items_translate (itemCode, itemValue, languageId)
111
VALUES
112
  ('office', 'Bureau', 2), ('office', 'Office', 1),
113
  ('factory', 'Usine', 2), ('factory', 'Factory', 1),
114
  ('retail_site', 'Points de vente ou Sites commerciaux', 2), ('retail_site', 'Retail or Commercial Sites', 1),
115
  ('regime_48h', 'Régime 48h', 2), ('regime_48h', '48h regime', 1),
116
  ('regime_40h', 'Régime 40h', 2), ('regime_40h', '40h regime', 1),
117
  ('flexible_hours', 'Horaire flexible', 2), ('flexible_hours', 'Flexible hours', 1),
118
  ('hybrid_week', 'Semaine de travail hybride', 2), ('hybrid_week', 'Hybrid work week', 1),
119
  ('part_time', 'Travail partiel', 2), ('part_time', 'Part-time work', 1),
120
 
121
  ('with_cap', 'Oui, avec un plafond défini', 2), ('with_cap', 'Yes, with a defined cap', 1),
122
  ('without_cap', 'Oui, sans un plafond défini', 2), 
123
  ('without_cap', 'Yes, without a defined cap', 1),
124
  ('under_conditions', 'Sous conditions (veuillez préciser)', 2), 
125
  ('under_conditions', 'Under conditions (please specify)', 1),
126
  ('one_day', '1 jour', 2), ('one_day', '1 day', 1),
127
  ('two_days', '2 jours', 2), ('two_days', '2 days', 1),
128
  ('three_days', '3 jours', 2), ('three_days', '3 days', 1),
129

    
130
  ('seven_h', '7h', 2), ('seven_h', '7am', 1),
131
  ('eight_h', '8h', 2), ('eight_h', '8am', 1),
132
  ('nine_h', '9h', 2), ('nine_h', '9am', 1),
133

    
134
  ('fourteen_h', '14h', 2), ('fourteen_h', '2pm', 1),
135
  ('fifteen_h', '15h', 2), ('fifteen_h', '3pm', 1),
136
  ('sixteen_h', '16h', 2), ('sixteen_h', '4pm', 1),
137

    
138
  ('two_shifts', '2 shifts', 2), ('two_shifts', '2 shifts', 1),
139
  ('three_shifts', '3 shifts', 2), ('three_shifts', '3 shifts', 1),
140

    
141
  ('telework', 'Télétravail', 2),
142
  ('telework', 'Telework', 1);
143
  -- Standardized codes (add French if not present)
144
-- 9) Link items to Quiz 8 questions (use standardized codes)
145
INSERT INTO solution_quiz_section_questions_items (itemCode, questionCode, itemParentId, isOther)
146
VALUES
147
  -- Q8-WHP-1 (Work locations)
148
  ('office', 'Q8-WHP-1', NULL, 0),
149
  ('factory', 'Q8-WHP-1', NULL, 0),
150
  ('retail_site', 'Q8-WHP-1', NULL, 0),
151
  ('telework', 'Q8-WHP-1', NULL, 0),
152
  ('other-please-specify', 'Q8-WHP-1', NULL, 1),
153
  -- Q8-WHP-2 (Weekly regime)
154
  ('regime_48h', 'Q8-WHP-2', NULL, 0),
155
  ('regime_40h', 'Q8-WHP-2', NULL, 0),
156
  ('other-please-specify', 'Q8-WHP-2', NULL, 1),
157
  -- Q8-WHP-3 (Overtime allowed)
158
  ('yes', 'Q8-WHP-3', NULL, 0),
159
  ('no', 'Q8-WHP-3', NULL, 0),
160
  -- Q8-WHP-4 (Eligible for overtime)
161
  ('executives', 'Q8-WHP-4', 'yes', 0),
162
  ('middle_managers', 'Q8-WHP-4', 'yes', 0),
163
  ('managers', 'Q8-WHP-4', 'yes', 0),
164
  ('professionals', 'Q8-WHP-4', 'yes', 0),
165
  ('support_tech', 'Q8-WHP-4', 'yes', 0),
166
  ('professional_support', 'Q8-WHP-4', 'yes', 0),
167
  ('labor', 'Q8-WHP-4', 'yes', 0),
168
  -- Q8-WHP-5 (Formalized flexible policy)
169
  ('yes', 'Q8-WHP-5', NULL, 0),
170
  ('no', 'Q8-WHP-5', NULL, 0),
171
  -- Q8-WHP-6 (Types of flexible arrangements)
172
  ('flexible_hours', 'Q8-WHP-6', 'yes', 0),
173
  ('telework', 'Q8-WHP-6', 'yes', 0),
174
  ('hybrid_week', 'Q8-WHP-6', 'yes', 0),
175
  ('part_time', 'Q8-WHP-6', 'yes', 0),
176
  ('other-please-specify', 'Q8-WHP-6', 'yes', 1),
177
  -- Q8-WHP-7 (Telework for all)
178
  ('yes', 'Q8-WHP-7', 'telework', 0),
179
  ('no', 'Q8-WHP-7', 'telework', 0),
180
  -- Q8-WHP-8 (Categories for telework)
181
  ('executives', 'Q8-WHP-8', 'telework', 0),
182
  ('middle_managers', 'Q8-WHP-8', 'telework', 0),
183
  ('managers', 'Q8-WHP-8', 'telework', 0),
184
  ('professionals', 'Q8-WHP-8', 'telework', 0),
185
  ('support_tech', 'Q8-WHP-8', 'telework', 0),
186
  ('professional_support', 'Q8-WHP-8', 'telework', 0),
187
  ('labor', 'Q8-WHP-8', 'telework', 0),
188
  -- Q8-WHP-9 (Telework expense coverage)
189
  ('with_cap', 'Q8-WHP-9', 'telework', 0),
190
  ('without_cap', 'Q8-WHP-9', 'telework', 0),
191
  ('under_conditions', 'Q8-WHP-9', 'telework', 1),
192
  ('no', 'Q8-WHP-9', 'telework', 0),
193
  -- Q8-WHP-10 (Teleworkable days)
194
  ('one_day', 'Q8-WHP-10', 'telework', 0),
195
  ('two_days', 'Q8-WHP-10', 'telework', 0),
196
  ('three_days', 'Q8-WHP-10', 'telework', 0),
197
  ('other-please-specify', 'Q8-WHP-10', 'telework', 1),
198
  -- Q8-WHP-11 (Specific Ramadan hours)
199
  ('yes', 'Q8-WHP-11', NULL, 0),
200
  ('no', 'Q8-WHP-11', NULL, 0),
201
  -- Q8-WHP-12 (Single session in summer)
202
  ('yes', 'Q8-WHP-12', NULL, 0),
203
  ('no', 'Q8-WHP-12', NULL, 0),
204
  -- Q8-WHP-13 (Start time single session)
205
  ('seven_h', 'Q8-WHP-13', 'yes', 0),
206
  ('eight_h', 'Q8-WHP-13', 'yes', 0),
207
  ('nine_h', 'Q8-WHP-13', 'yes', 0),
208
  ('other-please-specify', 'Q8-WHP-13', 'yes', 1),
209
  -- Q8-WHP-14 (End time single session)
210
  ('fourteen_h', 'Q8-WHP-14', 'yes', 0),
211
  ('fifteen_h', 'Q8-WHP-14', 'yes', 0),
212
  ('sixteen_h', 'Q8-WHP-14', 'yes', 0),
213
  ('other-please-specify', 'Q8-WHP-14', 'yes', 1),
214
  -- Q8-WHP-15 (Shift work)
215
  ('yes', 'Q8-WHP-15', NULL, 0),
216
  ('no', 'Q8-WHP-15', NULL, 0),
217
  -- Q8-WHP-16 (Number of shifts)
218
  ('two_shifts', 'Q8-WHP-16', 'yes', 0),
219
  ('three_shifts', 'Q8-WHP-16', 'yes', 0),
220
  ('other-please-specify', 'Q8-WHP-16', 'yes', 1);
(25-25/25)