you can ask your question
code review for better reach. from starting what i can see is, this function
archive
is doing a lot of thing, like connection, validation, coversion, insertion, error handling. so this should be avoided in an ideal case as this limit the scope of change and refactor in future. you can read on this
SOLID Prinicipal. PS. in case of software engineering interview, try to corelate the situation with the code strategy, prinicpal —
sahasrara62 15 secs ago