FE-386: refactoring backend-module (#130)

FE-386: remove .class in filenames
This commit is contained in:
andrey 2017-07-05 15:51:06 +03:00 committed by GitHub
parent 9b0331a1db
commit 57bc8be0f2
134 changed files with 359 additions and 370 deletions

View File

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { SelectItem } from 'koffing/common/components/select/select.class'; import { SelectItem } from 'koffing/common/select/select-item';
import { AnalyticsService } from 'koffing/analytics/analytics.service'; import { AnalyticsService } from 'koffing/analytics/analytics.service';
@Component({ @Component({

View File

@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
import { SelectItem } from 'koffing/common/components/select/select.class'; import { SelectItem } from 'koffing/common/select/select-item';
import { ShopIDStorage } from 'koffing/analytics/shop-id-storage.service'; import { ShopIDStorage } from 'koffing/analytics/shop-id-storage.service';
import { ShopService } from 'koffing/backend/services/shop.service'; import { ShopService } from 'koffing/backend/shop.service';
@Injectable() @Injectable()
export class AnalyticsService { export class AnalyticsService {

View File

@ -3,9 +3,9 @@ import { ActivatedRoute, Params } from '@angular/router';
import * as moment from 'moment'; import * as moment from 'moment';
import { Subject } from 'rxjs/Subject'; import { Subject } from 'rxjs/Subject';
import { ShopService } from 'koffing/backend/services/shop.service'; import { ShopService } from 'koffing/backend/shop.service';
import { AccountsService } from 'koffing/backend/accounts.service'; import { AccountsService } from 'koffing/backend/accounts.service';
import { DateRange } from '../date-range-selector/date-range.class'; import { DateRange } from '../date-range-selector/date-range';
import { PanelData } from '../statistic-panel/panel-data'; import { PanelData } from '../statistic-panel/panel-data';
import { DashboardService } from './dashboard.service'; import { DashboardService } from './dashboard.service';
import { LineChartData } from './stats-data/line-chart-data'; import { LineChartData } from './stats-data/line-chart-data';

View File

@ -6,8 +6,8 @@ import { LocationService } from 'koffing/backend/location.service';
import { AnalyticsService } from 'koffing/backend/analytics.service'; import { AnalyticsService } from 'koffing/backend/analytics.service';
import { DoughnutChartData } from './stats-data/doughnut-chart-data'; import { DoughnutChartData } from './stats-data/doughnut-chart-data';
import { StatsDataConverter } from './stats-data/stats-data.converter'; import { StatsDataConverter } from './stats-data/stats-data.converter';
import { PaymentConversionData } from './stats-data/payment-conversion-data.class'; import { PaymentConversionData } from './stats-data/payment-conversion-data';
import { PaymentRevenueData } from './stats-data/payment-revenue-data.class'; import { PaymentRevenueData } from './stats-data/payment-revenue-data';
@Injectable() @Injectable()
export class DashboardService { export class DashboardService {

View File

@ -1,4 +1,4 @@
import { PaymentCount } from './payment-count.class'; import { PaymentCount } from './payment-count';
import { LineChartData } from './line-chart-data'; import { LineChartData } from './line-chart-data';
export interface PaymentConversionData { export interface PaymentConversionData {

View File

@ -1,11 +1,11 @@
import { groupBy, keys, round } from 'lodash'; import { groupBy, keys, round } from 'lodash';
import * as moment from 'moment'; import * as moment from 'moment';
import { PaymentGeoStat } from 'koffing/backend/model/payment-geo-stat.class'; import { PaymentGeoStat } from 'koffing/backend/model/payment-geo-stat';
import { PaymentMethodStat } from 'koffing/backend/model/payment-method-stat.class'; import { PaymentMethodStat } from 'koffing/backend/model/payment-method-stat';
import { PaymentConversionStat } from 'koffing/backend/model/payment-conversion-stat.class'; import { PaymentConversionStat } from 'koffing/backend/model/payment-conversion-stat';
import { PaymentRevenueStat } from 'koffing/backend/model/payment-revenue-stat.class'; import { PaymentRevenueStat } from 'koffing/backend/model/payment-revenue-stat';
import { PaymentCount } from './payment-count.class'; import { PaymentCount } from './payment-count';
import { LineChartData } from './line-chart-data'; import { LineChartData } from './line-chart-data';
import { Dataset } from './dataset'; import { Dataset } from './dataset';
import { DoughnutChartData } from './doughnut-chart-data'; import { DoughnutChartData } from './doughnut-chart-data';

View File

@ -1,7 +1,7 @@
import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core'; import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core';
import * as moment from 'moment'; import * as moment from 'moment';
import { DateRange } from './date-range.class'; import { DateRange } from './date-range';
@Component({ @Component({
selector: 'kof-date-range-selector', selector: 'kof-date-range-selector',

View File

@ -2,7 +2,7 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core';
import * as moment from 'moment'; import * as moment from 'moment';
import { map, clone } from 'lodash'; import { map, clone } from 'lodash';
import { SelectItem } from 'koffing/common/common.module'; import { SelectItem } from 'koffing/common/select/select-item';
import { FormSearchParams } from './form-search-params'; import { FormSearchParams } from './form-search-params';
import { invoiceStatuses } from '../invoice-statuses'; import { invoiceStatuses } from '../invoice-statuses';
import { paymentStatuses } from '../payment-statuses'; import { paymentStatuses } from '../payment-statuses';

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { chain } from 'lodash'; import { chain } from 'lodash';
import { ConfigService } from 'koffing/backend/services/config.service'; import { ConfigService } from 'koffing/backend/config.service';
import { InvoiceService } from 'koffing/backend/invoice.service'; import { InvoiceService } from 'koffing/backend/invoice.service';
import { PaymentLinkArguments } from './payment-link-arguments'; import { PaymentLinkArguments } from './payment-link-arguments';

View File

@ -3,14 +3,14 @@ import * as _ from 'lodash';
import { Observable, Observer } from 'rxjs'; import { Observable, Observer } from 'rxjs';
import 'rxjs/add/observable/forkJoin'; import 'rxjs/add/observable/forkJoin';
import { ShopService } from 'koffing/backend/services/shop.service'; import { ShopService } from 'koffing/backend/shop.service';
import { ContractService } from 'koffing/backend/services/contract.service'; import { ContractService } from 'koffing/backend/contract.service';
import { SearchService } from 'koffing/backend/search.service'; import { SearchService } from 'koffing/backend/search.service';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
import { Contract } from 'koffing/backend/classes/contract.class'; import { Contract } from 'koffing/backend/model/contract';
import { Invoice } from 'koffing/backend/model/invoice'; import { Invoice } from 'koffing/backend/model/invoice';
import { Payment } from 'koffing/backend/model/payment'; import { Payment } from 'koffing/backend/model/payment';
import { RussianLegalEntity } from 'koffing/backend/classes/russian-legal-entity.class'; import { RussianLegalEntity } from 'koffing/backend/model/russian-legal-entity';
import { SearchPaymentsParams } from 'koffing/backend/requests/search-payments-request'; import { SearchPaymentsParams } from 'koffing/backend/requests/search-payments-request';
import { Registry } from './registry'; import { Registry } from './registry';
import { RegistryItem } from './registry-item'; import { RegistryItem } from './registry-item';

View File

@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import * as moment from 'moment'; import * as moment from 'moment';
import { DateRange } from '../date-range-selector/date-range.class'; import { DateRange } from '../date-range-selector/date-range';
import { RegistryExportService } from './registry-export.service'; import { RegistryExportService } from './registry-export.service';
import { RegistryDataService } from './registry-data.service'; import { RegistryDataService } from './registry-data.service';
import { ExcelService } from './excel/excel.service'; import { ExcelService } from './excel/excel.service';

View File

@ -1,5 +1,5 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
export class ShopIDStorage { export class ShopIDStorage {

View File

@ -2,8 +2,8 @@ import { NgModule, APP_INITIALIZER } from '@angular/core';
import { Http, XHRBackend, RequestOptions, HttpModule } from '@angular/http'; import { Http, XHRBackend, RequestOptions, HttpModule } from '@angular/http';
import { RootModule } from './root/root.module'; import { RootModule } from './root/root.module';
import { AuthHttpInterceptor } from './auth/interceptors/auth-http.interceptor'; import { AuthHttpInterceptor } from './auth/auth-http.interceptor';
import { ConfigService } from './backend/services/config.service'; import { ConfigService } from './backend/config.service';
import { ContainerComponent } from './root/components/container/container.component'; import { ContainerComponent } from './root/components/container/container.component';
import { HttpErrorBroadcaster } from 'koffing/broadcaster/services/http-error-broadcaster.service'; import { HttpErrorBroadcaster } from 'koffing/broadcaster/services/http-error-broadcaster.service';

View File

@ -1,7 +1,7 @@
import { Http, ConnectionBackend, RequestOptions, Request, RequestOptionsArgs, Response, Headers } from '@angular/http'; import { Http, ConnectionBackend, RequestOptions, Request, RequestOptionsArgs, Response, Headers } from '@angular/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { AuthService } from '../services/auth.service'; import { AuthService } from './auth.service';
import { HttpErrorBroadcaster } from 'koffing/broadcaster/services/http-error-broadcaster.service'; import { HttpErrorBroadcaster } from 'koffing/broadcaster/services/http-error-broadcaster.service';
export class AuthHttpInterceptor extends Http { export class AuthHttpInterceptor extends Http {

View File

@ -1,3 +1,3 @@
export * from './classes/AuthInfo.class'; export * from './auth-info';
export * from './interceptors/auth-http.interceptor'; export * from './auth-http.interceptor';
export * from './services/auth.service'; export * from './auth.service';

View File

@ -1,4 +1,4 @@
import { AuthInfo } from '../classes/AuthInfo.class'; import { AuthInfo } from './auth-info';
declare const Keycloak: any; declare const Keycloak: any;

View File

@ -2,15 +2,16 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { ConfigService } from 'koffing/backend/services/config.service'; import { ConfigService } from './config.service';
import { Account } from 'koffing/backend/model/account.class'; import { Account } from './model/account';
@Injectable() @Injectable()
export class AccountsService { export class AccountsService {
constructor(private http: Http, constructor(
private config: ConfigService) { private http: Http,
} private config: ConfigService
) { }
public getAccountByID(accountID: number): Observable<Account> { public getAccountByID(accountID: number): Observable<Account> {
return this.http.get(`${this.config.capiUrl}/processing/accounts/${accountID}`).map(res => res.json()); return this.http.get(`${this.config.capiUrl}/processing/accounts/${accountID}`).map(res => res.json());

View File

@ -4,19 +4,20 @@ import * as moment from 'moment';
import { toString } from 'lodash'; import { toString } from 'lodash';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { ConfigService } from 'koffing/backend/services/config.service'; import { ConfigService } from './config.service';
import { PaymentMethodStat } from 'koffing/backend/model/payment-method-stat.class'; import { PaymentMethodStat } from './model/payment-method-stat';
import { PaymentRateStat } from 'koffing/backend/model/payment-rate-stat.class'; import { PaymentRateStat } from './model/payment-rate-stat';
import { PaymentGeoStat } from 'koffing/backend/model/payment-geo-stat.class'; import { PaymentGeoStat } from './model/payment-geo-stat';
import { PaymentConversionStat } from 'koffing/backend/model/payment-conversion-stat.class'; import { PaymentConversionStat } from './model/payment-conversion-stat';
import { PaymentRevenueStat } from 'koffing/backend/model/payment-revenue-stat.class'; import { PaymentRevenueStat } from './model/payment-revenue-stat';
@Injectable() @Injectable()
export class AnalyticsService { export class AnalyticsService {
constructor(private http: Http, constructor(
private config: ConfigService) { private http: Http,
} private config: ConfigService
) { }
public getPaymentMethodStats(shopID: number, from: Date, to: Date, splitUnit?: string, splitSize?: number, paymentMethod?: string): Observable<PaymentMethodStat[]> { public getPaymentMethodStats(shopID: number, from: Date, to: Date, splitUnit?: string, splitSize?: number, paymentMethod?: string): Observable<PaymentMethodStat[]> {
const params = new URLSearchParams(); const params = new URLSearchParams();

View File

@ -1,15 +1,15 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CategoryService } from './services/category.service'; import { CategoryService } from './category.service';
import { ContractService } from './services/contract.service'; import { ContractService } from './contract.service';
import { ShopService } from './services/shop.service'; import { ShopService } from './shop.service';
import { ConfigService } from './services/config.service'; import { ConfigService } from './config.service';
import { WebhooksService } from './webhooks.service'; import { WebhooksService } from './webhooks.service';
import { AnalyticsService } from 'koffing/backend/analytics.service'; import { AnalyticsService } from './analytics.service';
import { LocationService } from 'koffing/backend/location.service'; import { LocationService } from './location.service';
import { AccountsService } from 'koffing/backend/accounts.service'; import { AccountsService } from './accounts.service';
import { SearchService } from 'koffing/backend/search.service'; import { SearchService } from './search.service';
import { InvoiceService } from 'koffing/backend/invoice.service'; import { InvoiceService } from './invoice.service';
@NgModule({ @NgModule({
providers: [ providers: [
@ -26,27 +26,3 @@ import { InvoiceService } from 'koffing/backend/invoice.service';
] ]
}) })
export class BackendModule { } export class BackendModule { }
export * from './services/category.service';
export * from './services/config.service';
export * from './services/contract.service';
export * from './services/shop.service';
export * from './webhooks.service';
export * from './classes/account.class';
export * from './classes/bank-account.class';
export * from './classes/category.class';
export * from './classes/contract.class';
export * from './classes/contractor.class';
export * from './classes/conversion.class';
export * from './classes/legal-entity.class';
export * from './classes/payout-tool.class';
export * from './classes/payout-tool-params.class';
export * from './classes/payout-tool-bank-account.class';
export * from './classes/revenue.class';
export * from './classes/russian-legal-entity.class';
export * from './classes/shop.class';
export * from './classes/shop-details.class';
export * from './classes/shop-item.class';
export * from './classes/shop-location.class';
export * from './classes/shop-params.class';

View File

@ -2,13 +2,16 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import 'rxjs/add/operator/toPromise'; import 'rxjs/add/operator/toPromise';
import { Category } from '../classes/category.class'; import { Category } from './model/category';
import { ConfigService } from './config.service'; import { ConfigService } from './config.service';
@Injectable() @Injectable()
export class CategoryService { export class CategoryService {
constructor(private http: Http, private config: ConfigService) { } constructor(
private http: Http,
private config: ConfigService
) { }
public getCategories(): Promise<Category[]> { public getCategories(): Promise<Category[]> {
return this.http.get(`${this.config.capiUrl}/processing/categories`) return this.http.get(`${this.config.capiUrl}/processing/categories`)

View File

@ -1,7 +0,0 @@
import { Contractor } from 'koffing/backend/classes/contractor.class';
import { PayoutToolParams } from 'koffing/backend/classes/payout-tool-params.class';
export class ContractParams {
public contractor: Contractor;
public payoutToolParams: PayoutToolParams;
}

View File

@ -1,9 +0,0 @@
export class ShopItem {
public value: string;
public label: string;
constructor(value: string, label: string) {
this.value = value;
this.label = label;
}
}

View File

@ -1,27 +0,0 @@
import * as _ from 'lodash';
import { ShopDetails } from './shop-details.class';
import { ShopAccount } from './account.class';
import { ShopParams } from './shop-params.class';
export class Shop {
public id: number;
public isBlocked: boolean;
public isSuspended: boolean;
public categoryID: number;
public contractID: number;
public payoutToolID: number;
public details: ShopDetails;
public account: ShopAccount;
constructor() {
this.details = new ShopDetails();
this.account = new ShopAccount();
}
public update(params: ShopParams) {
_.assign(this.details, params.details);
this.contractID = _.defaultTo(params.contractID, this.contractID);
this.payoutToolID = _.defaultTo(params.payoutToolID, this.payoutToolID);
}
}

View File

@ -1,21 +1,23 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/toPromise'; import 'rxjs/add/operator/toPromise';
import { ConfigService } from './config.service'; import { ConfigService } from './config.service';
import { Contract } from '../classes/contract.class'; import { Contract } from './model/contract';
import { PayoutTool } from '../classes/payout-tool.class'; import { PayoutTool } from './model/payout-tool';
import { ContractParams } from 'koffing/backend/classes/contract-params.class'; import { ContractParams } from './model/contract-params';
import { PayoutToolParams } from 'koffing/backend/classes/payout-tool-params.class'; import { PayoutToolParams } from './model/payout-tool-params';
import { Observable } from 'rxjs';
@Injectable() @Injectable()
export class ContractService { export class ContractService {
private contractsUrl: string = `${this.config.capiUrl}/processing/contracts`; private contractsUrl: string = `${this.config.capiUrl}/processing/contracts`;
constructor(private http: Http, private config: ConfigService) { constructor(
} private http: Http,
private config: ConfigService
) { }
public getContracts(): Promise<Contract[]> { public getContracts(): Promise<Contract[]> {
return this.http.get(this.contractsUrl) return this.http.get(this.contractsUrl)

View File

@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { ConfigService } from './services/config.service'; import { ConfigService } from './config.service';
import { CreateInvoiceParams } from './requests/create-invoice-request'; import { CreateInvoiceParams } from './requests/create-invoice-request';
import { Invoice } from './model/invoice'; import { Invoice } from './model/invoice';
import { InvoiceAccessToken } from './model/invoice-access-token'; import { InvoiceAccessToken } from './model/invoice-access-token';

View File

@ -4,15 +4,16 @@ import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer'; import { Observer } from 'rxjs/Observer';
import { isNil } from 'lodash'; import { isNil } from 'lodash';
import { ConfigService } from 'koffing/backend/services/config.service'; import { ConfigService } from './config.service';
import { LocationName } from 'koffing/backend/model/location-name.class'; import { LocationName } from './model/location-name';
@Injectable() @Injectable()
export class LocationService { export class LocationService {
constructor(private http: Http, constructor(
private config: ConfigService) { private http: Http,
} private config: ConfigService
) { }
public getLocationsNames(geoIDs: string[], language?: string): Observable<LocationName[]> { public getLocationsNames(geoIDs: string[], language?: string): Observable<LocationName[]> {
if (isNil(geoIDs) || geoIDs.length === 0) { if (isNil(geoIDs) || geoIDs.length === 0) {

View File

@ -0,0 +1,12 @@
import { Contractor } from './contractor';
import { PayoutToolParams } from './payout-tool-params';
export class ContractParams {
public contractor: Contractor;
public payoutToolParams: PayoutToolParams;
constructor() {
this.contractor = new Contractor();
this.payoutToolParams = new PayoutToolParams();
}
}

View File

@ -1,8 +1,9 @@
import { Contractor } from './contractor.class'; import { Contractor } from './contractor';
export class Contract { export class Contract {
public id: number; public id: number;
public contractor: Contractor; public contractor: Contractor;
public status: string;
public validSince: string; public validSince: string;
public validUntil: string; public validUntil: string;
public terminatedAt: string; public terminatedAt: string;

View File

@ -1,5 +1,5 @@
import { BankAccount } from './bank-account.class'; import { BankAccount } from './bank-account';
import { LegalEntity } from './legal-entity.class'; import { LegalEntity } from './legal-entity';
export class Contractor { export class Contractor {
public bankAccount: BankAccount; public bankAccount: BankAccount;

View File

@ -1,4 +1,4 @@
import { Invoice } from 'koffing/backend/model/invoice'; import { Invoice } from './invoice';
export class InvoiceSearchResult { export class InvoiceSearchResult {
public totalCount: number; public totalCount: number;

View File

@ -1,6 +1,4 @@
export class Invoice { export class Invoice {
public status: string;
public reason: string;
public id: string; public id: string;
public shopID: number; public shopID: number;
public createdAt: string; public createdAt: string;
@ -10,4 +8,6 @@ export class Invoice {
public metadata: object; public metadata: object;
public product: string; public product: string;
public description: string; public description: string;
public status: string;
public reason: string;
} }

View File

@ -1,4 +1,4 @@
import { Payment } from 'koffing/backend/model/payment'; import { Payment } from './payment';
export class PaymentSearchResult { export class PaymentSearchResult {
public totalCount: number; public totalCount: number;

View File

@ -1,18 +1,18 @@
import { LogicError } from 'koffing/backend/model/logic-error'; import { LogicError } from './logic-error';
import { ContactInfo } from 'koffing/backend/model/contact-info'; import { ContactInfo } from './contact-info';
export class Payment { export class Payment {
public id: string; public id: string;
public status: string;
public error: LogicError;
public invoiceID: string; public invoiceID: string;
public createdAt: string; public createdAt: string;
public paymentToolToken: string;
public paymentSession: string;
public contactInfo: ContactInfo;
public amount: number; public amount: number;
public fee: number;
public currency: string; public currency: string;
public contactInfo: ContactInfo;
public paymentSession: string;
public paymentToolToken: string;
public fee: number;
public fingerprint: string; public fingerprint: string;
public payerIP: string; public payerIP: string;
public status: string;
public error: LogicError;
} }

View File

@ -1,5 +1,5 @@
import { PayoutToolParams } from './payout-tool-params.class'; import { PayoutToolParams } from './payout-tool-params';
import { BankAccount } from './bank-account.class'; import { BankAccount } from './bank-account';
export class PayoutToolBankAccount extends PayoutToolParams { export class PayoutToolBankAccount extends PayoutToolParams {
public bankAccount: BankAccount; public bankAccount: BankAccount;

View File

@ -1,4 +1,4 @@
import { PayoutToolParams } from './payout-tool-params.class'; import { PayoutToolParams } from './payout-tool-params';
export class PayoutTool { export class PayoutTool {
public id: number; public id: number;

View File

@ -1,4 +1,4 @@
import { LegalEntity } from './legal-entity.class'; import { LegalEntity } from './legal-entity';
export class RussianLegalEntity extends LegalEntity { export class RussianLegalEntity extends LegalEntity {
public registeredName: string; public registeredName: string;

View File

@ -1,7 +1,11 @@
import { ShopLocation } from './shop-location.class'; import { ShopLocation } from './shop-location';
export class ShopDetails { export class ShopDetails {
public name: string; public name: string;
public description: string; public description: string;
public location: ShopLocation; public location: ShopLocation;
constructor() {
this.location = new ShopLocation();
}
} }

View File

@ -1,4 +1,4 @@
import { ShopLocation } from 'koffing/backend/classes/shop-location.class'; import { ShopLocation } from './shop-location';
export class ShopLocationUrl extends ShopLocation { export class ShopLocationUrl extends ShopLocation {

View File

@ -0,0 +1,28 @@
import { assign, defaultTo } from 'lodash';
import { ShopDetails } from './shop-details';
import { ShopAccount } from './shop-account';
import { ShopParams } from '../requests/shop-request';
export class Shop {
public id: number;
public isBlocked: boolean;
public isSuspended: boolean;
public categoryID: number;
public contractID: number;
public payoutToolID: number;
public details: ShopDetails;
public account: ShopAccount;
constructor() {
this.details = new ShopDetails();
this.account = new ShopAccount();
}
// TODO: избавиться от этого метода
public update(params: ShopParams) {
assign(this.details, params.details);
this.contractID = defaultTo(params.contractID, this.contractID);
this.payoutToolID = defaultTo(params.payoutToolID, this.payoutToolID);
}
}

View File

@ -1,4 +1,4 @@
import { WebhookScope } from './webhook-scope.class'; import { WebhookScope } from './webhook-scope';
export class Webhook { export class Webhook {
public id: string; public id: string;

View File

@ -1,6 +0,0 @@
import { WebhookScope } from '../model/webhook-scope.class';
export class CreateWebhook {
public url: string;
public scope: WebhookScope;
}

View File

@ -0,0 +1,6 @@
import { WebhookScope } from '../model/webhook-scope';
export class CreateWebhookParams {
public url: string;
public scope: WebhookScope;
}

View File

@ -1,4 +1,4 @@
import { ShopDetails } from 'koffing/backend/backend.module'; import { ShopDetails } from '../model/shop-details';
import * as _ from 'lodash'; import * as _ from 'lodash';
export class ShopParams { export class ShopParams {

View File

@ -4,18 +4,19 @@ import { Observable } from 'rxjs/Observable';
import * as moment from 'moment'; import * as moment from 'moment';
import { toString, forEach, isNumber, isDate } from 'lodash'; import { toString, forEach, isNumber, isDate } from 'lodash';
import { InvoiceSearchResult } from 'koffing/backend/model/invoice-search-result'; import { ConfigService } from './config.service';
import { ConfigService } from 'koffing/backend/services/config.service'; import { InvoiceSearchResult } from './model/invoice-search-result';
import { PaymentSearchResult } from 'koffing/backend/model/payment-search-result'; import { PaymentSearchResult } from './model/payment-search-result';
import { SearchInvoicesParams } from 'koffing/backend/requests/search-invoices-request'; import { SearchInvoicesParams } from './requests/search-invoices-request';
import { SearchPaymentsParams } from 'koffing/backend/requests/search-payments-request'; import { SearchPaymentsParams } from './requests/search-payments-request';
@Injectable() @Injectable()
export class SearchService { export class SearchService {
constructor(private http: Http, constructor(
private config: ConfigService) { private http: Http,
} private config: ConfigService
) { }
public searchInvoices(shopID: string, invoiceParams: SearchInvoicesParams): Observable<InvoiceSearchResult> { public searchInvoices(shopID: string, invoiceParams: SearchInvoicesParams): Observable<InvoiceSearchResult> {
const params = this.toSearchParams(invoiceParams); const params = this.toSearchParams(invoiceParams);

View File

@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import 'rxjs/add/operator/toPromise'; import 'rxjs/add/operator/toPromise';
import { Shop } from '../classes/shop.class'; import { Shop } from './model/shop';
import { ConfigService } from './config.service'; import { ConfigService } from './config.service';
import { ShopParams } from 'koffing/backend/classes/shop-params.class'; import { ShopParams } from './requests/shop-request';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
@Injectable() @Injectable()
@ -12,7 +12,10 @@ export class ShopService {
private shopsUrl: string = `${this.config.capiUrl}/processing/shops`; private shopsUrl: string = `${this.config.capiUrl}/processing/shops`;
constructor(private http: Http, private config: ConfigService) {} constructor(
private http: Http,
private config: ConfigService
) { }
public getShops(): Promise<Shop[]> { public getShops(): Promise<Shop[]> {
return this.http.get(this.shopsUrl) return this.http.get(this.shopsUrl)

View File

@ -2,18 +2,19 @@ import { Injectable } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { ConfigService } from 'koffing/backend/services/config.service'; import { ConfigService } from './config.service';
import { Webhook } from 'koffing/backend/model/webhook.class'; import { Webhook } from './model/webhook';
import { CreateWebhook } from 'koffing/backend/queries/create-webhook'; import { CreateWebhookParams } from './requests/create-webhook-request';
@Injectable() @Injectable()
export class WebhooksService { export class WebhooksService {
constructor(private http: Http, constructor(
private config: ConfigService) { private http: Http,
} private config: ConfigService
) { }
public createWebhook(webhook: CreateWebhook): Observable<Webhook> { public createWebhook(webhook: CreateWebhookParams): Observable<Webhook> {
return this.http.post(`${this.config.capiUrl}/processing/webhooks`, webhook).map(res => res.json()); return this.http.post(`${this.config.capiUrl}/processing/webhooks`, webhook).map(res => res.json());
} }

View File

@ -2,10 +2,10 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { SelectComponent } from './components/select/select.component'; import { SelectComponent } from './select/select.component';
import { LoadingComponent } from './components/loading/loading.component'; import { LoadingComponent } from './loading/loading.component';
import { MinValueValidatorDirective } from 'koffing/common/min-value.directive'; import { MinValueValidatorDirective } from './min-value.directive';
import { MaxValueValidatorDirective } from 'koffing/common/max-value.directive'; import { MaxValueValidatorDirective } from './max-value.directive';
@NgModule({ @NgModule({
imports: [ imports: [
@ -26,7 +26,3 @@ import { MaxValueValidatorDirective } from 'koffing/common/max-value.directive';
] ]
}) })
export class CommonModule { } export class CommonModule { }
export * from './components/loading/loading.component';
export * from './components/select/select.component';
export * from './components/select/select.class';

View File

@ -1,7 +1,7 @@
import { Component, Input, Output, EventEmitter } from '@angular/core'; import { Component, Input, Output, EventEmitter } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { SelectItem } from './select.class'; import { SelectItem } from './select-item';
@Component({ @Component({
selector: 'kof-select', selector: 'kof-select',

View File

@ -1,14 +0,0 @@
import { PayoutToolParams } from 'koffing/backend/classes/payout-tool-params.class';
import { Contractor } from 'koffing/backend/classes/contractor.class';
import { Shop } from 'koffing/backend/classes/shop.class';
import { ShopEditingParams } from './shop-editing-params.class';
export class ClaimData {
public claimID: number;
public payoutToolParams: PayoutToolParams;
public payoutToolContractId: number;
public contractor: Contractor;
public shop: Shop;
public shopEditingParams: ShopEditingParams;
}

View File

@ -1,14 +1,14 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
import { ShopService } from 'koffing/backend/services/shop.service'; import { ShopService } from 'koffing/backend/shop.service';
import { ClaimData } from './claim-data.class'; import { ClaimData } from './claim-data';
import { ShopEditingParams } from './shop-editing-params.class'; import { ShopEditingParams } from './shop-editing-params';
import { ContractCreation } from './classes/contract-creation.class'; import { ContractCreation } from './classes/contract-creation';
import { ContractPayoutToolCreation } from './classes/contract-payout-tool-creation.class'; import { ContractPayoutToolCreation } from './classes/contract-payout-tool-creation';
import { ShopCreation } from './classes/shop-creation.class'; import { ShopCreation } from './classes/shop-creation';
import { ShopUpdate } from './classes/shop-update.class'; import { ShopUpdate } from './classes/shop-update';
@Injectable() @Injectable()
export class ClaimDataService { export class ClaimDataService {

View File

@ -0,0 +1,14 @@
import { PayoutToolParams } from 'koffing/backend/model/payout-tool-params';
import { Contractor } from 'koffing/backend/model/contractor';
import { Shop } from 'koffing/backend/model/shop';
import { ShopEditingParams } from './shop-editing-params';
export class ClaimData {
public claimID: number;
public payoutToolParams: PayoutToolParams;
public payoutToolContractId: number;
public contractor: Contractor;
public shop: Shop;
public shopEditingParams: ShopEditingParams;
}

View File

@ -2,12 +2,12 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { ContractorTransfer } from '../../shops/create-shop-wizard/selection-contract/create-contract/contractor-transfer.class'; import { ContractorTransfer } from '../../shops/create-shop-wizard/selection-contract/create-contract/contractor-transfer';
import { PaytoolTransfer } from '../../shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer.class'; import { PaytoolTransfer } from '../../shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer';
import { ShopDetailTransfer } from '../../shops/create-shop-wizard/selection-shop-fields/add-shop/shop-detail-transfer.class'; import { ShopDetailTransfer } from '../../shops/create-shop-wizard/selection-shop-fields/add-shop/shop-detail-transfer';
import { ShopEditingTransfer } from '../../shops/shop-editing/edit-shop/shop-editing-transfer.class'; import { ShopEditingTransfer } from '../../shops/shop-editing/edit-shop/shop-editing-transfer';
import { CreatePayoutToolComponent } from '../../shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component'; import { CreatePayoutToolComponent } from '../../shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component';
import { ClaimData } from './claim-data.class'; import { ClaimData } from './claim-data';
import { ClaimDataService } from './claim-data.service'; import { ClaimDataService } from './claim-data.service';
import { ClaimsEditService } from './claims-edit.service'; import { ClaimsEditService } from './claims-edit.service';

View File

@ -1,22 +1,22 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
import { Contractor } from 'koffing/backend/classes/contractor.class'; import { Contractor } from 'koffing/backend/model/contractor';
import { ShopService } from 'koffing/backend/services/shop.service'; import { ShopService } from 'koffing/backend/shop.service';
import { ShopParams } from 'koffing/backend/classes/shop-params.class'; import { ShopParams } from 'koffing/backend/requests/shop-request';
import { PayoutToolParams } from 'koffing/backend/classes/payout-tool-params.class'; import { PayoutToolParams } from 'koffing/backend/model/payout-tool-params';
import { PaytoolDecision } from 'koffing/management/shops/create-shop-wizard/selection-paytool/paytool-decision.class'; import { PaytoolDecision } from 'koffing/management/shops/create-shop-wizard/selection-paytool/paytool-decision';
import { PaytoolDecisionService } from 'koffing/management/shops/create-shop-wizard/selection-paytool/paytool-decision.service'; import { PaytoolDecisionService } from 'koffing/management/shops/create-shop-wizard/selection-paytool/paytool-decision.service';
import { ClaimDataService } from './claim-data.service'; import { ClaimDataService } from './claim-data.service';
import { ClaimData } from './claim-data.class'; import { ClaimData } from './claim-data';
import { Claim } from '../../shared/claim.class'; import { Claim } from '../../shared/claim';
import { ClaimService } from '../../shared/claim.service'; import { ClaimService } from '../../shared/claim.service';
import { ContractCreation } from './classes/contract-creation.class'; import { ContractCreation } from './classes/contract-creation';
import { ContractModification } from './classes/contract-modification.class'; import { ContractModification } from './classes/contract-modification';
import { ContractPayoutToolCreation } from './classes/contract-payout-tool-creation.class'; import { ContractPayoutToolCreation } from './classes/contract-payout-tool-creation';
import { ShopCreation } from './classes/shop-creation.class'; import { ShopCreation } from './classes/shop-creation';
import { ShopModification } from './classes/shop-modification.class'; import { ShopModification } from './classes/shop-modification';
import { ShopUpdate } from './classes/shop-update.class'; import { ShopUpdate } from './classes/shop-update';
@Injectable() @Injectable()
export class ClaimsEditService { export class ClaimsEditService {

View File

@ -1,5 +1,5 @@
import { PartyModification } from '../../../shared/party-modification.class'; import { PartyModification } from '../../../shared/party-modification';
import { Contract } from 'koffing/backend/classes/contract.class'; import { Contract } from 'koffing/backend/model/contract';
export class ContractCreation extends PartyModification { export class ContractCreation extends PartyModification {

View File

@ -1,4 +1,4 @@
import { PartyModification } from '../../../shared/party-modification.class'; import { PartyModification } from '../../../shared/party-modification';
export class ContractModification extends PartyModification { export class ContractModification extends PartyModification {

View File

@ -1,7 +0,0 @@
import { ContractModification } from './contract-modification.class';
import { PayoutTool } from 'koffing/backend/classes/payout-tool.class';
export class ContractPayoutToolCreation extends ContractModification {
public payoutTool: PayoutTool;
}

View File

@ -0,0 +1,7 @@
import { ContractModification } from './contract-modification';
import { PayoutTool } from 'koffing/backend/model/payout-tool';
export class ContractPayoutToolCreation extends ContractModification {
public payoutTool: PayoutTool;
}

View File

@ -1,7 +0,0 @@
import { ShopModification } from './shop-modification.class';
import { ShopAccount } from 'koffing/backend/classes/account.class';
export class ShopAccountCreation extends ShopModification {
public account: ShopAccount;
}

View File

@ -0,0 +1,7 @@
import { ShopModification } from './shop-modification';
import { ShopAccount } from 'koffing/backend/model/shop-account';
export class ShopAccountCreation extends ShopModification {
public account: ShopAccount;
}

View File

@ -1,5 +1,5 @@
import { PartyModification } from '../../../shared/party-modification.class'; import { PartyModification } from '../../../shared/party-modification';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
export class ShopCreation extends PartyModification { export class ShopCreation extends PartyModification {

View File

@ -1,4 +1,4 @@
import { PartyModification } from '../../../shared/party-modification.class'; import { PartyModification } from '../../../shared/party-modification';
export class ShopModification extends PartyModification { export class ShopModification extends PartyModification {

View File

@ -1,7 +0,0 @@
import { ShopModification } from './shop-modification.class';
import { ShopParams } from 'koffing/backend/classes/shop-params.class';
export class ShopUpdate extends ShopModification {
public details: ShopParams;
}

View File

@ -0,0 +1,7 @@
import { ShopModification } from './shop-modification';
import { ShopParams } from 'koffing/backend/requests/shop-request';
export class ShopUpdate extends ShopModification {
public details: ShopParams;
}

View File

@ -1,5 +1,5 @@
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
import { ShopParams } from 'koffing/backend/classes/shop-params.class'; import { ShopParams } from 'koffing/backend/requests/shop-request';
export class ShopEditingParams { export class ShopEditingParams {
public shop: Shop; public shop: Shop;

View File

@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service'; import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service';
import { ClaimRevokeBroadcaster } from 'koffing/broadcaster/services/claim-revoke-broadcaster.service'; import { ClaimRevokeBroadcaster } from 'koffing/broadcaster/services/claim-revoke-broadcaster.service';
import { Claim } from '../shared/claim.class'; import { Claim } from '../shared/claim';
import { ClaimService } from '../shared/claim.service'; import { ClaimService } from '../shared/claim.service';
@Component({ @Component({

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { Contract } from 'koffing/backend/classes/contract.class'; import { Contract } from 'koffing/backend/model/contract';
@Component({ @Component({
selector: 'kof-contract-creation', selector: 'kof-contract-creation',

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { PayoutTool } from 'koffing/backend/classes/payout-tool.class'; import { PayoutTool } from 'koffing/backend/model/payout-tool';
@Component({ @Component({
selector: 'kof-payout-tool-creation', selector: 'kof-payout-tool-creation',

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { Shop } from 'koffing/backend/classes/shop.class'; import { Shop } from 'koffing/backend/model/shop';
@Component({ @Component({
selector: 'kof-shop-modification', selector: 'kof-shop-modification',

View File

@ -1,15 +1,15 @@
import { Component, ViewChild } from '@angular/core'; import { Component, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ContractService } from 'koffing/backend/services/contract.service'; import { ContractService } from 'koffing/backend/contract.service';
import { Contractor } from 'koffing/backend/classes/contractor.class'; import { Contractor } from 'koffing/backend/model/contractor';
import { PayoutToolBankAccount } from 'koffing/backend/classes/payout-tool-bank-account.class'; import { PayoutToolBankAccount } from 'koffing/backend/model/payout-tool-bank-account';
import { ContractParams } from 'koffing/backend/classes/contract-params.class'; import { ContractParams } from 'koffing/backend/model/contract-params';
import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service'; import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service';
import { ClaimCreateBroadcaster } from 'koffing/broadcaster/services/claim-create.broadcaster.service'; import { ClaimCreateBroadcaster } from 'koffing/broadcaster/services/claim-create.broadcaster.service';
import { ContractorTransfer } from 'koffing/management/shops/create-shop-wizard/selection-contract/create-contract/contractor-transfer.class'; import { ContractorTransfer } from 'koffing/management/shops/create-shop-wizard/selection-contract/create-contract/contractor-transfer';
import { PaytoolTransfer } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer.class'; import { PaytoolTransfer } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer';
import { BankAccount } from 'koffing/backend/classes/bank-account.class'; import { BankAccount } from 'koffing/backend/model/bank-account';
import { CreatePayoutToolComponent } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component'; import { CreatePayoutToolComponent } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component';
import { CreateContractComponent } from 'koffing/management/shops/create-shop-wizard/selection-contract/create-contract/create-contract.component'; import { CreateContractComponent } from 'koffing/management/shops/create-shop-wizard/selection-contract/create-contract/create-contract.component';

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { Contract } from 'koffing/backend/classes/contract.class'; import { Contract } from 'koffing/backend/model/contract';
@Component({ @Component({
selector: 'kof-contract-view', selector: 'kof-contract-view',

View File

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ContractService } from 'koffing/backend/services/contract.service'; import { ContractService } from 'koffing/backend/contract.service';
import { Contract } from 'koffing/backend/classes/contract.class'; import { Contract } from 'koffing/backend/model/contract';
import { ClaimRevokeBroadcaster } from 'koffing/broadcaster/services/claim-revoke-broadcaster.service'; import { ClaimRevokeBroadcaster } from 'koffing/broadcaster/services/claim-revoke-broadcaster.service';
import { Claim } from '../shared/claim.class'; import { Claim } from '../shared/claim';
import { ClaimService } from '../shared/claim.service'; import { ClaimService } from '../shared/claim.service';
@Component({ @Component({

View File

@ -1,11 +1,11 @@
import { Component, ViewChild } from '@angular/core'; import { Component, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { ContractService } from 'koffing/backend/services/contract.service'; import { ContractService } from 'koffing/backend/contract.service';
import { PayoutToolBankAccount } from 'koffing/backend/classes/payout-tool-bank-account.class'; import { PayoutToolBankAccount } from 'koffing/backend/model/payout-tool-bank-account';
import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service'; import { ClaimReceiveBroadcaster } from 'koffing/broadcaster/services/claim-receive.broadcaster.service';
import { ClaimCreateBroadcaster } from 'koffing/broadcaster/services/claim-create.broadcaster.service'; import { ClaimCreateBroadcaster } from 'koffing/broadcaster/services/claim-create.broadcaster.service';
import { PaytoolTransfer } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer.class'; import { PaytoolTransfer } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/paytool-transfer';
import { CreatePayoutToolComponent } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component'; import { CreatePayoutToolComponent } from 'koffing/management/shops/create-shop-wizard/selection-paytool/create-paytool/create-paytool.component';
@Component({ @Component({

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { PayoutTool } from 'koffing/backend/classes/payout-tool.class'; import { PayoutTool } from 'koffing/backend/model/payout-tool';
@Component({ @Component({
selector: 'kof-payout-tool-view', selector: 'kof-payout-tool-view',

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { ContractService } from 'koffing/backend/services/contract.service'; import { ContractService } from 'koffing/backend/contract.service';
import { PayoutTool } from 'koffing/backend/classes/payout-tool.class'; import { PayoutTool } from 'koffing/backend/model/payout-tool';
@Component({ @Component({
selector: 'kof-payout-tools', selector: 'kof-payout-tools',

Some files were not shown because too many files have changed in this diff Show More