@7365admin1/core 2.44.0 → 2.45.0
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +156 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -86
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2146,7 +2146,7 @@ declare function parseDahuaFind(text: string): {
|
|
|
2146
2146
|
plateNumber: string | undefined;
|
|
2147
2147
|
};
|
|
2148
2148
|
declare function useVehicleService(): {
|
|
2149
|
-
add: (value: TVehicle) => Promise<string>;
|
|
2149
|
+
add: (value: TVehicle, session?: ClientSession) => Promise<string>;
|
|
2150
2150
|
deleteVehicle: (_id: string, recno: string, site: string, type: string, bypass?: boolean) => Promise<string>;
|
|
2151
2151
|
approveVehicleById: (id: string, orgId: string, siteId: string) => Promise<string>;
|
|
2152
2152
|
processDeletingExpiredVehicles: () => Promise<string>;
|
|
@@ -3971,7 +3971,7 @@ declare function MEventManagement(value: TEventManagement): {
|
|
|
3971
3971
|
site: ObjectId;
|
|
3972
3972
|
title: string;
|
|
3973
3973
|
description: string;
|
|
3974
|
-
dateTime:
|
|
3974
|
+
dateTime: Date;
|
|
3975
3975
|
status: "completed" | "planned" | "in_progress";
|
|
3976
3976
|
type: "TASK" | "EVENT";
|
|
3977
3977
|
createdAt: string | Date;
|
|
@@ -4793,6 +4793,15 @@ declare function useOccurrenceBookController(): {
|
|
|
4793
4793
|
deleteOccurrenceBookById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
4794
4794
|
};
|
|
4795
4795
|
|
|
4796
|
+
declare enum BulletinVideoSort {
|
|
4797
|
+
CREATED_AT = "createdAt",
|
|
4798
|
+
NAME = "name",
|
|
4799
|
+
ID = "_id"
|
|
4800
|
+
}
|
|
4801
|
+
declare enum BulletinVideoOrder {
|
|
4802
|
+
ASC = "asc",
|
|
4803
|
+
DESC = "desc"
|
|
4804
|
+
}
|
|
4796
4805
|
type TBulletinVideo = {
|
|
4797
4806
|
_id?: ObjectId;
|
|
4798
4807
|
site: ObjectId;
|
|
@@ -6606,4 +6615,4 @@ declare function useRoleControllerV2(): {
|
|
|
6606
6615
|
createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
6607
6616
|
};
|
|
6608
6617
|
|
|
6609
|
-
export { ANPRMode, AccessTypeProps, AppServiceType, AssignCardConfig, BuildingStatus, BulkCardUpdate, BulletinRecipient, BulletinSort, BulletinStatus, Camera, CameraType, DEVICE_STATUS, DOBStatus, DayOfWeek, EAccessCardTypes, EAccessCardUserTypes, EmailSender, EntryOrder, EntrySort, FacilitySort, FacilityStatus, GuestSort, GuestStatus, IAccessCard, IAccessCardTransaction, MAccessCard, MAccessCardTransaction, MAddress, MAttendance, MAttendanceSettings, MBillingConfiguration, MBillingItem, MBuilding, MBuildingUnit, MBulletinBoard, MBulletinVideo, MChat, MCustomer, MCustomerSite, MDocumentManagement, MEntryPassSettings, MEventManagement, MFeedback, MFile, MGuestManagement, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPromoCode, MRobot, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubscription, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PERSON_TYPES, PMDashboardCollection, PStatus, Period, PersonStatus, PersonType, PersonTypes, QrTagProps, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TChat, TCheckPoint$1 as TCheckPoint, TComplaintInfo, TComplaintReceivedTo, TCounter, TCustomer, TCustomerSite, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentManagement, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInvoice, TKeyRef, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMember, TMemberUpdateStatus, TMiniRole, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOrg, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPerson, TPlaceOfIncident, TPlates, TPrice, TPriceType, TPromoCode, TPromoTier, TRecipientOfComplaint, TRemarks, TResident, TRobot, TRobotMetadata, TRole, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSite, TSiteCamera, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteUpdateBlock, TStatementOfAccount, TSubmissionForm, TSubscription, TUnitBilling, TUnits, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationMetadata, TVerificationMetadataV2, TVerificationV2, TVisitorTransaction, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UseAccessManagementRepo, UserStatus, VehicleCategory, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, addressSchema, allowedFieldsSite, allowedNatures, attendanceSchema, attendanceSettingsSchema, buildings_namespace_collection, bulletin_boards_namespace_collection, calculatePercentage, chatSchema, createManpowerRemarksDaily, customerSchema, designationsSchema, events_namespace_collection, facility_bookings_namespace_collection, feedbackSchema, feedbacks_namespace_collection, formatDahuaDate, getPeriodRangeWithPrevious, guests_namespace_collection, incidentReport, incidentReportLog, incidents_namespace_collection, landscapeDashboardCollection, logCamera, mAndEDashboardCollection, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, occurrence_book_namespace_collection, orgSchema, overnight_parking_requests_namespace_collection, parseDahuaFind, pestDashboardCollection, poolDashboardCollection, promoCodeSchema, remarksSchema, robotSchema, schema, schemaApprovedBy, schemaApprover, schemaBilling, schemaBillingConfiguration, schemaBillingItem, schemaBuilding, schemaBuildingUnit, schemaBuildingUpdateOptions, schemaBulletinBoard, schemaBulletinVideo, schemaCustomerSite, schemaDocumentManagement, schemaEntryPassSettings, schemaEventManagement, schemaFiles, schemaGuestManagement, schemaIncidentReport, schemaNfcPatrolLog, schemaNfcPatrolRoute, schemaNfcPatrolTag, schemaNfcPatrolTagUpdateData, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPlate, schemaServiceProvider, schemaServiceProviderBilling, schemaSiteCamera, schemaSiteFacility, schemaSiteFacilityBooking, schemaStatementOfAccount, schemaUnitBilling, schemaUpdateBulletinBoard, schemaUpdateBulletinVideo, schemaUpdateDocumentManagement, schemaUpdateEntryPassSettings, schemaUpdateEventManagement, schemaUpdateGuestManagement, schemaUpdateIncidentReport, schemaUpdateOccurrenceBook, schemaUpdateOccurrenceEntry, schemaUpdateOccurrenceSubject, schemaUpdateOnlineForm, schemaUpdateOptions, schemaUpdateOvernightParkingRequest, schemaUpdatePatrolLog, schemaUpdatePatrolQuestion, schemaUpdatePatrolRoute, schemaUpdatePerson, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, securityDashboardCollection, shiftSchema, siteSchema, site_people_namespace_collection, tokenSchema, updateRemarksStatusEod, updateRemarksisAcknowledged, updateSiteSchema, useAccessManagementController, useAddressRepo, useAttendanceController, useAttendanceRepository, useAttendanceSettingsController, useAttendanceSettingsRepository, useAttendanceSettingsService, useAuthController, useAuthControllerV2, useAuthService, useAuthServiceV2, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBulletinBoardController, useBulletinBoardRepo, useBulletinBoardService, useBulletinVideoController, useBulletinVideoRepo, useBulletinVideoService, useChatController, useChatRepo, useCounterModel, useCounterRepo, useCustomerController, useCustomerRepo, useCustomerSiteController, useCustomerSiteRepo, useCustomerSiteService, useDahuaService, useDashboardController, useDashboardRepo, useDocumentManagementController, useDocumentManagementRepo, useDocumentManagementService, useEntryPassSettingsController, useEntryPassSettingsRepo, useEventManagementController, useEventManagementRepo, useEventManagementService, useFeedbackController, useFeedbackRepo, useFeedbackService, useFileController, useFileRepo, useFileService, useGuestManagementController, useGuestManagementRepo, useGuestManagementService, useHrmLabsAttendanceCtrl, useHrmLabsAttendanceSrvc, useIncidentReportController, useIncidentReportRepo, useIncidentReportService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useManpowerDesignationCtrl, useManpowerDesignationRepo, useManpowerMonitoringCtrl, useManpowerMonitoringRepo, useManpowerMonitoringSrvc, useManpowerRemarkCtrl, useManpowerRemarksRepo, useManpowerSitesCtrl, useManpowerSitesRepo, useManpowerSitesSrvc, useMemberController, useMemberRepo, useNewDashboardController, useNewDashboardRepo, useNfcPatrolLogController, useNfcPatrolLogRepo, useNfcPatrolLogService, useNfcPatrolRouteController, useNfcPatrolRouteRepo, useNfcPatrolRouteService, useNfcPatrolSettingsController, useNfcPatrolSettingsRepository, useNfcPatrolSettingsService, useNfcPatrolTagController, useNfcPatrolTagRepo, useNfcPatrolTagService, useOccurrenceBookController, useOccurrenceBookRepo, useOccurrenceBookService, useOccurrenceEntryController, useOccurrenceEntryRepo, useOccurrenceEntryService, useOccurrenceSubjectController, useOccurrenceSubjectRepo, useOccurrenceSubjectService, useOnlineFormController, useOnlineFormRepo, useOrgController, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolLogController, usePatrolLogRepo, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotController, useRobotRepo, useRobotService, useRoleController, useRoleControllerV2, useRoleRepo, useRoleRepoV2, useRoleServiceV2, useServiceProviderBillingController, useServiceProviderBillingRepo, useServiceProviderBillingService, useServiceProviderController, useServiceProviderRepo, useSessionRepo, useSiteBillingConfigurationController, useSiteBillingConfigurationRepo, useSiteBillingItemController, useSiteBillingItemRepo, useSiteCameraController, useSiteCameraRepo, useSiteCameraService, useSiteController, useSiteFacilityBookingController, useSiteFacilityBookingRepo, useSiteFacilityBookingService, useSiteFacilityController, useSiteFacilityRepo, useSiteFacilityService, useSiteRepo, useSiteService, useSiteUnitBillingController, useSiteUnitBillingRepo, useSiteUnitBillingService, useStatementOfAccountController, useStatementOfAccountRepo, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useUserController, useUserControllerV2, useUserRepo, useUserRepoV2, useUserService, useUserServiceV2, useVehicleController, useVehicleRepo, useVehicleService, useVerificationController, useVerificationControllerV2, useVerificationRepo, useVerificationRepoV2, useVerificationService, useVerificationServiceV2, useVisitorTransactionController, useVisitorTransactionRepo, useVisitorTransactionService, useWorkOrderController, useWorkOrderRepo, useWorkOrderService, userSchema, vehicleSchema, vehicles_namespace_collection, visitors_namespace_collection, workOrderSchema, work_orders_namespace_collection };
|
|
6618
|
+
export { ANPRMode, AccessTypeProps, AppServiceType, AssignCardConfig, BuildingStatus, BulkCardUpdate, BulletinRecipient, BulletinSort, BulletinStatus, BulletinVideoOrder, BulletinVideoSort, Camera, CameraType, DEVICE_STATUS, DOBStatus, DayOfWeek, EAccessCardTypes, EAccessCardUserTypes, EmailSender, EntryOrder, EntrySort, FacilitySort, FacilityStatus, GuestSort, GuestStatus, IAccessCard, IAccessCardTransaction, MAccessCard, MAccessCardTransaction, MAddress, MAttendance, MAttendanceSettings, MBillingConfiguration, MBillingItem, MBuilding, MBuildingUnit, MBulletinBoard, MBulletinVideo, MChat, MCustomer, MCustomerSite, MDocumentManagement, MEntryPassSettings, MEventManagement, MFeedback, MFile, MGuestManagement, MIncidentReport, MManpowerDesignations, MManpowerMonitoring, MManpowerRemarks, MManpowerSites, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MOvernightParkingApprovalHours, MOvernightParkingRequest, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPromoCode, MRobot, MRole, MRoleV2, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubscription, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVerificationV2, MVisitorTransaction, MWorkOrder, OrgNature, OvernightParkingRequestSort, OvernightParkingRequestStatus, PERSON_TYPES, PMDashboardCollection, PStatus, Period, PersonStatus, PersonType, PersonTypes, QrTagProps, SiteAddress, SiteCategories, SiteStatus, SortFields, SortOrder, Status, SubjectOrder, SubjectSort, SubscriptionType, TAccessMngmntSettings, TActionStatus, TAddress, TAffectedEntities, TAffectedInjured, TAppServiceType, TApprovedBy, TApprover, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TAuthoritiesCalled, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TChat, TCheckPoint$1 as TCheckPoint, TComplaintInfo, TComplaintReceivedTo, TCounter, TCustomer, TCustomerSite, TDayNumber, TDaySchedule, TDefaultAccessCard, TDesignations, TDocs, TDocumentManagement, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TFiles, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInvoice, TKeyRef, TManpowerDesignations, TManpowerDesignationsUpdate, TManpowerMonitoring, TManpowerMonitoringUpdate, TManpowerRemarks, TManpowerRemarksStatusUpdate, TManpowerRemarksUpdate, TManpowerSearchFilter, TManpowerSites, TMember, TMemberUpdateStatus, TMiniRole, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOrg, TOvernightParkingApprovalHours, TOvernightParkingRequest, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPerson, TPlaceOfIncident, TPlates, TPrice, TPriceType, TPromoCode, TPromoTier, TRecipientOfComplaint, TRemarks, TResident, TRobot, TRobotMetadata, TRole, TRoleV2, TRoute, TSOABillingItem, TSOAStatus, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TShifts, TSite, TSiteCamera, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteInformation, TSiteMetadata, TSiteUpdateBlock, TStatementOfAccount, TSubmissionForm, TSubscription, TUnitBilling, TUnits, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationMetadata, TVerificationMetadataV2, TVerificationV2, TVisitorTransaction, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, TanyoneDamageToProperty, UseAccessManagementRepo, UserStatus, VehicleCategory, VehicleOrder, VehicleSort, VehicleStatus, VehicleType, VerificationLinkType, VerificationStatus, VerificationSubjectType, VerificationType, VisitorSort, VisitorStatus, addressSchema, allowedFieldsSite, allowedNatures, attendanceSchema, attendanceSettingsSchema, buildings_namespace_collection, bulletin_boards_namespace_collection, calculatePercentage, chatSchema, createManpowerRemarksDaily, customerSchema, designationsSchema, events_namespace_collection, facility_bookings_namespace_collection, feedbackSchema, feedbacks_namespace_collection, formatDahuaDate, getPeriodRangeWithPrevious, guests_namespace_collection, incidentReport, incidentReportLog, incidents_namespace_collection, landscapeDashboardCollection, logCamera, mAndEDashboardCollection, manpowerDesignationsSchema, manpowerEvents, manpowerMonitoringSchema, manpowerRemarksSchema, manpowerSitesSchema, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, occurrence_book_namespace_collection, orgSchema, overnight_parking_requests_namespace_collection, parseDahuaFind, pestDashboardCollection, poolDashboardCollection, promoCodeSchema, remarksSchema, robotSchema, schema, schemaApprovedBy, schemaApprover, schemaBilling, schemaBillingConfiguration, schemaBillingItem, schemaBuilding, schemaBuildingUnit, schemaBuildingUpdateOptions, schemaBulletinBoard, schemaBulletinVideo, schemaCustomerSite, schemaDocumentManagement, schemaEntryPassSettings, schemaEventManagement, schemaFiles, schemaGuestManagement, schemaIncidentReport, schemaNfcPatrolLog, schemaNfcPatrolRoute, schemaNfcPatrolTag, schemaNfcPatrolTagUpdateData, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaOvernightParkingApprovalHours, schemaOvernightParkingRequest, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPlate, schemaServiceProvider, schemaServiceProviderBilling, schemaSiteCamera, schemaSiteFacility, schemaSiteFacilityBooking, schemaStatementOfAccount, schemaUnitBilling, schemaUpdateBulletinBoard, schemaUpdateBulletinVideo, schemaUpdateDocumentManagement, schemaUpdateEntryPassSettings, schemaUpdateEventManagement, schemaUpdateGuestManagement, schemaUpdateIncidentReport, schemaUpdateOccurrenceBook, schemaUpdateOccurrenceEntry, schemaUpdateOccurrenceSubject, schemaUpdateOnlineForm, schemaUpdateOptions, schemaUpdateOvernightParkingRequest, schemaUpdatePatrolLog, schemaUpdatePatrolQuestion, schemaUpdatePatrolRoute, schemaUpdatePerson, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteFacilityBooking, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, securityDashboardCollection, shiftSchema, siteSchema, site_people_namespace_collection, tokenSchema, updateRemarksStatusEod, updateRemarksisAcknowledged, updateSiteSchema, useAccessManagementController, useAddressRepo, useAttendanceController, useAttendanceRepository, useAttendanceSettingsController, useAttendanceSettingsRepository, useAttendanceSettingsService, useAuthController, useAuthControllerV2, useAuthService, useAuthServiceV2, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBulletinBoardController, useBulletinBoardRepo, useBulletinBoardService, useBulletinVideoController, useBulletinVideoRepo, useBulletinVideoService, useChatController, useChatRepo, useCounterModel, useCounterRepo, useCustomerController, useCustomerRepo, useCustomerSiteController, useCustomerSiteRepo, useCustomerSiteService, useDahuaService, useDashboardController, useDashboardRepo, useDocumentManagementController, useDocumentManagementRepo, useDocumentManagementService, useEntryPassSettingsController, useEntryPassSettingsRepo, useEventManagementController, useEventManagementRepo, useEventManagementService, useFeedbackController, useFeedbackRepo, useFeedbackService, useFileController, useFileRepo, useFileService, useGuestManagementController, useGuestManagementRepo, useGuestManagementService, useHrmLabsAttendanceCtrl, useHrmLabsAttendanceSrvc, useIncidentReportController, useIncidentReportRepo, useIncidentReportService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useManpowerDesignationCtrl, useManpowerDesignationRepo, useManpowerMonitoringCtrl, useManpowerMonitoringRepo, useManpowerMonitoringSrvc, useManpowerRemarkCtrl, useManpowerRemarksRepo, useManpowerSitesCtrl, useManpowerSitesRepo, useManpowerSitesSrvc, useMemberController, useMemberRepo, useNewDashboardController, useNewDashboardRepo, useNfcPatrolLogController, useNfcPatrolLogRepo, useNfcPatrolLogService, useNfcPatrolRouteController, useNfcPatrolRouteRepo, useNfcPatrolRouteService, useNfcPatrolSettingsController, useNfcPatrolSettingsRepository, useNfcPatrolSettingsService, useNfcPatrolTagController, useNfcPatrolTagRepo, useNfcPatrolTagService, useOccurrenceBookController, useOccurrenceBookRepo, useOccurrenceBookService, useOccurrenceEntryController, useOccurrenceEntryRepo, useOccurrenceEntryService, useOccurrenceSubjectController, useOccurrenceSubjectRepo, useOccurrenceSubjectService, useOnlineFormController, useOnlineFormRepo, useOrgController, useOrgRepo, useOvernightParkingController, useOvernightParkingRepo, useOvernightParkingRequestController, useOvernightParkingRequestRepo, useOvernightParkingRequestService, usePatrolLogController, usePatrolLogRepo, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRedDotPaymentController, useRedDotPaymentRepo, useRedDotPaymentSvc, useRobotController, useRobotRepo, useRobotService, useRoleController, useRoleControllerV2, useRoleRepo, useRoleRepoV2, useRoleServiceV2, useServiceProviderBillingController, useServiceProviderBillingRepo, useServiceProviderBillingService, useServiceProviderController, useServiceProviderRepo, useSessionRepo, useSiteBillingConfigurationController, useSiteBillingConfigurationRepo, useSiteBillingItemController, useSiteBillingItemRepo, useSiteCameraController, useSiteCameraRepo, useSiteCameraService, useSiteController, useSiteFacilityBookingController, useSiteFacilityBookingRepo, useSiteFacilityBookingService, useSiteFacilityController, useSiteFacilityRepo, useSiteFacilityService, useSiteRepo, useSiteService, useSiteUnitBillingController, useSiteUnitBillingRepo, useSiteUnitBillingService, useStatementOfAccountController, useStatementOfAccountRepo, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useUserController, useUserControllerV2, useUserRepo, useUserRepoV2, useUserService, useUserServiceV2, useVehicleController, useVehicleRepo, useVehicleService, useVerificationController, useVerificationControllerV2, useVerificationRepo, useVerificationRepoV2, useVerificationService, useVerificationServiceV2, useVisitorTransactionController, useVisitorTransactionRepo, useVisitorTransactionService, useWorkOrderController, useWorkOrderRepo, useWorkOrderService, userSchema, vehicleSchema, vehicles_namespace_collection, visitors_namespace_collection, workOrderSchema, work_orders_namespace_collection };
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,8 @@ __export(src_exports, {
|
|
|
37
37
|
BulletinRecipient: () => BulletinRecipient,
|
|
38
38
|
BulletinSort: () => BulletinSort,
|
|
39
39
|
BulletinStatus: () => BulletinStatus,
|
|
40
|
+
BulletinVideoOrder: () => BulletinVideoOrder,
|
|
41
|
+
BulletinVideoSort: () => BulletinVideoSort,
|
|
40
42
|
CameraType: () => CameraType,
|
|
41
43
|
DEVICE_STATUS: () => DEVICE_STATUS,
|
|
42
44
|
DOBStatus: () => DOBStatus,
|
|
@@ -3012,7 +3014,8 @@ function useUserRepo() {
|
|
|
3012
3014
|
"dateOfBirth",
|
|
3013
3015
|
"profile",
|
|
3014
3016
|
"gender",
|
|
3015
|
-
"defaultOrg"
|
|
3017
|
+
"defaultOrg",
|
|
3018
|
+
"status"
|
|
3016
3019
|
];
|
|
3017
3020
|
if (!allowedFields.includes(field)) {
|
|
3018
3021
|
throw new import_node_server_utils10.BadRequestError(
|
|
@@ -16730,10 +16733,13 @@ function useVehicleService() {
|
|
|
16730
16733
|
pullVehicleByRecNo: _pullVehicleByRecNo
|
|
16731
16734
|
} = usePersonRepo();
|
|
16732
16735
|
const { getUnitByBlockLevelUnitNumber: _getUnitByBlockLevelUnitNumber } = useBuildingUnitRepo();
|
|
16733
|
-
async function add(value) {
|
|
16734
|
-
const
|
|
16736
|
+
async function add(value, session) {
|
|
16737
|
+
const isExternalSession = !!session;
|
|
16735
16738
|
if (!session) {
|
|
16736
|
-
|
|
16739
|
+
session = await import_node_server_utils75.useAtlas.getClient()?.startSession();
|
|
16740
|
+
if (!session) {
|
|
16741
|
+
throw new Error("Unable to start session for vehicle service.");
|
|
16742
|
+
}
|
|
16737
16743
|
}
|
|
16738
16744
|
const [_vehiclePlateNumber] = value.plateNumber;
|
|
16739
16745
|
const [existingPlateNumber, org] = await Promise.all([
|
|
@@ -16790,7 +16796,9 @@ function useVehicleService() {
|
|
|
16790
16796
|
const owner = value.name;
|
|
16791
16797
|
const plateNumbers = value.plateNumber;
|
|
16792
16798
|
try {
|
|
16793
|
-
|
|
16799
|
+
if (!isExternalSession) {
|
|
16800
|
+
session.startTransaction();
|
|
16801
|
+
}
|
|
16794
16802
|
let message = "Vehicle plate number needs approval from property management.";
|
|
16795
16803
|
let siteCameras = [];
|
|
16796
16804
|
if (value.status && value.status !== "pending" /* PENDING */) {
|
|
@@ -16888,14 +16896,20 @@ function useVehicleService() {
|
|
|
16888
16896
|
}
|
|
16889
16897
|
await _add(vehicleValue, session);
|
|
16890
16898
|
}
|
|
16891
|
-
|
|
16899
|
+
if (!isExternalSession) {
|
|
16900
|
+
await session.commitTransaction();
|
|
16901
|
+
}
|
|
16892
16902
|
return message;
|
|
16893
16903
|
} catch (error) {
|
|
16894
16904
|
import_node_server_utils75.logger.error("Error in vehicle service add:", error);
|
|
16895
|
-
|
|
16905
|
+
if (!isExternalSession) {
|
|
16906
|
+
await session.abortTransaction();
|
|
16907
|
+
}
|
|
16896
16908
|
throw error;
|
|
16897
16909
|
} finally {
|
|
16898
|
-
|
|
16910
|
+
if (!isExternalSession) {
|
|
16911
|
+
session.endSession();
|
|
16912
|
+
}
|
|
16899
16913
|
}
|
|
16900
16914
|
}
|
|
16901
16915
|
async function deleteVehicle(_id, recno, site, type, bypass = false) {
|
|
@@ -24085,6 +24099,7 @@ function usePersonService() {
|
|
|
24085
24099
|
const { updateStatusById } = useFileRepo();
|
|
24086
24100
|
const { getById: getOrgById } = useOrgRepo();
|
|
24087
24101
|
const { getSiteById } = useSiteRepo();
|
|
24102
|
+
const { add: addVehicle } = useVehicleService();
|
|
24088
24103
|
async function add(value) {
|
|
24089
24104
|
const session = import_node_server_utils107.useAtlas.getClient()?.startSession();
|
|
24090
24105
|
if (!session) {
|
|
@@ -24118,7 +24133,7 @@ function usePersonService() {
|
|
|
24118
24133
|
email: value.email,
|
|
24119
24134
|
password: hashedPassword,
|
|
24120
24135
|
name: value.name,
|
|
24121
|
-
status: value.platform == "mobile" ? "
|
|
24136
|
+
status: value.platform == "mobile" ? "pending" : "active",
|
|
24122
24137
|
defaultOrg: value.org?.toString() || ""
|
|
24123
24138
|
};
|
|
24124
24139
|
const userId = await addUser(user, session);
|
|
@@ -24239,6 +24254,9 @@ function usePersonService() {
|
|
|
24239
24254
|
const session = import_node_server_utils107.useAtlas.getClient()?.startSession();
|
|
24240
24255
|
session?.startTransaction();
|
|
24241
24256
|
try {
|
|
24257
|
+
const person = await _getById(id.toString());
|
|
24258
|
+
if (!person)
|
|
24259
|
+
throw new import_node_server_utils107.BadRequestError("Person not found.");
|
|
24242
24260
|
if (value.approvedBy) {
|
|
24243
24261
|
const approvedBy = await getUserById(value.approvedBy.id);
|
|
24244
24262
|
if (!approvedBy || !approvedBy.name)
|
|
@@ -24246,9 +24264,51 @@ function usePersonService() {
|
|
|
24246
24264
|
value.approvedBy.name = approvedBy.name;
|
|
24247
24265
|
value.approvedBy.id = approvedBy._id;
|
|
24248
24266
|
}
|
|
24267
|
+
const vehicle = {
|
|
24268
|
+
plateNumber: person.plateNumber || "",
|
|
24269
|
+
type: "whitelist",
|
|
24270
|
+
category: person.type || "",
|
|
24271
|
+
name: person.name,
|
|
24272
|
+
phoneNumber: person.contact,
|
|
24273
|
+
org: person.org.toString(),
|
|
24274
|
+
site: person.site.toString(),
|
|
24275
|
+
block: person.block,
|
|
24276
|
+
level: person.level,
|
|
24277
|
+
unit: person.unit.toString(),
|
|
24278
|
+
nric: person.nric,
|
|
24279
|
+
status: "active",
|
|
24280
|
+
peopleId: person._id?.toString()
|
|
24281
|
+
};
|
|
24282
|
+
const reviewStatus = value.status;
|
|
24283
|
+
if (reviewStatus === "approved") {
|
|
24284
|
+
value.status = "active";
|
|
24285
|
+
}
|
|
24249
24286
|
await _reviewResidentPerson(id, value, session);
|
|
24287
|
+
if (person.user) {
|
|
24288
|
+
let userStatus;
|
|
24289
|
+
switch (reviewStatus) {
|
|
24290
|
+
case "approved":
|
|
24291
|
+
userStatus = "active";
|
|
24292
|
+
if (person.plateNumber && person.plateNumber.trim() !== "") {
|
|
24293
|
+
await addVehicle(vehicle, session);
|
|
24294
|
+
}
|
|
24295
|
+
break;
|
|
24296
|
+
case "resubmit":
|
|
24297
|
+
userStatus = "resubmit";
|
|
24298
|
+
break;
|
|
24299
|
+
case "rejected":
|
|
24300
|
+
userStatus = "rejected";
|
|
24301
|
+
break;
|
|
24302
|
+
default:
|
|
24303
|
+
throw new Error("Invalid review status");
|
|
24304
|
+
}
|
|
24305
|
+
await _updateUserFieldById(
|
|
24306
|
+
{ _id: person.user.toString(), field: "status", value: userStatus },
|
|
24307
|
+
session
|
|
24308
|
+
);
|
|
24309
|
+
}
|
|
24250
24310
|
await session?.commitTransaction();
|
|
24251
|
-
return `Successfully ${
|
|
24311
|
+
return `Successfully ${reviewStatus} person`;
|
|
24252
24312
|
} catch (error) {
|
|
24253
24313
|
await session?.abortTransaction();
|
|
24254
24314
|
throw error;
|
|
@@ -29824,21 +29884,23 @@ function useBulletinBoardController() {
|
|
|
29824
29884
|
}
|
|
29825
29885
|
}
|
|
29826
29886
|
async function getBulletinBoardById(req, res, next) {
|
|
29827
|
-
const validation = import_joi76.default.string().hex().required();
|
|
29828
|
-
const _id = req.params.id;
|
|
29829
|
-
const { error } = validation.validate(_id);
|
|
29830
|
-
if (error) {
|
|
29831
|
-
import_node_server_utils137.logger.log({ level: "error", message: error.message });
|
|
29832
|
-
next(new import_node_server_utils137.BadRequestError(error.message));
|
|
29833
|
-
return;
|
|
29834
|
-
}
|
|
29835
29887
|
try {
|
|
29888
|
+
const schema2 = import_joi76.default.object({
|
|
29889
|
+
_id: import_joi76.default.string().hex().length(24).required()
|
|
29890
|
+
});
|
|
29891
|
+
const { error, value } = schema2.validate({ _id: req.params.id });
|
|
29892
|
+
if (error) {
|
|
29893
|
+
import_node_server_utils137.logger.log({ level: "error", message: error.message });
|
|
29894
|
+
next(new import_node_server_utils137.BadRequestError(error.message));
|
|
29895
|
+
return;
|
|
29896
|
+
}
|
|
29897
|
+
const { _id } = value;
|
|
29836
29898
|
const data = await _getBulletinBoardById(_id);
|
|
29837
29899
|
res.status(200).json(data);
|
|
29838
29900
|
return;
|
|
29839
|
-
} catch (
|
|
29840
|
-
import_node_server_utils137.logger.log({ level: "error", message:
|
|
29841
|
-
next(
|
|
29901
|
+
} catch (error) {
|
|
29902
|
+
import_node_server_utils137.logger.log({ level: "error", message: error.message });
|
|
29903
|
+
next(error);
|
|
29842
29904
|
return;
|
|
29843
29905
|
}
|
|
29844
29906
|
}
|
|
@@ -31146,7 +31208,7 @@ var schemaEventManagement = import_joi81.default.object({
|
|
|
31146
31208
|
site: import_joi81.default.string().required(),
|
|
31147
31209
|
title: import_joi81.default.string().required(),
|
|
31148
31210
|
description: import_joi81.default.string().optional().allow(""),
|
|
31149
|
-
dateTime: import_joi81.default.
|
|
31211
|
+
dateTime: import_joi81.default.date().iso().required(),
|
|
31150
31212
|
status: import_joi81.default.string().optional().default("planned"),
|
|
31151
31213
|
type: import_joi81.default.string().optional().default("TASK")
|
|
31152
31214
|
});
|
|
@@ -31154,7 +31216,7 @@ var schemaUpdateEventManagement = import_joi81.default.object({
|
|
|
31154
31216
|
_id: import_joi81.default.string().hex().required(),
|
|
31155
31217
|
title: import_joi81.default.string().optional().allow(null, ""),
|
|
31156
31218
|
description: import_joi81.default.string().optional().allow(null, ""),
|
|
31157
|
-
dateTime: import_joi81.default.
|
|
31219
|
+
dateTime: import_joi81.default.date().iso().optional().allow(null, ""),
|
|
31158
31220
|
status: import_joi81.default.string().optional().allow(null, ""),
|
|
31159
31221
|
type: import_joi81.default.string().optional().allow(null, "")
|
|
31160
31222
|
});
|
|
@@ -31178,10 +31240,10 @@ function MEventManagement(value) {
|
|
|
31178
31240
|
site: value.site,
|
|
31179
31241
|
title: value.title,
|
|
31180
31242
|
description: value.description ?? "",
|
|
31181
|
-
dateTime: value.dateTime,
|
|
31243
|
+
dateTime: new Date(value.dateTime),
|
|
31182
31244
|
status: value.status ?? "planned",
|
|
31183
31245
|
type: value.type ?? "TASK",
|
|
31184
|
-
createdAt: value.createdAt ??
|
|
31246
|
+
createdAt: value.createdAt ?? /* @__PURE__ */ new Date(),
|
|
31185
31247
|
updatedAt: value.updatedAt,
|
|
31186
31248
|
deletedAt: value.deletedAt
|
|
31187
31249
|
};
|
|
@@ -31359,7 +31421,7 @@ function useEventManagementRepo() {
|
|
|
31359
31421
|
}
|
|
31360
31422
|
}
|
|
31361
31423
|
async function updateEventManagementById(_id, value, session) {
|
|
31362
|
-
value.updatedAt =
|
|
31424
|
+
value.updatedAt = /* @__PURE__ */ new Date();
|
|
31363
31425
|
try {
|
|
31364
31426
|
_id = new import_mongodb85.ObjectId(_id);
|
|
31365
31427
|
} catch (error) {
|
|
@@ -31405,8 +31467,7 @@ function useEventManagementRepo() {
|
|
|
31405
31467
|
try {
|
|
31406
31468
|
const updateValue = {
|
|
31407
31469
|
status: "deleted",
|
|
31408
|
-
|
|
31409
|
-
deletedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
31470
|
+
deletedAt: /* @__PURE__ */ new Date()
|
|
31410
31471
|
};
|
|
31411
31472
|
const res = await collection.updateOne({ _id }, { $set: updateValue });
|
|
31412
31473
|
if (res.modifiedCount === 0) {
|
|
@@ -31499,7 +31560,12 @@ function useEventManagementService() {
|
|
|
31499
31560
|
const session = import_node_server_utils147.useAtlas.getClient()?.startSession();
|
|
31500
31561
|
session?.startTransaction();
|
|
31501
31562
|
try {
|
|
31502
|
-
|
|
31563
|
+
const updatedValue = {
|
|
31564
|
+
...value.dateTime && { dateTime: new Date(value.dateTime) },
|
|
31565
|
+
...value.title && { title: value.title },
|
|
31566
|
+
...value.description && { description: value.description }
|
|
31567
|
+
};
|
|
31568
|
+
await _updateEventManagementById(id, updatedValue, session);
|
|
31503
31569
|
await session?.commitTransaction();
|
|
31504
31570
|
return "Successfully updated event.";
|
|
31505
31571
|
} catch (error) {
|
|
@@ -33011,7 +33077,7 @@ var minifyXml = (xml) => {
|
|
|
33011
33077
|
};
|
|
33012
33078
|
var readTemplate = (name, params) => {
|
|
33013
33079
|
const template = import_fs3.default.readFileSync(
|
|
33014
|
-
import_path.default.join(__dirname, `../
|
|
33080
|
+
import_path.default.join(__dirname, `../dist/public/xml-templates/${name}.xml`),
|
|
33015
33081
|
"utf-8"
|
|
33016
33082
|
);
|
|
33017
33083
|
if (!params)
|
|
@@ -37431,6 +37497,17 @@ function useOccurrenceBookController() {
|
|
|
37431
37497
|
// src/models/bulletin-video.model.ts
|
|
37432
37498
|
var import_mongodb95 = require("mongodb");
|
|
37433
37499
|
var import_joi90 = __toESM(require("joi"));
|
|
37500
|
+
var BulletinVideoSort = /* @__PURE__ */ ((BulletinVideoSort2) => {
|
|
37501
|
+
BulletinVideoSort2["CREATED_AT"] = "createdAt";
|
|
37502
|
+
BulletinVideoSort2["NAME"] = "name";
|
|
37503
|
+
BulletinVideoSort2["ID"] = "_id";
|
|
37504
|
+
return BulletinVideoSort2;
|
|
37505
|
+
})(BulletinVideoSort || {});
|
|
37506
|
+
var BulletinVideoOrder = /* @__PURE__ */ ((BulletinVideoOrder2) => {
|
|
37507
|
+
BulletinVideoOrder2["ASC"] = "asc";
|
|
37508
|
+
BulletinVideoOrder2["DESC"] = "desc";
|
|
37509
|
+
return BulletinVideoOrder2;
|
|
37510
|
+
})(BulletinVideoOrder || {});
|
|
37434
37511
|
var schemaBulletinVideo = import_joi90.default.object({
|
|
37435
37512
|
site: import_joi90.default.string().hex().required(),
|
|
37436
37513
|
title: import_joi90.default.string().optional().allow(null, ""),
|
|
@@ -37759,39 +37836,35 @@ function useBulletinVideoController() {
|
|
|
37759
37836
|
deleteBulletinVideoById: _deleteBulletinVideoById
|
|
37760
37837
|
} = useBulletinVideoRepo();
|
|
37761
37838
|
async function add(req, res, next) {
|
|
37762
|
-
const payload = { ...req.body };
|
|
37763
|
-
const { error } = schemaBulletinVideo.validate(payload, {
|
|
37764
|
-
abortEarly: false
|
|
37765
|
-
});
|
|
37766
|
-
if (error) {
|
|
37767
|
-
const messages = error.details.map((d) => d.message).join(", ");
|
|
37768
|
-
import_node_server_utils163.logger.log({ level: "error", message: messages });
|
|
37769
|
-
next(new import_node_server_utils163.BadRequestError(messages));
|
|
37770
|
-
return;
|
|
37771
|
-
}
|
|
37772
37839
|
try {
|
|
37773
|
-
const
|
|
37840
|
+
const { error, value } = schemaBulletinVideo.validate(req.body, {
|
|
37841
|
+
abortEarly: false
|
|
37842
|
+
});
|
|
37843
|
+
if (error) {
|
|
37844
|
+
const messages = error.details.map((d) => d.message).join(", ");
|
|
37845
|
+
import_node_server_utils163.logger.log({ level: "error", message: messages });
|
|
37846
|
+
next(new import_node_server_utils163.BadRequestError(messages));
|
|
37847
|
+
return;
|
|
37848
|
+
}
|
|
37849
|
+
const data = await _add(value);
|
|
37774
37850
|
res.status(201).json(data);
|
|
37775
37851
|
return;
|
|
37776
|
-
} catch (
|
|
37777
|
-
import_node_server_utils163.logger.log({ level: "error", message:
|
|
37778
|
-
next(
|
|
37852
|
+
} catch (error) {
|
|
37853
|
+
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37854
|
+
next(error);
|
|
37779
37855
|
return;
|
|
37780
37856
|
}
|
|
37781
37857
|
}
|
|
37782
37858
|
async function getAll(req, res, next) {
|
|
37783
|
-
const allowedFields = ["createdAt", "name"];
|
|
37784
|
-
const allowedOrder = ["asc", "desc"];
|
|
37785
37859
|
const validation = import_joi91.default.object({
|
|
37786
37860
|
search: import_joi91.default.string().optional().allow("", null),
|
|
37787
37861
|
page: import_joi91.default.number().integer().min(1).allow("", null).default(1),
|
|
37788
37862
|
limit: import_joi91.default.number().integer().min(1).max(100).allow("", null).default(10),
|
|
37789
|
-
sort: import_joi91.default.string().
|
|
37790
|
-
order: import_joi91.default.string().
|
|
37791
|
-
site: import_joi91.default.string().hex().required()
|
|
37863
|
+
sort: import_joi91.default.string().valid(...Object.values(BulletinVideoSort)).default("_id" /* ID */),
|
|
37864
|
+
order: import_joi91.default.string().valid(...Object.values(BulletinVideoOrder)).default("desc" /* DESC */),
|
|
37865
|
+
site: import_joi91.default.string().hex().length(24).required()
|
|
37792
37866
|
});
|
|
37793
|
-
const
|
|
37794
|
-
const { error } = validation.validate(query, {
|
|
37867
|
+
const { error, value } = validation.validate(req.query, {
|
|
37795
37868
|
abortEarly: false
|
|
37796
37869
|
});
|
|
37797
37870
|
if (error) {
|
|
@@ -37800,19 +37873,10 @@ function useBulletinVideoController() {
|
|
|
37800
37873
|
next(new import_node_server_utils163.BadRequestError(messages));
|
|
37801
37874
|
return;
|
|
37802
37875
|
}
|
|
37803
|
-
const search
|
|
37804
|
-
const
|
|
37805
|
-
|
|
37806
|
-
|
|
37807
|
-
const sortObj = {};
|
|
37808
|
-
const sortFields = String(req.query.sort).split(",");
|
|
37809
|
-
const sortOrders = String(req.query.order).split(",");
|
|
37810
|
-
sortFields.forEach((field, index) => {
|
|
37811
|
-
if (allowedFields.includes(field)) {
|
|
37812
|
-
const order = sortOrders[index] === "asc" ? 1 : -1;
|
|
37813
|
-
sortObj[field] = order;
|
|
37814
|
-
}
|
|
37815
|
-
});
|
|
37876
|
+
const { search, page, limit, site, sort, order } = value;
|
|
37877
|
+
const sortObj = {
|
|
37878
|
+
[sort ?? "_id" /* ID */]: order === "asc" /* ASC */ ? 1 : -1
|
|
37879
|
+
};
|
|
37816
37880
|
try {
|
|
37817
37881
|
const data = await _getAll({
|
|
37818
37882
|
search,
|
|
@@ -37830,21 +37894,23 @@ function useBulletinVideoController() {
|
|
|
37830
37894
|
}
|
|
37831
37895
|
}
|
|
37832
37896
|
async function getBulletinVideoById(req, res, next) {
|
|
37833
|
-
const validation = import_joi91.default.string().hex().required();
|
|
37834
|
-
const _id = req.params.id;
|
|
37835
|
-
const { error } = validation.validate(_id);
|
|
37836
|
-
if (error) {
|
|
37837
|
-
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37838
|
-
next(new import_node_server_utils163.BadRequestError(error.message));
|
|
37839
|
-
return;
|
|
37840
|
-
}
|
|
37841
37897
|
try {
|
|
37898
|
+
const schema2 = import_joi91.default.object({
|
|
37899
|
+
_id: import_joi91.default.string().hex().length(24).required()
|
|
37900
|
+
});
|
|
37901
|
+
const { error, value } = schema2.validate({ _id: req.params.id });
|
|
37902
|
+
if (error) {
|
|
37903
|
+
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37904
|
+
next(new import_node_server_utils163.BadRequestError(error.message));
|
|
37905
|
+
return;
|
|
37906
|
+
}
|
|
37907
|
+
const { _id } = value;
|
|
37842
37908
|
const data = await _getBulletinVideoById(_id);
|
|
37843
37909
|
res.status(200).json(data);
|
|
37844
37910
|
return;
|
|
37845
|
-
} catch (
|
|
37846
|
-
import_node_server_utils163.logger.log({ level: "error", message:
|
|
37847
|
-
next(
|
|
37911
|
+
} catch (error) {
|
|
37912
|
+
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37913
|
+
next(error);
|
|
37848
37914
|
return;
|
|
37849
37915
|
}
|
|
37850
37916
|
}
|
|
@@ -37871,21 +37937,23 @@ function useBulletinVideoController() {
|
|
|
37871
37937
|
}
|
|
37872
37938
|
}
|
|
37873
37939
|
async function deleteBulletinVideoById(req, res, next) {
|
|
37874
|
-
const validation = import_joi91.default.string().hex().required();
|
|
37875
|
-
const _id = req.params.id;
|
|
37876
|
-
const { error } = validation.validate(_id);
|
|
37877
|
-
if (error) {
|
|
37878
|
-
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37879
|
-
next(new import_node_server_utils163.BadRequestError(error.message));
|
|
37880
|
-
return;
|
|
37881
|
-
}
|
|
37882
37940
|
try {
|
|
37941
|
+
const schema2 = import_joi91.default.object({
|
|
37942
|
+
_id: import_joi91.default.string().hex().length(24).required()
|
|
37943
|
+
});
|
|
37944
|
+
const { error, value } = schema2.validate({ _id: req.params.id });
|
|
37945
|
+
if (error) {
|
|
37946
|
+
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37947
|
+
next(new import_node_server_utils163.BadRequestError(error.message));
|
|
37948
|
+
return;
|
|
37949
|
+
}
|
|
37950
|
+
const { _id } = value;
|
|
37883
37951
|
await _deleteBulletinVideoById(_id);
|
|
37884
37952
|
res.status(200).json({ message: "Successfully deleted bulletin video." });
|
|
37885
37953
|
return;
|
|
37886
|
-
} catch (
|
|
37887
|
-
import_node_server_utils163.logger.log({ level: "error", message:
|
|
37888
|
-
next(
|
|
37954
|
+
} catch (error) {
|
|
37955
|
+
import_node_server_utils163.logger.log({ level: "error", message: error.message });
|
|
37956
|
+
next(error);
|
|
37889
37957
|
return;
|
|
37890
37958
|
}
|
|
37891
37959
|
}
|
|
@@ -50102,6 +50170,8 @@ function useRoleControllerV2() {
|
|
|
50102
50170
|
BulletinRecipient,
|
|
50103
50171
|
BulletinSort,
|
|
50104
50172
|
BulletinStatus,
|
|
50173
|
+
BulletinVideoOrder,
|
|
50174
|
+
BulletinVideoSort,
|
|
50105
50175
|
CameraType,
|
|
50106
50176
|
DEVICE_STATUS,
|
|
50107
50177
|
DOBStatus,
|