Projet

Général

Profil

PROD V(22) ACTUEL » 5_quiz_5_Allocations_en_espèces_v2.sql

Tarek AOUADI, 15/08/2025 18:06

 
1
use socle;
2
--  quiz 5 Éléments garantis et Allocations”
3
-- 1) Quiz definition
4
INSERT INTO solution_quiz (id, quizCode, quiz_image, averagetime)
5
VALUES
6
  (5, 'quiz_5_Elements_Garantis_Allocations',
7
   'Questionnaire 5.jpg',
8
   20);
9
-- 2) Quiz translations
10
INSERT INTO solution_quiz_translate (quizCode, title, description, short_description, languageId)
11
VALUES
12
  ('quiz_5_Elements_Garantis_Allocations',
13
   'Questionnaire 5 – Éléments garantis et allocations',
14
   'Étude des éléments garantis et allocations en espèces offerts par l’entreprise',
15
   'Étude des éléments garantis et allocations en espèces',
16
   2),
17
  ('quiz_5_Elements_Garantis_Allocations',
18
   'Quiz 5 – Guaranteed Elements and Cash Allowances',
19
   'Survey of guaranteed elements and cash allowances provided by the company',
20
   'Survey of guaranteed elements and cash allowances',
21
   1);
22
-- 3) Sections
23
INSERT INTO solution_quiz_section (sectionCode, quizCode, section_order)
24
VALUES
25
  ('Fixed_Salary_Months',            'quiz_5_Elements_Garantis_Allocations', 1),
26
  ('Transport_Fee_Contribution',     'quiz_5_Elements_Garantis_Allocations', 2),
27
  ('Transport_Allocation_Details',   'quiz_5_Elements_Garantis_Allocations', 3),
28
  ('Housing_Allocation_Details',     'quiz_5_Elements_Garantis_Allocations', 4),
29
  ('Personal_Loans_Details',         'quiz_5_Elements_Garantis_Allocations', 5),
30
  ('Social_Association_Indemnities', 'quiz_5_Elements_Garantis_Allocations', 6);
31
-- 4) Section translations
32
INSERT INTO solution_quiz_section_translate (sectionCode, title, languageId)
33
VALUES
34
  -- English
35
  ('Fixed_Salary_Months',            'Fixed Salary Months',         1),
36
  ('Transport_Fee_Contribution',     'Transport Fee Contribution',  1),
37
  ('Transport_Allocation_Details',   'Transport Allowance Details', 1),
38
  ('Housing_Allocation_Details',     'Housing Allowance Details',   1),
39
  ('Personal_Loans_Details',         'Personal Loans Details',      1),
40
  ('Social_Association_Indemnities', 'Club & Association Indemnities',1),
41
  -- French
42
  ('Fixed_Salary_Months',            'Nombre de mois de salaire',   2),
43
  ('Transport_Fee_Contribution',     'Participation frais transport',2),
44
  ('Transport_Allocation_Details',   'Détails allocation transport',2),
45
  ('Housing_Allocation_Details',     'Détails allocation logement', 2),
46
  ('Personal_Loans_Details',         'Détails prêts personnels',    2),
47
  ('Social_Association_Indemnities', 'Indemnités clubs & associations',2);
48
-- 5) Questions & chart types
49
INSERT INTO solution_quiz_section_questions
50
  (questionCode, sectionCode, quizCode, idparent, type, question_order, echartType)
51
VALUES
52
  -- Section 1
53
  ('Q5-FSM-1',  'Fixed_Salary_Months',            'quiz_5_Elements_Garantis_Allocations', NULL,   'CU', 1,  'Pie'),
54
  -- Section 2
55
  ('Q5-TFC-2',  'Transport_Fee_Contribution',     'quiz_5_Elements_Garantis_Allocations', NULL,   'CU', 2,  'Pie'),
56
  ('Q5-TFC-3',  'Transport_Fee_Contribution',     'quiz_5_Elements_Garantis_Allocations', 'Q5-TFC-2','CM_all',3,  'Bar'),
57
  -- Section 3
58
  ('Q5-TAD-4',  'Transport_Allocation_Details',   'quiz_5_Elements_Garantis_Allocations', NULL,   'CU', 4,  'Pie'),
59
  ('Q5-TAD-5',  'Transport_Allocation_Details',   'quiz_5_Elements_Garantis_Allocations', 'Q5-TAD-4','CM_all',5,  'Bar'),
