diff --git a/firebase-debug.log b/firebase-debug.log new file mode 100644 index 0000000..4c07155 --- /dev/null +++ b/firebase-debug.log @@ -0,0 +1,13 @@ +[debug] [2025-01-05T18:01:58.255Z] ---------------------------------------------------------------------- +[debug] [2025-01-05T18:01:58.257Z] Command: /usr/bin/node /usr/local/bin/firebase login --reauth +[debug] [2025-01-05T18:01:58.257Z] CLI Version: 13.28.0 +[debug] [2025-01-05T18:01:58.257Z] Platform: linux +[debug] [2025-01-05T18:01:58.257Z] Node Version: v18.19.1 +[debug] [2025-01-05T18:01:58.258Z] Time: Sun Jan 05 2025 18:01:58 GMT+0000 (Western European Standard Time) +[debug] [2025-01-05T18:01:58.258Z] ---------------------------------------------------------------------- +[debug] +[info] +[info] Visit this URL on this device to log in: +[info] https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=211115440&redirect_uri=http%3A%2F%2Flocalhost%3A9005&login_hint=carlos.mesquita%40ecrop.dev +[info] +[info] Waiting for authentication... diff --git a/ielts_be/dtos/user_batch.py b/ielts_be/dtos/user_batch.py index 2198f5f..c5cdb06 100644 --- a/ielts_be/dtos/user_batch.py +++ b/ielts_be/dtos/user_batch.py @@ -15,7 +15,7 @@ class Entity(BaseModel): class UserDTO(BaseModel): - id: uuid.UUID = Field(default_factory=uuid.uuid4) + id: str email: str name: str type: str diff --git a/ielts_be/services/impl/user.py b/ielts_be/services/impl/user.py index b150876..deb6fd0 100644 --- a/ielts_be/services/impl/user.py +++ b/ielts_be/services/impl/user.py @@ -45,7 +45,6 @@ class UserService(IUserService): error_msg = f"Couldn't upload users. Failed to run command firebase auth import -> ```cmd {result.stdout}```" self._logger.error(error_msg) return error_msg - await self._init_users(batch_dto) FileHelper.remove_file(path) @@ -68,7 +67,7 @@ class UserService(IUserService): for user in batch_dto.users: user_data = { - 'UID': str(user.id), + 'UID': user.id, 'Email': user.email, 'Email Verified': False, 'Password Hash': user.passwordHash, @@ -142,7 +141,7 @@ class UserService(IUserService): 'subscriptionExpirationDate': user.expiryDate, 'entities': user.entities } - await self._db.save_to_db("users", new_user, str(user.id)) + await self._db.save_to_db("users", new_user, user.id) async def _create_code(self, user: UserDTO, maker_id: str) -> str: code = shortuuid.ShortUUID().random(length=6) @@ -174,6 +173,7 @@ class UserService(IUserService): 'name': user.groupName.strip(), 'participants': [user_id], 'disableEditing': False, + 'entity': user.entities[0]['id'] } await self._db.save_to_db("groups", new_group, str(uuid.uuid4())) else: diff --git a/tmp/110e7ab1-bba5-4768-8775-5e7a37f38a12.csv b/tmp/110e7ab1-bba5-4768-8775-5e7a37f38a12.csv new file mode 100644 index 0000000..164d72e --- /dev/null +++ b/tmp/110e7ab1-bba5-4768-8775-5e7a37f38a12.csv @@ -0,0 +1 @@ +8e44d32a-b921-4650-a0a5-2ad773356b61,batchentitytest1@ecrop.dev,False,5eoALGIXxSmwj8wRc3U7RGFM4tROrWs/+qJv6O9puXKoCCiniWlDQeWnCFXG8RJBrD48Hoqqoojso6rg31bTXA==,s76hIKNUacTPo8JqYx+7NA==,,,,,,,,,,,,,,,,,,,1736100072082,,