Strict done!!
This commit is contained in:
@ -2,5 +2,13 @@ export class NetTransactionsItem {
|
||||
type: string;
|
||||
name: string;
|
||||
debit: number;
|
||||
credit: string;
|
||||
credit: number;
|
||||
|
||||
public constructor(init?: Partial<NetTransactionsItem>) {
|
||||
this.type = '';
|
||||
this.name = '';
|
||||
this.debit = 0;
|
||||
this.credit = 0;
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,10 +16,10 @@ import { NetTransactionsDataSource } from './net-transactions-datasource';
|
||||
export class NetTransactionsComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
@ViewChild(MatSort, { static: true }) sort?: MatSort;
|
||||
dataSource: NetTransactionsDataSource;
|
||||
info: NetTransactions = new NetTransactions();
|
||||
dataSource: NetTransactionsDataSource = new NetTransactionsDataSource(this.info.body);
|
||||
form: FormGroup;
|
||||
info: NetTransactions;
|
||||
selectedRowId: string;
|
||||
selectedRowId = '';
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['type', 'name', 'debit', 'credit'];
|
||||
|
||||
@ -39,7 +39,7 @@ export class NetTransactionsComponent implements OnInit {
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new NetTransactionsDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.dataSource = new NetTransactionsDataSource(this.info.body, this.paginator, this.sort);
|
||||
});
|
||||
}
|
||||
|
||||
@ -56,10 +56,9 @@ export class NetTransactionsComponent implements OnInit {
|
||||
prepareSubmit(): NetTransactions {
|
||||
const formModel = this.form.value;
|
||||
|
||||
return {
|
||||
return new NetTransactions({
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
body: [],
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ const serviceName = 'NetTransactionsService';
|
||||
export class NetTransactionsService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(startDate: string, finishDate): Observable<NetTransactions> {
|
||||
list(startDate: string | null, finishDate: string | null): Observable<NetTransactions> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
return <Observable<NetTransactions>>(
|
||||
|
||||
@ -4,4 +4,11 @@ export class NetTransactions {
|
||||
startDate: string;
|
||||
finishDate: string;
|
||||
body: NetTransactionsItem[];
|
||||
|
||||
public constructor(init?: Partial<NetTransactions>) {
|
||||
this.startDate = '';
|
||||
this.finishDate = '';
|
||||
this.body = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user