60
  ('Q5-TAD-6',  'Transport_Allocation_Details',   'quiz_5_Elements_Garantis_Allocations', 'Q5-TAD-4','CM',6,  'Pie'),
61
  ('Q5-TAD-7',  'Transport_Allocation_Details',   'quiz_5_Elements_Garantis_Allocations', 'Q5-TAD-6','CM',7,  'tab_num'),
62
  -- Section 4
63
  ('Q5-HAD-8',  'Housing_Allocation_Details',     'quiz_5_Elements_Garantis_Allocations', NULL,   'CU', 8,  'Pie'),
64
  ('Q5-HAD-9',  'Housing_Allocation_Details',     'quiz_5_Elements_Garantis_Allocations', 'Q5-HAD-8','CM_all',9,  'Bar'),
65
  ('Q5-HAD-10', 'Housing_Allocation_Details',     'quiz_5_Elements_Garantis_Allocations', 'Q5-HAD-8','CU',10, 'Pie'),
66
  ('Q5-HAD-11', 'Housing_Allocation_Details',     'quiz_5_Elements_Garantis_Allocations', 'Q5-HAD-10','CM',11,'tab_num'),
67
  -- Section 5
68
  ('Q5-PLD-12','Personal_Loans_Details',         'quiz_5_Elements_Garantis_Allocations', NULL,   'CU',12, 'Pie'),
69
  ('Q5-PLD-13','Personal_Loans_Details',         'quiz_5_Elements_Garantis_Allocations', 'Q5-PLD-12','CM_all',13,'Bar'),
70
  ('Q5-PLD-14','Personal_Loans_Details',         'quiz_5_Elements_Garantis_Allocations', 'Q5-PLD-12','CM',14,'tab_num'),
71
  ('Q5-PLD-15','Personal_Loans_Details',         'quiz_5_Elements_Garantis_Allocations', 'Q5-PLD-12','CM',15,'tab_num'),
72
  -- Section 6
73
  ('Q5-SAI-16','Social_Association_Indemnities', 'quiz_5_Elements_Garantis_Allocations', NULL,   'CU',16, 'Pie'),
74
  ('Q5-SAI-17','Social_Association_Indemnities', 'quiz_5_Elements_Garantis_Allocations', 'Q5-SAI-16','CM_all',17,'Bar'),
75
  ('Q5-SAI-18','Social_Association_Indemnities', 'quiz_5_Elements_Garantis_Allocations', NULL,   'CU',18, 'Pie'),
76
  ('Q5-SAI-19','Social_Association_Indemnities', 'quiz_5_Elements_Garantis_Allocations', 'Q5-SAI-18','CM_all',19,'Bar');
77
-- French translations for Quiz 5 questions
78
INSERT INTO solution_quiz_section_questions_translate (questionCode, title, languageId)
79
VALUES
80
  ('Q5-FSM-1',  'Nombre de mois de salaire de base fixes versés annuellement', 2),
81
  ('Q5-TFC-2',  'Votre entreprise contibue t-elle aux frais de transport (exp bus de la société…)?', 2),
82
  ('Q5-TFC-3',  'Si oui,  quels niveaux hiérarchiques sont concérnés par cet avantage ? ', 2),
83
  ('Q5-TAD-4',  'Votre entreprise fournit t-elle une allocation de transport (Participation aux frais de transport , allocation en espèce…)?', 2),
84
  ('Q5-TAD-5',  'Si oui,  quels niveaux hiérarchiques  sont concérnés par cet avantage ?', 2),
85
  ('Q5-TAD-6',  'Si oui, sous quelle forme est  accordée cette allocation de transport ?', 2),
86
  ('Q5-TAD-7',  'Quel est le montant moyen mensuel de cette allocation de transport ?', 2),
87
  
88
  ('Q5-HAD-8',  'Votre entreprise fournit-elle une allocation de logement ?', 2),
89
  ('Q5-HAD-9',  ' Si oui,  quels niveaux hiérarchiques  sont concérnés par cet avantage ? ', 2),
90
  ('Q5-HAD-10', 'Si oui, sous quelle forme est  accordée cette allocation de logement?', 2),
91
  ('Q5-HAD-11', 'Quel est le montant moyen mensuel de cette allocation de logement ?', 2),
92
  
93
  ('Q5-PLD-12','Votre entreprise accorde-t-elle des prêts personnels ?', 2),
