feat: add more demo account seeders

This commit is contained in:
Ahmed Bouhuolia
2024-08-22 13:04:51 +02:00
parent 6cb9c919b5
commit 59f480f9d5
11 changed files with 228 additions and 15 deletions

View File

@@ -1,6 +1,17 @@
export class SeedDemoAbstract {
/**
* Retrieves the seeder file mapping.
* @returns {Array<>}
*/
get mapping() {
return [];
}
export class SeedDemoAbstract{
}
/**
* Retireves the seeder file import params.
* @returns {Record<string, any>}
*/
get importParams() {
return {};
}
}

View File

@@ -0,0 +1,35 @@
import { SeedDemoAbstract } from './SeedDemoAbstract';
export class SeedDemoBankTransactions extends SeedDemoAbstract {
get mapping() {
return [
{ from: 'Date', to: 'date' },
{ from: 'Payee', to: 'payee' },
{ from: 'Description', to: 'description' },
{ from: 'Reference No.', to: 'referenceNo' },
{ from: 'Amount', to: 'amount' },
];
}
/**
* Retrieves the seeder file name.
* @returns {string}
*/
get importFileName() {
return `bank-transactions.csv`;
}
/**
* Retrieve the resource name of the seeder.
* @returns {string}
*/
get resource() {
return 'UncategorizedCashflowTransaction';
}
get importParams() {
return {
accountId: 1001,
};
}
}

View File

@@ -12,12 +12,15 @@ export class SeedDemoAccountItems extends SeedDemoAbstract {
{ from: 'Sellable', to: 'sellable' },
{ from: 'Purchasable', to: 'purchasable' },
{ from: 'Sell Price', to: 'sellPrice' },
{ from: 'Cost Price', to: 'cost_price' },
{ from: 'Cost Account', to: 'costAccount' },
{ from: 'Sell Account', to: 'sellAccount' },
{ from: 'Inventory Account', to: 'inventoryAccount' },
{ from: 'Cost Price', to: 'costPrice' },
{ from: 'Cost Account', to: 'costAccountId' },
{ from: 'Sell Account', to: 'sellAccountId' },
{ from: 'Inventory Account', to: 'inventoryAccountId' },
{ from: 'Sell Description', to: 'sellDescription' },
{ from: 'Purchase Description', to: 'purchaseDescription' },
{
from: 'Purchase Description',
to: 'purchaseDescription',
},
{ from: 'Note', to: 'note' },
{ from: 'Category', to: 'category' },
{ from: 'Active', to: 'active' },

View File

@@ -0,0 +1,37 @@
import { SeedDemoAbstract } from './SeedDemoAbstract';
export class SeedDemoSaleInvoices extends SeedDemoAbstract {
get mapping() {
return [
{ from: 'Invoice Date', to: 'invoiceDate' },
{ from: 'Due Date', to: 'dueDate' },
{ from: 'Reference No.', to: 'referenceNo' },
{ from: 'Invoice No.', to: 'invoiceNo' },
{ from: 'Customer', to: 'customerId' },
{ from: 'Exchange Rate', to: 'exchangeRate' },
{ from: 'Invoice Message', to: 'invoiceMessage' },
{ from: 'Terms & Conditions', to: 'termsConditions' },
{ from: 'Delivered', to: 'delivered' },
{ from: 'Item', to: 'itemId', group: 'entries' },
{ from: 'Rate', to: 'rate', group: 'entries' },
{ from: 'Quantity', to: 'quantity', group: 'entries' },
{ from: 'Description', to: 'description', group: 'entries' },
];
}
/**
* Retrieves the seeder file name.
* @returns {string}
*/
get importFileName() {
return `sale-invoices.csv`;
}
/**
* Retrieve the resource name of the seeder.
* @returns {string}
*/
get resource() {
return 'SaleInvoice';
}
}