@kipicore/dbcore 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/fix-import-extensions.js +12 -7
- package/dist/scripts/generate-index.js +12 -7
- package/dist/src/configs/aws.js +9 -6
- package/dist/src/configs/env.js +56 -17
- package/dist/src/configs/postgresConfig.js +1 -1
- package/dist/src/constants/app.js +318 -312
- package/dist/src/constants/defaultModelAttributes.js +12 -9
- package/dist/src/constants/errorMessages.js +219 -214
- package/dist/src/constants/httpStatusCode.js +5 -2
- package/dist/src/constants/successMessages.js +223 -217
- package/dist/src/db/mongodb.js +10 -3
- package/dist/src/db/postgres.js +5 -2
- package/dist/src/db/psql/index.js +1 -1
- package/dist/src/db/psql/migrations/20241225101052-add-deleted-by-and-deleted-at-fields.js +0 -1
- package/dist/src/db/psql/migrations/20250106070945-add-user-fields-and-deleted-user-fields.js +0 -1
- package/dist/src/db/psql/migrations/20250106080059-add-fields-and-deleted-fields.js +0 -1
- package/dist/src/db/psql/migrations/20250108092439-update-batch-model-fields.js +0 -1
- package/dist/src/db/psql/migrations/20250210102846-add-profileImage-coverImage-to-users.js +0 -1
- package/dist/src/db/psql/migrations/20250211071743-add-action-user-has-histroy.js +0 -1
- package/dist/src/db/psql/migrations/20250213140815-add-assignQuantity-user-has-histroy.js +0 -1
- package/dist/src/db/psql/migrations/20250214072626-add-middlename-user.js +0 -1
- package/dist/src/db/psql/migrations/20250224085333-add-apptype-in-user.js +0 -1
- package/dist/src/db/psql/migrations/20250226053006-add-brouchure-in-institute.js +0 -1
- package/dist/src/db/psql/migrations/20250227123530-add-defult-in-fee-reminder.js +0 -1
- package/dist/src/db/psql/migrations/20250304052831-add-institued-in-school-data-clm.js +0 -1
- package/dist/src/db/psql/migrations/20250306053557-add-shifyId-in-batch.js +0 -1
- package/dist/src/db/psql/migrations/20250311044606-add-institued-in-school-data-clm-subtype.js +0 -1
- package/dist/src/db/psql/migrations/20250402090653-add-user-area.js +0 -1
- package/dist/src/db/psql/migrations/20250407094125-update-type-in-typeManagement.js +0 -1
- package/dist/src/db/psql/migrations/20250409105229-add-user-type-in-role.js +0 -1
- package/dist/src/db/psql/migrations/20250417121316-make-institute-id-nullable-in-type-management.js +0 -1
- package/dist/src/db/psql/migrations/20250419071236-fee_histroy_add_school_clm.js +0 -1
- package/dist/src/db/psql/migrations/20250419085334-fee_histroy_add_school_clm.js +0 -1
- package/dist/src/db/psql/migrations/20250421085618-add-entityIds-field-in-announcements.js +0 -1
- package/dist/src/db/psql/migrations/20250422114032-add-account.js +0 -1
- package/dist/src/db/psql/migrations/20250423051841-add-master-leave-clm.js +0 -1
- package/dist/src/db/psql/migrations/20250423064522-update-calender-enum.js +0 -1
- package/dist/src/db/psql/migrations/20250423093827-update-institued-district.js +0 -1
- package/dist/src/db/psql/migrations/20250424044755-update-fee-history-feeTyps-clm.js +0 -1
- package/dist/src/db/psql/migrations/20250424053841-update-fee-history-key.js +1 -1
- package/dist/src/db/psql/migrations/20250426070309-update-banner-clm-userType.js +0 -1
- package/dist/src/db/psql/migrations/20250505035157-update-fee-collection-clm-add.js +0 -1
- package/dist/src/db/psql/migrations/20250505082924-update-banner-clm.js +0 -1
- package/dist/src/db/psql/migrations/20250505094616-about-as-clm-in-institued.js +0 -1
- package/dist/src/db/psql/migrations/20250506070110-add-dayOfWeek-clm-in-working-model.js +0 -1
- package/dist/src/db/psql/migrations/20250509055920-add-feecollection-isleft-clm.js +0 -1
- package/dist/src/db/psql/migrations/20250513061037-add-techer-clm-batch.js +0 -1
- package/dist/src/db/psql/migrations/20250514101801-add-slotId-workingShif.js +0 -1
- package/dist/src/db/psql/migrations/20250516062917-add-globalId-clm-user-model.js +0 -1
- package/dist/src/db/psql/migrations/20250516063542-add-globalId-clm-institute-model.js +0 -1
- package/dist/src/db/psql/migrations/20250520061231-add-institued_mobile_person_data.js +0 -1
- package/dist/src/db/psql/migrations/20250522044729-add-institued_update_add_2.js +0 -1
- package/dist/src/db/psql/migrations/20250526035543-add-totalQuantity_add_remainingQuantiy_clm_userHasInventoryHistory.js +0 -1
- package/dist/src/db/psql/migrations/20250526093322-add-appType_clm_in_module.js +0 -1
- package/dist/src/db/psql/migrations/20250526094030-add-appType_clm_in_action.js +0 -1
- package/dist/src/db/psql/migrations/20250526094233-add-appType_clm_in_module_features.js +0 -1
- package/dist/src/db/psql/migrations/20250527065001-add-app-type-in-role-model.js +0 -1
- package/dist/src/db/psql/migrations/20250528045906-add-module-type-to-notifications.js +0 -1
- package/dist/src/db/psql/migrations/20250602090331-add-or-update-user-model-medicalHistory.js +0 -1
- package/dist/src/db/psql/migrations/20250602100550-add-planner-sync-status-to-institute.js +0 -1
- package/dist/src/db/psql/migrations/20250603054900-add-clm-for-defult-data-add-or-not-in-ins-model.js +0 -1
- package/dist/src/db/psql/migrations/20250604103905-add-is-institute-default-field-in-role.js +0 -1
- package/dist/src/db/psql/migrations/20250604121051-update-mobile-number-opstion.js +0 -1
- package/dist/src/db/psql/migrations/20250617064159-update-type-management-jun-17.js +0 -1
- package/dist/src/db/psql/migrations/20250627065013-is-institute-default-added-type-managemente.js +0 -1
- package/dist/src/db/psql/migrations/20250701095321-add-clm-institute-pdfId.js +0 -1
- package/dist/src/db/psql/migrations/20250704102117-add-clm-isDefult-in-typeManagemet.js +0 -1
- package/dist/src/db/psql/migrations/20250715103324-add-academic-calendar-id-to-batches.js +0 -1
- package/dist/src/db/psql/migrations/20250715121047-remove-batch-id-from-academic-calendars.js +0 -1
- package/dist/src/db/psql/migrations/20250716131731-rename-user-id-to-primary-user-id.js +0 -1
- package/dist/src/db/psql/migrations/20250717092933-add-floor-id-to-class-rooms.js +0 -1
- package/dist/src/db/psql/migrations/20250718121251-add-clm-classroom-typeid.js +0 -1
- package/dist/src/db/psql/migrations/20250721065317-add-instituteId-fileSize-to-fileStorage.js +0 -1
- package/dist/src/db/psql/migrations/20250721100004-add-shift-slot-id-to-lectures.js +0 -1
- package/dist/src/db/psql/migrations/20250721105455-add-clm-classroom-add-classroomnumber.js +0 -1
- package/dist/src/db/psql/migrations/20250722071836-add-title-to-floor-management.js +0 -1
- package/dist/src/db/psql/migrations/20250723150111-add-clm-batch-slotId.js +0 -1
- package/dist/src/db/psql/migrations/20250724062458-update_classRoom_number_clm_to_string.js +0 -1
- package/dist/src/db/psql/migrations/20250725132424-add-unique-index-on-instituteId-name-type.js +0 -1
- package/dist/src/db/psql/migrations/20250730104844-update-unique-key-assessment-type.js +0 -1
- package/dist/src/db/psql/migrations/20250804090437-update_ins_in_pdf_id_string_to_uuid.js +0 -1
- package/dist/src/db/psql/migrations/20250805062440-remove_unique_key_into_batch_subject_project_assessments.js +0 -1
- package/dist/src/db/psql/migrations/20250805115805-add-descriptions-to-lectures.js +0 -1
- package/dist/src/db/psql/migrations/20250808100700-add_clm_contectFeed_in_ins_givenId.js +0 -1
- package/dist/src/db/psql/migrations/20250808101515-add-sequence-to-institute_entities.js +0 -1
- package/dist/src/db/psql/migrations/20250812080521-add-title-and-descriptions-to-batch-subject-project-assessments.js +0 -1
- package/dist/src/db/psql/migrations/20250820092836-add-sequence-number-to-institute-entities.js +0 -1
- package/dist/src/db/psql/migrations/20250829103203-remove-syllabus-composit-index.js +0 -1
- package/dist/src/db/psql/migrations/20250905132024-add-uuid-to-users.js +0 -1
- package/dist/src/db/psql/migrations/20250908054025-userHasOffer_model_update.js +0 -1
- package/dist/src/db/psql/migrations/20250908054754-offer_in_add_offertype_clm.js +0 -1
- package/dist/src/db/psql/migrations/20250909061117-add-instituteId-isDefault-to-entityGroup.js +0 -1
- package/dist/src/db/psql/migrations/20250911060106-change-wallet-history-columns-to-float.js +0 -1
- package/dist/src/db/psql/migrations/20250911060245-change-coin-to-float-in-wallets.js +0 -1
- package/dist/src/db/psql/migrations/20250917135646-change-storageInBytes-to-float.js +0 -1
- package/dist/src/db/psql/seeders/20240809100759-add-countries-states-cities.js +1 -1
- package/dist/src/db/psql/seeders/20250101122757-add-default-permissions-modules.js +0 -1
- package/dist/src/db/psql/seeders/Data/AcademicCalendarModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/AdministrativeStaffModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/AnnouncementsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/AssetsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/AttendanceModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/BannerModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/BatchModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/BoardModule .js +1 -1
- package/dist/src/db/psql/seeders/Data/BookAssessmentsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/CategoriesModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/ClassroomModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/DivisionModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/EventModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/ExamsAndResultsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/FacilityModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/FeeAndDiscountModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/FeedBackModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/FileModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/GenerateIdModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/HolidayModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/HomeworkModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/IndexModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/InquiryModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/InstituteModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/InventoryModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/JobApplyModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/LectureModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/ParentModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/PayoutModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/PdcChequesModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/PhotosGalleryModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/PlannerModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/ProjectAssessmentsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/ReplaceTeacherModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/RoleModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/RollNumberModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/SchoolFeeModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/SchoolModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/SchoolRegistration.js +1 -1
- package/dist/src/db/psql/seeders/Data/SettingsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/StaffTimingModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/StudentModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/SubjectModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/SyllabusManagementModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/TeacherModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/TestimonialsModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/TimetableModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/To-doModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/TypeManagementModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/UserModule.js +1 -1
- package/dist/src/db/psql/seeders/Data/appType.js +1 -1
- package/dist/src/helpers/s3Uploader.js +25 -17
- package/dist/src/helpers/utils.js +148 -69
- package/dist/src/index.js +431 -415
- package/dist/src/interfaces/academicCalendarInterface.js +2 -1
- package/dist/src/interfaces/accountHasReceiptDetailsInterface.js +2 -1
- package/dist/src/interfaces/announcementInterface.js +2 -1
- package/dist/src/interfaces/approvalRequestInterface.js +2 -1
- package/dist/src/interfaces/areaInterface.js +2 -1
- package/dist/src/interfaces/attendanceInterface.js +2 -1
- package/dist/src/interfaces/bankAccountDetailsInterface.js +2 -1
- package/dist/src/interfaces/bannerInterface.js +2 -1
- package/dist/src/interfaces/batchInterface.js +2 -1
- package/dist/src/interfaces/batchSubjectBookAssessmentInterface.js +2 -1
- package/dist/src/interfaces/batchSubjectProjectAssessmentInterface.js +2 -1
- package/dist/src/interfaces/blogInterface.js +2 -1
- package/dist/src/interfaces/bookAssessmentDateInterface.js +2 -1
- package/dist/src/interfaces/careerInterface.js +2 -1
- package/dist/src/interfaces/categoriesInterface.js +2 -1
- package/dist/src/interfaces/certificatesHistoryInterface.js +2 -1
- package/dist/src/interfaces/certificatesManagementInterface.js +2 -1
- package/dist/src/interfaces/cityInterface.js +2 -1
- package/dist/src/interfaces/classRoomInterface.js +2 -1
- package/dist/src/interfaces/cloudStorageInterface.js +2 -1
- package/dist/src/interfaces/coinPurchaseOfferInterface.js +2 -1
- package/dist/src/interfaces/columnInterface.js +2 -1
- package/dist/src/interfaces/commanInterface.js +2 -1
- package/dist/src/interfaces/contactFeedBackInterface.js +2 -1
- package/dist/src/interfaces/countryInterface.js +2 -1
- package/dist/src/interfaces/courseHasVisitorsInterface.js +2 -1
- package/dist/src/interfaces/courseInterface.js +2 -1
- package/dist/src/interfaces/dailyBookInterface.js +2 -1
- package/dist/src/interfaces/dashboardManagementInterface.js +2 -1
- package/dist/src/interfaces/driverInterface.js +2 -1
- package/dist/src/interfaces/entityGroupInterface.js +2 -1
- package/dist/src/interfaces/eventInterface.js +2 -1
- package/dist/src/interfaces/examGroupInterface.js +2 -1
- package/dist/src/interfaces/examHasAnswerSheetInterface.js +2 -1
- package/dist/src/interfaces/examInterface.js +2 -1
- package/dist/src/interfaces/facilityInterface.js +2 -1
- package/dist/src/interfaces/featureActionInterface.js +2 -1
- package/dist/src/interfaces/feeHistoryDetailsInterface.js +2 -1
- package/dist/src/interfaces/feeHistoryInterface.js +2 -1
- package/dist/src/interfaces/feeReminderInterface.js +2 -1
- package/dist/src/interfaces/feeReminderSettingInterface.js +2 -1
- package/dist/src/interfaces/feeReminderTypeInterface.js +2 -1
- package/dist/src/interfaces/feeTypeHasTermsInterface.js +2 -1
- package/dist/src/interfaces/feeTypeInterface.js +2 -1
- package/dist/src/interfaces/feedBackInterface.js +2 -1
- package/dist/src/interfaces/feesCollectionInterface.js +2 -1
- package/dist/src/interfaces/fileStorageInterface.js +2 -1
- package/dist/src/interfaces/floorManagementInterface.js +2 -1
- package/dist/src/interfaces/generateIdCardInterface.js +2 -1
- package/dist/src/interfaces/greetingsInterface.js +2 -1
- package/dist/src/interfaces/holidayInterface.js +2 -1
- package/dist/src/interfaces/homeworkInterface.js +2 -1
- package/dist/src/interfaces/informationSupportInterface.js +2 -1
- package/dist/src/interfaces/inquiryInterface.js +2 -1
- package/dist/src/interfaces/instituteEntityInterface.js +2 -1
- package/dist/src/interfaces/instituteEntityTypeInterface.js +2 -1
- package/dist/src/interfaces/instituteInterface.js +2 -1
- package/dist/src/interfaces/instituteSubscriptionPlanInterface.js +2 -1
- package/dist/src/interfaces/inventoryHistoryInterface.js +2 -1
- package/dist/src/interfaces/inventoryInterface.js +2 -1
- package/dist/src/interfaces/invoiceInterface.js +2 -1
- package/dist/src/interfaces/jobApplyInterface.js +2 -1
- package/dist/src/interfaces/lectureHistoryInterface.js +2 -1
- package/dist/src/interfaces/lectureInterface.js +2 -1
- package/dist/src/interfaces/masterLeaveInterface.js +2 -1
- package/dist/src/interfaces/moduleFeatureInterface.js +2 -1
- package/dist/src/interfaces/moduleInterface.js +2 -1
- package/dist/src/interfaces/offersInterface.js +2 -1
- package/dist/src/interfaces/paymentTermsInterface.js +2 -1
- package/dist/src/interfaces/pdcChequeInterface.js +2 -1
- package/dist/src/interfaces/pdcHistoryInterface.js +2 -1
- package/dist/src/interfaces/photosGalleryInterface.js +2 -1
- package/dist/src/interfaces/pincodeInterface.js +2 -1
- package/dist/src/interfaces/plannerInterface.js +2 -1
- package/dist/src/interfaces/productInterface.js +2 -1
- package/dist/src/interfaces/projectAssessmentOptionInterface.js +2 -1
- package/dist/src/interfaces/replaceTeacherInterface.js +2 -1
- package/dist/src/interfaces/roleInterface.js +2 -1
- package/dist/src/interfaces/rulesRegulationInterface.js +2 -1
- package/dist/src/interfaces/schoolFeeCollectionInterface.js +2 -1
- package/dist/src/interfaces/schoolFeeInterface.js +2 -1
- package/dist/src/interfaces/schoolOfferInterface.js +2 -1
- package/dist/src/interfaces/sendNotificationInerface.js +2 -1
- package/dist/src/interfaces/slotInterface.js +2 -1
- package/dist/src/interfaces/stateInterface.js +2 -1
- package/dist/src/interfaces/subCategoriesInterface.js +2 -1
- package/dist/src/interfaces/subjectHasFeeInterface.js +2 -1
- package/dist/src/interfaces/subjectHasPayFeeHistoryInterface.js +2 -1
- package/dist/src/interfaces/subjectIndexInterface.js +2 -1
- package/dist/src/interfaces/subscriptionPlanInterface.js +2 -1
- package/dist/src/interfaces/syllabusInterface.js +2 -1
- package/dist/src/interfaces/taskManagementInterface.js +2 -1
- package/dist/src/interfaces/testimonialInterface.js +2 -1
- package/dist/src/interfaces/toDoInterface.js +2 -1
- package/dist/src/interfaces/tokenInterface.js +2 -1
- package/dist/src/interfaces/tripInterface.js +2 -1
- package/dist/src/interfaces/typeManagementInterface.js +2 -1
- package/dist/src/interfaces/uniqueNumberCounterInterface.js +2 -1
- package/dist/src/interfaces/userBookAssessmentInterface.js +2 -1
- package/dist/src/interfaces/userDetailsInterface.js +2 -1
- package/dist/src/interfaces/userFeeTypeByAccountInterface.js +2 -1
- package/dist/src/interfaces/userFeeTypeInterface.js +2 -1
- package/dist/src/interfaces/userHasAnnouncementInterface.js +2 -1
- package/dist/src/interfaces/userHasBatchInterface.js +2 -1
- package/dist/src/interfaces/userHasCourseInterface.js +2 -1
- package/dist/src/interfaces/userHasDeviceInterface.js +2 -1
- package/dist/src/interfaces/userHasFeeTermsInterface.js +2 -1
- package/dist/src/interfaces/userHasFileInterface.js +2 -1
- package/dist/src/interfaces/userHasHomeWorkInterface.js +2 -1
- package/dist/src/interfaces/userHasInventoryHistoryInterface.js +2 -1
- package/dist/src/interfaces/userHasInventoryInterface.js +2 -1
- package/dist/src/interfaces/userHasLeaveHistoryInterface.js +2 -1
- package/dist/src/interfaces/userHasLeaveInterface.js +2 -1
- package/dist/src/interfaces/userHasOfferInterface.js +2 -1
- package/dist/src/interfaces/userHasParentInterface.js +2 -1
- package/dist/src/interfaces/userHasRoleInterface.js +2 -1
- package/dist/src/interfaces/userHasRollNumberInterface.js +2 -1
- package/dist/src/interfaces/userHasStorageInterface.js +2 -1
- package/dist/src/interfaces/userHasSubjectFeeInterface.js +2 -1
- package/dist/src/interfaces/userInstituteMetaInterface.js +2 -1
- package/dist/src/interfaces/userInterface.js +2 -1
- package/dist/src/interfaces/userLeaveRequestInterface.js +2 -1
- package/dist/src/interfaces/userMetaInterface.js +2 -1
- package/dist/src/interfaces/userPayoutDetailsInterface.js +2 -1
- package/dist/src/interfaces/userPayoutHistoryInterface.js +2 -1
- package/dist/src/interfaces/userPayoutInterface.js +2 -1
- package/dist/src/interfaces/userProjectAssessmentOptionInterface.js +2 -1
- package/dist/src/interfaces/userRequiredStepsInterface.js +2 -1
- package/dist/src/interfaces/userSchoolMetaInterface.js +2 -1
- package/dist/src/interfaces/vehicleInterface.js +2 -1
- package/dist/src/interfaces/vendorManagementInterface.js +2 -1
- package/dist/src/interfaces/videoAnalystInterface.js +2 -1
- package/dist/src/interfaces/walletHistoryInterface.js +2 -1
- package/dist/src/interfaces/walletInterface.js +2 -1
- package/dist/src/interfaces/walletTransactionInterface.js +2 -1
- package/dist/src/interfaces/workingDayInterface.js +2 -1
- package/dist/src/interfaces/workingShiftInterface.js +2 -1
- package/dist/src/models/mongodb/approvalRequestModel.js +43 -8
- package/dist/src/models/mongodb/attendanceModel.js +68 -30
- package/dist/src/models/mongodb/blogModel.js +46 -11
- package/dist/src/models/mongodb/careerModel.js +42 -7
- package/dist/src/models/mongodb/certificatesHistoryModel.js +39 -4
- package/dist/src/models/mongodb/certificatesManagementModel.js +42 -7
- package/dist/src/models/mongodb/columnModel.js +45 -10
- package/dist/src/models/mongodb/dailyBookModel.js +39 -4
- package/dist/src/models/mongodb/dashboardManagementModel.js +46 -11
- package/dist/src/models/mongodb/eventModel.js +58 -20
- package/dist/src/models/mongodb/examGroupModel.js +69 -31
- package/dist/src/models/mongodb/examHasAnswerSheetModel.js +56 -18
- package/dist/src/models/mongodb/examModel.js +76 -38
- package/dist/src/models/mongodb/feeReminderTypeModel.js +42 -7
- package/dist/src/models/mongodb/feedBackModel.js +43 -8
- package/dist/src/models/mongodb/generateIdCardModel.js +39 -4
- package/dist/src/models/mongodb/holidayModel.js +58 -20
- package/dist/src/models/mongodb/index.js +16 -11
- package/dist/src/models/mongodb/informationSupportModel.js +42 -7
- package/dist/src/models/mongodb/inquiryModel.js +67 -29
- package/dist/src/models/mongodb/invoiceModel.js +48 -13
- package/dist/src/models/mongodb/jobApplyModel.js +49 -14
- package/dist/src/models/mongodb/photosGalleryModel.js +46 -11
- package/dist/src/models/mongodb/plannerModel.js +45 -10
- package/dist/src/models/mongodb/plugin/addDefaultAttributesPlugin.js +4 -1
- package/dist/src/models/mongodb/plugin/transformIdInQueryPlugin.js +3 -1
- package/dist/src/models/mongodb/plugin/transformIdInResponsePlugin.js +8 -3
- package/dist/src/models/mongodb/replaceTeacherModel.js +46 -11
- package/dist/src/models/mongodb/schoolFeeModel.js +56 -18
- package/dist/src/models/mongodb/subjectIndexModel.js +152 -114
- package/dist/src/models/mongodb/subscriptionPlanModel.js +49 -14
- package/dist/src/models/mongodb/taskManagementModel.js +58 -20
- package/dist/src/models/mongodb/uniqueNumberCounterModel.js +42 -7
- package/dist/src/models/mongodb/userDetailsModel.js +68 -32
- package/dist/src/models/mongodb/userDoc.js +6 -3
- package/dist/src/models/mongodb/userInstituteMetaModel.js +54 -19
- package/dist/src/models/mongodb/userSchoolMetaModel.js +46 -41
- package/dist/src/models/mongodb/videoAnalystModel.js +40 -5
- package/dist/src/models/mongodb/walletTransactionModel.js +56 -21
- package/dist/src/models/psql/SubCategoriesModel.js +28 -23
- package/dist/src/models/psql/academicCalendarModel.js +26 -21
- package/dist/src/models/psql/accountHasReceiptDetailsModel.js +38 -33
- package/dist/src/models/psql/announcementModel.js +58 -53
- package/dist/src/models/psql/areaModel.js +17 -12
- package/dist/src/models/psql/bankAccountDetailsModel.js +35 -30
- package/dist/src/models/psql/bannerModel.js +40 -35
- package/dist/src/models/psql/batchModel.js +53 -48
- package/dist/src/models/psql/batchSubjectBookAssessmentModel.js +35 -30
- package/dist/src/models/psql/batchSubjectProjectAssessmentModel.js +35 -30
- package/dist/src/models/psql/bookAssessmentDateModel.js +25 -20
- package/dist/src/models/psql/categoriesModel.js +24 -19
- package/dist/src/models/psql/cityModel.js +21 -16
- package/dist/src/models/psql/classRoomModel.js +36 -31
- package/dist/src/models/psql/cloudStorageModel.js +30 -25
- package/dist/src/models/psql/coinPurchaseOfferModel.js +31 -26
- package/dist/src/models/psql/contactFeedBackModel.js +34 -29
- package/dist/src/models/psql/countryModel.js +13 -11
- package/dist/src/models/psql/courseHasVisitorsModel.js +22 -17
- package/dist/src/models/psql/courseModel.js +41 -36
- package/dist/src/models/psql/driverModel.js +51 -46
- package/dist/src/models/psql/entityGroupModel.js +29 -24
- package/dist/src/models/psql/facilityModel.js +34 -29
- package/dist/src/models/psql/featureActionModel.js +28 -23
- package/dist/src/models/psql/feeHistoryDetailsModel.js +45 -40
- package/dist/src/models/psql/feeHistoryModel.js +78 -73
- package/dist/src/models/psql/feeReminderModel.js +63 -58
- package/dist/src/models/psql/feeReminderSettingModel.js +27 -22
- package/dist/src/models/psql/feeTypeHasTermsModel.js +31 -26
- package/dist/src/models/psql/feeTypeModel.js +42 -37
- package/dist/src/models/psql/feesCollectionModel.js +55 -50
- package/dist/src/models/psql/fileStorageModel.js +26 -21
- package/dist/src/models/psql/floorManagementModel.js +25 -20
- package/dist/src/models/psql/greetingsModel.js +34 -29
- package/dist/src/models/psql/homeWorkModel.js +36 -31
- package/dist/src/models/psql/index.js +48 -7
- package/dist/src/models/psql/instituteEntityModel.js +34 -29
- package/dist/src/models/psql/instituteEntityTypeModel.js +25 -20
- package/dist/src/models/psql/instituteModel.js +70 -65
- package/dist/src/models/psql/instituteSubscriptionPlanModel.js +42 -37
- package/dist/src/models/psql/inventoryHistoryModel.js +42 -37
- package/dist/src/models/psql/inventoryModel.js +36 -31
- package/dist/src/models/psql/lectureHistoryModel.js +62 -57
- package/dist/src/models/psql/lectureModel.js +117 -112
- package/dist/src/models/psql/masterLeaveModel.js +41 -36
- package/dist/src/models/psql/moduleFeatureModel.js +29 -24
- package/dist/src/models/psql/moduleModel.js +30 -25
- package/dist/src/models/psql/offerModel.js +39 -34
- package/dist/src/models/psql/paymentTermsModel.js +35 -30
- package/dist/src/models/psql/pdcChequeModel.js +40 -35
- package/dist/src/models/psql/pdcHistoryModel.js +44 -39
- package/dist/src/models/psql/pincodeModel.js +28 -23
- package/dist/src/models/psql/productModel.js +32 -27
- package/dist/src/models/psql/projectAssessmentOptionModel.js +23 -18
- package/dist/src/models/psql/roleModel.js +26 -21
- package/dist/src/models/psql/rulesRegulationModel.js +23 -18
- package/dist/src/models/psql/schoolFeeCollectionModel.js +34 -29
- package/dist/src/models/psql/schoolOfferModel.js +43 -38
- package/dist/src/models/psql/sendNotificationModel.js +32 -27
- package/dist/src/models/psql/slotModel.js +27 -22
- package/dist/src/models/psql/stateModel.js +18 -13
- package/dist/src/models/psql/subjectHasFeeModel.js +25 -20
- package/dist/src/models/psql/subjectHasPayFeeHistoryModel.js +32 -27
- package/dist/src/models/psql/syllabusModel.js +31 -26
- package/dist/src/models/psql/testimonialModel.js +52 -47
- package/dist/src/models/psql/toDoModel.js +35 -30
- package/dist/src/models/psql/tokenModel.js +12 -10
- package/dist/src/models/psql/tripModel.js +34 -29
- package/dist/src/models/psql/typeManagementModel.js +32 -27
- package/dist/src/models/psql/userBookAssessmentModel.js +34 -29
- package/dist/src/models/psql/userFeeTypeByAccountModel.js +41 -36
- package/dist/src/models/psql/userFeeTypeModel.js +44 -39
- package/dist/src/models/psql/userHasAnnouncementModel.js +31 -26
- package/dist/src/models/psql/userHasBatchModel.js +24 -19
- package/dist/src/models/psql/userHasCourseModel.js +35 -30
- package/dist/src/models/psql/userHasDeviceModel.js +26 -21
- package/dist/src/models/psql/userHasFeeTermsModel.js +45 -40
- package/dist/src/models/psql/userHasFileModel.js +29 -24
- package/dist/src/models/psql/userHasHomeWorkModel.js +36 -31
- package/dist/src/models/psql/userHasInventoryHistoryModel.js +41 -36
- package/dist/src/models/psql/userHasInventoryModel.js +45 -40
- package/dist/src/models/psql/userHasLeaveHistoryModel.js +41 -36
- package/dist/src/models/psql/userHasLeaveModel.js +34 -29
- package/dist/src/models/psql/userHasOfferModel.js +36 -31
- package/dist/src/models/psql/userHasParentModel.js +31 -26
- package/dist/src/models/psql/userHasRoleModel.js +27 -22
- package/dist/src/models/psql/userHasRollNumberModel.js +28 -23
- package/dist/src/models/psql/userHasStorageModel.js +27 -22
- package/dist/src/models/psql/userHasSubjectFeeModel.js +27 -22
- package/dist/src/models/psql/userLeaveRequestModel.js +43 -38
- package/dist/src/models/psql/userModel.js +94 -89
- package/dist/src/models/psql/userPayoutDetailsModel.js +41 -36
- package/dist/src/models/psql/userPayoutHistoryModel.js +40 -35
- package/dist/src/models/psql/userPayoutModel.js +63 -58
- package/dist/src/models/psql/userProjectAssessmentOptionModel.js +31 -26
- package/dist/src/models/psql/userRequiredStepsModel.js +22 -17
- package/dist/src/models/psql/vehicleModel.js +30 -25
- package/dist/src/models/psql/vendorManagementModel.js +44 -39
- package/dist/src/models/psql/walletHistoryModel.js +34 -28
- package/dist/src/models/psql/walletModel.js +25 -20
- package/dist/src/models/psql/workingDayModel.js +24 -19
- package/dist/src/models/psql/workingShiftModel.js +34 -29
- package/dist/src/services/Concrete/mongooseCommonService.js +9 -5
- package/dist/src/services/Concrete/sequelizeCommanService.js +9 -6
- package/dist/src/services/Contracts/IMongooseCommonService.js +2 -1
- package/dist/src/services/Contracts/ISequelizeCommonService.js +2 -1
- package/dist/src/types/academicCalendarType.js +2 -1
- package/dist/src/types/accountHasReceiptDetailsType.js +2 -1
- package/dist/src/types/announcementType.js +2 -1
- package/dist/src/types/approveRequestType.js +2 -1
- package/dist/src/types/areaType.js +2 -1
- package/dist/src/types/attendanceType.js +2 -1
- package/dist/src/types/bankAccountDetailsType.js +2 -1
- package/dist/src/types/bannerType.js +2 -1
- package/dist/src/types/batchSubjectBookAssessmentType.js +2 -1
- package/dist/src/types/batchSubjectProjectAssessmentType.js +2 -1
- package/dist/src/types/batchType.js +2 -1
- package/dist/src/types/blogType.js +2 -1
- package/dist/src/types/bookAssessmentDateType.js +2 -1
- package/dist/src/types/careerType.js +2 -1
- package/dist/src/types/categoriesType.js +2 -1
- package/dist/src/types/certificatesHistoryType.js +2 -1
- package/dist/src/types/certificatesManagementType.js +2 -1
- package/dist/src/types/classRoomType.js +2 -1
- package/dist/src/types/cloudStorageType.js +2 -1
- package/dist/src/types/coinPurchaseOfferType.js +2 -1
- package/dist/src/types/commonType.js +2 -1
- package/dist/src/types/contactFeedBackType.js +2 -1
- package/dist/src/types/courseHasVisitorsType.js +2 -1
- package/dist/src/types/courseType.js +2 -1
- package/dist/src/types/dailyBookType.js +2 -1
- package/dist/src/types/dashboardManagementType.js +2 -1
- package/dist/src/types/driverType.js +2 -1
- package/dist/src/types/entityGroupType.js +2 -1
- package/dist/src/types/eventType.js +2 -1
- package/dist/src/types/examGroupType.js +2 -1
- package/dist/src/types/examHasAnswerSheetType.js +2 -1
- package/dist/src/types/examType.js +2 -1
- package/dist/src/types/facilityType.js +2 -1
- package/dist/src/types/featureActionType.js +2 -1
- package/dist/src/types/feeHistoryDetailsType.js +2 -1
- package/dist/src/types/feeHistoryType.js +2 -1
- package/dist/src/types/feeReminderSettingType.js +2 -1
- package/dist/src/types/feeReminderType.js +2 -1
- package/dist/src/types/feeReminderTypeType.js +2 -1
- package/dist/src/types/feeTypeHasTermsType.js +2 -1
- package/dist/src/types/feeTypeType.js +2 -1
- package/dist/src/types/feedBackType.js +2 -1
- package/dist/src/types/feesCollectionType.js +2 -1
- package/dist/src/types/fileStorageType.js +2 -1
- package/dist/src/types/floormanagementType.js +2 -1
- package/dist/src/types/generateIdCardType.js +2 -1
- package/dist/src/types/greetingsType.js +2 -1
- package/dist/src/types/holidayType.js +2 -1
- package/dist/src/types/homeWorkType.js +2 -1
- package/dist/src/types/informationSupportType.js +2 -1
- package/dist/src/types/inquiryType.js +2 -1
- package/dist/src/types/instituteEntityType.js +2 -1
- package/dist/src/types/instituteEntityTypeType.js +2 -1
- package/dist/src/types/instituteSubscriptionPlanType.js +2 -1
- package/dist/src/types/instituteType.js +2 -1
- package/dist/src/types/inventoryHistoryType.js +2 -1
- package/dist/src/types/inventoryType.js +2 -1
- package/dist/src/types/jobApply.js +2 -1
- package/dist/src/types/lectureHistoryType.js +2 -1
- package/dist/src/types/lectureType.js +2 -1
- package/dist/src/types/masterLeaveType.js +2 -1
- package/dist/src/types/moduleFeatureType.js +2 -1
- package/dist/src/types/moduleType.js +2 -1
- package/dist/src/types/offerType.js +2 -1
- package/dist/src/types/paymentTermsType.js +2 -1
- package/dist/src/types/pdcChequeType.js +2 -1
- package/dist/src/types/pdcHistoryType.js +2 -1
- package/dist/src/types/photosGalleryType.js +2 -1
- package/dist/src/types/plannerType.js +2 -1
- package/dist/src/types/productType.js +2 -1
- package/dist/src/types/projectAssessmentOptionType.js +2 -1
- package/dist/src/types/roleType.js +2 -1
- package/dist/src/types/rulesRegulationType.js +2 -1
- package/dist/src/types/schoolFeeCollectionType.js +2 -1
- package/dist/src/types/schoolFeeType.js +2 -1
- package/dist/src/types/schoolOfferType.js +2 -1
- package/dist/src/types/sendNotificationType.js +2 -1
- package/dist/src/types/slotType.js +2 -1
- package/dist/src/types/subCategoryType.js +2 -1
- package/dist/src/types/subjectHasFeeType.js +2 -1
- package/dist/src/types/subjectHasPayFeeHistoryType.js +2 -1
- package/dist/src/types/subjectIndexType.js +2 -1
- package/dist/src/types/subscriptionPlanType.js +2 -1
- package/dist/src/types/syllabusType.js +2 -1
- package/dist/src/types/taskManagementType.js +2 -1
- package/dist/src/types/testimonialType.js +2 -1
- package/dist/src/types/toDoType.js +2 -1
- package/dist/src/types/tripType.js +2 -1
- package/dist/src/types/typeManagementType.js +2 -1
- package/dist/src/types/uniqueNumberCounterType.js +2 -1
- package/dist/src/types/userBookAssessmentType.js +2 -1
- package/dist/src/types/userDetailsType.js +2 -1
- package/dist/src/types/userFeeTypeByAccountType.js +2 -1
- package/dist/src/types/userFeeTypeType.js +2 -1
- package/dist/src/types/userHasAnnouncementType.js +2 -1
- package/dist/src/types/userHasBatchType.js +2 -1
- package/dist/src/types/userHasCourseType.js +2 -1
- package/dist/src/types/userHasDeviceType.js +2 -1
- package/dist/src/types/userHasFeeTermsType.js +2 -1
- package/dist/src/types/userHasFileType.js +2 -1
- package/dist/src/types/userHasHomeWorkType.js +2 -1
- package/dist/src/types/userHasInventoryHistoryType.js +2 -1
- package/dist/src/types/userHasInventoryType.js +2 -1
- package/dist/src/types/userHasLeaveHistoryType.js +2 -1
- package/dist/src/types/userHasLeaveType.js +2 -1
- package/dist/src/types/userHasOffer.js +2 -1
- package/dist/src/types/userHasParentType.js +2 -1
- package/dist/src/types/userHasRoleType.js +2 -1
- package/dist/src/types/userHasRollNumberType.js +2 -1
- package/dist/src/types/userHasStorageType.js +2 -1
- package/dist/src/types/userHasSubjectFeeType.js +2 -1
- package/dist/src/types/userInstituteMetaType.js +2 -1
- package/dist/src/types/userLeaveRequestType.js +2 -1
- package/dist/src/types/userMetaType.js +2 -1
- package/dist/src/types/userPayoutDetailsType.js +2 -1
- package/dist/src/types/userPayoutHistoryType.js +2 -1
- package/dist/src/types/userPayoutType.js +2 -1
- package/dist/src/types/userProjectAssessmentOptionType.js +2 -1
- package/dist/src/types/userRequiredStepsType.js +2 -1
- package/dist/src/types/userSchoolMetaType.js +2 -1
- package/dist/src/types/userType.js +2 -1
- package/dist/src/types/vehicleType.js +2 -1
- package/dist/src/types/vendorType.js +2 -1
- package/dist/src/types/videoAnalystType.js +2 -1
- package/dist/src/types/walletHistoryType.js +2 -1
- package/dist/src/types/walletTransactionType.js +2 -1
- package/dist/src/types/walletType.js +2 -1
- package/dist/src/types/workingDayType.js +2 -1
- package/dist/src/types/workingShiftType.js +2 -1
- package/package.json +1 -1
|
@@ -1,47 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const sequelize_1 = require("sequelize");
|
|
7
|
+
const index_js_1 = require("./index.js");
|
|
8
|
+
const app_js_1 = require("../../constants/app.js");
|
|
9
|
+
const countryModel_js_1 = __importDefault(require("./countryModel.js"));
|
|
10
|
+
const stateModel_js_1 = __importDefault(require("./stateModel.js"));
|
|
11
|
+
const cityModel_js_1 = __importDefault(require("./cityModel.js"));
|
|
12
|
+
const tokenModel_js_1 = __importDefault(require("./tokenModel.js"));
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
14
|
+
const areaModel_js_1 = __importDefault(require("./areaModel.js"));
|
|
15
|
+
const utils_js_1 = require("../../helpers/utils.js");
|
|
16
|
+
const uniqueNumberCounterModel_js_1 = __importDefault(require("../mongodb/uniqueNumberCounterModel.js"));
|
|
17
|
+
class UserModel extends sequelize_1.Model {
|
|
13
18
|
// declare addParent: BelongsToManyAddAssociationMixin<UserModel, string>;
|
|
14
19
|
// declare getParents: BelongsToManyGetAssociationsMixin<UserModel>;
|
|
15
20
|
static associate() { }
|
|
16
21
|
}
|
|
17
22
|
UserModel.init({
|
|
18
23
|
id: {
|
|
19
|
-
type: DataTypes.UUID,
|
|
20
|
-
defaultValue: DataTypes.UUIDV4,
|
|
24
|
+
type: sequelize_1.DataTypes.UUID,
|
|
25
|
+
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
21
26
|
allowNull: false,
|
|
22
27
|
primaryKey: true,
|
|
23
28
|
},
|
|
24
29
|
uuid: {
|
|
25
|
-
type: DataTypes.UUID,
|
|
30
|
+
type: sequelize_1.DataTypes.UUID,
|
|
26
31
|
allowNull: true,
|
|
27
32
|
},
|
|
28
33
|
firstName: {
|
|
29
|
-
type: DataTypes.STRING(25),
|
|
34
|
+
type: sequelize_1.DataTypes.STRING(25),
|
|
30
35
|
allowNull: false,
|
|
31
36
|
field: "first_name",
|
|
32
37
|
},
|
|
33
38
|
lastName: {
|
|
34
|
-
type: DataTypes.STRING(25),
|
|
39
|
+
type: sequelize_1.DataTypes.STRING(25),
|
|
35
40
|
allowNull: false,
|
|
36
41
|
field: "last_name",
|
|
37
42
|
},
|
|
38
43
|
middleName: {
|
|
39
|
-
type: DataTypes.STRING(25),
|
|
44
|
+
type: sequelize_1.DataTypes.STRING(25),
|
|
40
45
|
allowNull: true,
|
|
41
46
|
field: "middle_name",
|
|
42
47
|
},
|
|
43
48
|
email: {
|
|
44
|
-
type: DataTypes.STRING(50),
|
|
49
|
+
type: sequelize_1.DataTypes.STRING(50),
|
|
45
50
|
allowNull: false,
|
|
46
51
|
},
|
|
47
52
|
// userProfileImage: {
|
|
@@ -50,149 +55,149 @@ UserModel.init({
|
|
|
50
55
|
// field: 'profile_image',
|
|
51
56
|
// },
|
|
52
57
|
mobile: {
|
|
53
|
-
type: DataTypes.STRING(10),
|
|
58
|
+
type: sequelize_1.DataTypes.STRING(10),
|
|
54
59
|
allowNull: true,
|
|
55
60
|
},
|
|
56
61
|
password: {
|
|
57
|
-
type: DataTypes.STRING,
|
|
62
|
+
type: sequelize_1.DataTypes.STRING,
|
|
58
63
|
allowNull: true,
|
|
59
64
|
},
|
|
60
65
|
emailVerification: {
|
|
61
|
-
type: DataTypes.STRING(30),
|
|
66
|
+
type: sequelize_1.DataTypes.STRING(30),
|
|
62
67
|
allowNull: false,
|
|
63
68
|
field: "email_varification",
|
|
64
|
-
defaultValue: EMAIL_VERIFICATION.PENDING,
|
|
69
|
+
defaultValue: app_js_1.EMAIL_VERIFICATION.PENDING,
|
|
65
70
|
},
|
|
66
71
|
mobileVerification: {
|
|
67
|
-
type: DataTypes.STRING(30),
|
|
72
|
+
type: sequelize_1.DataTypes.STRING(30),
|
|
68
73
|
allowNull: false,
|
|
69
74
|
field: "mobile_varification",
|
|
70
|
-
defaultValue: MOBILE_VERIFICATION.PENDING,
|
|
75
|
+
defaultValue: app_js_1.MOBILE_VERIFICATION.PENDING,
|
|
71
76
|
},
|
|
72
77
|
appType: {
|
|
73
|
-
type: DataTypes.ENUM,
|
|
74
|
-
values: Object.values(APP_TYPE),
|
|
78
|
+
type: sequelize_1.DataTypes.ENUM,
|
|
79
|
+
values: Object.values(app_js_1.APP_TYPE),
|
|
75
80
|
allowNull: true,
|
|
76
81
|
field: "app_type",
|
|
77
|
-
defaultValue: APP_TYPE.INSTITUTE_APP,
|
|
82
|
+
defaultValue: app_js_1.APP_TYPE.INSTITUTE_APP,
|
|
78
83
|
},
|
|
79
84
|
type: {
|
|
80
|
-
type: DataTypes.STRING(30),
|
|
85
|
+
type: sequelize_1.DataTypes.STRING(30),
|
|
81
86
|
allowNull: false,
|
|
82
87
|
},
|
|
83
88
|
globalId: {
|
|
84
|
-
type: DataTypes.STRING,
|
|
89
|
+
type: sequelize_1.DataTypes.STRING,
|
|
85
90
|
field: "global_id",
|
|
86
91
|
defaultValue: null,
|
|
87
92
|
allowNull: true,
|
|
88
93
|
},
|
|
89
94
|
address1: {
|
|
90
|
-
type: DataTypes.STRING,
|
|
95
|
+
type: sequelize_1.DataTypes.STRING,
|
|
91
96
|
allowNull: true,
|
|
92
97
|
},
|
|
93
98
|
address2: {
|
|
94
|
-
type: DataTypes.STRING,
|
|
99
|
+
type: sequelize_1.DataTypes.STRING,
|
|
95
100
|
allowNull: true,
|
|
96
101
|
},
|
|
97
102
|
gender: {
|
|
98
|
-
type: DataTypes.STRING,
|
|
103
|
+
type: sequelize_1.DataTypes.STRING,
|
|
99
104
|
allowNull: true,
|
|
100
105
|
},
|
|
101
106
|
dob: {
|
|
102
|
-
type: DataTypes.STRING,
|
|
107
|
+
type: sequelize_1.DataTypes.STRING,
|
|
103
108
|
allowNull: true,
|
|
104
109
|
},
|
|
105
110
|
bloodGroup: {
|
|
106
|
-
type: DataTypes.STRING,
|
|
111
|
+
type: sequelize_1.DataTypes.STRING,
|
|
107
112
|
allowNull: true,
|
|
108
113
|
},
|
|
109
114
|
motherTongue: {
|
|
110
|
-
type: DataTypes.STRING,
|
|
115
|
+
type: sequelize_1.DataTypes.STRING,
|
|
111
116
|
allowNull: true,
|
|
112
117
|
},
|
|
113
118
|
otherLanguages: {
|
|
114
|
-
type: DataTypes.STRING,
|
|
119
|
+
type: sequelize_1.DataTypes.STRING,
|
|
115
120
|
allowNull: true,
|
|
116
121
|
},
|
|
117
122
|
degree: {
|
|
118
|
-
type: DataTypes.STRING,
|
|
123
|
+
type: sequelize_1.DataTypes.STRING,
|
|
119
124
|
allowNull: true,
|
|
120
125
|
},
|
|
121
126
|
college: {
|
|
122
|
-
type: DataTypes.STRING,
|
|
127
|
+
type: sequelize_1.DataTypes.STRING,
|
|
123
128
|
allowNull: true,
|
|
124
129
|
},
|
|
125
130
|
passingYear: {
|
|
126
|
-
type: DataTypes.STRING,
|
|
131
|
+
type: sequelize_1.DataTypes.STRING,
|
|
127
132
|
allowNull: true,
|
|
128
133
|
},
|
|
129
134
|
pinCode: {
|
|
130
|
-
type: DataTypes.STRING,
|
|
135
|
+
type: sequelize_1.DataTypes.STRING,
|
|
131
136
|
allowNull: true,
|
|
132
137
|
field: "pin_code",
|
|
133
138
|
},
|
|
134
139
|
country: {
|
|
135
|
-
type: DataTypes.INTEGER,
|
|
140
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
136
141
|
allowNull: true,
|
|
137
142
|
},
|
|
138
143
|
area: {
|
|
139
|
-
type: DataTypes.STRING,
|
|
144
|
+
type: sequelize_1.DataTypes.STRING,
|
|
140
145
|
allowNull: true,
|
|
141
146
|
},
|
|
142
147
|
district: {
|
|
143
|
-
type: DataTypes.STRING,
|
|
148
|
+
type: sequelize_1.DataTypes.STRING,
|
|
144
149
|
allowNull: true,
|
|
145
150
|
},
|
|
146
151
|
state: {
|
|
147
|
-
type: DataTypes.INTEGER,
|
|
152
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
148
153
|
allowNull: true,
|
|
149
154
|
},
|
|
150
155
|
city: {
|
|
151
|
-
type: DataTypes.INTEGER,
|
|
156
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
152
157
|
allowNull: true,
|
|
153
158
|
},
|
|
154
159
|
verificationOtp: {
|
|
155
|
-
type: DataTypes.STRING(10),
|
|
160
|
+
type: sequelize_1.DataTypes.STRING(10),
|
|
156
161
|
allowNull: true,
|
|
157
162
|
},
|
|
158
163
|
schoolName: {
|
|
159
|
-
type: DataTypes.STRING,
|
|
164
|
+
type: sequelize_1.DataTypes.STRING,
|
|
160
165
|
allowNull: true,
|
|
161
166
|
field: "school_name",
|
|
162
167
|
},
|
|
163
168
|
board: {
|
|
164
|
-
type: DataTypes.STRING,
|
|
169
|
+
type: sequelize_1.DataTypes.STRING,
|
|
165
170
|
allowNull: true,
|
|
166
171
|
},
|
|
167
172
|
medium: {
|
|
168
|
-
type: DataTypes.STRING,
|
|
173
|
+
type: sequelize_1.DataTypes.STRING,
|
|
169
174
|
allowNull: true,
|
|
170
175
|
},
|
|
171
176
|
standard: {
|
|
172
|
-
type: DataTypes.STRING,
|
|
177
|
+
type: sequelize_1.DataTypes.STRING,
|
|
173
178
|
allowNull: true,
|
|
174
179
|
},
|
|
175
180
|
stream: {
|
|
176
|
-
type: DataTypes.STRING,
|
|
181
|
+
type: sequelize_1.DataTypes.STRING,
|
|
177
182
|
allowNull: true,
|
|
178
183
|
},
|
|
179
184
|
schoolAddress: {
|
|
180
|
-
type: DataTypes.STRING,
|
|
185
|
+
type: sequelize_1.DataTypes.STRING,
|
|
181
186
|
allowNull: true,
|
|
182
187
|
field: "school_address",
|
|
183
188
|
},
|
|
184
189
|
knownAllergies: {
|
|
185
|
-
type: DataTypes.STRING,
|
|
190
|
+
type: sequelize_1.DataTypes.STRING,
|
|
186
191
|
allowNull: true,
|
|
187
192
|
field: "known_allergies",
|
|
188
193
|
},
|
|
189
194
|
medications: {
|
|
190
|
-
type: DataTypes.STRING,
|
|
195
|
+
type: sequelize_1.DataTypes.STRING,
|
|
191
196
|
allowNull: true,
|
|
192
197
|
field: "medications",
|
|
193
198
|
},
|
|
194
199
|
relation: {
|
|
195
|
-
type: DataTypes.STRING,
|
|
200
|
+
type: sequelize_1.DataTypes.STRING,
|
|
196
201
|
allowNull: true,
|
|
197
202
|
},
|
|
198
203
|
}, {
|
|
@@ -200,12 +205,12 @@ UserModel.init({
|
|
|
200
205
|
tableName: "users",
|
|
201
206
|
timestamps: true,
|
|
202
207
|
paranoid: true,
|
|
203
|
-
sequelize,
|
|
208
|
+
sequelize: index_js_1.sequelize,
|
|
204
209
|
});
|
|
205
|
-
UserModel.belongsTo(
|
|
206
|
-
UserModel.belongsTo(
|
|
207
|
-
UserModel.belongsTo(
|
|
208
|
-
UserModel.hasMany(
|
|
210
|
+
UserModel.belongsTo(countryModel_js_1.default, { foreignKey: "country" });
|
|
211
|
+
UserModel.belongsTo(stateModel_js_1.default, { foreignKey: "state" });
|
|
212
|
+
UserModel.belongsTo(cityModel_js_1.default, { foreignKey: "city" });
|
|
213
|
+
UserModel.hasMany(tokenModel_js_1.default, {
|
|
209
214
|
foreignKey: {
|
|
210
215
|
name: "userId",
|
|
211
216
|
field: "user_id",
|
|
@@ -241,16 +246,16 @@ UserModel.belongsTo(UserModel, {
|
|
|
241
246
|
});
|
|
242
247
|
const upsertArea = async (city) => {
|
|
243
248
|
try {
|
|
244
|
-
const exists = await
|
|
249
|
+
const exists = await areaModel_js_1.default.findOne({ where: { city: city } });
|
|
245
250
|
if (!exists) {
|
|
246
|
-
const cityData = await
|
|
251
|
+
const cityData = await cityModel_js_1.default.findOne({ where: { id: city } });
|
|
247
252
|
if (cityData) {
|
|
248
|
-
const areas = await getCityAreas(cityData.name);
|
|
253
|
+
const areas = await (0, utils_js_1.getCityAreas)(cityData.name);
|
|
249
254
|
const data = areas.map((name) => ({
|
|
250
255
|
area: name,
|
|
251
256
|
city,
|
|
252
257
|
}));
|
|
253
|
-
await
|
|
258
|
+
await areaModel_js_1.default.bulkCreate(data);
|
|
254
259
|
}
|
|
255
260
|
}
|
|
256
261
|
}
|
|
@@ -259,8 +264,8 @@ const upsertArea = async (city) => {
|
|
|
259
264
|
}
|
|
260
265
|
};
|
|
261
266
|
const beforeUpdateHook = async (user) => {
|
|
262
|
-
if (user.type === USER_TYPES.PARENTS || user.type === USER_TYPES.STUDENT) {
|
|
263
|
-
user.appType = APP_TYPE.STUDENT_APP;
|
|
267
|
+
if (user.type === app_js_1.USER_TYPES.PARENTS || user.type === app_js_1.USER_TYPES.STUDENT) {
|
|
268
|
+
user.appType = app_js_1.APP_TYPE.STUDENT_APP;
|
|
264
269
|
}
|
|
265
270
|
if (user.city) {
|
|
266
271
|
upsertArea(user.city);
|
|
@@ -271,24 +276,24 @@ const generateGlobalUniqueNumber = async (type, userType) => {
|
|
|
271
276
|
let rollNumber = "";
|
|
272
277
|
if (userType && type) {
|
|
273
278
|
const USER_TYPE_PREFIXES = {
|
|
274
|
-
[USER_TYPES.MASTER_ADMIN]: "K-MA",
|
|
275
|
-
[USER_TYPES.ADMIN]: "K-ADM",
|
|
276
|
-
[USER_TYPES.INSTITUTE_MASTER_ADMIN]: "K-IMA",
|
|
277
|
-
[USER_TYPES.INSTITUTE_ADMIN]: "K-IA",
|
|
278
|
-
[USER_TYPES.TEACHER]: "K-TEA",
|
|
279
|
-
[USER_TYPES.STUDENT]: "K-STU",
|
|
280
|
-
[USER_TYPES.PARENTS]: "K-PAR",
|
|
281
|
-
[USER_TYPES.DRIVER]: "K-DRI",
|
|
279
|
+
[app_js_1.USER_TYPES.MASTER_ADMIN]: "K-MA",
|
|
280
|
+
[app_js_1.USER_TYPES.ADMIN]: "K-ADM",
|
|
281
|
+
[app_js_1.USER_TYPES.INSTITUTE_MASTER_ADMIN]: "K-IMA",
|
|
282
|
+
[app_js_1.USER_TYPES.INSTITUTE_ADMIN]: "K-IA",
|
|
283
|
+
[app_js_1.USER_TYPES.TEACHER]: "K-TEA",
|
|
284
|
+
[app_js_1.USER_TYPES.STUDENT]: "K-STU",
|
|
285
|
+
[app_js_1.USER_TYPES.PARENTS]: "K-PAR",
|
|
286
|
+
[app_js_1.USER_TYPES.DRIVER]: "K-DRI",
|
|
282
287
|
};
|
|
283
288
|
const prefix = USER_TYPE_PREFIXES[userType] ||
|
|
284
289
|
`K-${userType.substring(0, 3).toUpperCase()}`;
|
|
285
|
-
let data = await
|
|
290
|
+
let data = await uniqueNumberCounterModel_js_1.default.findOne({
|
|
286
291
|
type: type,
|
|
287
292
|
userType: userType,
|
|
288
293
|
instituteId: null,
|
|
289
294
|
});
|
|
290
295
|
if (!data) {
|
|
291
|
-
data = await
|
|
296
|
+
data = await uniqueNumberCounterModel_js_1.default.create({
|
|
292
297
|
type: type,
|
|
293
298
|
userType: userType,
|
|
294
299
|
lastRollNumber: 1,
|
|
@@ -299,12 +304,12 @@ const generateGlobalUniqueNumber = async (type, userType) => {
|
|
|
299
304
|
data.letterCode = data.letterCode || "A";
|
|
300
305
|
if (data.lastRollNumber >= MAX_NUMBER) {
|
|
301
306
|
data.lastRollNumber = 1;
|
|
302
|
-
data.letterCode = getNextLetter(data.letterCode);
|
|
307
|
+
data.letterCode = (0, utils_js_1.getNextLetter)(data.letterCode);
|
|
303
308
|
}
|
|
304
309
|
else {
|
|
305
310
|
data.lastRollNumber += 1;
|
|
306
311
|
}
|
|
307
|
-
await
|
|
312
|
+
await uniqueNumberCounterModel_js_1.default.updateOne({ id: data.id }, {
|
|
308
313
|
$set: {
|
|
309
314
|
lastRollNumber: data.lastRollNumber,
|
|
310
315
|
letterCode: data.letterCode,
|
|
@@ -315,13 +320,13 @@ const generateGlobalUniqueNumber = async (type, userType) => {
|
|
|
315
320
|
}
|
|
316
321
|
if (type && !userType) {
|
|
317
322
|
const prefix = `K-${type.substring(0, 3).toUpperCase()}`;
|
|
318
|
-
let data = await
|
|
323
|
+
let data = await uniqueNumberCounterModel_js_1.default.findOne({
|
|
319
324
|
type: type,
|
|
320
325
|
userType: null,
|
|
321
326
|
instituteId: null,
|
|
322
327
|
});
|
|
323
328
|
if (!data) {
|
|
324
|
-
data = await
|
|
329
|
+
data = await uniqueNumberCounterModel_js_1.default.create({
|
|
325
330
|
type: type,
|
|
326
331
|
lastRollNumber: 1,
|
|
327
332
|
letterCode: "A",
|
|
@@ -331,12 +336,12 @@ const generateGlobalUniqueNumber = async (type, userType) => {
|
|
|
331
336
|
data.letterCode = data.letterCode || "A";
|
|
332
337
|
if (data.lastRollNumber >= MAX_NUMBER) {
|
|
333
338
|
data.lastRollNumber = 1;
|
|
334
|
-
data.letterCode = getNextLetter(data.letterCode);
|
|
339
|
+
data.letterCode = (0, utils_js_1.getNextLetter)(data.letterCode);
|
|
335
340
|
}
|
|
336
341
|
else {
|
|
337
342
|
data.lastRollNumber += 1;
|
|
338
343
|
}
|
|
339
|
-
await
|
|
344
|
+
await uniqueNumberCounterModel_js_1.default.updateOne({ id: data.id }, {
|
|
340
345
|
$set: {
|
|
341
346
|
lastRollNumber: data.lastRollNumber,
|
|
342
347
|
letterCode: data.letterCode,
|
|
@@ -348,16 +353,16 @@ const generateGlobalUniqueNumber = async (type, userType) => {
|
|
|
348
353
|
return rollNumber;
|
|
349
354
|
};
|
|
350
355
|
const userBeforeCreateHook = async (user) => {
|
|
351
|
-
if (user.type === USER_TYPES.PARENTS || user.type === USER_TYPES.STUDENT) {
|
|
352
|
-
user.appType = APP_TYPE.STUDENT_APP;
|
|
356
|
+
if (user.type === app_js_1.USER_TYPES.PARENTS || user.type === app_js_1.USER_TYPES.STUDENT) {
|
|
357
|
+
user.appType = app_js_1.APP_TYPE.STUDENT_APP;
|
|
353
358
|
}
|
|
354
359
|
if (user.type) {
|
|
355
|
-
user.globalId = await generateGlobalUniqueNumber(TYPE_OF_USER.USER, user.type);
|
|
360
|
+
user.globalId = await generateGlobalUniqueNumber(app_js_1.TYPE_OF_USER.USER, user.type);
|
|
356
361
|
}
|
|
357
|
-
user.uuid =
|
|
362
|
+
user.uuid = (0, uuid_1.v4)();
|
|
358
363
|
const where = {
|
|
359
364
|
email: user.email,
|
|
360
|
-
uuid: { [Op.ne]: null }, // uuid must not be null
|
|
365
|
+
uuid: { [sequelize_1.Op.ne]: null }, // uuid must not be null
|
|
361
366
|
};
|
|
362
367
|
const existUuid = await UserModel.findOne({ where });
|
|
363
368
|
if (existUuid)
|
|
@@ -384,4 +389,4 @@ UserModel.beforeBulkUpdate(async (options) => {
|
|
|
384
389
|
// foreignKey: 'userId',
|
|
385
390
|
// otherKey: 'parentId',
|
|
386
391
|
// });
|
|
387
|
-
|
|
392
|
+
exports.default = UserModel;
|
|
@@ -1,65 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const sequelize_1 = require("sequelize");
|
|
7
|
+
const index_js_1 = require("./index.js");
|
|
8
|
+
const app_js_1 = require("../../constants/app.js");
|
|
9
|
+
const userModel_js_1 = __importDefault(require("./userModel.js"));
|
|
10
|
+
const instituteModel_js_1 = __importDefault(require("./instituteModel.js"));
|
|
11
|
+
const batchModel_js_1 = __importDefault(require("./batchModel.js"));
|
|
12
|
+
const instituteEntityModel_js_1 = __importDefault(require("./instituteEntityModel.js"));
|
|
13
|
+
const userPayoutModel_js_1 = __importDefault(require("./userPayoutModel.js"));
|
|
14
|
+
class UserPayoutDetailsModel extends sequelize_1.Model {
|
|
10
15
|
}
|
|
11
16
|
UserPayoutDetailsModel.init({
|
|
12
17
|
id: {
|
|
13
|
-
type: DataTypes.UUID,
|
|
14
|
-
defaultValue: DataTypes.UUIDV4,
|
|
18
|
+
type: sequelize_1.DataTypes.UUID,
|
|
19
|
+
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
15
20
|
allowNull: false,
|
|
16
21
|
primaryKey: true,
|
|
17
22
|
},
|
|
18
23
|
subjectId: {
|
|
19
|
-
type: DataTypes.UUID,
|
|
24
|
+
type: sequelize_1.DataTypes.UUID,
|
|
20
25
|
allowNull: false,
|
|
21
26
|
field: 'subject_id',
|
|
22
27
|
},
|
|
23
28
|
batchId: {
|
|
24
|
-
type: DataTypes.UUID,
|
|
29
|
+
type: sequelize_1.DataTypes.UUID,
|
|
25
30
|
allowNull: false,
|
|
26
31
|
field: 'batch_id',
|
|
27
32
|
},
|
|
28
33
|
userPayoutId: {
|
|
29
|
-
type: DataTypes.UUID,
|
|
34
|
+
type: sequelize_1.DataTypes.UUID,
|
|
30
35
|
allowNull: false,
|
|
31
36
|
field: 'user_payout_id',
|
|
32
37
|
},
|
|
33
38
|
payableAmount: {
|
|
34
|
-
type: DataTypes.FLOAT,
|
|
39
|
+
type: sequelize_1.DataTypes.FLOAT,
|
|
35
40
|
allowNull: true,
|
|
36
41
|
defaultValue: 0,
|
|
37
42
|
field: 'payable_amount',
|
|
38
43
|
},
|
|
39
44
|
amountPerHour: {
|
|
40
|
-
type: DataTypes.FLOAT,
|
|
45
|
+
type: sequelize_1.DataTypes.FLOAT,
|
|
41
46
|
allowNull: true,
|
|
42
47
|
defaultValue: 0,
|
|
43
48
|
field: 'amount_per_hour',
|
|
44
49
|
},
|
|
45
50
|
percentage: {
|
|
46
|
-
type: DataTypes.FLOAT,
|
|
51
|
+
type: sequelize_1.DataTypes.FLOAT,
|
|
47
52
|
allowNull: true,
|
|
48
53
|
defaultValue: 0,
|
|
49
54
|
field: 'percentage',
|
|
50
55
|
},
|
|
51
56
|
type: {
|
|
52
|
-
type: DataTypes.ENUM,
|
|
53
|
-
values: Object.values(USER_PAYOUT_TYPE),
|
|
57
|
+
type: sequelize_1.DataTypes.ENUM,
|
|
58
|
+
values: Object.values(app_js_1.USER_PAYOUT_TYPE),
|
|
54
59
|
allowNull: false,
|
|
55
60
|
},
|
|
56
61
|
userId: {
|
|
57
|
-
type: DataTypes.UUID,
|
|
62
|
+
type: sequelize_1.DataTypes.UUID,
|
|
58
63
|
allowNull: false,
|
|
59
64
|
field: 'user_id',
|
|
60
65
|
},
|
|
61
66
|
instituteId: {
|
|
62
|
-
type: DataTypes.UUID,
|
|
67
|
+
type: sequelize_1.DataTypes.UUID,
|
|
63
68
|
allowNull: false,
|
|
64
69
|
field: 'institute_id',
|
|
65
70
|
},
|
|
@@ -68,9 +73,9 @@ UserPayoutDetailsModel.init({
|
|
|
68
73
|
tableName: 'user_payout_details',
|
|
69
74
|
timestamps: true,
|
|
70
75
|
paranoid: true,
|
|
71
|
-
sequelize,
|
|
76
|
+
sequelize: index_js_1.sequelize,
|
|
72
77
|
});
|
|
73
|
-
UserPayoutDetailsModel.belongsTo(
|
|
78
|
+
UserPayoutDetailsModel.belongsTo(userModel_js_1.default, {
|
|
74
79
|
foreignKey: {
|
|
75
80
|
name: 'createdBy',
|
|
76
81
|
allowNull: true,
|
|
@@ -78,7 +83,7 @@ UserPayoutDetailsModel.belongsTo(UserModel, {
|
|
|
78
83
|
},
|
|
79
84
|
as: 'createdByUser',
|
|
80
85
|
});
|
|
81
|
-
UserPayoutDetailsModel.belongsTo(
|
|
86
|
+
UserPayoutDetailsModel.belongsTo(userModel_js_1.default, {
|
|
82
87
|
foreignKey: {
|
|
83
88
|
name: 'updatedBy',
|
|
84
89
|
allowNull: true,
|
|
@@ -86,7 +91,7 @@ UserPayoutDetailsModel.belongsTo(UserModel, {
|
|
|
86
91
|
},
|
|
87
92
|
as: 'updatedByUser',
|
|
88
93
|
});
|
|
89
|
-
UserPayoutDetailsModel.belongsTo(
|
|
94
|
+
UserPayoutDetailsModel.belongsTo(userModel_js_1.default, {
|
|
90
95
|
foreignKey: {
|
|
91
96
|
name: 'deletedBy',
|
|
92
97
|
allowNull: true,
|
|
@@ -94,64 +99,64 @@ UserPayoutDetailsModel.belongsTo(UserModel, {
|
|
|
94
99
|
},
|
|
95
100
|
as: 'deletedByUser',
|
|
96
101
|
});
|
|
97
|
-
UserPayoutDetailsModel.belongsTo(
|
|
102
|
+
UserPayoutDetailsModel.belongsTo(instituteModel_js_1.default, {
|
|
98
103
|
foreignKey: {
|
|
99
104
|
name: 'instituteId',
|
|
100
105
|
},
|
|
101
106
|
as: 'institute',
|
|
102
107
|
});
|
|
103
|
-
|
|
108
|
+
instituteModel_js_1.default.hasMany(UserPayoutDetailsModel, {
|
|
104
109
|
foreignKey: {
|
|
105
110
|
name: 'instituteId',
|
|
106
111
|
},
|
|
107
112
|
as: 'instituteHasPayoutDetailsList',
|
|
108
113
|
});
|
|
109
|
-
UserPayoutDetailsModel.belongsTo(
|
|
114
|
+
UserPayoutDetailsModel.belongsTo(batchModel_js_1.default, {
|
|
110
115
|
foreignKey: {
|
|
111
116
|
name: 'batchId',
|
|
112
117
|
},
|
|
113
118
|
as: 'batch',
|
|
114
119
|
});
|
|
115
|
-
|
|
120
|
+
batchModel_js_1.default.hasMany(UserPayoutDetailsModel, {
|
|
116
121
|
foreignKey: {
|
|
117
122
|
name: 'batchId',
|
|
118
123
|
},
|
|
119
124
|
as: 'batchHasPayoutDetailsList',
|
|
120
125
|
});
|
|
121
|
-
UserPayoutDetailsModel.belongsTo(
|
|
126
|
+
UserPayoutDetailsModel.belongsTo(instituteEntityModel_js_1.default, {
|
|
122
127
|
foreignKey: {
|
|
123
128
|
name: 'subjectId',
|
|
124
129
|
},
|
|
125
130
|
as: 'subject',
|
|
126
131
|
});
|
|
127
|
-
|
|
132
|
+
instituteEntityModel_js_1.default.hasMany(UserPayoutDetailsModel, {
|
|
128
133
|
foreignKey: {
|
|
129
134
|
name: 'subjectId',
|
|
130
135
|
},
|
|
131
136
|
as: 'subjectHasPayoutDetailsList',
|
|
132
137
|
});
|
|
133
|
-
UserPayoutDetailsModel.belongsTo(
|
|
138
|
+
UserPayoutDetailsModel.belongsTo(userModel_js_1.default, {
|
|
134
139
|
foreignKey: {
|
|
135
140
|
name: 'userId',
|
|
136
141
|
},
|
|
137
142
|
as: 'user',
|
|
138
143
|
});
|
|
139
|
-
|
|
144
|
+
userModel_js_1.default.hasMany(UserPayoutDetailsModel, {
|
|
140
145
|
foreignKey: {
|
|
141
146
|
name: 'userId',
|
|
142
147
|
},
|
|
143
148
|
as: 'userHasPayoutDetailsList',
|
|
144
149
|
});
|
|
145
|
-
UserPayoutDetailsModel.belongsTo(
|
|
150
|
+
UserPayoutDetailsModel.belongsTo(userPayoutModel_js_1.default, {
|
|
146
151
|
foreignKey: {
|
|
147
152
|
name: 'userPayoutId',
|
|
148
153
|
},
|
|
149
154
|
as: 'userPayout',
|
|
150
155
|
});
|
|
151
|
-
|
|
156
|
+
userPayoutModel_js_1.default.hasMany(UserPayoutDetailsModel, {
|
|
152
157
|
foreignKey: {
|
|
153
158
|
name: 'userPayoutId',
|
|
154
159
|
},
|
|
155
160
|
as: 'userPayoutDetailsList',
|
|
156
161
|
});
|
|
157
|
-
|
|
162
|
+
exports.default = UserPayoutDetailsModel;
|