94
  ('Q5-PLD-13','Si oui,  quels niveaux hiérarchiques  sont concérnés par cet avantage ?', 2),
95
  ('Q5-PLD-14',' Quel est le montant maximum du prêt accordé sous forme de multiple du salaire mensuel ?', 2),
96
  ('Q5-PLD-15','Quel est le délai maximum de remboursement du prêt personnel (nombre de mois)?', 2),
97
  
98
  ('Q5-SAI-16','Votre entreprise accordre t-elle des indemnités pour les clubs sociaux/sportifs ?', 2),
99
  ('Q5-SAI-17','Si oui,  quels niveaux hiérarchiques  sont concérnés par cette indemnité ? ', 2),
100
  ('Q5-SAI-18','Votre entreprise accordre t-elle des indemnités pour l''adhésion à une association professionnelle ?', 2),
101
  ('Q5-SAI-19','Si oui, quels niveaux hiérarchiques sont concernés ?', 2);
102
-- English translations for Quiz 5 questions
103
INSERT INTO solution_quiz_section_questions_translate (questionCode, title, languageId)
104
VALUES
105
  ('Q5-FSM-1',  'Number of fixed base-salary months paid annually', 1),
106
  ('Q5-TFC-2',  'Does your company contribute to transport costs?',    1),
107
  ('Q5-TFC-3',  'If yes, which hierarchical levels are covered?',     1),
108
  ('Q5-TAD-4',  'Does your company provide a transport allowance?',   1),
109
  ('Q5-TAD-5',  'If yes, which hierarchical levels are covered?',     1),
110
  ('Q5-TAD-6',  'In what form is this allowance granted?',            1),
111
  ('Q5-TAD-7',  'What is the average monthly amount?',                1),
112
  ('Q5-HAD-8',  'Does your company provide a housing allowance?',     1),
113
  ('Q5-HAD-9',  'If yes, which hierarchical levels are covered?',     1),
114
  ('Q5-HAD-10', 'In what form is the housing allowance granted?',    1),
115
  ('Q5-HAD-11', 'What is the average monthly amount?',                1),
116
  ('Q5-PLD-12','Does your company grant personal loans?',             1),
117
  ('Q5-PLD-13','If yes, which hierarchical levels are covered?',     1),
118
  ('Q5-PLD-14','Maximum loan amount (multiple of salary)?',          1),
119
  ('Q5-PLD-15','Maximum repayment term (months)?',                   1),
120
  ('Q5-SAI-16','Does your company pay club/sport indemnities?',      1),
121
  ('Q5-SAI-17','If yes, which hierarchical levels are covered?',     1),
122
  ('Q5-SAI-18','Does your company pay professional association indemnities?', 1),
123
  ('Q5-SAI-19','If yes, which hierarchical levels are covered?',     1);
124
  
125
-- 7) New response‐items for Quiz 5
126
INSERT INTO solution_reponses_items (itemCode, itemName)
127
VALUES
128
  ('commercial','commercial'),
129
  ('12_months',        '12'),
130
  ('13_months',        '13'),
131
  ('14_months',        '14'),
132
  ('transport_means',  'Company transport means'),
133
  ('fixed_housing',    'Fixed housing allowance'),
134
  ('housing_provision','Housing provided'),
135
  ('reimbursement_actual_costs',    'Reimbursement of actual costs');
136
-- 8) Translations for those new items
137
INSERT INTO solution_quiz_question_items_translate (itemCode, itemValue, languageId)
138
VALUES
139
  -- months
140
  ('12_months',    '12',                     1),
141
  ('12_months',    '12',                     2),
142
  
143
  ('13_months',    '13',                     1),
144
  ('13_months',    '13',                     2),
145
  
146
  ('14_months',    '14',                     1),
147
  ('14_months',    '14',                     2),
148
  
149
  
150
  -- transport
151
  ('transport_means',  'Company transport means',                               1),
152
  ('transport_means',  'Mise à disposition de moyens de transport (navette…)', 2),
153
  -- housing
154
  ('fixed_housing',    'Fixed housing allowance', 1),
155
  ('fixed_housing',    'Mise à disposition partielle ou totale d''un logement',2),
156
  
157
  ('housing_provision','Housing provided',                                     1),
158
  ('housing_provision','Mise à disposition partielle ou totale d\'un logement',2),
159

    
160
  -- reimbursement
161
  ('reimbursement_actual_costs',    'Reimbursement of actual costs',          1),
162
  ('reimbursement_actual_costs',    'Remboursement des frais réels',          2),
