Skip to content

Commit bd58396

Browse files
pelleclaude
andcommitted
Use descriptive names for enum properties in UnitCode, TaxCategoryCode and TaxSchemeCode
Changes enum property names to be more explanatory while preserving underlying code values: - TaxSchemeCode.AAA → TaxSchemeCode.ProfitTax (still equals "AAA") - UnitCode.KGM → UnitCode.Kilogram (still equals "KGM") - TaxCategoryCode.S → TaxCategoryCode.StandardRate (still equals "S") Also updates documentation examples to use new descriptive names. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 252c6ea commit bd58396

1 file changed

Lines changed: 77 additions & 77 deletions

File tree

packages/typescript/src/invoice.ts

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,46 @@ import { IsoCurrency } from "./currencies";
1111
*/
1212
export enum UnitCode {
1313
// Mass
14-
KGM = "KGM", // Kilogram
15-
GRM = "GRM", // Gram
16-
MGM = "MGM", // Milligram
17-
TNE = "TNE", // Tonne (metric ton)
14+
Kilogram = "KGM",
15+
Gram = "GRM",
16+
Milligram = "MGM",
17+
Tonne = "TNE",
1818

1919
// Volume
20-
LTR = "LTR", // Liter
21-
MLT = "MLT", // Milliliter
22-
MMQ = "MMQ", // Cubic millimeter
23-
CMQ = "CMQ", // Cubic centimeter
24-
DMQ = "DMQ", // Cubic decimeter
25-
MTQ = "MTQ", // Cubic meter
20+
Liter = "LTR",
21+
Milliliter = "MLT",
22+
CubicMillimeter = "MMQ",
23+
CubicCentimeter = "CMQ",
24+
CubicDecimeter = "DMQ",
25+
CubicMeter = "MTQ",
2626

2727
// Length
28-
MMT = "MMT", // Millimeter
29-
CMT = "CMT", // Centimeter
30-
DMT = "DMT", // Decimeter
31-
MTR = "MTR", // Meter
32-
KMT = "KMT", // Kilometer
28+
Millimeter = "MMT",
29+
Centimeter = "CMT",
30+
Decimeter = "DMT",
31+
Meter = "MTR",
32+
Kilometer = "KMT",
3333

3434
// Area
35-
MTK = "MTK", // Square meter
35+
SquareMeter = "MTK",
3636

3737
// Count
38-
EA = "EA", // Each
39-
PCE = "PCE", // Piece
40-
NPR = "NPR", // Number of pairs
38+
Each = "EA",
39+
Piece = "PCE",
40+
NumberOfPairs = "NPR",
4141

4242
// Time
43-
SEC = "SEC", // Second
44-
MIN = "MIN", // Minute
45-
HUR = "HUR", // Hour
46-
DAY = "DAY", // Day
47-
WEE = "WEE", // Week
48-
MON = "MON", // Month
49-
ANN = "ANN", // Year
43+
Second = "SEC",
44+
Minute = "MIN",
45+
Hour = "HUR",
46+
Day = "DAY",
47+
Week = "WEE",
48+
Month = "MON",
49+
Year = "ANN",
5050

5151
// Other
52-
KWH = "KWH", // Kilowatt hour
53-
NAR = "NAR", // Number of articles
52+
KilowattHour = "KWH",
53+
NumberOfArticles = "NAR",
5454
}
5555

5656
/**
@@ -61,24 +61,24 @@ export enum UnitCode {
6161
* @see {@link https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/ | PEPPOL BIS 3.0 Tax Category Codes}
6262
*/
6363
export enum TaxCategoryCode {
64-
S = "S", // Standard rate
65-
Z = "Z", // Zero rated goods
66-
E = "E", // Exempt from tax
67-
AE = "AE", // VAT Reverse Charge
68-
G = "G", // Free export item, tax not charged
69-
O = "O", // Services outside scope of tax
70-
K = "K", // VAT exempt for EEA intra-community supply
71-
L = "L", // Canary Islands general indirect tax
72-
M = "M", // Tax for production, services and importation in Ceuta and Melilla
73-
H = "H", // Higher rate
74-
AA = "AA", // Lower rate
75-
B = "B", // Transferred (VAT)
76-
A = "A", // Mixed tax rate
77-
AB = "AB", // Exempt for resale
78-
AC = "AC", // VAT Reverse Charge (alternative to AE)
79-
AD = "AD", // VAT exempt for EEA intra-community supply (alternative to K)
80-
C = "C", // Exempt from tax (deprecated, use E instead)
81-
D = "D", // Exempt based on article 309
64+
StandardRate = "S",
65+
ZeroRated = "Z",
66+
ExemptFromTax = "E",
67+
VATReverseCharge = "AE",
68+
FreeExportItem = "G",
69+
OutsideScopeOfTax = "O",
70+
VATExemptIntraCommunity = "K",
71+
CanaryIslandsIndirectTax = "L",
72+
CeutaMelillaTax = "M",
73+
HigherRate = "H",
74+
LowerRate = "AA",
75+
TransferredVAT = "B",
76+
MixedTaxRate = "A",
77+
ExemptForResale = "AB",
78+
VATReverseChargeAlt = "AC",
79+
VATExemptIntraCommunityAlt = "AD",
80+
ExemptFromTaxDeprecated = "C",
81+
ExemptArticle309 = "D",
8282
}
8383

