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F,WACTI,IAAI,GAAGF,KAAKD,qBAAqBI,6BAA6BS,eAC9DR,QAAKC,KAAS8B,MAAuB5B,KAAI4B,EAAgBC,GAAsBC,MAAS3B,SAAS0B,KACtG,WAnDWO,0CAAsBL,MAAAC,MAAAD,MAAAE,KAAA,4BAAtBG,EAAsBF,QAAtBE,EAAsBD,YAAtBC,CAAsB,8DCY5B,IAAMS,EAAgB,UAAAC,EAAvB,MAAOD,qDAAgB,yBAAhBA,iCAPA,CACT,CAACE,QAASC,IAAcC,SAAUb,GAClC,CAACW,QAASG,IAAWD,SAAUE,KAC/B,CAACJ,QAASK,IAAUH,SAAU7D,MAC/BiE,QAAA,CALSC,IAAcC,IAAuBC,SAQpCX,CAAgB,WAFZY,IAA+B,kBAAAxB,IAAA","names":["HttpArticlesService","_HttpArticlesService","constructor","httpClient","backendConfiguration","this","getAll","get","getEndpoint","pipe","rxjsMap","articlesJSON","map","articleJSON","OverviewListArticle","fromJSON","delete","id","deleteMulti","ids","body","reponsesJSON","reponseJSON","MultiDeleteResponse","getById","Article","save","item","post","toJSON","response","update","put","isIdentifierAvailable","name","params","HttpParams","set","nameAvailable","getConflicts","conflictsJSON","conflictJSON","Conflict","i0","i1","i2","factory","ɵfac","HttpSalesOrdersService","_HttpSalesOrdersService","salesOrdersJSON","salesOrderJSON","OverviewListSalesOrder","SalesOrder","identifier","salesOrderNumberAvailable","copyToOrderbook","SalesOrderModule","_SalesOrderModule","provide","SALES_ORDERS","useClass","CUSTOMERS","HttpCustomersService","ARTICLES","imports","SharedModule","salesOrderDataRouting","CanShowErrorForFormControlModule","SalesOrderOverviewPageComponent"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./apps/texconnect/src/app/infrastructure/http/article/http-articles.service.ts","./apps/texconnect/src/app/infrastructure/http/sales-order/http-sales-orders.service.ts","./apps/texconnect/src/app/presentation/pages/texfab/sales-order/sales-order.module.ts"],"sourcesContent":["import {HttpClient, HttpParams} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {BackendConfiguration} from '@application/configuration/backend-configuration';\nimport {Article} from '@domain/article/article';\nimport {MultiDeleteResponse} from '@domain/textile-data/multi-delete-reponse';\nimport {Articles} from '@infrastructure/http/article/articles';\nimport {OverviewListArticle} from '@presentation/pages/texfab/article/overview/overview-list-article';\nimport {Conflict} from '@vdw/angular-component-library';\nimport {map} from 'lodash-es';\nimport {Observable} from 'rxjs';\nimport {map as rxjsMap} from 'rxjs/operators';\n\n@Injectable()\nexport class HttpArticlesService implements Articles {\n private httpClient: HttpClient;\n private backendConfiguration: BackendConfiguration;\n\n public constructor(httpClient: HttpClient, backendConfiguration: BackendConfiguration) {\n this.httpClient = httpClient;\n this.backendConfiguration = backendConfiguration;\n }\n\n public getAll(): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}articles`).pipe(\n rxjsMap((articlesJSON: any) => {\n return map(articlesJSON, (articleJSON: any) => {\n return OverviewListArticle.fromJSON(articleJSON);\n });\n })\n );\n }\n\n public delete(id: number | string): Observable {\n return this.httpClient.delete(`${this.backendConfiguration.getEndpoint()}articles/${id}`);\n }\n\n public deleteMulti(ids: number[]): Observable {\n return this.httpClient.delete(`${this.backendConfiguration.getEndpoint()}articles/multi-delete`, {body: ids}).pipe(\n rxjsMap((reponsesJSON: any) => {\n return reponsesJSON.map((reponseJSON: any) => {\n return MultiDeleteResponse.fromJSON(reponseJSON);\n });\n })\n );\n }\n\n public getById(id: number | string): Observable
{\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}articles/${id}`).pipe(rxjsMap((articleJSON: any) => Article.fromJSON(articleJSON)));\n }\n\n public save(item: Article): Observable {\n return this.httpClient.post(`${this.backendConfiguration.getEndpoint()}articles`, item.toJSON()).pipe(rxjsMap((response: {id: number}) => response.id));\n }\n\n public update(item: Article): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getEndpoint()}articles/${item.id}`, item.toJSON());\n }\n\n public isIdentifierAvailable(name: string): Observable {\n const params = new HttpParams().set('name', name);\n\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}articles/check-name`, {params}).pipe(\n rxjsMap((response: {nameAvailable: boolean}) => {\n return response.nameAvailable;\n })\n );\n }\n\n public getConflicts(id: number): Observable {\n return this.httpClient\n .get(`${this.backendConfiguration.getEndpoint()}articles/${id}/conflicts`)\n .pipe(rxjsMap((conflictsJSON: any) => map(conflictsJSON, (conflictJSON: any) => Conflict.fromJSON(conflictJSON))));\n }\n}\n","import {HttpClient, HttpParams} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {BackendConfiguration} from '@application/configuration/backend-configuration';\nimport {SalesOrder} from '@domain/sales-order/sales-order';\nimport {SalesOrders} from '@infrastructure/http/sales-order/sales-orders';\nimport {OverviewListSalesOrder} from '@presentation/pages/texfab/sales-order/overview/overview-list-sales-order';\nimport {Conflict} from '@vdw/angular-component-library';\nimport {map} from 'lodash-es';\nimport {Observable} from 'rxjs';\nimport {map as rxjsMap} from 'rxjs/operators';\n\n@Injectable()\nexport class HttpSalesOrdersService implements SalesOrders {\n private httpClient: HttpClient;\n private backendConfiguration: BackendConfiguration;\n\n public constructor(httpClient: HttpClient, backendConfiguration: BackendConfiguration) {\n this.httpClient = httpClient;\n this.backendConfiguration = backendConfiguration;\n }\n\n public delete(id: number | string): Observable {\n return this.httpClient.delete(`${this.backendConfiguration.getEndpoint()}sales-orders/${id}`);\n }\n\n public getAll(): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}sales-orders`).pipe(\n rxjsMap((salesOrdersJSON: any) => {\n return map(salesOrdersJSON, (salesOrderJSON: any) => OverviewListSalesOrder.fromJSON(salesOrderJSON));\n })\n );\n }\n\n public getById(id: number | string): Observable {\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}sales-orders/${id}`).pipe(rxjsMap((response: any) => SalesOrder.fromJSON(response)));\n }\n\n public isIdentifierAvailable(identifier: string): Observable {\n const params = new HttpParams().set('number', identifier);\n\n return this.httpClient.get(`${this.backendConfiguration.getEndpoint()}sales-orders/check-number`, {params}).pipe(\n rxjsMap((response: {salesOrderNumberAvailable: boolean}) => {\n return response.salesOrderNumberAvailable;\n })\n );\n }\n\n public save(item: SalesOrder): Observable {\n return this.httpClient.post(`${this.backendConfiguration.getEndpoint()}sales-orders`, item.toJSON()).pipe(rxjsMap((response: {id: number}) => response.id));\n }\n\n public update(item: SalesOrder): Observable {\n return this.httpClient.put(`${this.backendConfiguration.getEndpoint()}sales-orders/${item.id}`, item.toJSON());\n }\n\n public copyToOrderbook(id: number): Observable {\n return this.httpClient.post(`${this.backendConfiguration.getEndpoint()}sales-orders/copy-to-orderbook`, {id});\n }\n\n public getConflicts(id: number): Observable {\n return this.httpClient\n .get(`${this.backendConfiguration.getEndpoint()}sales-orders/${id}/conflicts`)\n .pipe(rxjsMap((conflictsJSON: any) => map(conflictsJSON, (conflictJSON: any) => Conflict.fromJSON(conflictJSON))));\n }\n}\n","import {NgModule} from '@angular/core';\nimport {ARTICLES} from '@infrastructure/http/article/articles';\nimport {HttpArticlesService} from '@infrastructure/http/article/http-articles.service';\nimport {CUSTOMERS} from '@infrastructure/http/customer/customers';\nimport {HttpCustomersService} from '@infrastructure/http/customer/http-customers.service';\nimport {HttpSalesOrdersService} from '@infrastructure/http/sales-order/http-sales-orders.service';\nimport {SALES_ORDERS} from '@infrastructure/http/sales-order/sales-orders';\nimport {AddSalesOrderPageComponent} from '@presentation/pages/texfab/sales-order/add/add-sales-order-page.component';\nimport {SalesOrderOverviewPageComponent} from '@presentation/pages/texfab/sales-order/overview/sales-order-overview-page.component';\nimport {salesOrderDataRouting} from '@presentation/pages/texfab/sales-order/sales-order.routing';\nimport {SharedModule} from '@shared/shared.module';\nimport {CanShowErrorForFormControlModule} from '@vdw/angular-component-library';\nimport {SelectArticleComponent} from './add/select-article/select-article.component';\nimport {SelectCustomerComponent} from './add/select-customer/select-customer.component';\n\n@NgModule({\n imports: [SharedModule, salesOrderDataRouting, CanShowErrorForFormControlModule],\n providers: [\n {provide: SALES_ORDERS, useClass: HttpSalesOrdersService},\n {provide: CUSTOMERS, useClass: HttpCustomersService},\n {provide: ARTICLES, useClass: HttpArticlesService}\n ],\n declarations: [SalesOrderOverviewPageComponent, AddSalesOrderPageComponent, SelectCustomerComponent, SelectArticleComponent]\n})\nexport class SalesOrderModule {}\n"],"x_google_ignoreList":[]}