쿠폰발행머니로그 page 수정

This commit is contained in:
이담 정 2022-07-20 08:06:46 +00:00
parent fc5141c709
commit e590aaa6f2
16 changed files with 174 additions and 174 deletions

View File

@ -228,11 +228,11 @@ export const appRoutes: Route[] = [
), ),
}, },
{ {
path: 'coupon-moneylog', path: 'coupon-money-log',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/member/coupon-moneylog/coupon-moneylog.module' 'app/modules/admin/member/coupon-money-log/coupon-money-log.module'
).then((m: any) => m.CouponMoneylogModule), ).then((m: any) => m.CouponMoneyLogModule),
}, },
{ {
path: 'coupon-log', path: 'coupon-log',

View File

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { assign, cloneDeep } from 'lodash-es'; import { assign, cloneDeep } from 'lodash-es';
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
import { couponMoneylogs as couponMoneylogsData } from './data'; import { couponMoneyLogs as couponMoneyLogsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class MemberCouponMoneylogMockApi { export class MemberCouponMoneyLogMockApi {
private _couponMoneylogs: any[] = couponMoneylogsData; private _couponMoneyLogs: any[] = couponMoneyLogsData;
/** /**
* Constructor * Constructor
@ -26,10 +26,10 @@ export class MemberCouponMoneylogMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ CouponMoneylogs - GET // @ CouponMoneyLogs - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/member/coupon-moneylog/coupon-moneylogs', 300) .onGet('api/apps/member/coupon-money-log/coupon-money-logs', 300)
.reply(({ request }) => { .reply(({ request }) => {
// Get available queries // Get available queries
const search = request.params.get('search'); const search = request.params.get('search');
@ -38,12 +38,12 @@ export class MemberCouponMoneylogMockApi {
const page = parseInt(request.params.get('page') ?? '1', 10); const page = parseInt(request.params.get('page') ?? '1', 10);
const size = parseInt(request.params.get('size') ?? '10', 10); const size = parseInt(request.params.get('size') ?? '10', 10);
// Clone the couponMoneylogs // Clone the couponMoneyLogs
let couponMoneylogs: any[] | null = cloneDeep(this._couponMoneylogs); let couponMoneyLogs: any[] | null = cloneDeep(this._couponMoneyLogs);
// Sort the couponMoneylogs // Sort the couponMoneyLogs
if (sort === 'sku' || sort === 'name' || sort === 'active') { if (sort === 'sku' || sort === 'name' || sort === 'active') {
couponMoneylogs.sort((a, b) => { couponMoneyLogs.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase(); const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase();
return order === 'asc' return order === 'asc'
@ -51,15 +51,15 @@ export class MemberCouponMoneylogMockApi {
: fieldB.localeCompare(fieldA); : fieldB.localeCompare(fieldA);
}); });
} else { } else {
couponMoneylogs.sort((a, b) => couponMoneyLogs.sort((a, b) =>
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
); );
} }
// If search exists... // If search exists...
if (search) { if (search) {
// Filter the couponMoneylogs // Filter the couponMoneyLogs
couponMoneylogs = couponMoneylogs.filter( couponMoneyLogs = couponMoneyLogs.filter(
(contact: any) => (contact: any) =>
contact.name && contact.name &&
contact.name.toLowerCase().includes(search.toLowerCase()) contact.name.toLowerCase().includes(search.toLowerCase())
@ -67,32 +67,32 @@ export class MemberCouponMoneylogMockApi {
} }
// Paginate - Start // Paginate - Start
const couponMoneylogsLength = couponMoneylogs.length; const couponMoneyLogsLength = couponMoneyLogs.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), couponMoneylogsLength); const end = Math.min(size * (page + 1), couponMoneyLogsLength);
const lastPage = Math.max(Math.ceil(couponMoneylogsLength / size), 1); const lastPage = Math.max(Math.ceil(couponMoneyLogsLength / size), 1);
// Prepare the pagination object // Prepare the pagination object
let pagination = {}; let pagination = {};
// If the requested page number is bigger than // If the requested page number is bigger than
// the last possible page number, return null for // the last possible page number, return null for
// couponMoneylogs but also send the last possible page so // couponMoneyLogs but also send the last possible page so
// the app can navigate to there // the app can navigate to there
if (page > lastPage) { if (page > lastPage) {
couponMoneylogs = null; couponMoneyLogs = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
couponMoneylogs = couponMoneylogs.slice(begin, end); couponMoneyLogs = couponMoneyLogs.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: couponMoneylogsLength, length: couponMoneyLogsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -105,41 +105,41 @@ export class MemberCouponMoneylogMockApi {
return [ return [
200, 200,
{ {
couponMoneylogs, couponMoneyLogs,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ CouponMoneylog - GET // @ CouponMoneyLog - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/member/coupon-moneylog/coupon-moneylog') .onGet('api/apps/member/coupon-money-log/coupon-money-log')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id from the params // Get the id from the params
const id = request.params.get('id'); const id = request.params.get('id');
// Clone the couponMoneylogs // Clone the couponMoneyLogs
const couponMoneylogs = cloneDeep(this._couponMoneylogs); const couponMoneyLogs = cloneDeep(this._couponMoneyLogs);
// Find the couponMoneylog // Find the couponMoneyLog
const couponMoneylog = couponMoneylogs.find( const couponMoneyLog = couponMoneyLogs.find(
(item: any) => item.id === id (item: any) => item.id === id
); );
// Return the response // Return the response
return [200, couponMoneylog]; return [200, couponMoneyLog];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ CouponMoneylog - POST // @ CouponMoneyLog - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/member/coupon-moneylog/coupon-moneylog') .onPost('api/apps/member/coupon-money-log/coupon-money-log')
.reply(() => { .reply(() => {
// Generate a new couponMoneylog // Generate a new couponMoneyLog
const newCouponMoneylog = { const newCouponMoneyLog = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -161,58 +161,58 @@ export class MemberCouponMoneylogMockApi {
active: false, active: false,
}; };
// Unshift the new couponMoneylog // Unshift the new couponMoneyLog
this._couponMoneylogs.unshift(newCouponMoneylog); this._couponMoneyLogs.unshift(newCouponMoneyLog);
// Return the response // Return the response
return [200, newCouponMoneylog]; return [200, newCouponMoneyLog];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ CouponMoneylog - PATCH // @ CouponMoneyLog - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/member/coupon-moneylog/coupon-moneylog') .onPatch('api/apps/member/coupon-money-log/coupon-money-log')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and couponMoneylog // Get the id and couponMoneyLog
const id = request.body.id; const id = request.body.id;
const couponMoneylog = cloneDeep(request.body.couponMoneylog); const couponMoneyLog = cloneDeep(request.body.couponMoneyLog);
// Prepare the updated couponMoneylog // Prepare the updated couponMoneyLog
let updatedCouponMoneylog = null; let updatedCouponMoneyLog = null;
// Find the couponMoneylog and update it // Find the couponMoneyLog and update it
this._couponMoneylogs.forEach((item, index, couponMoneylogs) => { this._couponMoneyLogs.forEach((item, index, couponMoneyLogs) => {
if (item.id === id) { if (item.id === id) {
// Update the couponMoneylog // Update the couponMoneyLog
couponMoneylogs[index] = assign( couponMoneyLogs[index] = assign(
{}, {},
couponMoneylogs[index], couponMoneyLogs[index],
couponMoneylog couponMoneyLog
); );
// Store the updated couponMoneylog // Store the updated couponMoneyLog
updatedCouponMoneylog = couponMoneylogs[index]; updatedCouponMoneyLog = couponMoneyLogs[index];
} }
}); });
// Return the response // Return the response
return [200, updatedCouponMoneylog]; return [200, updatedCouponMoneyLog];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ CouponMoneylog - DELETE // @ CouponMoneyLog - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/member/coupon-moneylog/coupon-moneylog') .onDelete('api/apps/member/coupon-money-log/coupon-money-log')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id // Get the id
const id = request.params.get('id'); const id = request.params.get('id');
// Find the couponMoneylog and delete it // Find the couponMoneyLog and delete it
this._couponMoneylogs.forEach((item, index) => { this._couponMoneyLogs.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._couponMoneylogs.splice(index, 1); this._couponMoneyLogs.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const couponMoneylogs = [ export const couponMoneyLogs = [
{ {
id: 'on00', id: 'on00',
totalPartnerCount: '5', totalPartnerCount: '5',

View File

@ -133,11 +133,11 @@ export const defaultNavigation: FuseNavigationItem[] = [
link: '/member/coupon', link: '/member/coupon',
}, },
{ {
id: 'member.coupon-moneylog', id: 'member.coupon-money-log',
title: 'Coupon Moneylog', title: 'Coupon Money Log',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/member/coupon-moneylog', link: '/member/coupon-money-log',
}, },
{ {
id: 'member.coupon-log', id: 'member.coupon-log',

View File

@ -23,7 +23,7 @@ import { MemberPartnerOfficeMockApi } from './apps/member/partner-office/api';
import { MemberPartnerStoreMockApi } from './apps/member/partner-store/api'; import { MemberPartnerStoreMockApi } from './apps/member/partner-store/api';
import { MemberPartnerRecommendationMockApi } from './apps/member/partner-recommendation/api'; import { MemberPartnerRecommendationMockApi } from './apps/member/partner-recommendation/api';
import { MemberCouponMockApi } from './apps/member/coupon/api'; import { MemberCouponMockApi } from './apps/member/coupon/api';
import { MemberCouponMoneylogMockApi } from './apps/member/coupon-moneylog/api'; import { MemberCouponMoneyLogMockApi } from './apps/member/coupon-money-log/api';
import { MemberCouponLogMockApi } from './apps/member/coupon-log/api'; import { MemberCouponLogMockApi } from './apps/member/coupon-log/api';
import { MessagesMockApi } from 'app/mock-api/common/messages/api'; import { MessagesMockApi } from 'app/mock-api/common/messages/api';
import { NavigationMockApi } from 'app/mock-api/common/navigation/api'; import { NavigationMockApi } from 'app/mock-api/common/navigation/api';
@ -96,7 +96,7 @@ export const mockApiServices = [
MemberPartnerStoreMockApi, MemberPartnerStoreMockApi,
MemberPartnerRecommendationMockApi, MemberPartnerRecommendationMockApi,
MemberCouponMockApi, MemberCouponMockApi,
MemberCouponMoneylogMockApi, MemberCouponMoneyLogMockApi,
MemberCouponLogMockApi, MemberCouponLogMockApi,
MessagesMockApi, MessagesMockApi,
NavigationMockApi, NavigationMockApi,

View File

@ -15,20 +15,20 @@
<div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4"> <div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4">
<!-- Memo --> <!-- Memo -->
<!-- <mat-form-field> <!-- <mat-form-field>
<ng-container *ngIf="couponMoneylogs$ | async as couponMoneylogs"> <ng-container *ngIf="couponMoneyLogs$ | async as couponMoneyLogs">
<ng-container <ng-container
*ngFor="let couponMoneylog of couponMoneylogs; trackBy: __trackByFn" *ngFor="let couponMoneyLog of couponMoneyLogs; trackBy: __trackByFn"
> >
<div <div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
> >
<fieldset> <fieldset>
총 파트너수:{{ couponMoneylog.totalPartnerCount }} 총 파트너수:{{ couponMoneyLog.totalPartnerCount }}
총 보유머니:{{ 총 보유머니:{{
couponMoneylog.totalHoldingMoney couponMoneyLog.totalHoldingMoney
}} }}
총 콤프:{{ couponMoneylog.totalComp }} 총 합계:{{ 총 콤프:{{ couponMoneyLog.totalComp }} 총 합계:{{
couponMoneylog.total couponMoneyLog.total
}} }}
</fieldset> </fieldset>
</div> </div>
@ -152,8 +152,8 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="couponMoneylogs$ | async as couponMoneylogs"> <ng-container *ngIf="couponMoneyLogs$ | async as couponMoneyLogs">
<ng-container *ngIf="couponMoneylogs.length > 0; else noCouponMoneylog"> <ng-container *ngIf="couponMoneyLogs.length > 0; else noCouponMoneyLog">
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -183,10 +183,10 @@
<div class="hidden sm:block">비고</div> <div class="hidden sm:block">비고</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="couponMoneylogs$ | async as couponMoneylogs"> <ng-container *ngIf="couponMoneyLogs$ | async as couponMoneyLogs">
<ng-container <ng-container
*ngFor=" *ngFor="
let couponMoneylog of couponMoneylogs; let couponMoneyLog of couponMoneyLogs;
trackBy: __trackByFn trackBy: __trackByFn
" "
> >
@ -232,22 +232,22 @@
<!-- 매장수 --> <!-- 매장수 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.branchCount }} {{ couponMoneyLog.branchCount }}
</button> </button>
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.divisionCount }} {{ couponMoneyLog.divisionCount }}
</button> </button>
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.officeCount }} {{ couponMoneyLog.officeCount }}
</button> </button>
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.storeCount }} {{ couponMoneyLog.storeCount }}
</button> </button>
</div> </div>
<!-- 회원수 --> <!-- 회원수 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.memberCount }} {{ couponMoneyLog.memberCount }}
</button> </button>
</div> </div>
<!-- id --> <!-- id -->
@ -259,36 +259,36 @@
class="hidden sm:block truncate" class="hidden sm:block truncate"
(click)="viewUserDetail(user.id!)" (click)="viewUserDetail(user.id!)"
> >
{{ couponMoneylog.id }} {{ couponMoneyLog.id }}
</div> </div>
</ng-container> </ng-container>
</ng-container> </ng-container>
<!-- nickname --> <!-- nickname -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.nickname }} {{ couponMoneyLog.nickname }}
</div> </div>
<!-- accountHolder --> <!-- accountHolder -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.accountHolder }} {{ couponMoneyLog.accountHolder }}
</div> </div>
<!-- 연락처 --> <!-- 연락처 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.phoneNumber }} {{ couponMoneyLog.phoneNumber }}
</div> </div>
<!-- 정산 --> <!-- 정산 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.calculateType }} {{ couponMoneyLog.calculateType }}
</div> </div>
<!-- 보유금 --> <!-- 보유금 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
캐쉬{{ couponMoneylog.ownCash }} 콤프{{ 캐쉬{{ couponMoneyLog.ownCash }} 콤프{{
couponMoneylog.ownComp couponMoneyLog.ownComp
}} }}
쿠폰{{ couponMoneylog.ownCoupon }} 쿠폰{{ couponMoneyLog.ownCoupon }}
</div> </div>
<!-- gameMoney --> <!-- gameMoney -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.gameMoney }} {{ couponMoneyLog.gameMoney }}
</div> </div>
<!-- casinoCash --> <!-- casinoCash -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
@ -301,34 +301,34 @@
</div> </div>
<!-- todayComp --> <!-- todayComp -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.todayComp }}P {{ couponMoneyLog.todayComp }}P
</div> </div>
<!-- 총입출 --> <!-- 총입출 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
입금{{ couponMoneylog.totalDeposit }} 출금{{ 입금{{ couponMoneyLog.totalDeposit }} 출금{{
couponMoneylog.totalWithdraw couponMoneyLog.totalWithdraw
}} }}
차익{{ couponMoneylog.balance }} 차익{{ couponMoneyLog.balance }}
</div> </div>
<!-- log --> <!-- log -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
가입{{ couponMoneylog.registDate }} 최종{{ 가입{{ couponMoneyLog.registDate }} 최종{{
couponMoneylog.finalSigninDate couponMoneyLog.finalSigninDate
}} }}
IP{{ couponMoneylog.ip }} IP{{ couponMoneyLog.ip }}
</div> </div>
<!-- state --> <!-- state -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.state }} {{ couponMoneyLog.state }}
</div> </div>
<!-- 회원수 --> <!-- 회원수 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
{{ couponMoneylog.memberCount }} {{ couponMoneyLog.memberCount }}
</div> </div>
<!-- 비고 --> <!-- 비고 -->
<div class="hidden sm:block truncate"> <div class="hidden sm:block truncate">
<button mat-flat-button [color]="'primary'"> <button mat-flat-button [color]="'primary'">
{{ couponMoneylog.note }} {{ couponMoneyLog.note }}
</button> </button>
</div> </div>
</div> </div>
@ -348,7 +348,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noCouponMoneylog> <ng-template #noCouponMoneyLog>
<div <div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
> >

View File

@ -30,13 +30,13 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../../user/models/user'; import { User } from '../../user/models/user';
import { CouponMoneylog } from '../models/coupon-moneylog'; import { CouponMoneyLog } from '../models/coupon-money-log';
import { CouponMoneylogPagination } from '../models/coupon-moneylog-pagination'; import { CouponMoneyLogPagination } from '../models/coupon-money-log-pagination';
import { CouponMoneylogService } from '../services/coupon-moneylog.service'; import { CouponMoneyLogService } from '../services/coupon-money-log.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'coupon-moneylog-list', selector: 'coupon-money-log-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -66,13 +66,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
couponMoneylogs$!: Observable<CouponMoneylog[] | undefined>; couponMoneyLogs$!: Observable<CouponMoneyLog[] | undefined>;
users$!: Observable<User[] | undefined>; users$!: Observable<User[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedCouponMoneylog?: CouponMoneylog; selectedCouponMoneyLog?: CouponMoneyLog;
pagination?: CouponMoneylogPagination; pagination?: CouponMoneyLogPagination;
private _unsubscribeAll: Subject<any> = new Subject<any>(); private _unsubscribeAll: Subject<any> = new Subject<any>();
@ -83,7 +83,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _couponMoneylogService: CouponMoneylogService, private _couponMoneyLogService: CouponMoneyLogService,
private router: Router private router: Router
) {} ) {}
@ -96,9 +96,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._couponMoneylogService.pagination$ this._couponMoneyLogService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: CouponMoneylogPagination | undefined) => { .subscribe((pagination: CouponMoneyLogPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -107,7 +107,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.couponMoneylogs$ = this._couponMoneylogService.couponMoneylogs$; this.couponMoneyLogs$ = this._couponMoneyLogService.couponMoneyLogs$;
} }
/** /**
@ -125,7 +125,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
// If the couponMoneylog changes the sort order... // If the couponMoneyLog changes the sort order...
this._sort.sortChange this._sort.sortChange
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => { .subscribe(() => {
@ -138,7 +138,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
.pipe( .pipe(
switchMap(() => { switchMap(() => {
this.isLoading = true; this.isLoading = true;
return this._couponMoneylogService.getCouponMoneylogs( return this._couponMoneyLogService.getCouponMoneyLogs(
this._paginator.pageIndex, this._paginator.pageIndex,
this._paginator.pageSize, this._paginator.pageSize,
this._sort.active, this._sort.active,

View File

@ -22,14 +22,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { CouponMoneylogRoutes } from './coupon-moneylog.routing'; import { CouponMoneyLogRoutes } from './coupon-money-log.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(CouponMoneylogRoutes), RouterModule.forChild(CouponMoneyLogRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -47,4 +47,4 @@ import { CouponMoneylogRoutes } from './coupon-moneylog.routing';
MatCheckboxModule, MatCheckboxModule,
], ],
}) })
export class CouponMoneylogModule {} export class CouponMoneyLogModule {}

View File

@ -3,15 +3,15 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../user/components/view.component'; import { ViewComponent } from '../user/components/view.component';
import { CouponMoneylogsResolver } from './resolvers/coupon-moneylog.resolver'; import { CouponMoneyLogsResolver } from './resolvers/coupon-money-log.resolver';
import { UserResolver } from '../user/resolvers/user.resolver'; import { UserResolver } from '../user/resolvers/user.resolver';
export const CouponMoneylogRoutes: Route[] = [ export const CouponMoneyLogRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
CouponMoneylogs: CouponMoneylogsResolver, CouponMoneyLogs: CouponMoneyLogsResolver,
}, },
}, },
{ {

View File

@ -1,4 +1,4 @@
export interface CouponMoneylogPagination { export interface CouponMoneyLogPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface CouponMoneylog { export interface CouponMoneyLog {
id?: string; id?: string;
totalPartnerCount?: number; totalPartnerCount?: number;
totalHoldingMoney?: number; totalHoldingMoney?: number;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { CouponMoneylog } from '../models/coupon-moneylog'; import { CouponMoneyLog } from '../models/coupon-money-log';
import { CouponMoneylogPagination } from '../models/coupon-moneylog-pagination'; import { CouponMoneyLogPagination } from '../models/coupon-money-log-pagination';
import { CouponMoneylogService } from '../services/coupon-moneylog.service'; import { CouponMoneyLogService } from '../services/coupon-money-log.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class CouponMoneylogResolver implements Resolve<any> { export class CouponMoneyLogResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _couponMoneylogService: CouponMoneylogService, private _couponMoneyLogService: CouponMoneyLogService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class CouponMoneylogResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<CouponMoneylog | undefined> { ): Observable<CouponMoneyLog | undefined> {
return this._couponMoneylogService return this._couponMoneyLogService
.getCouponMoneylogById(route.paramMap.get('id')) .getCouponMoneyLogById(route.paramMap.get('id'))
.pipe( .pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
@ -61,11 +61,11 @@ export class CouponMoneylogResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class CouponMoneylogsResolver implements Resolve<any> { export class CouponMoneyLogsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _couponMoneylogService: CouponMoneylogService) {} constructor(private _couponMoneyLogService: CouponMoneyLogService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class CouponMoneylogsResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: CouponMoneylogPagination; pagination: CouponMoneyLogPagination;
couponMoneylogs: CouponMoneylog[]; couponMoneyLogs: CouponMoneyLog[];
}> { }> {
return this._couponMoneylogService.getCouponMoneylogs(); return this._couponMoneyLogService.getCouponMoneyLogs();
} }
} }

View File

@ -12,21 +12,21 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { CouponMoneylog } from '../models/coupon-moneylog'; import { CouponMoneyLog } from '../models/coupon-money-log';
import { CouponMoneylogPagination } from '../models/coupon-moneylog-pagination'; import { CouponMoneyLogPagination } from '../models/coupon-money-log-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class CouponMoneylogService { export class CouponMoneyLogService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<
CouponMoneylogPagination | undefined CouponMoneyLogPagination | undefined
>(undefined); >(undefined);
private __couponMoneylog = new BehaviorSubject<CouponMoneylog | undefined>( private __couponMoneyLog = new BehaviorSubject<CouponMoneyLog | undefined>(
undefined undefined
); );
private __couponMoneylogs = new BehaviorSubject<CouponMoneylog[] | undefined>( private __couponMoneyLogs = new BehaviorSubject<CouponMoneyLog[] | undefined>(
undefined undefined
); );
@ -42,22 +42,22 @@ export class CouponMoneylogService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<CouponMoneylogPagination | undefined> { get pagination$(): Observable<CouponMoneyLogPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for couponMoneylog * Getter for couponMoneyLog
*/ */
get couponMoneylog$(): Observable<CouponMoneylog | undefined> { get couponMoneyLog$(): Observable<CouponMoneyLog | undefined> {
return this.__couponMoneylog.asObservable(); return this.__couponMoneyLog.asObservable();
} }
/** /**
* Getter for couponMoneylogs * Getter for couponMoneyLogs
*/ */
get couponMoneylogs$(): Observable<CouponMoneylog[] | undefined> { get couponMoneyLogs$(): Observable<CouponMoneyLog[] | undefined> {
return this.__couponMoneylogs.asObservable(); return this.__couponMoneyLogs.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class CouponMoneylogService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get couponMoneylogs * Get couponMoneyLogs
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class CouponMoneylogService {
* @param order * @param order
* @param search * @param search
*/ */
getCouponMoneylogs( getCouponMoneyLogs(
page: number = 0, page: number = 0,
size: number = 10, size: number = 10,
sort: string = 'name', sort: string = 'name',
order: 'asc' | 'desc' | '' = 'asc', order: 'asc' | 'desc' | '' = 'asc',
search: string = '' search: string = ''
): Observable<{ ): Observable<{
pagination: CouponMoneylogPagination; pagination: CouponMoneyLogPagination;
couponMoneylogs: CouponMoneylog[]; couponMoneyLogs: CouponMoneyLog[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: CouponMoneylogPagination; pagination: CouponMoneyLogPagination;
couponMoneylogs: CouponMoneylog[]; couponMoneyLogs: CouponMoneyLog[];
}>('api/apps/member/coupon-moneylog/coupon-moneylogs', { }>('api/apps/member/coupon-money-log/coupon-money-logs', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class CouponMoneylogService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__couponMoneylogs.next(response.couponMoneylogs); this.__couponMoneyLogs.next(response.couponMoneyLogs);
}) })
); );
} }
@ -108,19 +108,19 @@ export class CouponMoneylogService {
/** /**
* Get product by id * Get product by id
*/ */
getCouponMoneylogById(id: string | null): Observable<CouponMoneylog> { getCouponMoneyLogById(id: string | null): Observable<CouponMoneyLog> {
return this.__couponMoneylogs.pipe( return this.__couponMoneyLogs.pipe(
take(1), take(1),
map((couponMoneylogs) => { map((couponMoneyLogs) => {
// Find the product // Find the product
const couponMoneylog = const couponMoneyLog =
couponMoneylogs?.find((item) => item.id === id) || undefined; couponMoneyLogs?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__couponMoneylog.next(couponMoneylog); this.__couponMoneyLog.next(couponMoneyLog);
// Return the product // Return the product
return couponMoneylog; return couponMoneyLog;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,24 +135,24 @@ export class CouponMoneylogService {
/** /**
* Create product * Create product
*/ */
createCouponMoneylog(): Observable<CouponMoneylog> { createCouponMoneyLog(): Observable<CouponMoneyLog> {
return this.couponMoneylogs$.pipe( return this.couponMoneyLogs$.pipe(
take(1), take(1),
switchMap((couponMoneylogs) => switchMap((couponMoneyLogs) =>
this._httpClient this._httpClient
.post<CouponMoneylog>('api/apps/member/coupon-moneylog/product', {}) .post<CouponMoneyLog>('api/apps/member/coupon-money-log/product', {})
.pipe( .pipe(
map((newCouponMoneylog) => { map((newCouponMoneyLog) => {
// Update the couponMoneylogs with the new product // Update the couponMoneyLogs with the new product
if (!!couponMoneylogs) { if (!!couponMoneyLogs) {
this.__couponMoneylogs.next([ this.__couponMoneyLogs.next([
newCouponMoneylog, newCouponMoneyLog,
...couponMoneylogs, ...couponMoneyLogs,
]); ]);
} }
// Return the new product // Return the new product
return newCouponMoneylog; return newCouponMoneyLog;
}) })
) )
) )

View File

@ -14,7 +14,7 @@
"Partner Store": "Partner Store", "Partner Store": "Partner Store",
"Partner Recommendation": "Partner Recommendation", "Partner Recommendation": "Partner Recommendation",
"Coupon": "Coupon", "Coupon": "Coupon",
"Coupon Moneylog": "Coupon Moneylog", "Coupon Money Log": "Coupon Money Log",
"Coupon Log": "Coupon Log", "Coupon Log": "Coupon Log",
"Analytics": "Analytics", "Analytics": "Analytics",
"Deposit": "Deposit", "Deposit": "Deposit",

View File

@ -15,7 +15,7 @@
"Partner Store": "매장", "Partner Store": "매장",
"Partner Recommendation": "추천코드등록", "Partner Recommendation": "추천코드등록",
"Coupon": "쿠폰발행리스트", "Coupon": "쿠폰발행리스트",
"Coupon Moneylog": "쿠폰발행머니로그", "Coupon Money Log": "쿠폰발행머니로그",
"Coupon Log": "쿠폰발행 로그", "Coupon Log": "쿠폰발행 로그",
"Analytics": "Analytics", "Analytics": "Analytics",
"Deposit": "입금관리", "Deposit": "입금관리",