8484
/**
@@ -88,28 +88,28 @@ export enum TaxCategoryCode {
8888
* @see {@link http://docs.oasis-open.org/ubl/os-UBL-2.1/cl/gc/default/TaxScheme-2.1.gc | UBL Tax Scheme Codes}
8989
*/
9090
export enum TaxSchemeCode {
91-
AAA = "AAA", // Profit tax
92-
AAB = "AAB", // Corporate income tax
93-
AAC = "AAC", // Personal income tax
94-
AAD = "AAD", // Social security tax
95-
AAE = "AAE", // Property tax
96-
AAF = "AAF", // Inheritance tax
97-
AAG = "AAG", // Gift tax
98-
AAH = "AAH", // Capital gains tax
99-
AAI = "AAI", // Wealth tax
100-
AAJ = "AAJ", // Stamp duty
101-
CST = "CST", // Consumption tax
102-
CUS = "CUS", // Customs duty
103-
ENV = "ENV", // Environmental tax
104-
EXC = "EXC", // Excise tax
105-
EXP = "EXP", // Export tax
106-
FRT = "FRT", // Freight tax
107-
GST = "GST", // Goods and Services Tax
108-
IMP = "IMP", // Import tax
109-
OTH = "OTH", // Other tax
110-
SAL = "SAL", // Sales tax
111-
TOT = "TOT", // Turnover tax
112-
VAT = "VAT", // Value Added Tax
91+
ProfitTax = "AAA",
92+
CorporateIncomeTax = "AAB",
93+
PersonalIncomeTax = "AAC",
94+
SocialSecurityTax = "AAD",
95+
PropertyTax = "AAE",
96+
InheritanceTax = "AAF",
97+
GiftTax = "AAG",
98+
CapitalGainsTax = "AAH",
99+
WealthTax = "AAI",
100+
StampDuty = "AAJ",
101+
ConsumptionTax = "CST",
102+
CustomsDuty = "CUS",
103+
EnvironmentalTax = "ENV",
104+
ExciseTax = "EXC",
105+
ExportTax = "EXP",
106+
FreightTax = "FRT",
107+
GoodsAndServicesTax = "GST",
108+
ImportTax = "IMP",
109+
OtherTax = "OTH",
110+
SalesTax = "SAL",
111+
TurnoverTax = "TOT",
112+
ValueAddedTax = "VAT",
113113
}
114114

115115
/**
@@ -161,9 +161,9 @@ export interface TaxCategory {
161161
* Tax category identifier
162162
* Uses UBL Tax Category Code standard
163163
*
164-
* @example "S" // Standard rate
165-
* @example "Z" // Zero rated goods
166-
* @example "E" // Exempt from tax
164+
* @example TaxCategoryCode.StandardRate
165+
* @example TaxCategoryCode.ZeroRated
166+
* @example TaxCategoryCode.ExemptFromTax
167167
*/
168168
id: TaxCategoryCode;
169169

@@ -179,9 +179,9 @@ export interface TaxCategory {
179179
* Tax scheme identifier
180180
* Uses UBL Tax Scheme Code standard
181181
*
182-
* @example "VAT" // Value Added Tax
183-
* @example "GST" // Goods and Services Tax
184-
* @example "SAL" // Sales Tax
182+
* @example TaxSchemeCode.ValueAddedTax
183+
* @example TaxSchemeCode.GoodsAndServicesTax
184+
* @example TaxSchemeCode.SalesTax
185185
*/
186186
taxScheme: TaxSchemeCode | string;
187187
}
@@ -235,9 +235,9 @@ export interface LineItem {
235235
* Unit of measure code
236236
* Uses UBL Unit of Measure Code standard
237237
*
238-
* @example "EA" // Each
239-
* @example "KGM" // Kilogram
240-
* @example "HUR" // Hour
238+
* @example UnitCode.Each
239+
* @example UnitCode.Kilogram
240+
* @example UnitCode.Hour
241241
*/
242242
unitCode?: UnitCode;
243243

0 commit comments

Comments
 (0)