Ports "گزارش" end to end (D24), the last missing app page.
In the reference this feature computes nothing: Customer\TahesabController
proxies an external accounting system (hesab.henzagold.com and a bare IP at
31.7.68.147:3030) with TLS verification disabled, a bearer token hardcoded in
the source and a URL-embedded secret, keyed on Customer.mcode. The target has
no such system and no mcode, so per the owner's option الف this is built on our
own ledger with no external connection.
API — customer/me/report{,/detail,/balances,/:id}
- one row per CONFIRMED ledger entry with the running gold and rial balance
after it, newest first as the reference displayed it
- only confirmed entries count, the same rule the cached
Customer.goldDebtGrams/fiatDebtRial follow, so the statement's closing
balance agrees with the figure shown everywhere else in the app
- fields the target has no source for (foreign currency, نام کارساخته,
جنس فلز, the external system's internal ids) are null/zero and the UI OMITS
the row rather than rendering a fabricated value (REP-01)
SEC-16, NOT ported: the reference's detail($id) took the factor code from the
URL and performed no ownership check at all — it never consults auth() — so any
signed-in customer could read any other customer's document by guessing a code.
Here the id is only a filter on top of a customerId scope from the token.
Tested in both directions.
Apps (both, template+script byte-identical, per-app styling only)
- ReportView with the reference's two tabs, its card rows and its «جزئیات»
modal; ReportDocument for one document
- routes /report and /report/detail, the latter opening the second tab
- dashboard entry (v1 tile, v2 row), shown to every signed-in customer since
the reference's hasMCode() gate has no target equivalent
Verified: build 5/5 · jest 45/45 · report 40/40 (new) ·
complete-profile 38/38 · apps smoke 43/43 · typecheck clean on all four apps.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 lines
658 B
JavaScript
2 lines
658 B
JavaScript
import{d as r,l as c,a2 as p,ap as l,aq as d,$ as i,ar as u,as as m,ad as f,at as e,ac as g,ak as k}from"./index-DXb_5IMH.js";const[h,P]=g("notify"),w=["lockScroll","position","show","teleport","zIndex"],y=i({},u,{type:e("danger"),color:String,message:f,position:e("top"),className:m,background:String,lockScroll:Boolean});var S=r({name:h,props:y,emits:["update:show"],setup(a,{emit:s,slots:o}){const t=n=>s("update:show",n);return()=>c(d,p({class:[P([a.type]),a.className],style:{color:a.color,background:a.background},overlay:!1,duration:.2,"onUpdate:show":t},l(a,w)),{default:()=>[o.default?o.default():a.message]})}});const b=k(S);export{b as N,S as s};
|