mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: Pdf templates customer/company addresses
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { Service } from 'typedi';
|
||||
import { TenantMetadata } from '@/system/models';
|
||||
import { CommonOrganizationBrandingAttributes } from './types';
|
||||
|
||||
@Service()
|
||||
export class GetOrganizationBrandingAttributes {
|
||||
/**
|
||||
* Retrieves the given organization branding attributes initial state.
|
||||
* @param {number} tenantId
|
||||
* @returns {Promise<CommonOrganizationBrandingAttributes>}
|
||||
*/
|
||||
async getOrganizationBrandingAttributes(
|
||||
tenantId: number
|
||||
): Promise<CommonOrganizationBrandingAttributes> {
|
||||
const tenantMetadata = await TenantMetadata.query().findOne({ tenantId });
|
||||
|
||||
const companyName = tenantMetadata?.name;
|
||||
const primaryColor = tenantMetadata?.primaryColor;
|
||||
const companyLogoKey = tenantMetadata?.logoKey;
|
||||
const companyLogoUri = tenantMetadata?.logoUri;
|
||||
const companyAddress = tenantMetadata?.addressTextFormatted;
|
||||
|
||||
return {
|
||||
companyName,
|
||||
companyAddress,
|
||||
companyLogoUri,
|
||||
companyLogoKey,
|
||||
primaryColor,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user