DEPLOY-01: docker-compose.yml passed only DATABASE_URL and PORT to the api service, so JWT_SECRET, JWT_CUSTOMER_SECRET, OTP_MASTER_CODE and every SMS_TREZ_* variable were silently dropped in Docker. A deployed build would have used the development JWT fallback and would not have had the delivery master code at all, so the demo login would have failed with no obvious cause. All are now forwarded, defaulting to empty (which the code treats as unset); verified with `docker compose config`. TEST-01: test-sales-expert-roundtrip.cjs had localhost:3077 hardcoded and could only connect by accident. Now defaults to the repo's API_PORT. 33/33. DELIVERY.md documents env vars (names only), run/deploy commands, how migrations run inside the container, the verification results and the known issues. release/delivery contains both parity branches with no conflicts (fast-forward). build 5/5, jest 45/45, admin smoke 43/43, apps smoke 43/43, B2B scan 34/34, B2B writes 25/25, auth-smoke 32/32, typecheck clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
import{d as ve,u as me,v as fe,x as p,a as f,w as s,i as v,l as i,r as c,o,c as n,n as C,f as _,b as B,h,E as J,D as K,F as T,e as Q,t as N,z as d}from"./index-JKzARUiG.js";import{u as _e}from"./useDeleteHandler-Ddu12Nud.js";import{_ as ye}from"./ImageUploadInput.vue_vue_type_script_setup_true_lang-CHSXOCGA.js";import{_ as ge}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ke={class:"row"},Ce={class:"row"},be={class:"mt-4 tags"},we={class:"mobile-c"},xe={class:"row"},Be={class:"row mt-4"},Ee={class:"row"},Ie=ve({__name:"Const",setup($e){const R=me(),y=t=>!!R.hasPermission(t),A=i(!1),S=i([]),b=i(""),E=i(!1),I=i(""),z=i(void 0),W=[{title:"عنوان",dataIndex:"title"},{title:"عملیات",dataIndex:"op"}],g=i([]),$=i(""),w=i([]),O=i([]),k=i(""),x=i(!1),D=i(void 0),X=[{title:"عنوان",dataIndex:"title"},{title:"عملیات",dataIndex:"op"}];async function U(){const{data:t}=await p.get("brand");S.value=t}async function F(){var t,e;if(b.value.trim())try{await p.post("brand/create",{title:b.value.trim()}),b.value="",await U(),d.success("برند اضافه شد")}catch(a){d.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا در افزودن برند")}}function Y(t){z.value=t.id,I.value=t.title,E.value=!0}async function Z(){var t,e;try{await p.put(`brand/${z.value}`,{title:I.value}),E.value=!1,await U(),d.success("تغییرات ثبت شد")}catch(a){d.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا در ویرایش")}}const{remove:ee}=_e({onSuccess:U,successMessage:"برند حذف شد",fallbackErrorMessage:"خطا در حذف برند"});function te(t){return ee(`brand/${t}`)}function H(){const t=$.value.trim();t&&(g.value.includes(t)||g.value.push(t),$.value="")}function ae(t){g.value.splice(t,1)}async function ne(){var t,e;try{await p.put("const/__list__tags",{val:g.value}),d.success("برچسب ها ذخیره شد")}catch(a){d.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا در ذخیره")}}async function se(){var t,e;try{await p.put("const/slider",{val:w.value}),d.success("اسلایدر ذخیره شد")}catch(a){d.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا در ذخیره")}}async function M(){const{data:t}=await p.post("ciny",{page:1,limit:200});O.value=t.rows??t}async function L(){var t,e;if(k.value.trim())try{x.value?await p.put(`ciny/${D.value}`,{title:k.value.trim()}):await p.post("ciny/create",{title:k.value.trim()}),j(),await M(),d.success("عملیات انجام شد")}catch(a){d.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا")}}function le(t){x.value=!0,D.value=t.id,k.value=t.title}function j(){x.value=!1,D.value=void 0,k.value=""}async function oe(t){var e,a;try{await p.delete(`ciny/${t}`),await M(),d.success("حذف شد")}catch(r){d.error(((a=(e=r==null?void 0:r.response)==null?void 0:e.data)==null?void 0:a.message)??"خطا در حذف")}}return fe(async()=>{try{A.value=!0,await Promise.all([U(),M()]);const[t,e]=await Promise.all([p.get("const/__list__tags"),y("custom.config.statics.slider")?p.get("const/slider"):Promise.resolve(null)]);g.value=Array.isArray(t.data)?t.data:[],w.value=Array.isArray(e==null?void 0:e.data)?e.data:[]}catch(t){console.log(t)}finally{A.value=!1}}),(t,e)=>{const a=c("a-input"),r=c("a-button"),V=c("a-tooltip"),q=c("a-popconfirm"),G=c("a-table"),P=c("a-tab-pane"),ie=c("a-tag"),re=c("a-empty"),ue=c("a-tabs"),ce=c("a-spin"),de=c("a-modal"),pe=c("a-card");return y("config.statics")?(o(),f(pe,{key:0,title:"مدیریت ثابت ها"},{default:s(()=>[n(ce,{spinning:A.value},{default:s(()=>[n(ue,null,{default:s(()=>[n(P,{key:"brands",tab:"برند ها"},{default:s(()=>[C("div",ke,[n(a,{value:b.value,"onUpdate:value":e[0]||(e[0]=l=>b.value=l),placeholder:"نام برند",style:{"max-width":"260px"},onPressEnter:F},null,8,["value"]),y("config.statics.brand.create")?(o(),f(r,{key:0,type:"primary",onClick:F},{default:s(()=>[...e[6]||(e[6]=[_(" افزودن ",-1)])]),_:1})):v("",!0)]),n(G,{class:"mt-4",size:"small","data-source":S.value,columns:W,pagination:!1,"row-key":"id"},{bodyCell:s(({column:l,record:u})=>[l.dataIndex==="op"?(o(),B(T,{key:0},[y("config.statics.brand.edit")?(o(),f(V,{key:0,title:"ویرایش"},{default:s(()=>[n(h(J),{class:"cursor-pointer mx-1 text-primary",onClick:m=>Y(u)},null,8,["onClick"])]),_:2},1024)):v("",!0),y("config.statics.brand.remove")?(o(),f(V,{key:1,title:"حذف"},{default:s(()=>[n(q,{"ok-text":"بله","cancel-text":"خیر",title:"آیا مطمئن هستید؟",onConfirm:m=>te(u.id)},{default:s(()=>[n(h(K),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)):v("",!0)],64)):v("",!0)]),_:1},8,["data-source"])]),_:1}),n(P,{key:"tags",tab:"برچسب ها"},{default:s(()=>[C("div",Ce,[n(a,{value:$.value,"onUpdate:value":e[1]||(e[1]=l=>$.value=l),placeholder:"برچسب",style:{"max-width":"260px"},onPressEnter:H},null,8,["value"]),y("config.statics.tags.create")?(o(),f(r,{key:0,type:"primary",onClick:H},{default:s(()=>[...e[7]||(e[7]=[_(" افزودن ",-1)])]),_:1})):v("",!0)]),C("div",be,[(o(!0),B(T,null,Q(g.value,(l,u)=>(o(),f(ie,{key:u,closable:y("config.statics.tags.remove"),onClose:m=>ae(u)},{default:s(()=>[_(N(l),1)]),_:2},1032,["closable","onClose"]))),128)),g.value.length===0?(o(),f(re,{key:0,description:"برچسبی ثبت نشده است"})):v("",!0)]),n(r,{class:"mt-4",type:"primary",onClick:ne},{default:s(()=>[...e[8]||(e[8]=[_("ذخیره برچسب ها",-1)])]),_:1})]),_:1}),y("custom.config.statics.slider")?(o(),f(P,{key:"slider",tab:"اسلایدر موبایل"},{default:s(()=>[(o(!0),B(T,null,Q(w.value,(l,u)=>(o(),B("div",{key:u,class:"slide"},[C("h6",we,"اسلاید "+N(u+1),1),C("div",xe,[n(ye,{modelValue:l.image,"onUpdate:modelValue":m=>l.image=m,purpose:"slider",placeholder:"تصویر اسلاید"},null,8,["modelValue","onUpdate:modelValue"]),n(a,{value:l.link,"onUpdate:value":m=>l.link=m,placeholder:"لینک"},null,8,["value","onUpdate:value"]),n(r,{danger:"",onClick:m=>w.value.splice(u,1)},{default:s(()=>[...e[9]||(e[9]=[_("حذف",-1)])]),_:1},8,["onClick"])])]))),128)),C("div",Be,[n(r,{onClick:e[2]||(e[2]=l=>w.value.push({image:"",link:""}))},{default:s(()=>[...e[10]||(e[10]=[_("افزودن اسلاید",-1)])]),_:1}),n(r,{type:"primary",onClick:se},{default:s(()=>[...e[11]||(e[11]=[_("ذخیره اسلایدر",-1)])]),_:1})])]),_:1})):v("",!0),n(P,{key:"collections",tab:"سینی ها"},{default:s(()=>[C("div",Ee,[n(a,{value:k.value,"onUpdate:value":e[3]||(e[3]=l=>k.value=l),placeholder:"نام سینی",style:{"max-width":"260px"},onPressEnter:L},null,8,["value"]),n(r,{type:"primary",onClick:L},{default:s(()=>[_(N(x.value?"ویرایش":"ثبت")+" سینی ",1)]),_:1}),x.value?(o(),f(r,{key:0,onClick:j},{default:s(()=>[...e[12]||(e[12]=[_("انصراف",-1)])]),_:1})):v("",!0)]),n(G,{class:"mt-4",size:"small","data-source":O.value,columns:X,pagination:!1,"row-key":"id"},{bodyCell:s(({column:l,record:u})=>[l.dataIndex==="op"?(o(),B(T,{key:0},[n(V,{title:"ویرایش"},{default:s(()=>[n(h(J),{class:"cursor-pointer mx-1 text-primary",onClick:m=>le(u)},null,8,["onClick"])]),_:2},1024),n(V,{title:"حذف"},{default:s(()=>[n(q,{"ok-text":"بله","cancel-text":"خیر",title:"آیا مطمئن هستید؟",onConfirm:m=>oe(u.id)},{default:s(()=>[n(h(K),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)],64)):v("",!0)]),_:1},8,["data-source"])]),_:1})]),_:1})]),_:1},8,["spinning"]),n(de,{open:E.value,"onUpdate:open":e[5]||(e[5]=l=>E.value=l),title:"ویرایش برند",onOk:Z},{default:s(()=>[n(a,{value:I.value,"onUpdate:value":e[4]||(e[4]=l=>I.value=l)},null,8,["value"])]),_:1},8,["open"])]),_:1})):v("",!0)}}}),Te=ge(Ie,[["__scopeId","data-v-580880e4"]]);export{Te as default};
|