163
  ('commercial', 'Commercial staff', 1),
164
  ('commercial', 'Commercial', 2);
165
  
166
-- 9) Link items to Quiz 5 que stions (ordered Q1 → Q19)
167
INSERT INTO solution_quiz_section_questions_items (itemCode, questionCode, itemParentId, isOther)
168
VALUES
169
  -- Q5-FSM-1
170
  ('12_months',     'Q5-FSM-1',  NULL, 0),
171
  ('13_months',     'Q5-FSM-1',  NULL, 0),
172
  ('14_months',     'Q5-FSM-1',  NULL, 0),
173
  ('other-please-specify',  'Q5-FSM-1',  NULL, 1),
174
  -- Q5-TFC-2
175
  ('yes',           'Q5-TFC-2',  NULL, 0),
176
  ('no',            'Q5-TFC-2',  NULL, 0),
177
  -- Q5-TFC-3
178
  ('executives',          'Q5-TFC-3', 'yes', 0),
179
  ('middle_managers',     'Q5-TFC-3', 'yes', 0),
180
  ('managers',            'Q5-TFC-3', 'yes', 0),
181
  ('commercial',          'Q5-TFC-3', 'yes', 0),
182
  ('professionals',       'Q5-TFC-3', 'yes', 0),
183
  ('support_tech',        'Q5-TFC-3', 'yes', 0),
184
  ('support_professional','Q5-TFC-3', 'yes', 0),
185
  ('labor',               'Q5-TFC-3', 'yes', 0),
186
  -- Q5-TAD-4
187
  ('yes',           'Q5-TAD-4',  NULL, 0),
188
  ('no',            'Q5-TAD-4',  NULL, 0),
189
  -- Q5-TAD-5
190
  ('executives',          'Q5-TAD-5', 'yes', 0),
191
  ('middle_managers',     'Q5-TAD-5', 'yes', 0),
192
  ('managers',            'Q5-TAD-5', 'yes', 0),
193
  ('commercial',          'Q5-TAD-5', 'yes', 0),
194
  ('professionals',       'Q5-TAD-5', 'yes', 0),
195
  ('support_tech',        'Q5-TAD-5', 'yes', 0),
196
  ('support_professional','Q5-TAD-5', 'yes', 0),
197
  ('labor',               'Q5-TAD-5', 'yes', 0),
198
  -- Q5-TAD-6
199
  ('fixed-amount',     'Q5-TAD-6', 'yes', 0),
200
  ('reimbursement_actual_costs',    'Q5-TAD-6', 'yes', 0),
201
  ('transport_means',  'Q5-TAD-6', 'yes', 0),
202
  -- Q5-TAD-7
203
  ('executives',          'Q5-TAD-7', 'fixed-amount', 1),
204
  ('middle_managers',     'Q5-TAD-7', 'fixed-amount', 1),
205
  ('managers',            'Q5-TAD-7', 'fixed-amount', 1),
206
  ('commercial',          'Q5-TAD-7', 'fixed-amount', 1),
207
  ('professionals',       'Q5-TAD-7', 'fixed-amount',1),
208
  ('support_tech',        'Q5-TAD-7', 'fixed-amount', 1),
209
  ('support_professional','Q5-TAD-7', 'fixed-amount', 1),
210
  ('labor',               'Q5-TAD-7', 'fixed-amount', 1),
211
  -- Q5-HAD-8
212
  ('yes',           'Q5-HAD-8',  NULL, 0),
213
  ('no',            'Q5-HAD-8',  NULL, 0),
214
  -- Q5-HAD-9
215
  ('executives',          'Q5-HAD-9', 'yes', 0),
216
  ('middle_managers',     'Q5-HAD-9', 'yes', 0),
217
  ('managers',            'Q5-HAD-9', 'yes', 0),
218
  ('commercial',          'Q5-HAD-9', 'yes', 0),
219
  ('professionals',       'Q5-HAD-9', 'yes', 0),
220
  ('support_tech',        'Q5-HAD-9', 'yes', 0),
221
  ('support_professional','Q5-HAD-9', 'yes', 0),
222
  ('labor',               'Q5-HAD-9', 'yes', 0),
223
  -- Q5-HAD-10
224
  ('fixed-amount',    'Q5-HAD-10', 'yes', 0),
225
  ('housing_provision','Q5-HAD-10', 'yes', 0),
226
  -- Q5-HAD-11
