@@ -33,6 +33,21 @@ public class AllStudentLightCollectionGenerateCsvService {
33
33
private final SdcSchoolCollectionStudentSearchService sdcSchoolCollectionStudentSearchService ;
34
34
private final RestUtils restUtils ;
35
35
36
+ private static final String SCHOOL_CODE = "School Code" ;
37
+ private static final String SCHOOL_NAME = "School Name" ;
38
+ private static final String FACILITY_CODE = "Facility Code" ;
39
+
40
+ private static final String PEN = "PEN" ;
41
+ private static final String LEGAL_NAME = "Legal Name" ;
42
+ private static final String USUAL_NAME = "Usual Name" ;
43
+ private static final String FTE = "FTE" ;
44
+ private static final String PROGRAM_ELIGIBLE = "Program Eligible" ;
45
+ private static final String LOCAL_ID = "Local ID" ;
46
+ private static final String ADULT = "Adult" ;
47
+ private static final String GRADUATE = "Graduate" ;
48
+ private static final String GRADE = "Grade" ;
49
+ private static final String FUNDING_CODE = "Funding Code" ;
50
+
36
51
public AllStudentLightCollectionGenerateCsvService (SdcSchoolCollectionStudentSearchService sdcSchoolCollectionStudentSearchService , RestUtils restUtils ) {
37
52
this .sdcSchoolCollectionStudentSearchService = sdcSchoolCollectionStudentSearchService ;
38
53
this .restUtils = restUtils ;
@@ -41,7 +56,7 @@ public AllStudentLightCollectionGenerateCsvService(SdcSchoolCollectionStudentSea
41
56
public DownloadableReportResponse generateErrorWarnInfoReportFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
42
57
List <SdcSchoolCollectionStudentEntity > entities = sdcSchoolCollectionStudentSearchService .findAllStudentsWithErrorsWarningInfoBySchoolCollectionID (sdcSchoolCollectionID );
43
58
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
44
- .setHeader ("Errors & Warnings" , "P.E.N." , "Legal Name" , "Usual Name" , "Birth Date" , "Gender" , "Postal Code" , "Local ID" , "Grade" , "F.T.E." , "Adult" , "Graduate" , "Fee Payer" ,
59
+ .setHeader ("Errors & Warnings" , PEN , LEGAL_NAME , USUAL_NAME , "Birth Date" , "Gender" , "Postal Code" , LOCAL_ID , GRADE , "F.T.E." , ADULT , GRADUATE , "Fee Payer" ,
45
60
"Refugee" , "Indigenous Ancestry" , "Ordinarily Resident on Reserve" , "Band Code" , "Home Language" , "# Courses" , "# Support Blocks" , "# Other Courses" ,
46
61
"Programme Francophone" , "Core French" , "Early Immersion" , "Late Immersion" , "ELL" , "Years in ELL" , "Indigenous Culture/Lang" , "Indigenous Support" , "Indigenous Other" ,
47
62
"Career Prog" , "Career Prep" , "Coop" , "Apprentice" , "CTC - Career Technical C." , "Inclusive Ed Category" )
@@ -69,7 +84,7 @@ public DownloadableReportResponse generateErrorWarnInfoReportFromSdcSchoolCollec
69
84
public DownloadableReportResponse generateFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
70
85
List <SdcSchoolCollectionStudentLightEntity > entities = sdcSchoolCollectionStudentSearchService .findAllStudentsLightBySchoolCollectionID (sdcSchoolCollectionID );
71
86
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
72
- .setHeader ("P.E.N." , "Legal Name" , "Usual Name" , "Birth Date" , "Gender" , "Postal Code" , "Local ID" , "Grade" , "F.T.E." , "Adult" , "Graduate" , "Fee Payer" ,
87
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , "Birth Date" , "Gender" , "Postal Code" , LOCAL_ID , GRADE , "F.T.E." , ADULT , GRADUATE , "Fee Payer" ,
73
88
"Refugee" , "Indigenous Ancestry" , "Ordinarily Resident on Reserve" , "Band Code" , "Home Language" , "# Courses" , "# Support Blocks" , "# Other Courses" ,
74
89
"Programme Francophone" , "Core French" , "Early Immersion" , "Late Immersion" , "ELL" , "Years in ELL" , "Indigenous Culture/Lang" , "Indigenous Support" , "Indigenous Other" ,
75
90
"Career Prog" , "Career Prep" , "Coop" , "Apprentice" , "CTC - Career Technical C." , "Inclusive Ed Category" )
@@ -97,7 +112,7 @@ public DownloadableReportResponse generateFromSdcSchoolCollectionID(UUID sdcScho
97
112
public DownloadableReportResponse generateFrenchFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
98
113
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllFrenchStudentsLightBySchoolCollectionID (sdcSchoolCollectionID );
99
114
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
100
- .setHeader (" PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "French Program" )
115
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "French Program" )
101
116
.build ();
102
117
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
103
118
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -122,7 +137,7 @@ public DownloadableReportResponse generateFrenchFromSdcSchoolCollectionID(UUID s
122
137
public DownloadableReportResponse generateCareerFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
123
138
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllCareerStudentsLightBySchoolCollectionID (sdcSchoolCollectionID );
124
139
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
125
- .setHeader (" PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Career Program" , "Career Code" )
140
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Career Program" , "Career Code" )
126
141
.build ();
127
142
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
128
143
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -147,7 +162,7 @@ public DownloadableReportResponse generateCareerFromSdcSchoolCollectionID(UUID s
147
162
public DownloadableReportResponse generateIndigenousFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
148
163
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllIndigenousStudentsLightBySchoolCollectionID (sdcSchoolCollectionID );
149
164
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
150
- .setHeader (" PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Indigenous Ancestry" , "Band Code" , "Indigenous Support Program" )
165
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Indigenous Ancestry" , "Band Code" , "Indigenous Support Program" )
151
166
.build ();
152
167
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
153
168
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -172,7 +187,7 @@ public DownloadableReportResponse generateIndigenousFromSdcSchoolCollectionID(UU
172
187
public DownloadableReportResponse generateInclusiveFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
173
188
List <SdcSchoolCollectionStudentLightEntity > entities = sdcSchoolCollectionStudentSearchService .findAllInclusiveEdStudentsLightBySchoolCollectionId (sdcSchoolCollectionID );
174
189
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
175
- .setHeader (" PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Inclusive Education Category" )
190
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Inclusive Education Category" )
176
191
.build ();
177
192
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
178
193
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -197,7 +212,7 @@ public DownloadableReportResponse generateInclusiveFromSdcSchoolCollectionID(UUI
197
212
public DownloadableReportResponse generateEllFromSdcSchoolCollectionID (UUID sdcSchoolCollectionID ) {
198
213
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllEllStudentsLightBySchoolCollectionId (sdcSchoolCollectionID );
199
214
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
200
- .setHeader (" PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Language Program" , "Years in ELL" )
215
+ .setHeader (PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Language Program" , "Years in ELL" )
201
216
.build ();
202
217
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
203
218
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -222,7 +237,7 @@ public DownloadableReportResponse generateEllFromSdcSchoolCollectionID(UUID sdcS
222
237
public DownloadableReportResponse generateErrorWarnInfoReportFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
223
238
List <SdcSchoolCollectionStudentEntity > entities = sdcSchoolCollectionStudentSearchService .findAllStudentsWithErrorsWarningInfoByDistrictCollectionID (sdcDistrictCollectionID );
224
239
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
225
- .setHeader ("School Code" , "School Name" , "Facility Type" ,"Errors & Warnings" , "P.E.N." , "Legal Name" , "Usual Name" , "Birth Date" , "Gender" , "Postal Code" , "Local ID" , "Grade" , "F.T.E." , "Adult" , "Graduate" , "Fee Payer" ,
240
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , "Facility Type" ,"Errors & Warnings" , PEN , LEGAL_NAME , USUAL_NAME , "Birth Date" , "Gender" , "Postal Code" , LOCAL_ID , GRADE , "F.T.E." , ADULT , GRADUATE , "Fee Payer" ,
226
241
"Refugee" , "Indigenous Ancestry" , "Ordinarily Resident on Reserve" , "Band Code" , "Home Lang" , "# Courses" , "# Support Blocks" , "# Other Courses" ,
227
242
"Prog Franco" , "Core French" , "Early Immer" , "Late Immer" , "ELL" , "ELL-yrs" , "Indigenous Culture/Lang" , "Indigenous Support" , "Indigenous Other" ,
228
243
"Career Prog" , "Career Prep" , "Coop" , "Apprentice" , "CTC" , "Inclusive Ed Category" )
@@ -250,7 +265,7 @@ public DownloadableReportResponse generateErrorWarnInfoReportFromSdcDistrictColl
250
265
public DownloadableReportResponse generateFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
251
266
List <SdcSchoolCollectionStudentLightEntity > entities = sdcSchoolCollectionStudentSearchService .findAllStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
252
267
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
253
- .setHeader ("School Code" , "School Name" , "Facility Type" , "P.E.N." , "Legal Name" , "Usual Name" , "Birth Date" , "Gender" , "Postal Code" , "Local ID" , "Grade" , "F.T.E." , "Adult" , "Graduate" , "Fee Payer" ,
268
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , "Facility Type" , PEN , LEGAL_NAME , USUAL_NAME , "Birth Date" , "Gender" , "Postal Code" , LOCAL_ID , GRADE , "F.T.E." , ADULT , GRADUATE , "Fee Payer" ,
254
269
"Refugee" , "Indigenous Ancestry" , "Ordinarily Resident on Reserve" , "Band Code" , "Home Lang" , "# Courses" , "# Support Blocks" , "# Other Courses" ,
255
270
"Prog Franco" , "Core French" , "Early Immer" , "Late Immer" , "ELL" , "ELL-yrs" , "Indigenous Culture/Lang" , "Indigenous Support" , "Indigenous Other" ,
256
271
"Career Prog" , "Career Prep" , "Coop" , "Apprentice" , "CTC" , "Inclusive Ed Category" )
@@ -278,7 +293,7 @@ public DownloadableReportResponse generateFromSdcDistrictCollectionID(UUID sdcDi
278
293
public DownloadableReportResponse generateFrenchFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
279
294
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllFrenchStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
280
295
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
281
- .setHeader ("School Code" , "School Name" , "Facility Code" , " PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "French Program" )
296
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , FACILITY_CODE , PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "French Program" )
282
297
.build ();
283
298
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
284
299
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -303,7 +318,7 @@ public DownloadableReportResponse generateFrenchFromSdcDistrictCollectionID(UUID
303
318
public DownloadableReportResponse generateCareerFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
304
319
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllCareerStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
305
320
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
306
- .setHeader ("School Code" , "School Name" , "Facility Code" , " PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Career Program" , "Career Code" )
321
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , FACILITY_CODE , PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Career Program" , "Career Code" )
307
322
.build ();
308
323
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
309
324
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -328,7 +343,7 @@ public DownloadableReportResponse generateCareerFromSdcDistrictCollectionID(UUID
328
343
public DownloadableReportResponse generateIndigenousFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
329
344
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllIndigenousStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
330
345
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
331
- .setHeader ("School Code" , "School Name" , "Facility Code" , " PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" ,
346
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , FACILITY_CODE , PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE ,
332
347
"Indigenous Ancestry" , "Band Code" , "Indigenous Support Program" )
333
348
.build ();
334
349
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
@@ -354,7 +369,7 @@ public DownloadableReportResponse generateIndigenousFromSdcDistrictCollectionID(
354
369
public DownloadableReportResponse generateInclusiveFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
355
370
List <SdcSchoolCollectionStudentLightEntity > entities = sdcSchoolCollectionStudentSearchService .findAllInclusiveEdStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
356
371
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
357
- .setHeader ("School Code" , "School Name" , "Facility Code" , " PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Inclusive Education Category" )
372
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , FACILITY_CODE , PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Inclusive Education Category" )
358
373
.build ();
359
374
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
360
375
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
@@ -379,7 +394,7 @@ public DownloadableReportResponse generateInclusiveFromSdcDistrictCollectionID(U
379
394
public DownloadableReportResponse generateEllFromSdcDistrictCollectionID (UUID sdcDistrictCollectionID ) {
380
395
List <SdcSchoolCollectionStudentLightWithEnrolledProgramCodesEntity > entities = sdcSchoolCollectionStudentSearchService .findAllEllStudentsLightByDistrictCollectionId (sdcDistrictCollectionID );
381
396
CSVFormat csvFormat = CSVFormat .DEFAULT .builder ()
382
- .setHeader ("School Code" , "School Name" , "Facility Code" , " PEN" , "Legal Name" , "Usual Name" , " FTE" , "Program Eligible" , "Local ID" , "Adult" , "Graduate" , "Grade" , "Funding Code" , "Language Program" , "Years in ELL" )
397
+ .setHeader (SCHOOL_CODE , SCHOOL_NAME , FACILITY_CODE , PEN , LEGAL_NAME , USUAL_NAME , FTE , PROGRAM_ELIGIBLE , LOCAL_ID , ADULT , GRADUATE , GRADE , FUNDING_CODE , "Language Program" , "Years in ELL" )
383
398
.build ();
384
399
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ();
385
400
BufferedWriter writer = new BufferedWriter (new OutputStreamWriter (byteArrayOutputStream ));
0 commit comments