feat: add serializers and details page view for sellers
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 2m3s
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 2m3s
This commit is contained in:
parent
1a0cca1eeb
commit
593c108c12
2 changed files with 6 additions and 19 deletions
|
|
@ -246,20 +246,7 @@ class SupplierProfileDetailSerializer(serializers.ModelSerializer):
|
|||
def get_documents(self, obj):
|
||||
docs = []
|
||||
|
||||
# 1. Aadhaar Card
|
||||
aadhar_key = obj.aadhar_s3_key or obj.aadhar_file
|
||||
if aadhar_key or obj.phone_verified:
|
||||
docs.append({
|
||||
"id": "aadhar",
|
||||
"name": "Aadhaar Card / e-Aadhaar Verification",
|
||||
"key": aadhar_key or "aadhaar_xml_verified",
|
||||
"type": "aadhar",
|
||||
"is_verified": obj.phone_verified or obj.is_verified,
|
||||
"status_text": "Aadhaar Verified" if (obj.phone_verified or obj.is_verified) else "Pending Verification",
|
||||
"preview_url": f"/api/sellers/{obj.id}/documents/preview/?file={aadhar_key or 'aadhaar.pdf'}",
|
||||
})
|
||||
|
||||
# 2. PAN Card
|
||||
# 1. PAN Card
|
||||
pan_key = obj.pan_s3_key or obj.pan_file
|
||||
if pan_key or obj.pan_number:
|
||||
docs.append({
|
||||
|
|
@ -274,7 +261,7 @@ class SupplierProfileDetailSerializer(serializers.ModelSerializer):
|
|||
"preview_url": f"/api/sellers/{obj.id}/documents/preview/?file={pan_key or f'pan_{obj.pan_number}.pdf'}",
|
||||
})
|
||||
|
||||
# 3. GSTIN Registration Certificate
|
||||
# 2. GSTIN Registration Certificate
|
||||
if obj.gstin:
|
||||
docs.append({
|
||||
"id": "gstin",
|
||||
|
|
@ -288,7 +275,7 @@ class SupplierProfileDetailSerializer(serializers.ModelSerializer):
|
|||
"preview_url": f"/api/sellers/{obj.id}/documents/preview/?file=gst_{obj.gstin}.pdf",
|
||||
})
|
||||
|
||||
# 4. Bank Account Record / Penny-Drop Record
|
||||
# 3. Bank Account Record / Penny-Drop Record
|
||||
if obj.account_number:
|
||||
docs.append({
|
||||
"id": "bank",
|
||||
|
|
@ -304,7 +291,7 @@ class SupplierProfileDetailSerializer(serializers.ModelSerializer):
|
|||
"preview_url": f"/api/sellers/{obj.id}/documents/preview/?file=bank_{obj.account_number}.pdf",
|
||||
})
|
||||
|
||||
# 5. Store Brand Logo
|
||||
# 4. Store Brand Logo
|
||||
logo_key = obj.logo_s3_key or obj.store_logo
|
||||
if logo_key:
|
||||
docs.append({
|
||||
|
|
|
|||
|
|
@ -418,14 +418,14 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
{#if documents.length === 0}
|
||||
{#if documents.filter(d => d.type !== 'aadhar' && d.id !== 'aadhar').length === 0}
|
||||
<div style="text-align:center;padding:40px;background:var(--v2-panel);border:1px solid var(--v2-line);border-radius:8px;">
|
||||
<ShieldCheck size={32} style="color:var(--v2-slate);margin-bottom:8px;" />
|
||||
<p style="font-weight:500;">No uploaded documents recorded for this seller profile.</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));gap:16px;">
|
||||
{#each documents as doc (doc.id)}
|
||||
{#each documents.filter(d => d.type !== 'aadhar' && d.id !== 'aadhar') as doc (doc.id)}
|
||||
<div style="background:var(--v2-panel);border:1px solid var(--v2-line);border-radius:8px;padding:18px;display:flex;flex-direction:column;justify-content:space-between;gap:14px;">
|
||||
<div>
|
||||
<div style="display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:8px;">
|
||||
|
|
|
|||
Loading…
Reference in a new issue