generated from moevm/nsql-clean-tempate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
VLADISLAV.BOBKOV
committed
Dec 8, 2024
1 parent
98f5af5
commit c483745
Showing
2 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,16 @@ | |
from mongoengine import connect | ||
from datetime import datetime | ||
from bson import ObjectId | ||
from backend.app.models import Credit, CreditHistory, CreditRequest, Client, Admin, InteractionHistory | ||
from models import Credit, CreditHistory, CreditRequest, Client, Admin, InteractionHistory | ||
|
||
connect(db="credit_database", host="localhost", port=27017) | ||
|
||
def create_sample_data(): | ||
|
||
credits = [ | ||
Credit(_id=ObjectId("64bfe2e30123456789abcdef"), loan_name="Молодежный", amount=5000, interest_rate=5.5, monthly_payment=150).save(), | ||
Credit(_id=ObjectId("64bfe2e40123456789abcdef"), loan_name="Эконом", amount=15000, interest_rate=4.2, monthly_payment=300).save(), | ||
Credit(_id=ObjectId("64bfe2e50123456789abcdef"), loan_name="Ипотека", amount=200000, interest_rate=3.8, monthly_payment=1200).save() | ||
Credit(_id=ObjectId("64bfe2e30123456789abcdef"), loan_name="Молодежный кредит", amount=5000, interest_rate=5.5, monthly_payment=150, expiration_time = 6).save(), | ||
Credit(_id=ObjectId("64bfe2e40123456789abcdef"), loan_name="Автокредит", amount=15000, interest_rate=4.2, monthly_payment=300, expiration_time = 5).save(), | ||
Credit(_id=ObjectId("64bfe2e50123456789abcdef"), loan_name="Ипотека", amount=200000, interest_rate=3.8, monthly_payment=1200, expiration_time = 4).save() | ||
] | ||
|
||
credit_history = [ | ||
|
@@ -43,7 +43,6 @@ def create_sample_data(): | |
Admin(_id=ObjectId("64bfe2e10123456789abcdef"), name="Admin2", email="[email protected]", password="adminpass", interaction_history=[interaction_history[1]]).save(), | ||
Admin(_id=ObjectId("64bfe2e20123456789abcdef"), name="Admin3", email="[email protected]", password="adminpass", interaction_history=[interaction_history[2]]).save() | ||
] | ||
|
||
|
||
|
||
def dump_data_to_json(output_file): | ||
|