taxtank-core 0.30.48 → 0.30.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8505,17 +8505,6 @@ class Holding extends AbstractModel {
|
|
|
8505
8505
|
const yearTime = 1000 * 60 * 60 * 24 * 365;
|
|
8506
8506
|
return (new FinancialYear().startDate.getTime() - this.date.getTime()) > yearTime;
|
|
8507
8507
|
}
|
|
8508
|
-
/**
|
|
8509
|
-
* in holding we are interested in 3 main categories: stock/crypto/other
|
|
8510
|
-
*/
|
|
8511
|
-
get category() {
|
|
8512
|
-
if (this.type) {
|
|
8513
|
-
return this.type.isOther() ? null : this.type.category;
|
|
8514
|
-
}
|
|
8515
|
-
else {
|
|
8516
|
-
return HoldingTypeCategoryEnum.STOCK;
|
|
8517
|
-
}
|
|
8518
|
-
}
|
|
8519
8508
|
isSold() {
|
|
8520
8509
|
return this.currentQuantity === 0;
|
|
8521
8510
|
}
|
|
@@ -8536,6 +8525,24 @@ __decorate([
|
|
|
8536
8525
|
Type(() => HoldingSale),
|
|
8537
8526
|
Transform(({ value }) => new Collection(value))
|
|
8538
8527
|
], Holding.prototype, "sales", void 0);
|
|
8528
|
+
__decorate([
|
|
8529
|
+
Transform(({ obj }) => {
|
|
8530
|
+
const type = plainToClass(HoldingType, obj.type);
|
|
8531
|
+
if (type) {
|
|
8532
|
+
return type.isOther() ? null : type.category;
|
|
8533
|
+
}
|
|
8534
|
+
if (obj.category) {
|
|
8535
|
+
return [
|
|
8536
|
+
HoldingTypeCategoryEnum.COLLECTIBLE,
|
|
8537
|
+
HoldingTypeCategoryEnum.UNLISTED_STOCK,
|
|
8538
|
+
HoldingTypeCategoryEnum.UNLISTED_UNIT,
|
|
8539
|
+
HoldingTypeCategoryEnum.OTHER
|
|
8540
|
+
].includes(obj.category) ? null : obj.category;
|
|
8541
|
+
}
|
|
8542
|
+
return HoldingTypeCategoryEnum.STOCK;
|
|
8543
|
+
}, { toClassOnly: true }),
|
|
8544
|
+
Expose({ toClassOnly: true })
|
|
8545
|
+
], Holding.prototype, "category", void 0);
|
|
8539
8546
|
|
|
8540
8547
|
class AnnualClientDetails extends AbstractModel {
|
|
8541
8548
|
constructor() {
|