227
  ('executives',          'Q5-HAD-11', 'fixed-amount', 1),
228
  ('middle_managers',     'Q5-HAD-11', 'fixed-amount', 1),
229
  ('managers',            'Q5-HAD-11', 'fixed-amount', 1),
230
  ('commercial',          'Q5-HAD-11', 'fixed-amount', 1),
231
  ('professionals',       'Q5-HAD-11', 'fixed-amount', 1),
232
  ('support_tech',        'Q5-HAD-11', 'fixed-amount', 1),
233
  ('support_professional','Q5-HAD-11', 'fixed-amount', 1),
234
  ('labor',               'Q5-HAD-11', 'fixed-amount', 1),
235
  -- Q5-PLD-12
236
  ('yes',           'Q5-PLD-12', NULL, 0),
237
  ('no',            'Q5-PLD-12', NULL, 0),
238
  -- Q5-PLD-13
239
  ('executives',          'Q5-PLD-13', 'yes', 0),
240
  ('middle_managers',     'Q5-PLD-13', 'yes', 0),
241
  ('managers',            'Q5-PLD-13', 'yes', 0),
242
  ('commercial',          'Q5-PLD-13', 'yes', 0),
243
  ('professionals',       'Q5-PLD-13', 'yes', 0),
244
  ('support_tech',        'Q5-PLD-13', 'yes', 0),
245
  ('support_professional','Q5-PLD-13', 'yes', 0),
246
  ('labor',               'Q5-PLD-13', 'yes', 0),
247
  -- Q5-PLD-14
248
  ('executives',          'Q5-PLD-14', 'yes', 1),
249
  ('middle_managers',     'Q5-PLD-14', 'yes', 1),
250
  ('managers',            'Q5-PLD-14', 'yes', 1),
251
  ('commercial',          'Q5-PLD-14', 'yes', 1),
252
  ('professionals',       'Q5-PLD-14', 'yes', 1),
253
  ('support_tech',        'Q5-PLD-14', 'yes', 1),
254
  ('support_professional','Q5-PLD-14', 'yes', 1),
255
  ('labor',               'Q5-PLD-14', 'yes', 1),
256
  -- Q5-PLD-15
257
  ('executives',          'Q5-PLD-15', 'yes', 1),
258
  ('middle_managers',     'Q5-PLD-15', 'yes', 1),
259
  ('managers',            'Q5-PLD-15', 'yes', 1),
260
  ('commercial',          'Q5-PLD-15', 'yes',1),
261
  ('professionals',       'Q5-PLD-15', 'yes', 1),
262
  ('support_tech',        'Q5-PLD-15', 'yes', 1),
263
  ('support_professional','Q5-PLD-15', 'yes', 1),
264
  ('labor',               'Q5-PLD-15', 'yes', 1),
265
  -- Q5-SAI-16
266
  ('yes',           'Q5-SAI-16', NULL, 0),
267
  ('no',            'Q5-SAI-16', NULL, 0),
268
  -- Q5-SAI-17
269
  ('executives',          'Q5-SAI-17', 'yes', 0),
270
  ('middle_managers',     'Q5-SAI-17', 'yes', 0),
271
  ('managers',            'Q5-SAI-17', 'yes', 0),
272
  ('commercial',          'Q5-SAI-17', 'yes', 0),
273
  ('professionals',       'Q5-SAI-17', 'yes', 0),
274
  ('support_tech',        'Q5-SAI-17', 'yes', 0),
275
  ('support_professional','Q5-SAI-17', 'yes', 0),
276
  ('labor',               'Q5-SAI-17', 'yes', 0),
277
  -- Q5-SAI-18
278
  ('yes',           'Q5-SAI-18', NULL, 0),
279
  ('no',            'Q5-SAI-18', NULL, 0),
280
  -- Q5-SAI-19
281
  ('executives',          'Q5-SAI-19', 'yes', 0),
282
  ('middle_managers',     'Q5-SAI-19', 'yes', 0),
283
  ('managers',            'Q5-SAI-19', 'yes', 0),
284
  ('commercial',          'Q5-SAI-19', 'yes', 0),
285
  ('professionals',       'Q5-SAI-19', 'yes', 0),
286
  ('support_tech',        'Q5-SAI-19', 'yes', 0),
287
  ('support_professional','Q5-SAI-19', 'yes', 0),
288
  ('labor',               'Q5-SAI-19', 'yes', 0);
(22-22/25)