diff --git a/src/app/modules/admin/member/partner/partner.routing.ts b/src/app/modules/admin/member/partner/partner.routing.ts index 8b586e2..2fa6302 100644 --- a/src/app/modules/admin/member/partner/partner.routing.ts +++ b/src/app/modules/admin/member/partner/partner.routing.ts @@ -3,6 +3,11 @@ import { Route } from '@angular/router'; import { ListComponent } from './components/list.component'; import { + PartnerListForBranchResolver, + PartnerListForDivisionResolver, + PartnerListForMainOfficeResolver, + PartnerListForOfficeResolver, + PartnerListForStoreResolver, PartnerListResolver, PartnersResolver, } from './resolvers/partner.resolver'; @@ -24,35 +29,35 @@ export const partnerRoutes: Route[] = [ path: 'main-office', component: ListComponent, resolve: { - Partners: PartnersResolver, + listPartner: PartnerListForMainOfficeResolver, }, }, { path: 'branch', component: ListComponent, resolve: { - Partners: PartnersResolver, + listPartner: PartnerListForBranchResolver, }, }, { path: 'division', component: ListComponent, resolve: { - Partners: PartnersResolver, + listPartner: PartnerListForDivisionResolver, }, }, { path: 'office', component: ListComponent, resolve: { - Partners: PartnersResolver, + listPartner: PartnerListForOfficeResolver, }, }, { path: 'store', component: ListComponent, resolve: { - Partners: PartnersResolver, + listPartner: PartnerListForStoreResolver, }, }, ]; diff --git a/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts b/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts index 89f65d2..f81dfcf 100644 --- a/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts +++ b/src/app/modules/admin/member/partner/resolvers/partner.resolver.ts @@ -128,3 +128,178 @@ export class PartnerListResolver implements Resolve { return this.__memberService.listMembers(req); } } + +@Injectable({ + providedIn: 'root', +}) +export class PartnerListForMainOfficeResolver implements Resolve { + /** + * Constructor + */ + constructor(private __memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + let search = new ListMembersRequest.Search(); + search.setMemberClassId('4b014ef5-3bab-4413-aaf9-b0040a70ec77'); + req.setSearch(search); + + return this.__memberService.listMembers(req); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class PartnerListForBranchResolver implements Resolve { + /** + * Constructor + */ + constructor(private __memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + let search = new ListMembersRequest.Search(); + search.setMemberClassId('ae9b874e-5d0e-4c4d-8432-f45f02691ceb'); + req.setSearch(search); + + return this.__memberService.listMembers(req); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class PartnerListForDivisionResolver implements Resolve { + /** + * Constructor + */ + constructor(private __memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + let search = new ListMembersRequest.Search(); + search.setMemberClassId('f25a17e9-5c5f-4e9c-bf80-92a9cedf829c'); + req.setSearch(search); + + return this.__memberService.listMembers(req); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class PartnerListForOfficeResolver implements Resolve { + /** + * Constructor + */ + constructor(private __memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + let search = new ListMembersRequest.Search(); + search.setMemberClassId('cac7b897-2549-4f04-8415-8868f1dcb1da'); + req.setSearch(search); + + return this.__memberService.listMembers(req); + } +} + +@Injectable({ + providedIn: 'root', +}) +export class PartnerListForStoreResolver implements Resolve { + /** + * Constructor + */ + constructor(private __memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + let search = new ListMembersRequest.Search(); + search.setMemberClassId('e11cac11-3825-4f4e-9cd5-39367f23f973'); + req.setSearch(search); + + return this.__memberService.listMembers(req); + } +}