mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
adds tax number to organization
This commit is contained in:
@@ -65,6 +65,7 @@ export default class OrganizationController extends BaseController {
|
||||
check('fiscal_year').exists().isIn(MONTHS),
|
||||
check('language').exists().isString().isIn(ACCEPTED_LOCALES),
|
||||
check('date_format').optional().isIn(DATE_FORMATS),
|
||||
check('tax_number').optional({ nullable: true }).isString().trim().escape(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface IOrganizationSetupDTO {
|
||||
fiscalYear: string;
|
||||
industry: string;
|
||||
timeZone: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationBuildDTO {
|
||||
@@ -16,6 +17,7 @@ export interface IOrganizationBuildDTO {
|
||||
timezone: string;
|
||||
fiscalYear: string;
|
||||
dateFormat?: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationUpdateDTO {
|
||||
@@ -25,6 +27,7 @@ export interface IOrganizationUpdateDTO {
|
||||
timezone: string;
|
||||
fiscalYear: string;
|
||||
industry: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationBuildEventPayload {
|
||||
|
||||
@@ -189,6 +189,7 @@ export default class OrganizationService {
|
||||
tenant.metadata?.baseCurrency
|
||||
);
|
||||
await tenant.saveMetadata(organizationDTO);
|
||||
// console.log('organizationDTO', organizationDTO);
|
||||
|
||||
if (organizationDTO.baseCurrency !== tenant.metadata?.baseCurrency) {
|
||||
// Triggers `onOrganizationBaseCurrencyUpdated` event.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.table('tenants_metadata', (table) => {
|
||||
table.string('tax_number')
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.table('tenants_metadata', (table) => {
|
||||
table.dropColumn('tax_number');
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user