diff --git a/app/utils/statistics.py b/app/utils/statistics.py index 0f535511..4a52f2bf 100644 --- a/app/utils/statistics.py +++ b/app/utils/statistics.py @@ -68,9 +68,8 @@ def get_general_statistics( This function retrieves general statistics about applications based on the provided start_date, end_date, and lender_id (if available). The statistics include the count of applications received, approved, rejected, waiting - for information, in progress, with credit disbursed, proportion of credit disbursed, average amount requested, - average repayment period, count of overdue applications, average processing time, and proportion of submitted - applications out of the opt-in applications. + for information, in progress, average amount requested, average repayment period, count of overdue applications, + average processing time, and proportion of submitted applications out of the opt-in applications. :param start_date: The start date for filtering applications. (default: None) :param end_date: The end date for filtering applications. (default: None) @@ -267,6 +266,7 @@ def _rejected_reason(reason: str) -> StatisticData: _rejected_reason("already_have_acredit"), _rejected_reason("preffer_to_go_to_bank"), _rejected_reason("dont_want_access_credit"), + _rejected_reason("suspicious_email"), _rejected_reason("other"), ], # diff --git a/docs/_static/routes.csv b/docs/_static/routes.csv index 667fcc71..1a02d925 100644 --- a/docs/_static/routes.csv +++ b/docs/_static/routes.csv @@ -1,56 +1,55 @@ -Methods,Path,Backend parsers,Backend serializers,Frontend request,Frontend response -POST,/users,models.User,models.User,CreateUserInput,IUser -PUT,/users/change-password,BasicUser,ChangePasswordResponse | ResponseBase,UpdatePasswordPayload,IUpdatePasswordResponse -PUT,/users/setup-mfa,SetupMFA,ResponseBase,SetupMFAInput,IResponse -POST,/users/login,BasicUser,LoginResponse,LoginInput,ILoginResponse -GET,/users/logout,,ResponseBase,,IResponse -GET,/users/me,,UserResponse,,IUserResponse -POST,/users/forgot-password,ResetPassword,ResponseBase,ResetPasswordInput,IResponse -GET,/users/{user_id},user_id,models.User,id,IUser -GET,/users,"page, page_size, sort_field, sort_order",UserListResponse,PaginationInput,IUsersListResponse -PUT,/users/{user_id},models.User,models.UserWithLender,UpdateUserInput,IUser -POST,/applications/{id}/reject-application,LenderRejectedApplication,models.ApplicationWithRelations,RejectApplicationInput,IApplication -POST,/applications/{id}/complete-application,LenderReviewContract,models.ApplicationWithRelations,CompleteApplicationInput,IApplication -POST,/applications/{id}/approve-application,LenderApprovedData,models.ApplicationWithRelations,ApproveApplicationInput,IApplication -PUT,/applications/{id}/verify-data-field,UpdateDataField,models.ApplicationWithRelations,IUpdateBorrower,IApplication -PUT,/applications/documents/{document_id}/verify-document,VerifyBorrowerDocument,models.ApplicationWithRelations,IVerifyDocument,IApplication -PUT,/applications/{id}/award,AwardUpdate,models.ApplicationWithRelations,IUpdateAward,IApplication -PUT,/applications/{id}/borrower,BorrowerUpdate,models.ApplicationWithRelations,IUpdateBorrower,IApplication -GET,/applications/admin-list,"page, page_size, sort_field, sort_order, search_value",ApplicationListResponse,PaginationInput,IApplicationsListResponse -GET,/applications/id/{id},,models.ApplicationWithRelations,id,IApplication -POST,/applications/{id}/start,,models.ApplicationWithRelations,id,IApplication -GET,/applications,"page, page_size, sort_field, sort_order, search_value",ApplicationListResponse,PaginationInput,IApplicationsListResponse -POST,/applications/email-sme/{id},ApplicationEmailBorrower,models.ApplicationWithRelations,EmailToSMEInput,IApplication -GET,/applications/{id}/previous-awards,,list[models.Award],id,IAward[] -GET,/applications/uuid/{uuid},,ApplicationResponse,uuid,IApplicationResponse -POST,/applications/decline,ApplicationDeclinePayload,ApplicationResponse,DeclineApplicationInput,IApplicationResponse -POST,/applications/rollback-decline,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/decline-feedback,ApplicationDeclineFeedbackPayload,ApplicationResponse,DeclineFeedbackInput,IApplicationResponse -POST,/applications/access-scheme,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/credit-product-options,ApplicationCreditOptions,CreditProductListResponse,GetCreditProductsOptionsInput,IApplicationCreditOptions -POST,/applications/select-credit-product,ApplicationSelectCreditProduct,ApplicationResponse,SelectCreditProductInput,IApplicationResponse -POST,/applications/rollback-select-credit-product,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/confirm-credit-product,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/rollback-confirm-credit-product,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/submit,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/upload-document,"file, type, uuid",models.BorrowerDocumentBase,UploadFileInput,IBorrowerDocument -POST,/applications/complete-information-request,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/upload-contract,"file, uuid",models.BorrowerDocumentBase,UploadContractInput,IBorrowerDocument -POST,/applications/confirm-upload-contract,UploadContractConfirmation,ApplicationResponse,ContractAmountInput,IApplicationResponse -POST,/applications/find-alternative-credit-option,ApplicationBase,ApplicationResponse,ApplicationBaseInput,IApplicationResponse -POST,/applications/change-email,ChangeEmail,parsers.ChangeEmail,ChangeEmailInput,ChangeEmailInput -POST,/applications/confirm-change-email,ConfirmNewEmail,parsers.ChangeEmail,ConfirmChangeEmailInput,ChangeEmailInput -GET,/applications/documents/id/{document_id},document_id,,id,blob -GET,/applications/{id}/download-application/{lang},lang,,"id, lang",blob -GET,/applications/export/{lang},lang,,lang,blob -POST,/lenders,models.LenderCreate,models.Lender,ILenderBase,ILender -POST,/lenders/{lender_id}/credit-products,models.CreditProduct,models.CreditProduct,ICreditProductBase,ICreditProduct -GET,/lenders/{lender_id},lender_id,models.LenderWithRelations,id,ILender -PUT,/lenders/{lender_id},models.LenderBase,models.Lender,ILenderUpdate,ILender -GET,/lenders,,LenderListResponse,,ILenderListResponse -GET,/procurement-categories,,list[str],,string[] -GET,/credit-products/{credit_product_id},credit_product_id,models.CreditProductWithLender,id,ICreditProduct -PUT,/credit-products/{credit_product_id},models.CreditProduct,models.CreditProduct,ICreditProductUpdate,ICreditProduct -GET,/statistics-ocp,"initial_date, final_date, lender_id, custom_range",StatisticResponse,StatisticsParmsInput,StatisticsFI -GET,/statistics-ocp/opt-in,,StatisticOptInResponse,,StatisticsOCPoptIn -GET,/statistics-fi,,StatisticResponse,,StatisticsFI +Methods,Path,Request format,Response format +POST,/users,models.User,models.User +PUT,/users/change-password,BasicUser,ChangePasswordResponse | ResponseBase +PUT,/users/setup-mfa,SetupMFA,ResponseBase +POST,/users/login,BasicUser,LoginResponse +GET,/users/logout,request,ResponseBase +GET,/users/me,,UserResponse +POST,/users/forgot-password,ResetPassword,ResponseBase +GET,/users/{user_id},user_id,models.User +GET,/users,"sort_order, sort_field, page_size, page",UserListResponse +PUT,/users/{user_id},models.User,models.UserWithLender +POST,/applications/{id}/reject-application,LenderRejectedApplication,models.ApplicationWithRelations +POST,/applications/{id}/approve-application,LenderApprovedData,models.ApplicationWithRelations +PUT,/applications/{id}/verify-data-field,UpdateDataField,models.ApplicationWithRelations +PUT,/applications/documents/{document_id}/verify-document,VerifyBorrowerDocument,models.ApplicationWithRelations +PUT,/applications/{id}/award,AwardUpdate,models.ApplicationWithRelations +PUT,/applications/{id}/borrower,BorrowerUpdate,models.ApplicationWithRelations +GET,/applications/admin-list,"search_value, sort_order, sort_field, page_size, page",ApplicationListResponse +GET,/applications,"search_value, sort_order, sort_field, page_size, page",ApplicationListResponse +GET,/applications/id/{id},,models.ApplicationWithRelations +POST,/applications/{id}/start,id,models.ApplicationWithRelations +POST,/applications/email-sme/{id},ApplicationEmailBorrower,models.ApplicationWithRelations +GET,/applications/{id}/previous-awards,,list[models.Award] +GET,/applications/uuid/{uuid},,ApplicationResponse +POST,/applications/decline,ApplicationDeclinePayload,ApplicationResponse +POST,/applications/rollback-decline,ApplicationBase,ApplicationResponse +POST,/applications/decline-feedback,ApplicationDeclineFeedbackPayload,ApplicationResponse +POST,/applications/access-scheme,ApplicationBase,ApplicationResponse +POST,/applications/credit-product-options,ApplicationCreditOptions,CreditProductListResponse +POST,/applications/select-credit-product,ApplicationSelectCreditProduct,ApplicationResponse +POST,/applications/rollback-select-credit-product,ApplicationBase,ApplicationResponse +POST,/applications/confirm-credit-product,ApplicationBase,ApplicationResponse +POST,/applications/rollback-confirm-credit-product,ApplicationBase,ApplicationResponse +POST,/applications/submit,ApplicationBase,ApplicationResponse +POST,/applications/upload-document,"file, type, uuid",models.BorrowerDocumentBase +POST,/applications/complete-information-request,ApplicationBase,ApplicationResponse +POST,/applications/upload-contract,"file, uuid",models.BorrowerDocumentBase +POST,/applications/find-alternative-credit-option,ApplicationBase,ApplicationResponse +POST,/applications/change-email,ChangeEmail,parsers.ChangeEmail +POST,/applications/confirm-change-email,ConfirmNewEmail,parsers.ChangeEmail +GET,/meta,,"dict[str, list[dict[str, str]]]" +GET,/applications/documents/id/{document_id},document_id, +GET,/applications/{id}/download-application/{lang},lang, +GET,/applications/export/{lang},lang, +POST,/lenders,models.LenderCreate,models.Lender +POST,/lenders/{lender_id}/credit-products,models.CreditProduct,models.CreditProduct +GET,/lenders/{lender_id},lender_id,models.LenderWithRelations +PUT,/lenders/{lender_id},models.LenderBase,models.Lender +GET,/lenders,,LenderListResponse +GET,/procurement-categories,,list[str] +GET,/credit-products/{credit_product_id},credit_product_id,models.CreditProductWithLender +PUT,/credit-products/{credit_product_id},models.CreditProduct,models.CreditProduct +GET,/statistics-ocp,"custom_range, lender_id, final_date, initial_date",StatisticResponse +GET,/statistics-ocp/opt-in,,StatisticOptInResponse +GET,/statistics-fi,,StatisticResponse diff --git a/docs/frontend.rst b/docs/frontend.rst index ded4635b..49690fb8 100644 --- a/docs/frontend.rst +++ b/docs/frontend.rst @@ -19,8 +19,6 @@ Credere frontend's ``src/constants/index.ts`` constants should match ``app.model - APPLICATION_STATUS * - BorrowerSize.NOT_INFORMED - DEFAULT_BORROWER_SIZE - * - BorrowerDocumentType.SIGNED_CONTRACT - - SIGNED_CONTRACT_DOCUMENT_TYPE * - CreditType - CREDIT_PRODUCT_TYPE * - UserType