mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 10:35:18 +00:00
Move payment adjustments module to section (#234)
This commit is contained in:
parent
5bbde6712b
commit
88681edb38
@ -26,11 +26,11 @@ import { DepositsModule } from './deposits/deposits.module';
|
|||||||
import { DomainModule } from './domain';
|
import { DomainModule } from './domain';
|
||||||
import icons from './icons.json';
|
import icons from './icons.json';
|
||||||
import { NotFoundModule } from './not-found';
|
import { NotFoundModule } from './not-found';
|
||||||
import { PaymentAdjustmentModule } from './payment-adjustment/payment-adjustment.module';
|
|
||||||
import { PayoutsModule } from './payouts/payouts.module';
|
import { PayoutsModule } from './payouts/payouts.module';
|
||||||
import { RepairingModule } from './repairing/repairing.module';
|
import { RepairingModule } from './repairing/repairing.module';
|
||||||
import { OperationsModule } from './sections/operations/operations.module';
|
import { OperationsModule } from './sections/operations/operations.module';
|
||||||
import { PartyModule } from './sections/party/party.module';
|
import { PartyModule } from './sections/party/party.module';
|
||||||
|
import { PaymentAdjustmentModule } from './sections/payment-adjustment/payment-adjustment.module';
|
||||||
import { SearchClaimsModule } from './sections/search-claims/search-claims.module';
|
import { SearchClaimsModule } from './sections/search-claims/search-claims.module';
|
||||||
import { SearchPartiesModule } from './sections/search-parties/search-parties.module';
|
import { SearchPartiesModule } from './sections/search-parties/search-parties.module';
|
||||||
import { SettingsModule } from './settings';
|
import { SettingsModule } from './settings';
|
||||||
|
@ -3,7 +3,7 @@ import groupBy from 'lodash-es/groupBy';
|
|||||||
import { Observable, Subject, throwError } from 'rxjs';
|
import { Observable, Subject, throwError } from 'rxjs';
|
||||||
import { catchError, map, tap } from 'rxjs/internal/operators';
|
import { catchError, map, tap } from 'rxjs/internal/operators';
|
||||||
|
|
||||||
import { PaymentProcessingService } from '../../../thrift-services/damsel/payment-processing.service';
|
import { PaymentProcessingService } from '../../../../thrift-services/damsel/payment-processing.service';
|
||||||
import { ExecutorService } from '../executor.service';
|
import { ExecutorService } from '../executor.service';
|
||||||
import { AdjustmentOperationEvent, EventType } from './adjustment-event';
|
import { AdjustmentOperationEvent, EventType } from './adjustment-event';
|
||||||
import { ExecResultGroup } from './exec-result-group';
|
import { ExecResultGroup } from './exec-result-group';
|
@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
InvoicePaymentAdjustmentParams,
|
InvoicePaymentAdjustmentParams,
|
||||||
UserInfo,
|
UserInfo,
|
||||||
} from '../../../thrift-services/damsel/gen-model/payment_processing';
|
} from '../../../../thrift-services/damsel/gen-model/payment_processing';
|
||||||
|
|
||||||
export interface PaymentAdjustmentCreationParams {
|
export interface PaymentAdjustmentCreationParams {
|
||||||
user: UserInfo;
|
user: UserInfo;
|
@ -3,7 +3,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import forEach from 'lodash-es/forEach';
|
import forEach from 'lodash-es/forEach';
|
||||||
import groupBy from 'lodash-es/groupBy';
|
import groupBy from 'lodash-es/groupBy';
|
||||||
|
|
||||||
import { InvoicePaymentAdjustmentParams } from '../../../thrift-services/damsel/gen-model/payment_processing';
|
import { InvoicePaymentAdjustmentParams } from '../../../../thrift-services/damsel/gen-model/payment_processing';
|
||||||
import {
|
import {
|
||||||
AdjustmentOperationEvent,
|
AdjustmentOperationEvent,
|
||||||
BatchPaymentAdjustmentService,
|
BatchPaymentAdjustmentService,
|
@ -5,12 +5,12 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import { KeycloakService } from 'keycloak-angular';
|
import { KeycloakService } from 'keycloak-angular';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { StatPayment } from '../../thrift-services/damsel/gen-model/merch_stat';
|
import { StatPayment } from '../../../thrift-services/damsel/gen-model/merch_stat';
|
||||||
import {
|
import {
|
||||||
InvoicePaymentAdjustmentParams,
|
InvoicePaymentAdjustmentParams,
|
||||||
InvoicePaymentAdjustmentScenario,
|
InvoicePaymentAdjustmentScenario,
|
||||||
UserInfo,
|
UserInfo,
|
||||||
} from '../../thrift-services/damsel/gen-model/payment_processing';
|
} from '../../../thrift-services/damsel/gen-model/payment_processing';
|
||||||
import {
|
import {
|
||||||
BatchPaymentAdjustmentService,
|
BatchPaymentAdjustmentService,
|
||||||
CancelAdjustmentService,
|
CancelAdjustmentService,
|
@ -1,16 +1,19 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
|
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
|
||||||
|
|
||||||
import { StatPayment } from '../thrift-services/damsel/gen-model/merch_stat';
|
import { StatPayment } from '../../thrift-services/damsel/gen-model/merch_stat';
|
||||||
import { CreateAndCaptureComponent } from './create-and-capture/create-and-capture.component';
|
import { CreateAndCaptureComponent } from './create-and-capture/create-and-capture.component';
|
||||||
import { PaymentAdjustmentService } from './payment-adjustment.service';
|
import { PaymentAdjustmentService } from './payment-adjustment.service';
|
||||||
import { SearchFormParams } from './search-form/search-form-params';
|
import { SearchFormParams } from './search-form/search-form-params';
|
||||||
|
|
||||||
|
@UntilDestroy()
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cc-payment-adjustment',
|
selector: 'cc-payment-adjustment',
|
||||||
templateUrl: './payment-adjustment.component.html',
|
templateUrl: './payment-adjustment.component.html',
|
||||||
styleUrls: ['payment-adjustment.component.scss'],
|
styleUrls: ['payment-adjustment.component.scss'],
|
||||||
|
providers: [PaymentAdjustmentService],
|
||||||
})
|
})
|
||||||
export class PaymentAdjustmentComponent implements OnInit {
|
export class PaymentAdjustmentComponent implements OnInit {
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
@ -30,7 +33,9 @@ export class PaymentAdjustmentComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.paymentAdjustmentService.searchPaymentChanges$.subscribe((payments) => {
|
this.paymentAdjustmentService.searchPaymentChanges$
|
||||||
|
.pipe(untilDestroyed(this))
|
||||||
|
.subscribe((payments) => {
|
||||||
this.payments = payments;
|
this.payments = payments;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -59,7 +64,10 @@ export class PaymentAdjustmentComponent implements OnInit {
|
|||||||
this.payments = [];
|
this.payments = [];
|
||||||
this.selectedPayments = [];
|
this.selectedPayments = [];
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.paymentAdjustmentService.fetchPayments(this.searchParams).subscribe(
|
this.paymentAdjustmentService
|
||||||
|
.fetchPayments(this.searchParams)
|
||||||
|
.pipe(untilDestroyed(this))
|
||||||
|
.subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.selectedPayments = [];
|
this.selectedPayments = [];
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
@ -25,9 +25,9 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|||||||
import { ThriftPipesModule } from '@cc/app/shared/pipes';
|
import { ThriftPipesModule } from '@cc/app/shared/pipes';
|
||||||
import { CardContainerModule } from '@cc/components/card-container/card-container.module';
|
import { CardContainerModule } from '@cc/components/card-container/card-container.module';
|
||||||
|
|
||||||
import { DomainModule } from '../domain';
|
import { DomainModule } from '../../domain';
|
||||||
import { PapiModule } from '../papi/papi.module';
|
import { PapiModule } from '../../papi/papi.module';
|
||||||
import { DamselModule } from '../thrift-services/damsel';
|
import { DamselModule } from '../../thrift-services/damsel';
|
||||||
import { ActionItemComponent } from './create-and-capture/action-item/action-item.component';
|
import { ActionItemComponent } from './create-and-capture/action-item/action-item.component';
|
||||||
import { CancelActionsComponent } from './create-and-capture/cancel-actions/cancel-actions.component';
|
import { CancelActionsComponent } from './create-and-capture/cancel-actions/cancel-actions.component';
|
||||||
import { CaptureActionsComponent } from './create-and-capture/capture-actions/capture-actions.component';
|
import { CaptureActionsComponent } from './create-and-capture/capture-actions/capture-actions.component';
|
||||||
@ -35,7 +35,6 @@ import { CreateActionsComponent } from './create-and-capture/create-actions/crea
|
|||||||
import { CreateAndCaptureComponent } from './create-and-capture/create-and-capture.component';
|
import { CreateAndCaptureComponent } from './create-and-capture/create-and-capture.component';
|
||||||
import { PaymentAdjustmentRoutingModule } from './payment-adjustment-routing.module';
|
import { PaymentAdjustmentRoutingModule } from './payment-adjustment-routing.module';
|
||||||
import { PaymentAdjustmentComponent } from './payment-adjustment.component';
|
import { PaymentAdjustmentComponent } from './payment-adjustment.component';
|
||||||
import { PaymentAdjustmentService } from './payment-adjustment.service';
|
|
||||||
import { SearchFormComponent } from './search-form/search-form.component';
|
import { SearchFormComponent } from './search-form/search-form.component';
|
||||||
import { TableComponent } from './table/table.component';
|
import { TableComponent } from './table/table.component';
|
||||||
|
|
||||||
@ -81,6 +80,5 @@ import { TableComponent } from './table/table.component';
|
|||||||
CaptureActionsComponent,
|
CaptureActionsComponent,
|
||||||
],
|
],
|
||||||
entryComponents: [CreateAndCaptureComponent],
|
entryComponents: [CreateAndCaptureComponent],
|
||||||
providers: [PaymentAdjustmentService],
|
|
||||||
})
|
})
|
||||||
export class PaymentAdjustmentModule {}
|
export class PaymentAdjustmentModule {}
|
@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Observable, of, Subject } from 'rxjs';
|
import { Observable, of, Subject } from 'rxjs';
|
||||||
import { mergeMap, shareReplay } from 'rxjs/operators';
|
import { mergeMap, shareReplay } from 'rxjs/operators';
|
||||||
|
|
||||||
import { DomainService } from '../domain';
|
import { DomainService } from '../../domain';
|
||||||
import { QueryDSL } from '../query-dsl';
|
import { QueryDSL } from '../../query-dsl';
|
||||||
import { StatPayment, StatResponse } from '../thrift-services/damsel/gen-model/merch_stat';
|
import { StatPayment, StatResponse } from '../../thrift-services/damsel/gen-model/merch_stat';
|
||||||
import { MerchantStatisticsService } from '../thrift-services/damsel/merchant-statistics.service';
|
import { MerchantStatisticsService } from '../../thrift-services/damsel/merchant-statistics.service';
|
||||||
import { SearchFormParams } from './search-form/search-form-params';
|
import { SearchFormParams } from './search-form/search-form-params';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
@ -14,7 +14,7 @@ import { MatTableDataSource } from '@angular/material/table';
|
|||||||
|
|
||||||
import { i64ToNumber } from '@cc/utils/i64-to-number';
|
import { i64ToNumber } from '@cc/utils/i64-to-number';
|
||||||
|
|
||||||
import { StatPayment } from '../../thrift-services/damsel/gen-model/merch_stat';
|
import { StatPayment } from '../../../thrift-services/damsel/gen-model/merch_stat';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cc-payment-adjustment-table',
|
selector: 'cc-payment-adjustment-table',
|
Loading…
Reference in New Issue
Block a user