feat: update API endpoints for company-vendor architecture
- Add transfer-ownership endpoint to companies API - Add user search endpoint for autocomplete (/admin/users/search) - Update company detail endpoint to include owner info and vendors list - Update vendor endpoints to use company relationship for ownership - Update deps.py vendor access check to use company.owner_user_id 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
18
app/api/v1/vendor/info.py
vendored
18
app/api/v1/vendor/info.py
vendored
@@ -92,12 +92,7 @@ def get_vendor_info(
|
||||
subdomain=vendor.subdomain,
|
||||
name=vendor.name,
|
||||
description=vendor.description,
|
||||
owner_user_id=vendor.owner_user_id,
|
||||
contact_email=vendor.contact_email,
|
||||
contact_phone=vendor.contact_phone,
|
||||
website=vendor.website,
|
||||
business_address=vendor.business_address,
|
||||
tax_number=vendor.tax_number,
|
||||
company_id=vendor.company_id,
|
||||
letzshop_csv_url_fr=vendor.letzshop_csv_url_fr,
|
||||
letzshop_csv_url_en=vendor.letzshop_csv_url_en,
|
||||
letzshop_csv_url_de=vendor.letzshop_csv_url_de,
|
||||
@@ -105,7 +100,12 @@ def get_vendor_info(
|
||||
is_verified=vendor.is_verified,
|
||||
created_at=vendor.created_at,
|
||||
updated_at=vendor.updated_at,
|
||||
# Owner details
|
||||
owner_email=vendor.owner.email,
|
||||
owner_username=vendor.owner.username,
|
||||
# Company info
|
||||
company_name=vendor.company.name,
|
||||
company_contact_email=vendor.company.contact_email,
|
||||
company_contact_phone=vendor.company.contact_phone,
|
||||
company_website=vendor.company.website,
|
||||
# Owner details (from company)
|
||||
owner_email=vendor.company.owner.email,
|
||||
owner_username=vendor.company.owner.username,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user