@@ -3,6 +3,7 @@ const path = require('path');
3
3
const fb = require ( 'firebase-admin' ) ;
4
4
const serviceAccount = require ( '../private/service-account.json' ) ;
5
5
const downloadUsers = require ( './utils/downloadUsers' ) ;
6
+ const isProfileComplete = require ( '../functions/utilities/profileComplete' ) ;
6
7
7
8
const run = async ( ) => {
8
9
let users = await downloadUsers ( ) ;
@@ -11,15 +12,15 @@ const run = async () => {
11
12
const accounts = JSON . parse ( fs . readFileSync ( file ) ) . users ;
12
13
13
14
let teachers = 'email,first,last,schoolName,phoneNumber,postCode,teacherCode,uniqueId\n' ;
14
- let students = 'email,first,last,level,birthYear,schoolName,teacherCode,guardianEmail,uniqueId,studentReference\n' ;
15
+ let students = 'email,first,last,level,birthYear,schoolName,teacherCode,guardianEmail,uniqueId,studentReference,schoolEmail,studentPanelConsidered,profileComplete \n' ;
15
16
16
17
for ( let a of accounts ) {
17
18
const u = users [ a . localId ] ;
18
19
if ( ! u ) continue ;
19
20
if ( u . code ) {
20
21
teachers += `"${ a . email } ","${ u . first } ","${ u . last } ","${ u . schoolName || '' } ","${ u . phoneNumber || '' } ","${ u . postCode || '' } ","${ u . code || '' } ","${ a . localId || '' } "\n` ;
21
22
} else {
22
- students += `"${ a . email } ","${ u . first } ","${ u . last } ","${ u . level || '' } ","${ u . birthYear || '' } ","${ u . schoolName || '' } ","${ u . teacherCode || '' } ","${ u . guardianEmail || '' } ","${ a . localId || '' } ","${ u . userReference || '' } "\n` ;
23
+ students += `"${ a . email } ","${ u . first } ","${ u . last } ","${ u . level || '' } ","${ u . birthYear || '' } ","${ u . schoolName || '' } ","${ u . teacherCode || '' } ","${ u . guardianEmail || '' } ","${ a . localId || '' } ","${ u . userReference || '' } "," ${ u . schoolEmail || '' } "," ${ u . studentPanelConsidered || '' } "," ${ isProfileComplete ( u ) ? 1 : 0 } " \n` ;
23
24
}
24
25
}
25
26
0 commit comments