From fc040db1c0353e6b9e0ac1fd8d67920290f7435a Mon Sep 17 00:00:00 2001 From: AMiR Date: Mon, 20 May 2024 21:33:36 +0330 Subject: [PATCH] "fix(repository):fixed scanner benefactor" --- mise.log | 237 ++++++++++++++++++ .../mysql/benefactor/exist_benefactor.go | 9 +- 2 files changed, 242 insertions(+), 4 deletions(-) diff --git a/mise.log b/mise.log index 9f475b0..d7df385 100644 --- a/mise.log +++ b/mise.log @@ -4037,3 +4037,240 @@ "MISE_TRACE": "0", }, } +17:23:42 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-not-found -s bash -- cls +17:23:42 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:23:42 [DEBUG] mise::toolset::builder: Toolset: go@1.21.4 +17:23:42 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:23:42 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:23:44 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:23:44 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:24:28 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-not-found -s bash -- go +17:24:28 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:24:28 [DEBUG] mise::toolset::builder: Toolset: go@1.21.4 +17:24:28 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:24:28 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:29:15 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:29:15 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:30:09 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:30:09 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:30:27 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:30:27 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:30:38 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:30:38 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:31:41 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:31:41 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:31:58 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-not-found -s bash -- cls +17:31:58 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:31:58 [DEBUG] mise::toolset::builder: Toolset: go@1.21.4 +17:31:58 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:31:58 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} +17:32:00 [DEBUG] mise::cli: ARGS: /home/amir/.local/bin/mise hook-env -s bash +17:32:00 [DEBUG] mise::config: Config { + Config Files: [ + "/mnt/d/Meta Course - Practice/Golang/niki/.mise.toml", + ], + Env: { + "GO_ENV": "GOLANG_MISE", + "MISE_USE_TOML": "1", + "RUST_BACKTRACE": "0", + "MISE_VERBOSE": "0", + "MISE_LOG_FILE": "./mise.log", + "MISE_LOG_FILE_LEVEL": "debug", + "MISE_DEBUG": "0", + "MISE_QUIET": "1", + "MISE_ERORR": "1", + "MISE_TRACE": "0", + }, +} diff --git a/repository/mysql/benefactor/exist_benefactor.go b/repository/mysql/benefactor/exist_benefactor.go index ddb0c61..6a68e84 100644 --- a/repository/mysql/benefactor/exist_benefactor.go +++ b/repository/mysql/benefactor/exist_benefactor.go @@ -8,6 +8,7 @@ import ( errmsg "git.gocasts.ir/ebhomengo/niki/pkg/err_msg" richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error" "git.gocasts.ir/ebhomengo/niki/repository/mysql" + "time" ) func (d DB) IsExistBenefactorByPhoneNumber(ctx context.Context, phoneNumber string) (bool, entity.Benefactor, error) { @@ -56,16 +57,16 @@ func (d *DB) IsExistBenefactorByID(ctx context.Context, id uint) (bool, error) { func scanBenefactor(scanner mysql.Scanner) (entity.Benefactor, error) { + var createdAt, updatedAt time.Time var benefactor entity.Benefactor // TODO - use db model and mapper between entity and db model OR use this approach var benefactorNullableFields nullableFields err := scanner.Scan(&benefactor.ID, &benefactorNullableFields.firstName, - &benefactorNullableFields.lastName, &benefactor.PhoneNumber, - &benefactorNullableFields.address, &benefactorNullableFields.description, - &benefactorNullableFields.email, &benefactorNullableFields.city, &benefactorNullableFields.genderStr, - &benefactorNullableFields.birthdate) + &benefactorNullableFields.lastName, &benefactor.PhoneNumber, &benefactorNullableFields.description, + &benefactorNullableFields.email, &benefactorNullableFields.genderStr, + &benefactorNullableFields.birthdate, &createdAt, &updatedAt) mapNotNullToBenefactor(benefactorNullableFields, &benefactor)