diff --git a/src/app/mock-api/apps/report/daily-partner/api.ts b/src/app/mock-api/apps/report/daily-partner/api.ts index 8acb3da..4981939 100644 --- a/src/app/mock-api/apps/report/daily-partner/api.ts +++ b/src/app/mock-api/apps/report/daily-partner/api.ts @@ -29,33 +29,16 @@ export class ReportDailyPartnerMockApi { // @ DailyPartners - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/dailyPartner/dailyPartners', 300) + .onGet('api/apps/report/daily-partner', 300) .reply(({ request }) => { // Get available queries const search = request.params.get('search'); const sort = request.params.get('sort') || 'name'; const order = request.params.get('order') || 'asc'; - const page = parseInt(request.params.get('page') ?? '1', 10); - const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the dailyPartners let dailyPartners: any[] | null = cloneDeep(this._dailyPartners); - // Sort the dailyPartners - if (sort === 'sku' || sort === 'name' || sort === 'active') { - dailyPartners.sort((a, b) => { - const fieldA = a[sort].toString().toUpperCase(); - const fieldB = b[sort].toString().toUpperCase(); - return order === 'asc' - ? fieldA.localeCompare(fieldB) - : fieldB.localeCompare(fieldA); - }); - } else { - dailyPartners.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } - // If search exists... if (search) { // Filter the dailyPartners @@ -66,47 +49,11 @@ export class ReportDailyPartnerMockApi { ); } - // Paginate - Start - const dailyPartnersLength = dailyPartners.length; - - // Calculate pagination details - const begin = page * size; - const end = Math.min(size * (page + 1), dailyPartnersLength); - const lastPage = Math.max(Math.ceil(dailyPartnersLength / size), 1); - - // Prepare the pagination object - let pagination = {}; - - // If the requested page number is bigger than - // the last possible page number, return null for - // dailyPartners but also send the last possible page so - // the app can navigate to there - if (page > lastPage) { - dailyPartners = null; - pagination = { - lastPage, - }; - } else { - // Paginate the results by size - dailyPartners = dailyPartners.slice(begin, end); - - // Prepare the pagination mock-api - pagination = { - length: dailyPartnersLength, - size: size, - page: page, - lastPage: lastPage, - startIndex: begin, - endIndex: end - 1, - }; - } - // Return the response return [ 200, { dailyPartners, - pagination, }, ]; }); @@ -114,27 +61,27 @@ export class ReportDailyPartnerMockApi { // ----------------------------------------------------------------------------------------------------- // @ DailyPartner - GET // ----------------------------------------------------------------------------------------------------- - this._fuseMockApiService - .onGet('api/apps/report/daily-partner/daily-partner') - .reply(({ request }) => { - // Get the id from the params - const id = request.params.get('id'); + // this._fuseMockApiService + // .onGet('api/apps/report/daily-partner') + // .reply(({ request }) => { + // // Get the id from the params + // const id = request.params.get('id'); - // Clone the dailyPartners - const dailyPartners = cloneDeep(this._dailyPartners); + // // Clone the dailyPartners + // const dailyPartners = cloneDeep(this._dailyPartners); - // Find the dailyPartner - const dailyPartner = dailyPartners.find((item: any) => item.id === id); + // // Find the dailyPartner + // const dailyPartner = dailyPartners.find((item: any) => item.id === id); - // Return the response - return [200, dailyPartner]; - }); + // // Return the response + // return [200, dailyPartner]; + // }); // ----------------------------------------------------------------------------------------------------- // @ DailyPartner - POST // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onPost('api/apps/report/daily-partner/daily-partner') + .onPost('api/apps/report/daily-partner') .reply(() => { // Generate a new dailyPartner const newDailyPartner = { @@ -170,7 +117,7 @@ export class ReportDailyPartnerMockApi { // @ DailyPartner - PATCH // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onPatch('api/apps/report/daily-partner/daily-partner') + .onPatch('api/apps/report/daily-partner') .reply(({ request }) => { // Get the id and dailyPartner const id = request.body.id; @@ -202,7 +149,7 @@ export class ReportDailyPartnerMockApi { // @ DailyPartner - DELETE // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onDelete('api/apps/report/daily-partner/daily-partner') + .onDelete('api/apps/report/daily-partner') .reply(({ request }) => { // Get the id const id = request.params.get('id'); diff --git a/src/app/mock-api/apps/report/daily-partner/data.ts b/src/app/mock-api/apps/report/daily-partner/data.ts index 183962c..2fd6c65 100644 --- a/src/app/mock-api/apps/report/daily-partner/data.ts +++ b/src/app/mock-api/apps/report/daily-partner/data.ts @@ -1,33 +1,545 @@ /* eslint-disable */ export const dailyPartners = [ + // { + // id: 'on00', + // totalPartnerCount: '5', + // totalHoldingMoney: 303675, + // totalComp: 108933, + // total: 412608, + // branchCount: 1, + // divisionCount: 1, + // officeCount: 1, + // storeCount: 1, + // memberCount: 1, + // nickname: 'on00', + // accountHolder: '11', + // phoneNumber: '010-1111-1111', + // calculateType: '롤링', + // ownCash: 50000, + // ownComp: 1711, + // ownCoupon: 50000, + // gameMoney: 0, + // todayComp: 0, + // totalDeposit: 0, + // totalWithdraw: 0, + // balance: 0, + // registDate: '2022-06-12 15:38', + // finalSigninDate: '', + // ip: '', + // state: '정상', + // note: '', + // }, { - id: 'on00', - totalPartnerCount: '5', - totalHoldingMoney: 303675, - totalComp: 108933, - total: 412608, - branchCount: 1, - divisionCount: 1, - officeCount: 1, - storeCount: 1, - memberCount: 1, - nickname: 'on00', - accountHolder: '11', - phoneNumber: '010-1111-1111', - calculateType: '롤링', - ownCash: 50000, - ownComp: 1711, - ownCoupon: 50000, - gameMoney: 0, - todayComp: 0, - totalDeposit: 0, - totalWithdraw: 0, - balance: 0, - registDate: '2022-06-12 15:38', - finalSigninDate: '', - ip: '', - state: '정상', - note: '', + user: { + id: '1', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '2', + signinId: 'kgon2', + type: '대본', + parentId: 1, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '3', + signinId: 'kgon1', + type: '본사', + parentId: 2, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '4', + signinId: 'kgon1', + type: '부본', + parentId: 3, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '5', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '6', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '7', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '8', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', }, ]; diff --git a/src/app/modules/admin/report/daily-partner/components/list.component.html b/src/app/modules/admin/report/daily-partner/components/list.component.html index 9a2c8e0..13b4efb 100644 --- a/src/app/modules/admin/report/daily-partner/components/list.component.html +++ b/src/app/modules/admin/report/daily-partner/components/list.component.html @@ -1,356 +1,234 @@ -