This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"uuid": "26b1fcad-2a22-4c0b-91f9-91711154bbab", | |
"auth": { | |
"token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJLV2EyWUhveVNfQ0xtNGZNbFJEcG9zU1Z0b0dUcHZnUUpGVVM0aU1lRGE0In0.eyJleHAiOjE2OTE4MTUzMDQsImlhdCI6MTY5MTcyODkwNCwianRpIjoiZDUzZTQ1ZGYtOTY1Ni00MjRiLWE1MzMtODc1N2YwNjlmZTI1IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrL2F1dGgvcmVhbG1zL3Njb3JpbmctcGxhdGZvcm0tcHJlcHJvZCIsImF1ZCI6WyJzY29yaW5nLXBsYXRmb3JtLXByZXByb2QiLCJhY2NvdW50Il0sInN1YiI6ImRiY2MxMGEzLTkwZDctNDdlZi1iYmQyLThlM2JhZjllNzUxNSIsInR5cCI6IkJlYXJlciIsImF6cCI6InNjb3JpbmctcGxhdGZvcm0tcHJlcHJvZCIsInNlc3Npb25fc3RhdGUiOiI3YWVlYmY1Yy1mYTE4LTRkNTUtYmQxNy1jY2E5NzMwM2E2NDYiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtc2NvcmluZy1wbGF0Zm9ybS1wcmVwcm9kIiwib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJzaWQiOiI3YWVlYmY1Yy1mYTE4LTRkNTUtYmQxNy1jY2E5NzMwM2E2NDYiLCJlbW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"uuid": "26b1fcad-2a22-4c0b-91f9-91711154bbab", | |
"auth": { | |
"token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJLV2EyWUhveVNfQ0xtNGZNbFJEcG9zU1Z0b0dUcHZnUUpGVVM0aU1lRGE0In0.eyJleHAiOjE2OTE4MTUyMzQsImlhdCI6MTY5MTcyODgzNCwianRpIjoiNjVmMjJmY2MtYzc4NC00OGIwLWI0ZmYtMWM1NmQ1YzVlODM2IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrL2F1dGgvcmVhbG1zL3Njb3JpbmctcGxhdGZvcm0tcHJlcHJvZCIsImF1ZCI6WyJzY29yaW5nLXBsYXRmb3JtLXByZXByb2QiLCJhY2NvdW50Il0sInN1YiI6ImRiY2MxMGEzLTkwZDctNDdlZi1iYmQyLThlM2JhZjllNzUxNSIsInR5cCI6IkJlYXJlciIsImF6cCI6InNjb3JpbmctcGxhdGZvcm0tcHJlcHJvZCIsInNlc3Npb25fc3RhdGUiOiJiZDNkZDcyYy02NjI2LTRkODMtOTNlZS1kMDZkNDk4ZjIyNmQiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbImRlZmF1bHQtcm9sZXMtc2NvcmluZy1wbGF0Zm9ybS1wcmVwcm9kIiwib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJzaWQiOiJiZDNkZDcyYy02NjI2LTRkODMtOTNlZS1kMDZkNDk4ZjIyNmQiLCJlbW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
distinct | |
DATE(cc.created_at) as Дата_заявки, | |
count(DISTINCT cc.id) as Дата_подачи_заявки_количество, | |
COUNT(CASE WHEN cc.status = 'FAILED' THEN 1 END) AS Дата_подачи_заявки_и_отказ_попала_в_любую, | |
COUNT(CASE WHEN DATE(cc.updated_at) != DATE(cc.created_at) and cc.status NOT IN ('FAILED', 'ISSUED') THEN 1 END) AS Дата_подачи_заявки_и_не_завершены, | |
COUNT(CASE WHEN DATE(scorin_steps.last_updated_at) != DATE(cc.created_at) and cc.status NOT IN ('FAILED', 'ISSUED') THEN 1 END) AS Проверен_но_не_завершен, | |
COUNT(CASE WHEN cred_admin.last_updated_at is not null and cc.status = 'IN_PROGRESS' THEN 1 END) AS Дата_подачи_заявки_в_CREDIT_ADMIN, | |
count_issued.Все_выданные_с_момента_проекта, | |
COUNT(CASE WHEN DATE(cc.created_at) = DATE(last_step.last_updated_at) and cc.status = 'ISSUED' THEN 1 END) AS Выдано_за_сегодня, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_obligation_response( | |
credit_application_id, | |
code, | |
status, | |
contract_number, | |
sign_date, | |
document_id, | |
record_id = None, | |
application_response_date = None | |
): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_obligation_response( | |
credit_application_id, | |
code, | |
status, | |
contract_number, | |
sign_date, | |
document_id, | |
record_id = None, | |
application_response_date = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_obligation_response( | |
credit_application_id, | |
code, | |
status, | |
contract_number, | |
sign_date, | |
document_id | |
): | |
from apps.credits.models import CreditApplication | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT "credits_creditapplication"."id", | |
"credits_creditapplication"."created_at", | |
"credits_creditapplication"."updated_at", | |
"credits_creditapplication"."status_reason", | |
"credits_creditapplication"."status", | |
"credits_creditapplication"."lead_id", | |
"credits_creditapplication"."flow_id", | |
"credits_creditapplication"."borrower_id", | |
"credits_creditapplication"."borrower_record_id", | |
"credits_creditapplication"."program_id", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.insert(0, '../media') | |
from test import params | |
from apps.credits.models import CreditApplication | |
from datetime import date | |
for i in params: | |
credit = CreditApplication.objects.get(id=i) | |
if credit.status == 'ISSUED': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with late_payment as ( | |
select lp.contract_id, lp.type_send from processing_latepayments lp | |
where lp.type_send = 'NOTICE_OF_THE_TRANSFER_THIRD_PARTY' | |
) | |
select ca.id | |
FROM credits_creditapplication AS ca | |
left join credits_creditcontract cc on cc.application_id = ca.id | |
left join late_payment on late_payment.contract_id = cc.id | |
where | |
late_payment.type_send is not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with late_payment as ( | |
select lp.contract_id, lp.type_send from processing_latepayments lp | |
where lp.type_send = 'NOTICE_OF_THE_TRANSFER_THIRD_PARTY' | |
) | |
select ca.id, ca.status | |
FROM credits_creditapplication AS ca | |
left join credits_creditcontract cc on cc.application_id = ca.id | |
left join late_payment on late_payment.contract_id = cc.id | |
where | |
late_payment.type_send is not null |
NewerOlder