Init commit

This commit is contained in:
Marek Fraczyk
2021-02-16 16:24:22 +02:00
parent 056a817632
commit 79e9705b01
106 changed files with 18400 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import { Model } from '@vuex-orm/core';
import { uuidv4 } from '@/utils/helpers';
export default class BankAccount extends Model {
// This is the name used as module name of the Vuex Store.
static entity = 'bank_accounts';
static fields() {
return {
id: this.attr(() => uuidv4()),
account_no: this.attr(''),
bank_name: this.attr(''),
updated_at: this.attr(''),
created_at: this.attr(''),
};
}
}

View File

@ -0,0 +1,30 @@
import { Model } from '@vuex-orm/core';
import { uuidv4 } from '@/utils/helpers';
import BankAccount from '@/store/models/bank-account';
export default class Client extends Model {
// This is the name used as module name of the Vuex Store.
static entity = 'clients';
static fields() {
return {
id: this.attr(() => uuidv4()),
company_name: this.attr(''),
company_address: this.attr(''),
company_postal_code: this.attr(''),
company_country: this.attr(''),
company_county: this.attr(''),
company_city: this.attr(''),
company_reg_no: this.attr(''),
company_vat_no: this.attr(''),
has_vat: this.attr(null),
currency: this.attr(null),
rate: this.attr(null),
invoice_email: this.attr(''),
bank_account_id: this.attr(null),
bank_account: this.belongsTo(BankAccount, 'bank_account_id', 'id'),
updated_at: this.attr(''),
created_at: this.attr(''),
};
}
}

View File

@ -0,0 +1,23 @@
import { Model } from '@vuex-orm/core';
import { uuidv4 } from '@/utils/helpers';
import Invoice from '@/store/models/invoice';
export default class InvoiceRow extends Model {
// This is the name used as module name of the Vuex Store.
static entity = 'invoice_rows';
static fields() {
return {
id: this.attr(() => uuidv4()),
invoice_id: this.attr(null),
invoice: this.belongsTo(Invoice, 'invoice_id'),
item: this.attr(''),
quantity: this.attr(null),
price: this.attr(null),
unit: this.attr(''),
order: this.attr(null),
updated_at: this.attr(''),
created_at: this.attr(''),
};
}
}

View File

@ -0,0 +1,51 @@
import { Model } from '@vuex-orm/core';
import { uuidv4 } from '@/utils/helpers';
import Client from '@/store/models/client';
import InvoiceRow from '@/store/models/invoice-row';
export default class Invoice extends Model {
// This is the name used as module name of the Vuex Store.
static entity = 'invoices';
static fields() {
return {
id: this.attr(() => uuidv4()),
number: this.attr(''),
status: this.attr('draft'),
issued_at: this.attr(''),
due_at: this.attr(''),
late_fee: this.attr(''),
vat_rate: this.attr(''),
currency: this.attr(''),
from_name: this.attr(''),
from_address: this.attr(''),
from_postal_code: this.attr(''),
from_city: this.attr(''),
from_country: this.attr(''),
from_county: this.attr(''),
from_reg_no: this.attr(''),
from_vat_no: this.attr(''),
from_website: this.attr(''),
from_email: this.attr(''),
from_phone: this.attr(''),
bank_name: this.attr(''),
bank_account_no: this.attr(''),
client_name: this.attr(''),
client_address: this.attr(''),
client_postal_code: this.attr(''),
client_country: this.attr(''),
client_county: this.attr(''),
client_city: this.attr(''),
client_reg_no: this.attr(''),
client_vat_no: this.attr(''),
client_email: this.attr(''),
client_id: this.attr(null),
client: this.belongsTo(Client, 'client_id'),
rows: this.hasMany(InvoiceRow, 'invoice_id'),
notes: this.attr(''),
updated_at: this.attr(''),
created_at: this.attr(''),
total: this.attr(null), // Only used in lists.
};
}
}

30
src/store/models/team.js Normal file
View File

@ -0,0 +1,30 @@
import { Model } from '@vuex-orm/core';
import { uuidv4 } from '@/utils/helpers';
export default class Team extends Model {
// This is the name used as module name of the Vuex Store.
static entity = 'teams';
static fields() {
return {
id: this.attr(() => uuidv4()),
company_name: this.attr(''),
company_address: this.attr(''),
company_postal_code: this.attr(''),
company_country: this.attr(''),
company_county: this.attr(''),
company_city: this.attr(''),
company_reg_no: this.attr(''),
company_vat_no: this.attr(''),
website: this.attr(''),
contact_email: this.attr(''),
contact_phone: this.attr(''),
vat_rate: this.attr(null),
invoice_late_fee: this.attr(null),
invoice_due_days: this.attr(null),
updated_at: this.attr(''),
created_at: this.attr(''),
logo_url: this.attr(''),
};
}
}