@@ -3,6 +3,7 @@ const path = require('path');
33const fb = require ( 'firebase-admin' ) ;
44const serviceAccount = require ( '../private/service-account.json' ) ;
55const downloadUsers = require ( './utils/downloadUsers' ) ;
6+ const isProfileComplete = require ( '../functions/utilities/profileComplete' ) ;
67
78const run = async ( ) => {
89 let users = await downloadUsers ( ) ;
@@ -11,15 +12,15 @@ const run = async () => {
1112 const accounts = JSON . parse ( fs . readFileSync ( file ) ) . users ;
1213
1314 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' ;
1516
1617 for ( let a of accounts ) {
1718 const u = users [ a . localId ] ;
1819 if ( ! u ) continue ;
1920 if ( u . code ) {
2021 teachers += `"${ a . email } ","${ u . first } ","${ u . last } ","${ u . schoolName || '' } ","${ u . phoneNumber || '' } ","${ u . postCode || '' } ","${ u . code || '' } ","${ a . localId || '' } "\n` ;
2122 } 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` ;
2324 }
2425 }
2526
0 commit comments