index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // TODO: App Specific Models
  2. const {database} = require('@alancnet/material-framework/server')
  3. const { Location, Retailer } = database
  4. // const Location = require('./location')
  5. const Workday = require('./workday')
  6. const Service = require('./service')
  7. //const Retailer = require('./retailer')
  8. const StaffMember = require('./staff-member')
  9. const StaffingAgency = require('./staffing-agency')
  10. const Labor = require('./labor')
  11. const LocationWorkday = Location.hasMany(Workday)
  12. const WorkdayLocation = Workday.belongsTo(Location)
  13. const WorkdayService = Workday.hasMany(Service)
  14. const ServiceWorkday = Service.belongsTo(Workday)
  15. const RetailerService = Retailer.hasMany(Service)
  16. const ServiceRetailer = Service.belongsTo(Retailer)
  17. const LocationStaffMember = Location.hasMany(StaffMember)
  18. const StaffMemberLocation = StaffMember.belongsTo(Location)
  19. const LocationRetailer = Location.hasMany(Retailer)
  20. const RetailerLocation = Retailer.belongsTo(Location)
  21. // const StaffingAgencyStaffMember = StaffingAgency.hasMany(StaffMember)
  22. // const StaffMemberStaffingAgency = StaffMember.belongsTo(StaffingAgency)
  23. module.exports = Object.assign(database, {
  24. Location,
  25. Workday,
  26. Service,
  27. Retailer,
  28. StaffMember,
  29. StaffingAgency,
  30. LocationWorkday,
  31. WorkdayLocation,
  32. WorkdayService,
  33. ServiceWorkday,
  34. RetailerService,
  35. ServiceRetailer,
  36. LocationStaffMember,
  37. StaffMemberLocation,
  38. Labor,
  39. LocationRetailer,
  40. RetailerLocation
  41. })