Ports "تکمیل پروفایل" end to end (D22). API - POST customer/me/complete-profile — three required document ids, the customer taken from the token, verification step set to the reference's LIVE value (approved outright; its `= 1` line is commented out at :83 in favour of `= 2` at :85). Both SMS messages byte-identical and non-blocking per D20. - POST customer/me/documents — the reference let the app upload through the same file/create the admin used, inside its auth:api-customer group (routes/api.php:95); the target's copy is admin-guarded, so the page could not have uploaded at all. Reuses AdminUploadsService unchanged, so both paths share one size limit, MIME whitelist and naming scheme (UPL-01). - PROFILE_ADMIN_MOBILES replaces the reference's four hardcoded personal numbers; blank means nobody is notified and the upload still succeeds. Three reference behaviours deliberately NOT ported, all in ISSUES.md: - SEC-14: `$customer->update($request->all())` mass-assigned the whole request body, letting the app write its own credit limit, making charge, gold debt, active flag or mobile. Replaced with a three-field whitelist. - SEC-15: four real personal mobiles hardcoded in the source. - APP-03: refresh()'s unterminated setInterval page reload. Apps (both, template+script byte-identical, per-app styling only) - CompleteProfileView + SingleImageUploader - route /complete_profile, redirecting home once the documents are in, as the reference's guard did (router/index.ts:266) - the entry point on the profile screen, shown only while they are missing (profile.vue:96-102) Also (D23): JWT_CUSTOMER_SECRET now warns loudly at boot when unset. It falls back to JWT_SECRET, which signs app and admin tokens with the same key and leaves the `typ` check as the only barrier — and an expert's app token carries their AdminUser id in `sub`. Warn rather than refuse to boot (D19, lowest risk); DELIVERY.md lists it as the first pre-release step (REL-03). Verified: build 5/5 · jest 45/45 · complete-profile 38/38 (new) · expert login 36/36 · apps smoke 43/43 · admin smoke 43/43 · B2B scan 34 ok/0 broken · typecheck clean on all four apps. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 lines
5.7 KiB
JavaScript
2 lines
5.7 KiB
JavaScript
import{d as $,G as B,o as P,c as u,b as s,u as l,k as a,s as d,g as b,C as z,q as k,i as c,t as _,E as g,e as w,I as y,F,r as G,y as U,h as p,v as q,_ as M}from"./index-0lMAZRQB.js";import{S as D}from"./SectionHead-BuisDFZg.js";import{R as H}from"./RateStrip-BT4Y1bag.js";import{_ as I}from"./DialogVant.vue_vue_type_style_index_0_lang-DiDmrjDM.js";import{l as j}from"./dialogEmpty1-Caw7F5KL.js";import{p as A}from"./filters-CLL9nGZ2.js";import{P as W}from"./index-CWibuKdZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";const X="/assets/dialogEmpty5-DWebUDaI.svg",J={class:"dash"},K={class:"dash__bar"},Q={class:"dash__barInner"},Y={key:1,class:"dash__barSpacer","aria-hidden":"true"},Z={key:0,class:"dash__balance"},ss={class:"dash__balanceHead"},es={class:"dash__eyebrow"},ts={class:"dash__figure"},as={class:"dash__balanceRow"},is={class:"dash__rowValue"},os={class:"dash__identity"},ns={class:"dash__name"},ls={class:"dash__mobile"},ds={key:1,class:"dash__invite"},rs={class:"dash__inviteIcon","aria-hidden":"true"},us={class:"dash__section"},cs={class:"dash__grid"},_s=["onClick"],fs={class:"dash__tileIcon","aria-hidden":"true"},ps={class:"dash__tileTitle"},vs={class:"dash__section"},hs=["src"],ms=["src"],bs=$({__name:"DashboardView",setup(gs){const i=U(),f=B(),n=b(null),v=b(null),h=b(!1),m=p(()=>n.value?parseFloat(n.value.goldDebtGrams)>0:!1),S=p(()=>m.value?"بدهکار گرمی":"بستانکار گرمی"),L=p(()=>n.value?Math.abs(parseFloat(n.value.goldDebtGrams)):0),o=z({notify:!1,loginNotify:!1}),x=[{id:0,icon:"vuesax-linear:box",title:"سفارشات",disabled:!1},{id:1,icon:"vuesax-linear:receipt-text",title:"اسناد",disabled:!1},{id:2,icon:"vuesax-linear:user",title:"پروفایل",disabled:!1},{id:3,icon:"vuesax-linear:heart",title:"علاقمندی",disabled:!1}],E=[{id:4,icon:"vuesax-linear:box-tick",title:"سفارش مشتریان",disabled:!1},{id:5,icon:"vuesax-linear:profile-2user",title:"مشتریان من",disabled:!1}],N=p(()=>f.isSalesExpert?[...x,...E]:x);function V(r){if(!f.isLoggedIn){o.loginNotify=!0;return}r===0&&i.push({name:"ordersList"}),r===1&&i.push({name:"transactionsList"}),r===2&&i.push({name:"profileData"}),r===3&&i.push({name:"favoritesList"}),r===4&&i.push({name:"ChildOrder"}),r===5&&i.push({name:"customerChoice"})}function O(){f.logout(),o.notify=!1,i.push({name:"home"})}async function C(){f.isLoggedIn&&(n.value=await k.getMe());try{v.value=await k.getLatestGoldPrice()}catch{v.value=null}}async function R(){await C(),h.value=!1}return P(C),(r,e)=>{const T=q("container");return c(),u("div",J,[s("header",K,[s("div",Q,[e[8]||(e[8]=s("span",{class:"dash__barSpacer","aria-hidden":"true"},null,-1)),e[9]||(e[9]=s("h1",{class:"dash__barTitle"},"میز کار",-1)),l(f).isLoggedIn?(c(),u("button",{key:0,type:"button",class:"dash__barBtn","aria-label":"خروج",onClick:e[0]||(e[0]=t=>o.notify=!0)},[a(y,{icon:"vuesax-linear:logout",size:"19"})])):(c(),u("span",Y))])]),a(l(W),{modelValue:h.value,"onUpdate:modelValue":e[2]||(e[2]=t=>h.value=t),onRefresh:R},{default:d(()=>[a(T,{class:"dash__body"},{default:d(()=>[n.value?(c(),u("section",Z,[s("div",ss,[s("div",null,[s("div",es,_(S.value),1),s("div",ts,[g(_(L.value)+" ",1),e[10]||(e[10]=s("span",{class:"dash__unit"},"گرم",-1))])]),s("span",{class:w(["dash__seal",m.value?"is-debtor":"is-creditor"])},_(m.value?"بدهکار":"بستانکار"),3)]),s("div",as,[e[12]||(e[12]=s("span",{class:"dash__rowLabel"},"بدهی ریالی",-1)),s("span",is,[g(_(l(A)(n.value.fiatDebtRial))+" ",1),e[11]||(e[11]=s("i",null,"ریال",-1))])]),s("div",os,[s("span",ns,_(n.value.fullName),1),s("span",ls,_(l(f).mobile),1)])])):(c(),u("section",ds,[s("div",rs,[a(y,{icon:"vuesax-linear:security-user",size:"20"})]),e[13]||(e[13]=s("div",{class:"dash__inviteCopy"},[s("h3",null,"حساب گرمی شما"),s("p",null,"برای دیدن موجودی، سفارشها و اسناد خود وارد شوید.")],-1)),s("button",{type:"button",class:"dash__inviteCta",onClick:e[1]||(e[1]=t=>l(i).push({name:"login"}))}," ورود / ثبتنام ")])),s("section",us,[a(D,{title:"دسترسیها",subtitle:"بخشهای حساب شما"}),s("div",cs,[(c(!0),u(F,null,G(N.value,t=>(c(),u("button",{key:t.id,type:"button",class:w(["dash__tile",{"is-disabled":t.disabled}]),onClick:ys=>V(t.id)},[s("span",fs,[a(y,{icon:t.icon,size:"20"},null,8,["icon"])]),s("span",ps,_(t.title),1)],10,_s))),128))])]),s("section",vs,[a(D,{title:"نرخ روز",subtitle:"آخرین نرخ اعلامشده"}),a(H,{quote:v.value},null,8,["quote"])])]),_:1})]),_:1},8,["modelValue"]),a(I,{timeOut:-1,show:o.notify,"onUpdate:show":e[4]||(e[4]=t=>o.notify=t),closeOnClickOverlay:!0},{img:d(()=>[s("img",{src:l(X),alt:"",class:"opacity-70 mb-8"},null,8,hs)]),title:d(()=>[...e[14]||(e[14]=[g("آیا می خواهید از برنامه خارج شوید؟",-1)])]),button:d(()=>[s("div",{class:"text-center text-[#1C2D56]",onClick:O},"بله"),s("div",{class:"text-center text-[#6b7280]",onClick:e[3]||(e[3]=t=>o.notify=!1)},"بی خیال")]),_:1},8,["show"]),a(I,{timeOut:-1,show:o.loginNotify,"onUpdate:show":e[7]||(e[7]=t=>o.loginNotify=t),closeOnClickOverlay:!0},{img:d(()=>[s("img",{src:l(j),alt:"",class:"opacity-80"},null,8,ms)]),title:d(()=>[...e[15]||(e[15]=[s("div",{class:"p-8 text-justify"}," برای دسترسی به تمامی امکانات نرم افزار منتزر، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",-1)])]),button:d(()=>[s("div",{class:"text-center text-[#1C2D56]",onClick:e[5]||(e[5]=t=>l(i).push({name:"login"}))},"ورود/ثبت نام"),s("div",{class:"text-center text-danger",onClick:e[6]||(e[6]=t=>o.loginNotify=!1)},"بیخیال")]),_:1},8,["show"])])}}}),Es=M(bs,[["__scopeId","data-v-25cce518"]]);export{Es as default};
|