diff --git a/.DS_Store b/.DS_Store index 958c839..7eac182 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/.DS_Store b/app/.DS_Store index aa09136..42c1d72 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/config/db.config.js b/app/config/db.config.js index 02e2978..c7bebfc 100644 --- a/app/config/db.config.js +++ b/app/config/db.config.js @@ -1,15 +1,18 @@ const devUri = "mongodb://localhost:27017/worldshine"; -const localUri = "mongodb+srv://new-user-test:Testing123@cluster0.qkzim.mongodb.net/leapbase?retryWrites=true&w=majority"; +// const localUri = "mongodb+srv://new-user-test:Testing123@cluster0.qkzim.mongodb.net/leapbase?retryWrites=true&w=majority"; +const localUri = "mongodb+srv://liyang1000000:Testing123@juxing.iosxg2f.mongodb.net/worldshine?retryWrites=true&w=majority&appName=juxing"; + module.exports = { - baseUrl: "mongodb://localhost:27017/", - fileUrl: "https://worldshine.mayo.llc/files/", - database: "worldshine", - url: devUri, + // baseUrl: "mongodb://localhost:27017/", + // fileUrl: "https://worldshine.mayo.llc/files/", + // database: "worldshine", + // url: devUri, // on local enable this - // url: localUri, + url: localUri, // baseUrl: "mongodb+srv://new-user-test:Testing123@cluster0.qkzim.mongodb.net/", - // database: "leapbase", - // fileUrl: "http://localhost:8080/files/", - // imgBucket: "photos", + baseUrl: "mongodb+srv://liyang1000000:Testing123@juxing.iosxg2f.mongodb.net/", + database: "worldshine", + fileUrl: "http://localhost:8080/files/", + imgBucket: "photos", }; \ No newline at end of file diff --git a/app/controllers/calendar-event.controller.js b/app/controllers/calendar-event.controller.js index 491ad36..a940d85 100644 --- a/app/controllers/calendar-event.controller.js +++ b/app/controllers/calendar-event.controller.js @@ -47,7 +47,10 @@ exports.createCalendarEvent = (req, res) => { event_location: req.body.event_location, event_prediction_date: req.body.event_prediction_date, event_reminder_type: req.body.event_reminder_type, - rrule: req.body.rrule + rrule: req.body.rrule, + meal_type: req.body.meal_type, + activity_category: req.body.activity_category, + ingredients: req.body.ingredients }); // Save event in the database calendarEvent diff --git a/app/controllers/customer.controller.js b/app/controllers/customer.controller.js index 422ccd2..6817cff 100644 --- a/app/controllers/customer.controller.js +++ b/app/controllers/customer.controller.js @@ -12,16 +12,76 @@ exports.createCustomer = (req, res) => { const site = splitSite.findSiteNumber(req); // Create a Customer const customer = new Customer({ + // Basic Info username: req.body.username || req.body.email || '', name: req.body.name || '', + firstname: req.body.firstname || '', + middle_name: req.body.middle_name || '', + lastname: req.body.lastname || '', name_cn: req.body.name_cn || '', + name_on_id: req.body.name_on_id || '', + type: req.body.type || '', + program_type: req.body.program_type || '', + pay_source: req.body.pay_source || '', + pay_source_other: req.body.pay_source_other || '', + birth_date: req.body.birth_date || null, + legal_sex: req.body.legal_sex || '', + gender: req.body.gender || req.body.legal_sex || '', + marital_status: req.body.marital_status || '', + marriage_date: req.body.marriage_date || null, + immigration_status: req.body.immigration_status || '', + immigration_status_other: req.body.immigration_status_other || '', + language_spoken: req.body.language_spoken || [], + language_spoken_other: req.body.language_spoken_other || '', + language: req.body.language || '', + + // Contact Info email: req.body.email || '', - password: req.body.password ? bcrypt.hashSync(req.body.password, 8) : '', + phone: req.body.phone || '', mobile_phone: req.body.mobile_phone || '', home_phone: req.body.home_phone || '', - phone: req.body.phone || '', - language: req.body.language || '', - status: 'active', + + // Address 1 + address_line_1: req.body.address_line_1 || '', + address_line_2: req.body.address_line_2 || '', + city: req.body.city || '', + state: req.body.state || '', + zip_code: req.body.zip_code || '', + address_note: req.body.address_note || '', + + // Address 2 + address2_line_1: req.body.address2_line_1 || '', + address2_line_2: req.body.address2_line_2 || '', + city2: req.body.city2 || '', + state2: req.body.state2 || '', + zip_code2: req.body.zip_code2 || '', + address2_note: req.body.address2_note || '', + + // Address 3 + address3_line_1: req.body.address3_line_1 || '', + address3_line_2: req.body.address3_line_2 || '', + city3: req.body.city3 || '', + state3: req.body.state3 || '', + zip_code3: req.body.zip_code3 || '', + address3_note: req.body.address3_note || '', + + // Address 4 + address4_line_1: req.body.address4_line_1 || '', + address4_line_2: req.body.address4_line_2 || '', + city4: req.body.city4 || '', + state4: req.body.state4 || '', + zip_code4: req.body.zip_code4 || '', + address4_note: req.body.address4_note || '', + + // Address 5 + address5_line_1: req.body.address5_line_1 || '', + address5_line_2: req.body.address5_line_2 || '', + city5: req.body.city5 || '', + state5: req.body.state5 || '', + zip_code5: req.body.zip_code5 || '', + address5_note: req.body.address5_note || '', + + // Legacy address fields address1: req.body.address1 || '', address2: req.body.address2 || '', address3: req.body.address3 || '', @@ -32,75 +92,130 @@ exports.createCustomer = (req, res) => { state1: req.body.state1 || '', zip_code1: req.body.zip_code1 || '', street_address_2: req.body.street_address_2 || '', - city2: req.body.city2 || '', - state2: req.body.state2 || '', - zip_code2: req.body.zip_code2 || '', street_address_3: req.body.street_address_3 || '', - city3: req.body.city3 || '', - state3: req.body.state3 || '', - zip_code3: req.body.zip_code3 || '', street_address_4: req.body.street_address_4 || '', - city4: req.body.city4 || '', - state4: req.body.state4 || '', - zip_code4: req.body.zip_code4 || '', street_address_5: req.body.street_address_5 || '', - city5: req.body.city5 || '', - state5: req.body.state5 || '', - zip_code5: req.body.zip_code5 || '', - firstname: req.body.firstname || '', - lastname: req.body.lastname || '', - birth_date: req.body.birth_date || null, - create_by: req.body.create_by || '', - create_date: new Date(), - edit_by: req.body.edit_by || '', - edit_date: new Date(), - note: req.body.note || '', - care_provider: req.body.care_provider || '', + apartment: req.body.apartment || '', + + // Emergency Contact emergency_contact: req.body.emergency_contact || '', emergency_contact2: req.body.emergency_contact2 || '', emergency_contact_name: req.body.emergency_contact_name || '', emergency_contact_phone: req.body.emergency_contact_phone || '', emergency_contact_relationship: req.body.emergency_contact_relationship || '', + emergency_contact_relationship_other: req.body.emergency_contact_relationship_other || '', + emergency_contact_role: req.body.emergency_contact_role || [], emergency_contact2_name: req.body.emergency_contact2_name || '', emergency_contact2_phone: req.body.emergency_contact2_phone || '', emergency_contact2_relationship: req.body.emergency_contact2_relationship || '', - medicare_number: req.body.medicare_number || '', - medicaid_number: req.body.medicaid_number || '', - pharmacy: req.body.pharmacy || '', - type: req.body.type || '', - avatar: req.body.avatar || '', - special_needs: req.body.special_needs || '', - pickup_status: req.body.pickup_status || '', - pharmacy_id: req.body.pharmacy_id || '', - pin: req.body.pin || '', + emergency_contact2_relationship_other: req.body.emergency_contact2_relationship_other || '', + emergency_contact2_role: req.body.emergency_contact2_role || [], + + // Schedule + days_of_week: req.body.days_of_week || [], + + // Admission & Discharge Record admission_date: req.body.admission_date || null, - seating: req.body.seating || '', - vehicle_no: req.body.vehicle_no || '', - caller: req.body.caller || '', + enrolled_date: req.body.enrolled_date || null, + create_by: req.body.create_by || '', + create_date: new Date(), + referral_source: req.body.referral_source || '', + referral_source_other: req.body.referral_source_other || '', discharge_date: req.body.discharge_date || null, - placement: req.body.placement || '', - nickname: req.body.nickname || '', + discharge_by: req.body.discharge_by || '', + discharge_reason: req.body.discharge_reason || '', + discharge_reason_other: req.body.discharge_reason_other || '', + join_reason: req.body.join_reason || '', + + // Care & Services + dietary_restrictions: req.body.dietary_restrictions || [], + dietary_restrictions_other: req.body.dietary_restrictions_other || '', + diet_texture: req.body.diet_texture || '', table_id: req.body.table_id || '', - groups: req.body.groups || null, - tags: req.body.tags || null, - roles: req.body.roles || null, - apartment: req.body.apartment || '', - private_note: req.body.private_note || '', - parent_id: '5eee3552b02fac3d4acfd5ea', - site, - disability: req.body.disability || false, - weight: req.body.weight || '', - height: req.body.height || '', - gender: req.body.gender || '', + seat_number: req.body.seat_number || '', + seating: req.body.seating || '', + transportation_type: req.body.transportation_type || '', + consent_to_text_messages: req.body.consent_to_text_messages || '', text_msg_enabled: req.body.text_msg_enabled || false, - health_condition: String, + preferred_text_language: req.body.preferred_text_language || '', + consent_to_media_use: req.body.consent_to_media_use || '', + pickup_status: req.body.pickup_status || '', + + // Medical & Insurance - Providers + care_provider: req.body.care_provider || '', + primary_care_physician: req.body.primary_care_physician || '', + pharmacy: req.body.pharmacy || '', + pharmacy_id: req.body.pharmacy_id || '', + + // General Conditions + diabetes_mellitus: req.body.diabetes_mellitus || '', + eyes_on: req.body.eyes_on || '', + disability: req.body.disability || false, + wheelchair: req.body.wheelchair || '', + special_needs: req.body.special_needs || '', + health_condition: req.body.health_condition || '', allergy_info: req.body.allergy_info || '', meal_requirement: req.body.meal_requirement || '', service_requirement: req.body.service_requirement || '', + + // Legal + molst: req.body.molst || '', + provisions_for_advance_medical: req.body.provisions_for_advance_medical || '', + hospice: req.body.hospice || '', + burial_arrangements: req.body.burial_arrangements || '', + power_of_attorney: req.body.power_of_attorney || '', + + // Rounding + requires_rounding: req.body.requires_rounding || '', + rounding_notes: req.body.rounding_notes || '', + + // Confidential Details + medicare_number: req.body.medicare_number || '', + medicaid_number: req.body.medicaid_number || '', + social_security_number: req.body.social_security_number || '', + adcaps_id: req.body.adcaps_id || '', + + // Compliance & Deadlines + adcaps_completed_date: req.body.adcaps_completed_date || null, + center_qualification_renew_date: req.body.center_qualification_renew_date || null, + medicaid_renew_date: req.body.medicaid_renew_date || null, + id_expiration_date: req.body.id_expiration_date || null, + + // Form Submission + hipaa_authorization_form: req.body.hipaa_authorization_form || '', + medication_management_consent_form: req.body.medication_management_consent_form || '', + freedom_of_choice_form: req.body.freedom_of_choice_form || '', + meal_benefit_application_form: req.body.meal_benefit_application_form || '', + photo_video_release_form: req.body.photo_video_release_form || '', + security_deposit_agreement_form: req.body.security_deposit_agreement_form || '', + recreational_program_contract_form: req.body.recreational_program_contract_form || '', + tb_form: req.body.tb_form || '', + pre_screening_form: req.body.pre_screening_form || '', + + // Additional Information + note: req.body.note || '', + private_note: req.body.private_note || '', + + // Other fields + password: req.body.password ? bcrypt.hashSync(req.body.password, 8) : '', + avatar: req.body.avatar || '', + parent_id: '5eee3552b02fac3d4acfd5ea', + nickname: req.body.nickname || '', + pin: req.body.pin || '', + vehicle_no: req.body.vehicle_no || '', + caller: req.body.caller || '', + placement: req.body.placement || '', + height: req.body.height || '', + weight: req.body.weight || '', + status: 'active', + roles: req.body.roles || [], + groups: req.body.groups || [], + tags: req.body.tags || [], + edit_by: req.body.edit_by || '', + edit_date: new Date(), payment_due_date: req.body.payment_due_date || '', payment_status: req.body.payment_status || '', - join_reason: req.body.join_reason || '', - discharge_reason: req.body.discharge_reason || '' + site }); // Save Customer in the database customer diff --git a/app/controllers/employee.controller.js b/app/controllers/employee.controller.js index 5aea528..70e2c76 100644 --- a/app/controllers/employee.controller.js +++ b/app/controllers/employee.controller.js @@ -14,26 +14,17 @@ exports.createEmployee = (req, res) => { // Create a Employee const employee = new Employee({ username: req.body.username || req.body.email || '', - name: req.body.name || '', name_cn: req.body.name_cn || '', email: req.body.email || '', password: req.body.password ? bcrypt.hashSync(req.body.password, 8) : '', roles: req.body.roles || [], mobile_phone: req.body.mobile_phone || '', - phone: req.body.phone || '', home_phone: req.body.home_phone || '', language: req.body.language || '', employment_status: req.body.employment_status || '', - status: req.body.status || 'active', address: req.body.address || '', - title: req.body.title || '', - title_cn: req.body.title_cn || '', - firstname: req.body.firstname || '', - lastname: req.body.lastname || '', - department: req.body.department || '', - birth_date: req.body.birth_date || null, + date_hired: req.body.date_hired || '', driver_capacity: req.body.driver_capacity || null, - date_hired: req.body.date_hired || null, create_by: req.body.create_by || '', create_date: new Date(), edit_by: req.body.edit_by || '', @@ -41,7 +32,68 @@ exports.createEmployee = (req, res) => { note: req.body.note || '', tags: req.body.tags || [], fetch_route_time: req.body.fetch_route_time || null, - site + site, + // new fields added and legacy fields are used in HR system + trinet_id: req.body.trinet_id || '', + name: req.body.name || '', + firstname: req.body.firstname || '', + middlename: req.body.middlename || '', + lastname: req.body.lastname || '', + preferred_name: req.body.preferred_name || '', + ssn: req.body.ssn || '', + marital_status: req.body.marital_status || '', + gender: req.body.gender || '', + city: req.body.city || '', + street_address: req.body.street_address || '', + state: req.body.state || '', + zip: req.body.zip || '', + country: req.body.country || '', + work_email: req.body.work_email || '', + personal_email: req.body.personal_email || '', + phone: req.body.phone || '', + work_phone: req.body.work_phone || '', + birth_date: req.body.birth_date || '', + work_phone_ext: req.body.work_phone_ext || '', + dietary_restrictions: req.body.dietary_restrictions || '', + tshirt_size: req.body.tshirt_size || '', + title: req.body.title || '', + title_cn: req.body.title_cn || '', + department: req.body.department || '', + manager_name: req.body.manager_name || '', + manager_email: req.body.manager_email || '', + manager_trinet_id: req.body.manager_trinet_id || '', + manager_id: req.body.manager_id || '', + direct_reports: req.body.direct_reports || [], + current_employment_start_date: req.body.current_employment_start_date || '', + initial_employment_start_date: req.body.initial_employment_start_date || '', + status: req.body.status || 'active', + work_location: req.body.work_location || '', + employment_type: req.body.employment_type || '', + employment_start_date: req.body.employment_start_date || '', + employment_end_date: req.body.employment_end_date || '', + termination_date: req.body.termination_date || '', + termination_type: req.body.termination_type || '', + termination_reason: req.body.termination_reason || '', + full_time_start_date: req.body.full_time_start_date || '', + end_date: req.body.end_date || '', + month_of_service: req.body.month_of_service || null, + full_years_of_service: req.body.full_years_of_service || null, + compensation_type: req.body.compensation_type || '', + compensation: req.body.compensation || null, + worker_type: req.body.worker_type || '', + monthly_salary: req.body.monthly_salary || null, + currency: req.body.currency || '', + salary: req.body.salary || null, + hourly_wage: req.body.hourly_wage || null, + work_site: req.body.work_site || null, + next_anniversary: req.body.next_anniversary || null, + job_id: req.body.job_id || '', + job_title: req.body.job_title || '', + job_category: req.body.job_category || '', + add_to_payroll: req.body.add_to_payroll || false, + collect_tax_information: req.body.collect_tax_information || false, + fingerprints: req.body.fingerprints || [], + entry_passcode: req.body.entry_passcode || [] }); // Save Employee in the database employee @@ -64,6 +116,31 @@ exports.getAllEmployees = (req, res) => { if (params.status) { condition.status = params.status; } + if (params.role) { + condition.roles = params.role; + } + if (params.site) { + condition.site = params.site; + } + Employee.find(condition) + .then(data => { + res.send(data); + }) + .catch(err => { + res.status(500).send({ + message: + err.message || "Some error occurred while retrieving employees." + }); + }); +}; + +// Retrive all Employees without site +exports.getAllEmployeesAcrossSites = (req, res) => { + var params = req.query; + var condition = {}; + if (params.status) { + condition.status = params.status; + } if (params.role) { condition.roles = params.role; } @@ -78,6 +155,7 @@ exports.getAllEmployees = (req, res) => { }); }); }; + // Retrieve all Active Employee from the database. exports.getAllActiveEmployees = (req, res) => { var params = req.query; @@ -86,6 +164,9 @@ exports.getAllActiveEmployees = (req, res) => { if (params.roles) { condition.roles = params.roles; } + if (params.site) { + condition.site = params.site; + } Employee.find(condition) .then(data => { res.send(data); diff --git a/app/controllers/resource.controller.js b/app/controllers/resource.controller.js index aea151f..15cbe1c 100644 --- a/app/controllers/resource.controller.js +++ b/app/controllers/resource.controller.js @@ -10,33 +10,51 @@ exports.createResource = (req, res) => { } const site = splitSite.findSiteNumber(req); const resource = new Resource({ - name: req.body.name, - name_original: req.body.name_original, - name_branch: req.body.name_branch, + // Basic Information + name: req.body.name, // Provider name + office_name: req.body.office_name || '', specialty: req.body.specialty, type: req.body.type, // value may be ['doctor', 'pharmacy' or 'other'] - color: req.body.color, - address: req.body.address, + + // Legacy fields for backward compatibility + name_original: req.body.name_original || req.body.office_name || '', + name_branch: req.body.name_branch || '', + + // Contact Information + phone: req.body.phone, // Office Phone Number + contact: req.body.contact, // Secondary Phone Number + fax: req.body.fax, + email: req.body.email, + + // Address (split fields) + address_line_1: req.body.address_line_1 || '', + address_line_2: req.body.address_line_2 || '', city: req.body.city, state: req.body.state, zipcode: req.body.zipcode, - phone: req.body.phone, - status: req.body.status || 'active', // value might be ['active', 'inactive'] + + // Legacy address field + address: req.body.address || req.body.address_line_1 || '', + + // Additional Information + note: req.body.note, + + // Legacy fields + description: req.body.description || '', + color: req.body.color || '', + category: req.body.category, + + // System fields + status: req.body.status || 'active', create_by: req.body.create_by, create_date: req.body.create_date || new Date(), parent_id: req.body.parent_id, ext_id: req.body.ext_id, - category: req.body.category, - description: req.body.description, - contact: req.body.contact, - fax: req.body.fax, - email: req.body.email, - note: req.body.note, data: req.body.data, edit_by: req.body.edit_by, edit_date: req.body.edit_date || new Date(), images: req.body.images, - edit_history: req.body.edit_history, + edit_history: req.body.edit_history, site }); // Save Resource in the database diff --git a/app/controllers/vehicle.controller.js b/app/controllers/vehicle.controller.js index 4b8dec3..df9b734 100644 --- a/app/controllers/vehicle.controller.js +++ b/app/controllers/vehicle.controller.js @@ -10,26 +10,44 @@ exports.createVehicle = (req, res) => { const site = splitSite.findSiteNumber(req); // Create a Vehicle const vehicle = new Vehicle({ + // Basic Information vehicle_number: req.body.vehicle_number, - tag: req.body.tag || '', - ezpass: req.body.ezpass || '', - gps_tag: req.body.gps_tag || '', - mileage: req.body.mileage || 0, + responsible_driver: req.body.responsible_driver || '', + responsible_driver_id: req.body.responsible_driver_id || '', capacity: req.body.capacity || 0, + mileage: req.body.mileage || 0, make: req.body.make || '', vehicle_model: req.body.vehicle_model || '', year: req.body.year || '', - checklist: req.body.checklist || '', - status: 'active', - site, - has_lift_equip: req.body.has_lift_equip, vin: req.body.vin || '', - note: req.body.note || '', - insurance_expire_on: req.body.insurance_expire_on, - title_registration_on: req.body.title_registration_on, - emission_test_on: req.body.emission_test_on, + tag: req.body.tag || '', + gps_tag: req.body.gps_tag || '', + ezpass: req.body.ezpass || '', + has_lift_equip: req.body.has_lift_equip, + fuel_type: req.body.fuel_type || '', + title: req.body.title || '', + title_other: req.body.title_other || '', + + // Compliance & Deadlines + insurance_start_date: req.body.insurance_start_date || '', + vehicle_registration_date: req.body.vehicle_registration_date || '', + + // Legacy fields (keeping for backward compatibility) + insurance_expire_on: req.body.insurance_expire_on || '', + title_registration_on: req.body.title_registration_on || '', + emission_test_on: req.body.emission_test_on || '', oil_change_mileage: req.body.oil_change_mileage, - oil_change_date: req.body.oil_change_date + oil_change_date: req.body.oil_change_date || '', + + // Check List + checklist: req.body.checklist || [], + + // Additional Information + note: req.body.note || '', + + // System fields + status: 'active', + site }); // Save Vehicle in the database diff --git a/app/models/calendar-event.model.js b/app/models/calendar-event.model.js index d52f047..12b7edc 100644 --- a/app/models/calendar-event.model.js +++ b/app/models/calendar-event.model.js @@ -81,7 +81,12 @@ module.exports = mongoose => { event_location: String, event_prediction_date: String, event_reminder_type: String, - rrule: String + rrule: String, + meal_type: String, + // meal_type could be 'breakfast', 'lunch', 'snack' + activity_category: String, + // activity_category could be 'classes', 'games', 'events', 'outings', 'personal_care', 'care_activities' + ingredients: String }, { collection: 'calendar_event', timestamps: true } ); diff --git a/app/models/customer.model.js b/app/models/customer.model.js index 6037ec7..d500fde 100644 --- a/app/models/customer.model.js +++ b/app/models/customer.model.js @@ -2,33 +2,84 @@ const uniqueValidator = require('mongoose-unique-validator'); module.exports = mongoose => { var schema = mongoose.Schema( { + // Basic Info username: { type: String, unique: true }, name: String, + firstname: String, + middle_name: String, + lastname: String, name_cn: String, + name_on_id: String, + type: String, + program_type: String, + pay_source: String, + pay_source_other: String, + birth_date: String, + legal_sex: String, + gender: String, // keeping for backward compatibility + marital_status: String, + marriage_date: String, + immigration_status: String, + immigration_status_other: String, + language_spoken: [{ + type: String + }], + language_spoken_other: String, + language: String, // keeping for backward compatibility + + // Contact Info email: { type: String, unique: true }, - parent_id: String, - password: String, - care_provider: String, - emergency_contact: String, - emergency_contact2: String, - emergency_contact_name: String, - emergency_contact_phone: String, - emergency_contact_relationship: String, - emergency_contact2_name: String, - emergency_contact2_phone: String, - emergency_contact2_relationship: String, - medicare_number: String, - medicaid_number: String, - pharmacy: String, - birth_date: String, - firstname: String, - lastname: String, + phone: String, + mobile_phone: String, + home_phone: String, + + // Address 1 + address_line_1: String, + address_line_2: String, + city: String, + state: String, + zip_code: String, + address_note: String, + + // Address 2 + address2_line_1: String, + address2_line_2: String, + city2: String, + state2: String, + zip_code2: String, + address2_note: String, + + // Address 3 + address3_line_1: String, + address3_line_2: String, + city3: String, + state3: String, + zip_code3: String, + address3_note: String, + + // Address 4 + address4_line_1: String, + address4_line_2: String, + city4: String, + state4: String, + zip_code4: String, + address4_note: String, + + // Address 5 + address5_line_1: String, + address5_line_2: String, + city5: String, + state5: String, + zip_code5: String, + address5_note: String, + + // Legacy address fields (keeping for backward compatibility) address1: String, address2: String, address3: String, @@ -39,75 +90,171 @@ module.exports = mongoose => { state1: String, zip_code1: String, street_address_2: String, - city2: String, - state2: String, - zip_code2: String, street_address_3: String, - city3: String, - state3: String, - zip_code3: String, street_address_4: String, - city4: String, - state4: String, - zip_code4: String, street_address_5: String, - city5: String, - state5: String, - zip_code5: String, - phone: String, - mobile_phone: String, - type: String, - avatar: String, - special_needs: String, - note: String, - language: String, - status: String, - pickup_status: String, + apartment: String, + + // Emergency Contact + emergency_contact: String, // legacy field + emergency_contact2: String, // legacy field + emergency_contact_name: String, + emergency_contact_phone: String, + emergency_contact_relationship: String, + emergency_contact_relationship_other: String, + emergency_contact_role: [{ + type: String + }], + emergency_contact2_name: String, + emergency_contact2_phone: String, + emergency_contact2_relationship: String, + emergency_contact2_relationship_other: String, + emergency_contact2_role: [{ + type: String + }], + emergency_contact3_name: String, + emergency_contact3_phone: String, + emergency_contact3_relationship: String, + emergency_contact3_relationship_other: String, + emergency_contact3_role: [{ + type: String + }], + emergency_contact4_name: String, + emergency_contact4_phone: String, + emergency_contact4_relationship: String, + emergency_contact4_relationship_other: String, + emergency_contact4_role: [{ + type: String + }], + emergency_contact5_name: String, + emergency_contact5_phone: String, + emergency_contact5_relationship: String, + emergency_contact5_relationship_other: String, + emergency_contact5_role: [{ + type: String + }], + + // Schedule + days_of_week: [{ + type: String + }], + + // Admission & Discharge Record + admission_date: String, + enrolled_date: String, create_by: String, create_date: Date, - edit_by: String, - edit_date: Date, - password: String, + referral_source: String, + referral_source_other: String, + discharge_date: String, + discharge_by: String, + discharge_reason: String, + discharge_reason_other: String, + join_reason: String, + + // Care & Services + dietary_restrictions: [{ + type: String + }], + dietary_restrictions_other: String, + diet_texture: String, + table_id: String, + seat_number: String, + seating: String, // legacy field + transportation_type: String, + consent_to_text_messages: String, + text_msg_enabled: Boolean, // legacy field + preferred_text_language: String, + consent_to_media_use: String, + pickup_status: String, + + // Medical & Insurance - Providers + care_provider: String, + primary_care_physician: String, + pharmacy: String, pharmacy_id: String, + + // General Conditions + diabetes_mellitus: String, + eyes_on: String, + disability: Boolean, // legacy field for eyes_on + wheelchair: String, + special_needs: String, + health_condition: String, + allergy_info: String, + meal_requirement: String, + service_requirement: String, + + // Legal + molst: String, + provisions_for_advance_medical: String, + hospice: String, + burial_arrangements: String, + power_of_attorney: String, + + // Rounding + requires_rounding: String, + rounding_notes: String, + + // Confidential Details + medicare_number: String, + medicaid_number: String, + social_security_number: String, + adcaps_id: String, + + // Compliance & Deadlines + adcaps_completed_date: String, + center_qualification_renew_date: String, + medicaid_renew_date: String, + id_expiration_date: String, + + // Form Submission - Admission Forms + hipaa_authorization_form: String, + medication_management_consent_form: String, + freedom_of_choice_form: String, + meal_benefit_application_form: String, + photo_video_release_form: String, + security_deposit_agreement_form: String, + recreational_program_contract_form: String, + + // Medical Forms + tb_form: String, + pre_screening_form: String, + + // Additional Information + note: String, + private_note: String, + + // Other legacy fields + password: String, + salt: String, + api_token: String, + avatar: String, + parent_id: String, + nickname: String, pin: String, - admission_date: String, - home_phone: String, - seating: String, vehicle_no: String, caller: String, + placement: String, + height: String, + weight: String, + status: String, roles: [{ type: String }], - discharge_date: String, - placement: String, - nickname: String, - table_id: String, - salt: String, groups: [{ type: String }], tags: [{ type: String }], - api_token: String, data: String, title: String, - apartment: String, - private_note: String, site: Number, - disability: Boolean, - height: String, - weight: String, - gender: String, - text_msg_enabled: Boolean, - health_condition: String, - allergy_info: String, - meal_requirement: String, - service_requirement: String, + edit_by: String, + edit_date: Date, payment_due_date: String, - payment_status: String, - join_reason: String, - discharge_reason: String + payment_status: String }, { collection: 'customer', timestamps: true } ); @@ -118,4 +265,4 @@ module.exports = mongoose => { }); const Customer = mongoose.model("customer", schema); return Customer; - }; \ No newline at end of file + }; diff --git a/app/models/employee.model.js b/app/models/employee.model.js index 400a41f..b090ff6 100644 --- a/app/models/employee.model.js +++ b/app/models/employee.model.js @@ -1,39 +1,98 @@ module.exports = mongoose => { var schema = mongoose.Schema( { - username: String, - name: String, - name_cn: String, - email: String, - password: String, - roles: [{ - type: String - }], - mobile_phone: String, - phone: String, - home_phone: String, - language: String, - employment_status: String, - status: String, - address: String, - title: String, - title_cn: String, - firstname: String, - lastname: String, - department: String, - birth_date: String, - driver_capacity: Number, - date_hired: String, - create_by: String, - create_date: Date, - edit_by: String, - edit_date: Date, - note: String, - tags: [{ - type: String - }], - fetch_route_time: Date, - site: Number + username: String, + name_cn: String, + email: String, + password: String, + roles: [{ + type: String + }], + mobile_phone: String, + home_phone: String, + language: String, + employment_status: String, + address: String, + date_hired: String, + driver_capacity: Number, + create_by: String, + create_date: Date, + edit_by: String, + edit_date: Date, + note: String, + tags: [{ + type: String + }], + fetch_route_time: Date, + site: Number, + // new fields added and legacy feilds are used in HR system + trinet_id: String, + name: String, + firstname: String, + middlename: String, + lastname: String, + preferred_name: String, + ssn: String, + marital_status: String, + gender: String, + city: String, + street_address: String, + state: String, + zip: String, + country: String, + work_email: String, + personal_email: String, + phone: String, + work_phone: String, + birth_date: String, // date of birth + work_phone_ext: String, // work phone extension + dietary_restrictions: String, + tshirt_size: String, + title: String, + title_cn: String, + department: String, + manager_name: String, + manager_email: String, + manager_trinet_id: String, + manager_id: String, + direct_reports: [{ + type: String + }], + current_employment_start_date: String, + initial_employment_start_date: String, + status: String, + work_location: String, + employment_type: String, + employment_start_date: String, + employment_end_date: String, + termination_date: String, + termination_type: String, + termination_reason: String, + full_time_start_date: String, + end_date: String, + month_of_service: Number, + full_years_of_service: Number, + compensation_type: String, + compensation: Number, + worker_type: String, + monthly_salary: Number, + currency: String, + salary: Number, + hourly_wage: Number, + work_site: Number, + next_anniversary: Number, + job_id: String, + job_title: String, + job_category: String, + + add_to_payroll: Boolean, + collect_tax_information: Boolean, + fingerprints: [{ + type: String + }], + entry_passcode: [{ + type: String + }] }, { collection: 'employee', timestamps: true } ); diff --git a/app/models/index.js b/app/models/index.js index 74a7210..4124096 100644 --- a/app/models/index.js +++ b/app/models/index.js @@ -32,4 +32,6 @@ db.label = require("./label.model")(mongoose); db.seating = require("./seating.model")(mongoose); db.attendance_note = require("./attendance-note.model")(mongoose); db.carousel = require("./carousel.model")(mongoose); +db.fingerprint_attendance = require("./fingerprint-attendance.model")(mongoose); +db.dailyRoutesTemplate = require("./daily-routes-template.model")(mongoose); module.exports = db; \ No newline at end of file diff --git a/app/models/resource.model.js b/app/models/resource.model.js index fd47ece..7c65a12 100644 --- a/app/models/resource.model.js +++ b/app/models/resource.model.js @@ -5,33 +5,49 @@ module.exports = mongoose => { }); var schema = mongoose.Schema( { - name: String, - name_original: String, - name_branch: String, + // Basic Information + name: String, // Provider name (renamed from doctor name) + office_name: String, // Merged from name_original and name_branch specialty: String, type: String, // value may be ['doctor', 'pharmacy' or 'other'] - color: String, - address: String, + + // Legacy fields for backward compatibility + name_original: String, + name_branch: String, + + // Contact Information + phone: String, // Office Phone Number + contact: String, // Secondary Phone Number + fax: String, // Fax Number + email: String, + + // Address (split fields) + address_line_1: String, + address_line_2: String, city: String, state: String, zipcode: String, - phone: String, + + // Legacy address field + address: String, + + // Additional Information + note: String, // Merged from description and note + + // Legacy fields + description: String, + color: String, status: String, // value might be ['active', 'inactive'] + + // System fields create_by: String, create_date: Date, parent_id: String, ext_id: String, category: String, - description: String, - contact: String, - fax: String, - email: String, - note: String, data: Object, edit_by: String, edit_date: Date, - create_by: String, - create_date: Date, site: Number, images: [{ type: String @@ -49,4 +65,4 @@ module.exports = mongoose => { }); const Resource = mongoose.model("resource", schema); return Resource; - }; \ No newline at end of file + }; diff --git a/app/models/vehicle.model.js b/app/models/vehicle.model.js index fe2ba84..6009300 100644 --- a/app/models/vehicle.model.js +++ b/app/models/vehicle.model.js @@ -2,38 +2,52 @@ const uniqueValidator = require('mongoose-unique-validator'); module.exports = mongoose => { var schema = mongoose.Schema( { + // Basic Information vehicle_number: { type: Number, required: true, }, + responsible_driver: String, + responsible_driver_id: String, + capacity: Number, + mileage: Number, + make: String, + vehicle_model: String, + year: String, + vin: String, tag: { type: String, required: true }, - ezpass: { - type: String, - }, - gps_tag: { - type: String, - }, - mileage: Number, - capacity: Number, - make: String, - vehicle_model: String, - year: String, - checklist: [{ - type: String - }], - status: String, - site: Number, - vin: String, + gps_tag: String, + ezpass: String, has_lift_equip: Boolean, + fuel_type: String, + title: String, + title_other: String, + + // Compliance & Deadlines + insurance_start_date: String, + vehicle_registration_date: String, + + // Legacy fields (keeping for backward compatibility) insurance_expire_on: String, title_registration_on: String, emission_test_on: String, oil_change_mileage: Number, oil_change_date: String, - note: String + + // Check List + checklist: [{ + type: String + }], + + // Additional Information + note: String, + + // System fields + status: String, + site: Number }, { collection: 'vehicle', timestamps: true } ); @@ -45,4 +59,4 @@ module.exports = mongoose => { schema.index({tag: 1, site:1}, {unique: true}); const Vehicle = mongoose.model("vehicle", schema); return Vehicle; - }; \ No newline at end of file + }; diff --git a/app/routes/employee.routes.js b/app/routes/employee.routes.js index 1890437..62e1212 100644 --- a/app/routes/employee.routes.js +++ b/app/routes/employee.routes.js @@ -10,7 +10,9 @@ module.exports = app => { }); var router = require("express").Router(); // Retrieve all employee - router.get("/",[authJwt.verifyToken], employees.getAllEmployees); + router.get("/", employees.getAllEmployees); + // Retrive employees across sites + router.get("/all-sites", employees.getAllEmployeesAcrossSites); // Create a new employee router.post("/", employees.createEmployee); // Update an employee diff --git a/app/views/.DS_Store b/app/views/.DS_Store index ed5e2ed..9d41745 100644 Binary files a/app/views/.DS_Store and b/app/views/.DS_Store differ diff --git a/app/views/asset-manifest.json b/app/views/asset-manifest.json index 8bd4309..0b5ce10 100644 --- a/app/views/asset-manifest.json +++ b/app/views/asset-manifest.json @@ -1,16 +1,16 @@ { "files": { - "main.css": "/static/css/main.2c06dda5.css", - "main.js": "/static/js/main.cddce86b.js", + "main.css": "/static/css/main.7fa0ef40.css", + "main.js": "/static/js/main.ea61a51a.js", "static/js/787.c4e7f8f9.chunk.js": "/static/js/787.c4e7f8f9.chunk.js", "static/media/landing.png": "/static/media/landing.d4c6072db7a67dff6a78.png", "index.html": "/index.html", - "main.2c06dda5.css.map": "/static/css/main.2c06dda5.css.map", - "main.cddce86b.js.map": "/static/js/main.cddce86b.js.map", + "main.7fa0ef40.css.map": "/static/css/main.7fa0ef40.css.map", + "main.ea61a51a.js.map": "/static/js/main.ea61a51a.js.map", "787.c4e7f8f9.chunk.js.map": "/static/js/787.c4e7f8f9.chunk.js.map" }, "entrypoints": [ - "static/css/main.2c06dda5.css", - "static/js/main.cddce86b.js" + "static/css/main.7fa0ef40.css", + "static/js/main.ea61a51a.js" ] } \ No newline at end of file diff --git a/app/views/index.html b/app/views/index.html index 712638b..d777474 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1 +1 @@ -
`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\n\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n\n// Abbreviations\n//\n// 1. Duplicate behavior to the data-bs-* attribute for our tooltip plugin\n// 2. Add the correct text decoration in Chrome, Edge, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Prevent the text-decoration to be skipped.\n\nabbr[title],\nabbr[data-bs-original-title] { // 1\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n text-decoration-skip-ink: none; // 4\n}\n\n\n// Address\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\n\n// Lists\n\nol,\nul {\n padding-left: 2rem;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\n// 1. Undo browser default\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // 1\n}\n\n\n// Blockquote\n\nblockquote {\n margin: 0 0 1rem;\n}\n\n\n// Strong\n//\n// Add the correct font weight in Chrome, Edge, and Safari\n\nb,\nstrong {\n font-weight: $font-weight-bolder;\n}\n\n\n// Small\n//\n// Add the correct font size in all browsers\n\nsmall {\n @include font-size($small-font-size);\n}\n\n\n// Mark\n\nmark {\n padding: $mark-padding;\n background-color: $mark-bg;\n}\n\n\n// Sub and Sup\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n\nsub,\nsup {\n position: relative;\n @include font-size($sub-sup-font-size);\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n// Links\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n\n &:hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([class]) {\n &,\n &:hover {\n color: inherit;\n text-decoration: none;\n }\n}\n\n\n// Code\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-code;\n @include font-size(1em); // Correct the odd `em` font sizing in all browsers.\n direction: ltr #{\"/* rtl:ignore */\"};\n unicode-bidi: bidi-override;\n}\n\n// 1. Remove browser default top margin\n// 2. Reset browser default of `1em` to use `rem`s\n// 3. Don't allow content to break outside\n\npre {\n display: block;\n margin-top: 0; // 1\n margin-bottom: 1rem; // 2\n overflow: auto; // 3\n @include font-size($code-font-size);\n color: $pre-color;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n @include font-size(inherit);\n color: inherit;\n word-break: normal;\n }\n}\n\ncode {\n @include font-size($code-font-size);\n color: $code-color;\n word-wrap: break-word;\n\n // Streamline the style when inside anchors to avoid broken underline and more\n a > & {\n color: inherit;\n }\n}\n\nkbd {\n padding: $kbd-padding-y $kbd-padding-x;\n @include font-size($kbd-font-size);\n color: $kbd-color;\n background-color: $kbd-bg;\n @include border-radius($border-radius-sm);\n\n kbd {\n padding: 0;\n @include font-size(1em);\n font-weight: $nested-kbd-font-weight;\n }\n}\n\n\n// Figures\n//\n// Apply a consistent margin strategy (matches our type styles).\n\nfigure {\n margin: 0 0 1rem;\n}\n\n\n// Images and content\n\nimg,\nsvg {\n vertical-align: middle;\n}\n\n\n// Tables\n//\n// Prevent double borders\n\ntable {\n caption-side: bottom;\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: $table-cell-padding-y;\n padding-bottom: $table-cell-padding-y;\n color: $table-caption-color;\n text-align: left;\n}\n\n// 1. Removes font-weight bold by inheriting\n// 2. Matches default `