DB Integrity checks for batch integrity and also updates quantities when it can.
This commit is contained in:
1 parent
6212eead20
commit
b1557bef88
5 files changed
+206
-15
No files matched your search
@@ -6,6 +6,7 @@ import { catchError } from 'rxjs/operators';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
import { Product } from '../core/product';
|
||||
|
||||
import { BatchDate, IntegrityBatch } from './integrity-batch';
|
||||
import { LockInfo } from './lock-info';
|
||||
|
||||
const serviceName = 'SettingsService';
|
||||
@@ -82,12 +83,21 @@ export class SettingsService {
|
||||
}>;
|
||||
}
|
||||
|
||||
checkDatabaseIntegrity(): Observable<{ attendanceCount: number }> {
|
||||
checkDatabaseIntegrity(): Observable<{
|
||||
attendanceCount: number;
|
||||
batches: IntegrityBatch[];
|
||||
batchDates: BatchDate[];
|
||||
}> {
|
||||
const url = '/api/db-integrity';
|
||||
return this.http
|
||||
.post<{ attendanceCount: number }>(url, {})
|
||||
.post<{ attendanceCount: number; batches: IntegrityBatch[]; batchDates: BatchDate[] }>(
|
||||
url,
|
||||
{},
|
||||
)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity'))) as Observable<{
|
||||
attendanceCount: number;
|
||||
batches: IntegrityBatch[];
|
||||
batchDates: BatchDate[];
|
||||
}>;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user