UNPKG

@etsoo/appscript

Version:

Applications shared TypeScript framework

62 lines (61 loc) 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BusinessTax = void 0; /** * Business tax * https://imask.js.org/ */ class BusinessTax { /** * Get country or region by id * @param id Country id */ static getById(id) { return BusinessTax.all.find((c) => c.id === id); } // Typescript constructor shorthand constructor(id, name, mask) { this.id = id; this.name = name; this.mask = mask; } /** * Get label key */ get labelKey() { return "tax" + this.id + this.name; } } exports.BusinessTax = BusinessTax; /** * CN * Unified Social Credit Code (USCC) / 统一信用代码 * https://zh.wikisource.org/wiki/GB_32100-2015_%E6%B3%95%E4%BA%BA%E5%92%8C%E5%85%B6%E4%BB%96%E7%BB%84%E7%BB%87%E7%BB%9F%E4%B8%80%E7%A4%BE%E4%BC%9A%E4%BF%A1%E7%94%A8%E4%BB%A3%E7%A0%81%E7%BC%96%E7%A0%81%E8%A7%84%E5%88%99 */ BusinessTax.CN = new BusinessTax("CN", "USCC", "*0-000000-**********"); /** * NZ, Inland Revenue (IRD) */ BusinessTax.NZ = new BusinessTax("NZ", "IRD", "00[0]-000-000"); /** * US, Employer Identification Number (EIN) */ BusinessTax.US = new BusinessTax("US", "EIN", "00-0000000"); /** * CA, tax ID number (Business Number, BN) */ BusinessTax.CA = new BusinessTax("CA", "BN", "000000000"); /** * HK, Business Registration Number (BRN) */ BusinessTax.HK = new BusinessTax("HK", "BRN", "00000000"); /** * All countries and regions */ BusinessTax.all = [ BusinessTax.CN, BusinessTax.NZ, BusinessTax.US, BusinessTax.CA, BusinessTax.HK ];