fix: database migrations FK relations.

fix: database columns indexing.
This commit is contained in:
Ahmed Bouhuolia
2020-10-03 12:08:11 +02:00
parent 1250eccc0d
commit 0114ed9f8b
86 changed files with 788 additions and 801 deletions

View File

@@ -1,3 +1,4 @@
import { IVendor } from "interfaces";
import TenantRepository from "./TenantRepository";
@@ -18,7 +19,7 @@ export default class VendorRepository extends TenantRepository {
/**
* Retrieve the bill that associated to the given vendor id.
* @param {number} vendorId
* @param {number} vendorId - Vendor id.
*/
getBills(vendorId: number) {
const { Bill } = this.models;
@@ -29,16 +30,17 @@ export default class VendorRepository extends TenantRepository {
}
/**
*
* Retrieve all the given vendors.
* @param {numner[]} vendorsIds
* @return {IVendor}
*/
vendors(vendorsIds: number[]) {
vendors(vendorsIds: number[]): IVendor[] {
const { Contact } = this.models;
return Contact.query().modifier('vendor').whereIn('id', vendorsIds);
}
/**
*
* Retrieve vendors with associated bills.
* @param {number[]} vendorIds
*/
vendorsWithBills(vendorIds: number[]) {