Добавлено новое поле agentCommissionRate в компоненты AccountProfile и AccountProfileCompany для отображения процента комиссии агента. Обновлены соответствующие метки и значения в интерфейсе.

This commit is contained in:
Redsandyg 2025-06-10 14:16:16 +03:00
parent 5380866af3
commit 4e0409949c
2 changed files with 10 additions and 1 deletions

View File

@ -23,6 +23,7 @@ interface ProfileData {
registrationDate: string; registrationDate: string;
company: string; company: string;
commissionRate: number; commissionRate: number;
agentCommissionRate: number;
companyKey: string; companyKey: string;
address?: string; address?: string;
birthDate?: string; birthDate?: string;
@ -134,6 +135,7 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
registrationDate: data.create_dttm || "", registrationDate: data.create_dttm || "",
company: data.company?.name || "", company: data.company?.name || "",
commissionRate: data.company?.commission || 0, commissionRate: data.company?.commission || 0,
agentCommissionRate: data.company?.agent_commission || 0,
companyKey: data.company?.key || "", companyKey: data.company?.key || "",
}); });
if (onNameChange) { if (onNameChange) {
@ -176,6 +178,7 @@ const AccountProfile: React.FC<AccountProfileProps> = ({ onNameChange }) => {
company={profileData.company} company={profileData.company}
companyKey={profileData.companyKey} companyKey={profileData.companyKey}
commissionRate={profileData.commissionRate} commissionRate={profileData.commissionRate}
agentCommissionRate={profileData.agentCommissionRate}
onCopy={handleCopy} onCopy={handleCopy}
/> />
{isEditing && ( {isEditing && (

View File

@ -6,6 +6,7 @@ interface AccountProfileCompanyProps {
company: string; company: string;
companyKey: string; companyKey: string;
commissionRate: number; commissionRate: number;
agentCommissionRate: number;
onCopy: () => void; onCopy: () => void;
} }
@ -13,6 +14,7 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
company, company,
companyKey, companyKey,
commissionRate, commissionRate,
agentCommissionRate,
onCopy onCopy
}) => ( }) => (
<div className={styles.card}> <div className={styles.card}>
@ -32,9 +34,13 @@ const AccountProfileCompany: React.FC<AccountProfileCompanyProps> = ({
</div> </div>
</div> </div>
<div> <div>
<label className={styles.label}>Процент комиссии</label> <label className={styles.label}>Процент комиссии компании</label>
<div className={styles.commissionValue}>{commissionRate}%</div> <div className={styles.commissionValue}>{commissionRate}%</div>
</div> </div>
<div>
<label className={styles.label}>Процент комиссии агента</label>
<div className={styles.commissionValue}>{agentCommissionRate}%</div>
</div>
</div> </div>
</div> </div>
); );