#4451 #4463 Add name method to PickupShelfInService and

PickupShelfOutService
This commit is contained in:
Lorenz Hilpert
2023-11-08 11:04:58 +01:00
parent a5b9115a91
commit a5e569cf05
5 changed files with 13 additions and 6 deletions

View File

@@ -8,6 +8,10 @@ import { Filter } from '@shared/components/filter';
export class PickupShelfInService extends PickupShelfIOService {
private _abholfachService = inject(AbholfachService);
name() {
return 'PickupShelfInService';
}
getQuerySettings() {
return this._abholfachService.AbholfachWareneingangQuerySettings();
}

View File

@@ -11,6 +11,8 @@ import { Observable } from 'rxjs';
@Injectable()
export abstract class PickupShelfIOService {
abstract name(): string;
abstract getQuerySettings(): Observable<ResponseArgsOfQuerySettingsDTO>;
abstract search(queryToken: QueryTokenDTO): Observable<ListResponseArgsOfDBHOrderItemListItemDTO>;

View File

@@ -8,6 +8,10 @@ import { Filter } from '@shared/components/filter';
export class PickupShelfOutService extends PickupShelfIOService {
private _abholfachService = inject(AbholfachService);
name() {
return 'PickupShelfOutService';
}
getQuerySettings() {
return this._abholfachService.AbholfachWarenausgabeQuerySettings();
}

View File

@@ -164,7 +164,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
private beforeFetchQuerySettings = () => {
const cachedQuerySettings = this._cacheService.get<QuerySettingsDTO>({
name: 'pickup-shelf',
providerName: this._pickupShelfIOService.constructor.name,
providerName: this._pickupShelfIOService.name(),
});
if (!!cachedQuerySettings) {
@@ -179,10 +179,7 @@ export class PickupShelfStore extends ComponentStore<PickupShelfState> implement
private fetchQuerySettingsDone = (resp: ResponseArgsOfQuerySettingsDTO) => {
this.patchState({ fetchingQuerySettings: false, querySettings: resp.result });
this._cacheService.set<QuerySettingsDTO>(
{ name: 'pickup-shelf', providerName: this._pickupShelfIOService.constructor.name },
resp.result
);
this._cacheService.set<QuerySettingsDTO>({ name: 'pickup-shelf', providerName: this._pickupShelfIOService.name() }, resp.result);
};
private fetchQuerySettingsError = (err: any) => {

View File

@@ -35,7 +35,7 @@
"test:shared": "ng test shared",
"*test:shell-breadcrumb": "ng test @shell/breadcrumb",
"test:store-search-component-store": "ng test @store/search-component-store",
"test:ui": "ng test ui",
"*test:ui": "ng test ui",
"*test:utils": "ng test utils",
"*test:native-container": "ng test native-container",
"lint": "ng lint",