User creations logic in comments.

This commit is contained in:
ogerly 2021-11-24 10:41:34 +01:00
parent c2c03d1032
commit f3cd722e9f

View File

@ -32,6 +32,13 @@ export class AdminResolver {
// TODO: Check user validity
const userRepository = getCustomRepository(UserRepository)
const user = await userRepository.findByEmail(email)
// TODO: Check user open creation state (Open creation)
// SELECT * FROM transaction_creations WHERE state_user_id = loginUser.id AND target_date > Date - 2 Monat
// SELECT * FROM pending_creations WHERE userId = loginUser.id
// COUNT amount from 2 tables
// if amount < 3000 => Store in pending_creations
const creations = getUserCreations(user.id)
// UserAdmin.creations()
return true
}
}