átlagos kiegészítséek jó sok

This commit is contained in:
Roo
2026-03-22 11:02:05 +00:00
parent f53e0b53df
commit 5d44339f21
249 changed files with 20922 additions and 2253 deletions

View File

@@ -9,8 +9,8 @@ from fastapi.encoders import jsonable_encoder
from fastapi import HTTPException, status
from app.models.identity import User, Person, UserRole, VerificationToken, Wallet
from app.models.gamification import UserStats
from app.models.organization import Organization, OrganizationMember, OrgType, Branch
from app.models import UserStats
from app.models.marketplace import Organization, OrganizationMember, OrgType, Branch
from app.schemas.auth import UserLiteRegister, UserKYCComplete
from app.core.security import get_password_hash, verify_password, generate_secure_slug
from app.services.email_manager import email_manager
@@ -41,7 +41,15 @@ class AuthService:
new_person = Person(
first_name=user_in.first_name,
last_name=user_in.last_name,
is_active=False
is_active=False,
identity_docs={}, # EXPLICIT BEÁLLÍTÁS A DB HIBA ELKERÜLÉSÉRE
ice_contact={}, # EXPLICIT BEÁLLÍTÁS A DB HIBA ELKERÜLÉSÉRE
lifetime_xp=0, # default -1, de explicit 0
penalty_points=0, # default -1, de explicit 0
social_reputation=1.0, # default 0.0, de explicit 1.0
is_sales_agent=False, # default True, de explicit False
is_ghost=False,
created_at=datetime.now(timezone.utc)
)
db.add(new_person)
await db.flush()
@@ -58,7 +66,13 @@ class AuthService:
is_deleted=False,
region_code=user_in.region_code,
preferred_language=user_in.lang,
timezone=user_in.timezone
subscription_plan='FREE',
# --- EXPLICIT DEFAULT ÉRTÉKEK A DB HIBA ELKERÜLÉSÉRE ---
is_vip=True, # Changed to True to force inclusion in INSERT
preferred_currency="HUF",
scope_level="individual",
custom_permissions={},
created_at=datetime.now(timezone.utc)
)
db.add(new_user)
await db.flush()
@@ -84,7 +98,7 @@ class AuthService:
# Sentinel Audit Log
await security_service.log_event(
db, user_id=new_user.id, action="USER_REGISTER_LITE",
severity="info", target_type="User", target_id=str(new_user.id),
severity="INFO", target_type="User", target_id=str(new_user.id),
new_data={"email": user_in.email}
)
@@ -136,7 +150,17 @@ class AuthService:
owner_id=user.id,
is_active=True,
status="verified",
country_code=user.region_code
country_code=user.region_code,
# --- EXPLICIT IDŐBÉLYEGEK A DB HIBA ELKERÜLÉSÉRE ---
first_registered_at=datetime.now(timezone.utc),
current_lifecycle_started_at=datetime.now(timezone.utc),
created_at=datetime.now(timezone.utc),
subscription_plan="FREE",
base_asset_limit=1,
purchased_extra_slots=0,
notification_settings={},
external_integration_config={},
is_ownership_transferable=True
)
db.add(new_org)
await db.flush()
@@ -251,7 +275,7 @@ class AuthService:
await security_service.log_event(
db, user_id=actor_id, action="USER_SOFT_DELETE",
severity="warning", target_type="User", target_id=str(user_id),
severity="WARNING", target_type="User", target_id=str(user_id),
new_data={"reason": reason}
)
await db.commit()