This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<div class="container py-5"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="main-timeline"> | |
<div class="timeline"> | |
<div class="timeline-content"> | |
<div class="circle"><span class="homebox"> | |
<img src="https://picsum.photos/164" class="img"> | |
</span></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Contructor based DI (intermediary solution we had before) | |
const UserService = require('../user/userService') | |
const userService = new UserService(crmService, lhNotifier, userPropertyService) | |
// Note: All of the required services had to be managed in each occurrence | |
// Consistency was not the only pain we had | |
// With DI container in place | |
const { container, types } = require('../dependencyContainer') | |
const userService = container.get(types.UserService) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UserPropertyRepo from './account/repos/userPropertyRepo' | |
import UserRepo from './account/repos/userRepo' | |
container.bind<IUserPropertyRepo>(DI_TYPES.UserPropertyRepo).to(UserPropertyRepo) | |
container.bind<IUserRepo>(DI_TYPES.UserRepo).to(UserRepo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.associate = function ({ Company, UserRole, Role }) { | |
// association for or table not needed anymore | |
// models.User.hasMany(models.Order) | |
User.belongsTo(Company, { as: 'company' }) | |
User.belongsToMany(Role, { as: 'roles') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IUserPropertyService, IUserService, IUserRoleService} from '../interfaces/services' | |
import UserService from './account/userService' | |
import UserPropertyService from './account/userPropertyService' | |
import UserRoleService from './account/userRoleService' | |
container.bind<IUserService>(DI_TYPES.UserService).to(UserService) | |
container.bind<IUserPropertyService>(DI_TYPES.UserPropertyService).to(UserPropertyService) | |
container.bind<IUserRoleService>(DI_TYPES.UserRoleService).to(UserRoleService) |