[HIMA-570] Updated cat search API to V5

This commit is contained in:
Eraldo Hasanaj
2019-05-27 10:50:38 +02:00
parent ea2e1dbda7
commit 3336e571d9
14 changed files with 54 additions and 50 deletions

View File

@@ -1,10 +1,11 @@
import { Injectable } from '@angular/core';
import { AvailabilityService, StockService, StockRequest, StockResponse } from 'swagger';
import { AvailabilityService, StockRequest, StockInfoDTO } from 'swagger';
import { AvailabilityRequestDTO } from 'swagger/lib/availability/models/availability-request-dto';
import { map } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { AvailabilityDTO } from 'swagger/lib/availability/models/availability-dto';
import { CheckoutType } from '../models/checkout-type.enum';
import { StockService } from 'swagger';
@Injectable({
providedIn: 'root',
@@ -59,7 +60,7 @@ export class ProductAvailabilityService {
);
}
getStockInfo(branchIds: number[], itemIds: number[]): Observable<StockResponse[]> {
getStockInfo(branchIds: number[], itemIds: number[]): Observable<StockInfoDTO[]> {
const params = <StockRequest>{
branchIds,
itemIds,

View File

@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/ng-swagger-gen/ng-swagger-gen-schema.json",
"swagger": "https://isa.paragon-data.de/cat/v4/swagger.json",
"swagger": "https://isa.paragon-data.de/cat/v5/swagger.json",
"output": "src/lib/api",
"prefix": "Api",
"ignoreUnusedModels": true,

View File

@@ -8,5 +8,5 @@ import { Injectable } from '@angular/core';
providedIn: 'root',
})
export class ApiConfiguration {
rootUrl: string = 'https://isa.paragon-data.de/cat/v4';
rootUrl: string = 'https://isa.paragon-data.de/cat/v5';
}

View File

@@ -26,6 +26,5 @@ export { UISettingsDTO } from './models/uisettings-dto';
export { InputGroupDTO } from './models/input-group-dto';
export { InputDTO } from './models/input-dto';
export { TranslationDTO } from './models/translation-dto';
export { ResponseArgsOfIEnumerableOfStockResponse } from './models/response-args-of-ienumerable-of-stock-response';
export { StockResponse } from './models/stock-response';
export { ResponseArgsOfIEnumerableOfStockInfoDTO } from './models/response-args-of-ienumerable-of-stock-info-dto';
export { StockRequest } from './models/stock-request';

View File

@@ -5,16 +5,16 @@
*/
export interface AvailabilityDTO {
/**
* Stock Status Code / Beschreibung
*/
sscText?: string;
/**
* Produkt / Artikel PK
*/
itemId?: number;
/**
* Shop
*/
shop?: any;
/**
* Preis (VK)
*/
@@ -31,9 +31,9 @@ export interface AvailabilityDTO {
ssc?: string;
/**
* Shop
* Stock Status Code / Beschreibung
*/
shop?: any;
sscText?: string;
/**
* Verfügbare Menge

View File

@@ -9,16 +9,16 @@ import { ShelfInfoDTO } from './shelf-info-dto';
import { ReviewDTO } from './review-dto';
export interface ItemDTO extends EntityDTO {
/**
* Verfügbarkeit laut Katalog
*/
catalogAvailability?: any;
/**
* Rang
*/
scoring?: number;
/**
* Weitere Artikel-IDs
*/
ids?: {[key: string]: number};
/**
* Artikel / Produkttyp
*/
@@ -55,9 +55,9 @@ export interface ItemDTO extends EntityDTO {
images?: Array<ImageDTO>;
/**
* Weitere Artikel-IDs
* Verfügbarkeit laut Katalog
*/
ids?: {[key: string]: number};
catalogAvailability?: any;
/**
* Verfügbarkeit zur Bestellung in die Filiale

View File

@@ -6,16 +6,16 @@ import { OrderByDTO } from './order-by-dto';
*/
export interface QueryTokenDTO {
/**
* Katalogbereich
*/
catalogType?: any;
/**
* Lager PK
*/
stockId?: number;
/**
* Bezeichner
*/
friendlyName?: string;
/**
* Eingabewerte z.B. ("qs", "heller süden")
*/
@@ -32,9 +32,9 @@ export interface QueryTokenDTO {
fuzzy?: number;
/**
* Bezeichner
* Katalogbereich
*/
friendlyName?: string;
catalogType?: any;
/**
* Filter

View File

@@ -0,0 +1,6 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { StockInfoDTO } from './stock-info-dto';
export interface ResponseArgsOfIEnumerableOfStockInfoDTO extends ResponseArgs {
result?: Array<StockInfoDTO>;
}

View File

@@ -1,6 +0,0 @@
/* tslint:disable */
import { ResponseArgs } from './response-args';
import { StockResponse } from './stock-response';
export interface ResponseArgsOfIEnumerableOfStockResponse extends ResponseArgs {
result?: Array<StockResponse>;
}

View File

@@ -6,9 +6,19 @@
export interface StockInfoDTO {
/**
* PK
* Artikel PK
*/
id?: number;
itemId?: number;
/**
* Filiale PK
*/
branchId?: number;
/**
* Lager PK
*/
stockId?: number;
/**
* Lagerbestand

View File

@@ -1,6 +0,0 @@
/* tslint:disable */
export interface StockResponse {
branchId: number;
itemId: number;
inStock: number;
}

View File

@@ -7,7 +7,7 @@ import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-respo
import { Observable as __Observable } from 'rxjs';
import { map as __map, filter as __filter } from 'rxjs/operators';
import { ResponseArgsOfIEnumerableOfStockResponse } from '../models/response-args-of-ienumerable-of-stock-response';
import { ResponseArgsOfIEnumerableOfStockInfoDTO } from '../models/response-args-of-ienumerable-of-stock-info-dto';
import { StockRequest } from '../models/stock-request';
@Injectable({
providedIn: 'root',
@@ -25,7 +25,7 @@ class StockService extends __BaseService {
/**
* @param stockRequest undefined
*/
StockInStockResponse(stockRequest: StockRequest): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockResponse>> {
StockInStockResponse(stockRequest: StockRequest): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>> {
let __params = this.newParams();
let __headers = new HttpHeaders();
let __body: any = null;
@@ -43,16 +43,16 @@ class StockService extends __BaseService {
return this.http.request<any>(req).pipe(
__filter(_r => _r instanceof HttpResponse),
__map((_r) => {
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockResponse>;
return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockInfoDTO>;
})
);
}
/**
* @param stockRequest undefined
*/
StockInStock(stockRequest: StockRequest): __Observable<ResponseArgsOfIEnumerableOfStockResponse> {
StockInStock(stockRequest: StockRequest): __Observable<ResponseArgsOfIEnumerableOfStockInfoDTO> {
return this.StockInStockResponse(stockRequest).pipe(
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockResponse)
__map(_r => _r.body as ResponseArgsOfIEnumerableOfStockInfoDTO)
);
}
}

View File

@@ -2,8 +2,8 @@
import { PriceDTO } from './price-dto';
import { AvailabilityType } from './availability-type';
export interface AvailabilityDTO {
ssc?: string;
itemId?: number;
altItemId?: number;
requestReference?: string;
ean?: string;
shop?: number;
@@ -12,7 +12,7 @@ export interface AvailabilityDTO {
supplierId?: number;
logistician?: string;
logisticianId?: number;
altItemId?: number;
ssc?: string;
sscText?: string;
qty?: number;
isPrebooked?: boolean;

View File

@@ -1,13 +1,13 @@
/* tslint:disable */
import { PriceDTO } from './price-dto';
export interface AvailabilityRequestDTO {
price?: PriceDTO;
itemId?: string;
ean?: string;
qty: number;
orderCode?: string;
supplier?: string;
preBook?: boolean;
ean?: string;
price?: PriceDTO;
ssc?: string;
estimatedShipping?: string;
shopId?: number;