feat: Add online share functionality for secretaries
- Introduced `online_share_enabled` and `online_share_percent` fields in the `doctor_secretaries` table to manage secretary shares from online appointments. - Added `bank_account` field in the `profiles` table to store user-level IBANs for settlements. - Created `secretary_earnings` table to track earnings per secretary from online appointments, including a foreign key relationship with `financial_breakdowns`. - Implemented `SecretaryEarning` entity and repository for managing secretary earnings. - Developed `SecretaryShareResolver` service to determine which secretaries earn from online payments. - Added `UserIbanResolver` service to handle user IBAN retrieval and management. - Created `HasIbansTrait` for entities to manage IBANs in a JSON format. - Implemented tests for secretary earnings and API endpoints for managing secretary shares and IBANs.
This commit is contained in:
@@ -485,6 +485,16 @@ export interface Secretary {
|
||||
address?: string | null;
|
||||
permissions: SecretaryPermissions;
|
||||
created_at: string;
|
||||
clinic_uuid?: string | null;
|
||||
clinic_name?: string | null;
|
||||
/** سهم منشی از نوبتهای آنلاین — per-relation، توسط ادمین تنظیم میشود. */
|
||||
online_share_enabled?: boolean;
|
||||
online_share_percent?: number;
|
||||
earnings?: {
|
||||
total_rials: number;
|
||||
this_month_rials: number;
|
||||
appointments_count: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SecretaryPermissions {
|
||||
|
||||
Reference in New Issue
Block a user