improvement: error handeling structure changed and unified all across the app. user no longer sees inappropriate messages.

This commit is contained in:
2026-07-12 18:27:38 +03:30
parent 901d838a2c
commit fab5111aa8
45 changed files with 977 additions and 241 deletions

View File

@@ -828,5 +828,66 @@
"monthOctober": "October",
"monthNovember": "November",
"monthDecember": "December"
},
"errors": {
"GENERIC": "Something went wrong. Please try again.",
"NETWORK_ERROR": "Could not reach the server. Check your connection and try again.",
"TIMEOUT": "The request took too long. Please try again.",
"AUTH_INVALID_CREDENTIALS": "Incorrect email or password.",
"AUTH_UNAUTHORIZED": "Your session has expired. Please sign in again.",
"AUTH_REFRESH_TOKEN_NOT_FOUND": "Your session has expired. Please sign in again.",
"AUTH_REFRESH_TOKEN_INVALID": "Your session has expired. Please sign in again.",
"AUTH_SESSION_EXPIRED": "Your session has expired. Please sign in again.",
"AUTH_USER_NOT_FOUND": "We could not find your account.",
"AUTH_ORG_NOT_SELECTED": "Please select an organization to continue.",
"AUTH_ORG_ACCESS_DENIED": "You do not have access to this organization.",
"AUTH_INVITATION_PENDING": "Your invitation is still pending. Ask an administrator to activate your account.",
"AUTH_REGISTRATION_EMAIL_EXISTS": "An account with this email already exists. Sign in to add a new organization from your account.",
"AUTH_REGISTRATION_MOBILE_EXISTS": "This mobile number is already registered.",
"AUTH_REGISTRATION_MOBILE_INVALID": "Please enter a valid mobile number.",
"AUTH_REGISTRATION_FAILED": "Registration could not be completed. Please try again.",
"AUTH_PASSWORD_INCORRECT": "Current password is incorrect.",
"AUTH_PASSWORD_RESET_EXPIRED": "Password reset verification expired. Please verify your mobile number again.",
"AUTH_VERIFICATION_CODE_INVALID": "Invalid or expired verification code.",
"AUTH_VERIFICATION_RATE_LIMIT": "Please wait a moment before requesting another code.",
"AUTH_SELECT_ORG_FIRST": "Select an organization before creating a new one.",
"AUTH_CREATE_ORG_OWNER_ONLY": "Only owners of the current organization can create new organizations.",
"AUTH_PASSWORD_CURRENT_REQUIRED": "Current password is required.",
"PERMISSION_DENIED": "You do not have permission to perform this action.",
"PERMISSION_ORG_MANAGE": "You do not have permission to manage organizations.",
"PERMISSION_CLINIC_ONLY": "This action is only available for clinic organizations.",
"PERMISSION_LAB_ONLY": "This action is only available for lab organizations.",
"PERMISSION_NOT_MEMBER": "You are not a member of this organization.",
"PERMISSION_OWNER_ONLY": "Only organization owners can perform this action.",
"PERMISSION_PARTICIPATION_SUBSCRIPTION": "An active subscription is required to participate in treatments or tasks.",
"PERMISSION_ENABLE_PARTICIPATION_FIRST": "Enable treatment participation before setting working hours.",
"PERMISSION_CLINIC_WORKING_HOURS": "Working hours are only available for clinic organizations.",
"PERMISSION_ACCESS_APPOINTMENTS": "You do not have access to appointments.",
"PERMISSION_EDIT_APPOINTMENTS": "You cannot create or modify appointments.",
"PERMISSION_ACCESS_TREATMENTS": "You do not have access to treatments.",
"PERMISSION_EDIT_TREATMENTS": "You cannot edit treatments.",
"PERMISSION_ACCESS_TASKS": "You do not have access to tasks.",
"PERMISSION_EDIT_TASKS": "You cannot edit tasks.",
"PERMISSION_ACCESS_CASES": "You do not have access to cases.",
"PERMISSION_ACCESS_STAFF": "You do not have access to staff management.",
"PERMISSION_EDIT_STAFF": "You cannot manage staff working hours.",
"PERMISSION_ORG_NOT_FOUND": "Organization not found.",
"VALIDATION_FAILED": "Please check the form and try again.",
"VALIDATION_EMAIL_INVALID": "Please enter a valid email address.",
"VALIDATION_PASSWORD_TOO_SHORT": "Password is too short.",
"VALIDATION_PASSWORD_REQUIRED": "Password is required.",
"VALIDATION_MOBILE_INVALID": "Please enter a valid mobile number.",
"VALIDATION_NAME_TOO_SHORT": "Name is too short.",
"VALIDATION_ORGANIZATION_NAME_REQUIRED": "Organization name is required.",
"VALIDATION_ORGANIZATION_TYPE_INVALID": "Please select a valid organization type.",
"VALIDATION_TOKEN_REQUIRED": "This link is invalid or incomplete.",
"VALIDATION_FIELD_REQUIRED": "Please fill in all required fields.",
"VALIDATION_LANGUAGE_INVALID": "Please select a supported language.",
"VALIDATION_INVALID_REQUEST": "The request contains invalid data.",
"NOT_FOUND": "The requested item was not found.",
"CONFLICT": "This action conflicts with existing data.",
"CONFLICT_FUTURE_APPOINTMENTS": "You cannot stop participating in treatments while you have future appointments. Reassign or cancel them first.",
"BAD_REQUEST": "The request could not be processed.",
"INTERNAL_ERROR": "Something went wrong on our end. Please try again later."
}
}