From 158f3e0e36b1ce9d7737a07444f05678863a6223 Mon Sep 17 00:00:00 2001 From: tanshu Date: Fri, 11 Dec 2020 07:47:36 +0530 Subject: [PATCH] Fix: Raw material cost detail report borked on sort at the end as order was not in RawMaterialCost schema. Although it is not needed in the frontend, added it as optional. --- brewman/brewman/schemas/raw_material_cost.py | 1 + overlord/package.json | 1 - .../account-list/account-list-datasource.ts | 3 ++- .../balance-sheet/balance-sheet-datasource.ts | 3 ++- .../client-list/client-list-datasource.ts | 3 ++- .../closing-stock/closing-stock-datasource.ts | 3 ++- .../cost-centre-list-datasource.ts | 3 ++- .../src/app/daybook/daybook-datasource.ts | 3 ++- .../employee-attendance.service.ts | 4 +-- .../employee-benefits.component.ts | 2 +- .../employee-list/employee-list-datasource.ts | 3 ++- .../src/app/incentive/incentive.component.ts | 2 +- overlord/src/app/issue/issue.component.ts | 2 +- overlord/src/app/journal/journal.component.ts | 2 +- overlord/src/app/ledger/ledger-datasource.ts | 3 ++- .../net-transactions-datasource.ts | 3 ++- overlord/src/app/payment/payment.component.ts | 2 +- .../product-group-list-datasource.ts | 3 ++- .../product-ledger-datasource.ts | 3 ++- .../product-list/product-list-datasource.ts | 3 ++- .../app/profit-loss/profit-loss-datasource.ts | 3 ++- .../purchase-entries-datasource.ts | 3 ++- .../purchase-return.component.ts | 2 +- .../src/app/purchase/purchase.component.ts | 2 +- .../src/app/purchases/purchases-datasource.ts | 3 ++- .../raw-material-cost-datasource.ts | 3 ++- overlord/src/app/receipt/receipt.component.ts | 2 +- .../role/role-list/role-list-datasource.ts | 3 ++- overlord/src/app/settings/settings.service.ts | 26 +++++++++++++------ .../stock-movement-datasource.ts | 3 ++- .../trial-balance/trial-balance-datasource.ts | 3 ++- .../src/app/unposted/unposted-datasource.ts | 3 ++- .../user/user-list/user-list-datasource.ts | 3 ++- 33 files changed, 70 insertions(+), 41 deletions(-) diff --git a/brewman/brewman/schemas/raw_material_cost.py b/brewman/brewman/schemas/raw_material_cost.py index 05cf5e27..19b11ceb 100644 --- a/brewman/brewman/schemas/raw_material_cost.py +++ b/brewman/brewman/schemas/raw_material_cost.py @@ -20,6 +20,7 @@ class RawMaterialCostItem(BaseModel): quantity: Optional[Decimal] net: Optional[Decimal] gross: Optional[Decimal] + order: Optional[int] heading: Optional[bool] diff --git a/overlord/package.json b/overlord/package.json index 5dbd4876..ace8eaa1 100644 --- a/overlord/package.json +++ b/overlord/package.json @@ -55,7 +55,6 @@ "@typescript-eslint/eslint-plugin": "^4.9.0", "@typescript-eslint/parser": "^4.9.0", "eslint": "^7.14.0", - "eslint-config-airbnb-typescript": "^12.0.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsdoc": "^30.7.8", diff --git a/overlord/src/app/account/account-list/account-list-datasource.ts b/overlord/src/app/account/account-list/account-list-datasource.ts index 57a32cba..1452c104 100644 --- a/overlord/src/app/account/account-list/account-list-datasource.ts +++ b/overlord/src/app/account/account-list/account-list-datasource.ts @@ -8,7 +8,8 @@ import { map, tap } from 'rxjs/operators'; import { Account } from '../../core/account'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number | boolean, b: string | number | boolean, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number | boolean, b: string | number | boolean, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class AccountListDataSource extends DataSource { private filterValue = ''; diff --git a/overlord/src/app/balance-sheet/balance-sheet-datasource.ts b/overlord/src/app/balance-sheet/balance-sheet-datasource.ts index d4302194..190c3fd0 100644 --- a/overlord/src/app/balance-sheet/balance-sheet-datasource.ts +++ b/overlord/src/app/balance-sheet/balance-sheet-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { BalanceSheetItem } from './balance-sheet-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class BalanceSheetDataSource extends DataSource { constructor( public data: BalanceSheetItem[], diff --git a/overlord/src/app/client/client-list/client-list-datasource.ts b/overlord/src/app/client/client-list/client-list-datasource.ts index 88448369..ddf807e3 100644 --- a/overlord/src/app/client/client-list/client-list-datasource.ts +++ b/overlord/src/app/client/client-list/client-list-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { Client } from '../client'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ClientListDataSource extends DataSource { constructor(public data: Client[], private paginator?: MatPaginator, private sort?: MatSort) { super(); diff --git a/overlord/src/app/closing-stock/closing-stock-datasource.ts b/overlord/src/app/closing-stock/closing-stock-datasource.ts index 4a6ec09b..e5b5e960 100644 --- a/overlord/src/app/closing-stock/closing-stock-datasource.ts +++ b/overlord/src/app/closing-stock/closing-stock-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { ClosingStockItem } from './closing-stock-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ClosingStockDataSource extends DataSource { constructor( public data: ClosingStockItem[], diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts index 9fcc02ab..8fe687fa 100644 --- a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts +++ b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { CostCentre } from '../../core/cost-centre'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class CostCentreListDataSource extends DataSource { constructor(public data: CostCentre[], private paginator?: MatPaginator, private sort?: MatSort) { super(); diff --git a/overlord/src/app/daybook/daybook-datasource.ts b/overlord/src/app/daybook/daybook-datasource.ts index a9edd272..3dd60e5d 100644 --- a/overlord/src/app/daybook/daybook-datasource.ts +++ b/overlord/src/app/daybook/daybook-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { DaybookItem } from './daybook-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class DaybookDataSource extends DataSource { constructor( public data: DaybookItem[], diff --git a/overlord/src/app/employee-attendance/employee-attendance.service.ts b/overlord/src/app/employee-attendance/employee-attendance.service.ts index 1de20def..303e5dff 100644 --- a/overlord/src/app/employee-attendance/employee-attendance.service.ts +++ b/overlord/src/app/employee-attendance/employee-attendance.service.ts @@ -30,9 +30,7 @@ export class EmployeeAttendanceService { return this.http .get(getUrl, options) .pipe( - catchError( - this.log.handleError(serviceName, `get id=${id}`), - ), + catchError(this.log.handleError(serviceName, `get id=${id}`)), ) as Observable; } diff --git a/overlord/src/app/employee-benefits/employee-benefits.component.ts b/overlord/src/app/employee-benefits/employee-benefits.component.ts index 63e25ceb..f9ad6997 100644 --- a/overlord/src/app/employee-benefits/employee-benefits.component.ts +++ b/overlord/src/app/employee-benefits/employee-benefits.component.ts @@ -198,7 +198,7 @@ export class EmployeeBenefitsComponent implements OnInit, AfterViewInit { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/employee/employee-list/employee-list-datasource.ts b/overlord/src/app/employee/employee-list/employee-list-datasource.ts index bfa53fe3..8ead3558 100644 --- a/overlord/src/app/employee/employee-list/employee-list-datasource.ts +++ b/overlord/src/app/employee/employee-list/employee-list-datasource.ts @@ -8,7 +8,8 @@ import { map, tap } from 'rxjs/operators'; import { Employee } from '../employee'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class EmployeeListDataSource extends DataSource { private filterValue = ''; diff --git a/overlord/src/app/incentive/incentive.component.ts b/overlord/src/app/incentive/incentive.component.ts index 5868c762..d30194c5 100644 --- a/overlord/src/app/incentive/incentive.component.ts +++ b/overlord/src/app/incentive/incentive.component.ts @@ -134,7 +134,7 @@ export class IncentiveComponent implements OnInit { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/issue/issue.component.ts b/overlord/src/app/issue/issue.component.ts index 69108d22..8e4f21a3 100644 --- a/overlord/src/app/issue/issue.component.ts +++ b/overlord/src/app/issue/issue.component.ts @@ -262,7 +262,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/journal/journal.component.ts b/overlord/src/app/journal/journal.component.ts index 9d71a563..4a80dee3 100644 --- a/overlord/src/app/journal/journal.component.ts +++ b/overlord/src/app/journal/journal.component.ts @@ -253,7 +253,7 @@ export class JournalComponent implements OnInit, AfterViewInit, OnDestroy { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/ledger/ledger-datasource.ts b/overlord/src/app/ledger/ledger-datasource.ts index 53b68cff..a2e967cf 100644 --- a/overlord/src/app/ledger/ledger-datasource.ts +++ b/overlord/src/app/ledger/ledger-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { LedgerItem } from './ledger-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class LedgerDataSource extends DataSource { constructor(public data: LedgerItem[], private paginator?: MatPaginator, private sort?: MatSort) { super(); diff --git a/overlord/src/app/net-transactions/net-transactions-datasource.ts b/overlord/src/app/net-transactions/net-transactions-datasource.ts index 3af6abf0..edad6dcf 100644 --- a/overlord/src/app/net-transactions/net-transactions-datasource.ts +++ b/overlord/src/app/net-transactions/net-transactions-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { NetTransactionsItem } from './net-transactions-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class NetTransactionsDataSource extends DataSource { constructor( public data: NetTransactionsItem[], diff --git a/overlord/src/app/payment/payment.component.ts b/overlord/src/app/payment/payment.component.ts index ab0c40f5..f9e4ffc9 100644 --- a/overlord/src/app/payment/payment.component.ts +++ b/overlord/src/app/payment/payment.component.ts @@ -265,7 +265,7 @@ export class PaymentComponent implements OnInit, AfterViewInit, OnDestroy { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts b/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts index f4028177..d4cdccee 100644 --- a/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts +++ b/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { ProductGroup } from '../../core/product-group'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ProductGroupListDataSource extends DataSource { constructor( public data: ProductGroup[], diff --git a/overlord/src/app/product-ledger/product-ledger-datasource.ts b/overlord/src/app/product-ledger/product-ledger-datasource.ts index 62608c52..f46a287b 100644 --- a/overlord/src/app/product-ledger/product-ledger-datasource.ts +++ b/overlord/src/app/product-ledger/product-ledger-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { ProductLedgerItem } from './product-ledger-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ProductLedgerDataSource extends DataSource { constructor( public data: ProductLedgerItem[], diff --git a/overlord/src/app/product/product-list/product-list-datasource.ts b/overlord/src/app/product/product-list/product-list-datasource.ts index 4507a4ff..a9f2f1ed 100644 --- a/overlord/src/app/product/product-list/product-list-datasource.ts +++ b/overlord/src/app/product/product-list/product-list-datasource.ts @@ -9,7 +9,8 @@ import { Product } from '../../core/product'; import { ProductGroup } from '../../core/product-group'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ProductListDataSource extends DataSource { private filterValue = ''; diff --git a/overlord/src/app/profit-loss/profit-loss-datasource.ts b/overlord/src/app/profit-loss/profit-loss-datasource.ts index a18552ef..2347f80d 100644 --- a/overlord/src/app/profit-loss/profit-loss-datasource.ts +++ b/overlord/src/app/profit-loss/profit-loss-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { ProfitLossItem } from './profit-loss-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class ProfitLossDataSource extends DataSource { constructor( public data: ProfitLossItem[], diff --git a/overlord/src/app/purchase-entries/purchase-entries-datasource.ts b/overlord/src/app/purchase-entries/purchase-entries-datasource.ts index 7c461da8..52c9696e 100644 --- a/overlord/src/app/purchase-entries/purchase-entries-datasource.ts +++ b/overlord/src/app/purchase-entries/purchase-entries-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { PurchaseEntriesItem } from './purchase-entries-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class PurchaseEntriesDataSource extends DataSource { constructor( public data: PurchaseEntriesItem[], diff --git a/overlord/src/app/purchase-return/purchase-return.component.ts b/overlord/src/app/purchase-return/purchase-return.component.ts index 9a0d28ec..569a5dc1 100644 --- a/overlord/src/app/purchase-return/purchase-return.component.ts +++ b/overlord/src/app/purchase-return/purchase-return.component.ts @@ -260,7 +260,7 @@ export class PurchaseReturnComponent implements OnInit, AfterViewInit, OnDestroy } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/purchase/purchase.component.ts b/overlord/src/app/purchase/purchase.component.ts index 19d9cf16..314f2275 100644 --- a/overlord/src/app/purchase/purchase.component.ts +++ b/overlord/src/app/purchase/purchase.component.ts @@ -269,7 +269,7 @@ export class PurchaseComponent implements OnInit, AfterViewInit, OnDestroy { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/purchases/purchases-datasource.ts b/overlord/src/app/purchases/purchases-datasource.ts index 07338fe8..610f2b6c 100644 --- a/overlord/src/app/purchases/purchases-datasource.ts +++ b/overlord/src/app/purchases/purchases-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { PurchasesItem } from './purchases-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class PurchasesDataSource extends DataSource { constructor( public data: PurchasesItem[], diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts b/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts index d2e3737a..74b2fa64 100644 --- a/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts +++ b/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { RawMaterialCostItem } from './raw-material-cost-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class RawMaterialCostDataSource extends DataSource { constructor( public data: RawMaterialCostItem[], diff --git a/overlord/src/app/receipt/receipt.component.ts b/overlord/src/app/receipt/receipt.component.ts index cb7bbc90..f840c881 100644 --- a/overlord/src/app/receipt/receipt.component.ts +++ b/overlord/src/app/receipt/receipt.component.ts @@ -264,7 +264,7 @@ export class ReceiptComponent implements OnInit, AfterViewInit, OnDestroy { } return ( this.voucher.user.id === (this.auth.user as User).id || - this.auth.allowed('edit-other-user\'s-vouchers') + this.auth.allowed("edit-other-user's-vouchers") ); } diff --git a/overlord/src/app/role/role-list/role-list-datasource.ts b/overlord/src/app/role/role-list/role-list-datasource.ts index 4c631b70..2f0f1575 100644 --- a/overlord/src/app/role/role-list/role-list-datasource.ts +++ b/overlord/src/app/role/role-list/role-list-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { Role } from '../role'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class RoleListDatasource extends DataSource { constructor(public data: Role[], private paginator?: MatPaginator, private sort?: MatSort) { super(); diff --git a/overlord/src/app/settings/settings.service.ts b/overlord/src/app/settings/settings.service.ts index e9f0c7d1..23bf0d45 100644 --- a/overlord/src/app/settings/settings.service.ts +++ b/overlord/src/app/settings/settings.service.ts @@ -56,28 +56,38 @@ export class SettingsService { rebaseDatabase(date: string): Observable> { const url = '/api/rebase'; return this.http - .post>(`${url}/${date}`, {}) - .pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase'))) as Observable>; + .post>(`${url}/${date}`, {}) + .pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase'))) as Observable< + Record + >; } setMaintenance(enable: boolean): Observable<{ enabled: boolean; user: string }> { const url = '/api/maintenance'; return this.http .post<{ enabled: boolean; user: string }>(url, { enabled: enable }) - .pipe(catchError(this.log.handleError(serviceName, 'setMaintenance'))) as Observable<{ enabled: boolean; user: string }>; + .pipe(catchError(this.log.handleError(serviceName, 'setMaintenance'))) as Observable<{ + enabled: boolean; + user: string; + }>; } getMaintenance(): Observable<{ enabled: boolean; user: string }> { const url = '/api/maintenance'; return this.http - .get<{ enabled: boolean; user: string }>(url) - .pipe(catchError(this.log.handleError(serviceName, 'getMaintenance'))) as Observable<{ enabled: boolean; user: string }>; + .get<{ enabled: boolean; user: string }>(url) + .pipe(catchError(this.log.handleError(serviceName, 'getMaintenance'))) as Observable<{ + enabled: boolean; + user: string; + }>; } - checkDatabaseIntegrity(): Observable<{ 'attendanceCount': number }> { + checkDatabaseIntegrity(): Observable<{ attendanceCount: number }> { const url = '/api/db-integrity'; return this.http - .post<{ 'attendanceCount': number }>(url, {}) - .pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity'))) as Observable<{ 'attendanceCount': number }>; + .post<{ attendanceCount: number }>(url, {}) + .pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity'))) as Observable<{ + attendanceCount: number; + }>; } } diff --git a/overlord/src/app/stock-movement/stock-movement-datasource.ts b/overlord/src/app/stock-movement/stock-movement-datasource.ts index ebdc0086..298ba11c 100644 --- a/overlord/src/app/stock-movement/stock-movement-datasource.ts +++ b/overlord/src/app/stock-movement/stock-movement-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { StockMovementItem } from './stock-movement-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class StockMovementDataSource extends DataSource { constructor( public data: StockMovementItem[], diff --git a/overlord/src/app/trial-balance/trial-balance-datasource.ts b/overlord/src/app/trial-balance/trial-balance-datasource.ts index 61b5aa02..2d3a46e2 100644 --- a/overlord/src/app/trial-balance/trial-balance-datasource.ts +++ b/overlord/src/app/trial-balance/trial-balance-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { TrialBalanceItem } from './trial-balance-item'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class TrialBalanceDataSource extends DataSource { constructor( public data: TrialBalanceItem[], diff --git a/overlord/src/app/unposted/unposted-datasource.ts b/overlord/src/app/unposted/unposted-datasource.ts index 7d8039ab..c8858ec7 100644 --- a/overlord/src/app/unposted/unposted-datasource.ts +++ b/overlord/src/app/unposted/unposted-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { Unposted } from './unposted'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class UnpostedDataSource extends DataSource { constructor(public data: Unposted[], private paginator?: MatPaginator, private sort?: MatSort) { diff --git a/overlord/src/app/user/user-list/user-list-datasource.ts b/overlord/src/app/user/user-list/user-list-datasource.ts index b73fcafe..72663b54 100644 --- a/overlord/src/app/user/user-list/user-list-datasource.ts +++ b/overlord/src/app/user/user-list/user-list-datasource.ts @@ -8,7 +8,8 @@ import { map } from 'rxjs/operators'; import { User } from '../../core/user'; /** Simple sort comparator for example ID/Name columns (for client-side sorting). */ -const compare = (a: string | number, b: string | number, isAsc: boolean) => (a < b ? -1 : 1) * (isAsc ? 1 : -1); +const compare = (a: string | number, b: string | number, isAsc: boolean) => + (a < b ? -1 : 1) * (isAsc ? 1 : -1); export class UserListDataSource extends DataSource { constructor(public data: User[], private paginator?: MatPaginator, private sort?: MatSort) {