@thisisagile/easy 8.10.1 → 8.11.0
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.
- package/dist/domain/enums/UnitOfMeasurement.d.ts +10 -0
- package/dist/domain/enums/UnitOfMeasurement.js +17 -0
- package/dist/domain/enums/UnitOfMeasurement.js.map +1 -0
- package/dist/domain/enums/index.d.ts +1 -0
- package/dist/domain/enums/index.js +1 -0
- package/dist/domain/enums/index.js.map +1 -1
- package/dist/domain/structs/Dimension.d.ts +10 -0
- package/dist/domain/structs/Dimension.js +40 -0
- package/dist/domain/structs/Dimension.js.map +1 -0
- package/dist/domain/structs/index.d.ts +1 -0
- package/dist/domain/structs/index.js +1 -0
- package/dist/domain/structs/index.js.map +1 -1
- package/package.json +2 -2
- package/src/domain/enums/UnitOfMeasurement.ts +14 -0
- package/src/domain/enums/index.ts +1 -0
- package/src/domain/structs/Dimension.ts +13 -0
- package/src/domain/structs/index.ts +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Enum } from '../../types';
|
|
2
|
+
export declare class UnitOfMeasurement extends Enum {
|
|
3
|
+
readonly mmMultiplier: number;
|
|
4
|
+
static readonly MM: UnitOfMeasurement;
|
|
5
|
+
static readonly CM: UnitOfMeasurement;
|
|
6
|
+
static readonly DM: UnitOfMeasurement;
|
|
7
|
+
static readonly M: UnitOfMeasurement;
|
|
8
|
+
static readonly KM: UnitOfMeasurement;
|
|
9
|
+
constructor(name: string, id: string, mmMultiplier: number);
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnitOfMeasurement = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
class UnitOfMeasurement extends types_1.Enum {
|
|
6
|
+
constructor(name, id, mmMultiplier) {
|
|
7
|
+
super(name, id);
|
|
8
|
+
this.mmMultiplier = mmMultiplier;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.UnitOfMeasurement = UnitOfMeasurement;
|
|
12
|
+
UnitOfMeasurement.MM = new UnitOfMeasurement('Millimeter', 'mm', 1);
|
|
13
|
+
UnitOfMeasurement.CM = new UnitOfMeasurement('Centimeter', 'cm', 10);
|
|
14
|
+
UnitOfMeasurement.DM = new UnitOfMeasurement('Centimeter', 'cm', 100);
|
|
15
|
+
UnitOfMeasurement.M = new UnitOfMeasurement('Meter', 'm', 1000);
|
|
16
|
+
UnitOfMeasurement.KM = new UnitOfMeasurement('Kilometer', 'km', 1000000);
|
|
17
|
+
//# sourceMappingURL=UnitOfMeasurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitOfMeasurement.js","sourceRoot":"","sources":["../../../src/domain/enums/UnitOfMeasurement.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAEnC,MAAa,iBAAkB,SAAQ,YAAI;IAOzC,YAAY,IAAY,EAAE,EAAU,EAAW,YAAoB;QACjE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAD6B,iBAAY,GAAZ,YAAY,CAAQ;IAEnE,CAAC;;AATH,8CAWC;AAViB,oBAAE,GAAG,IAAI,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAClD,oBAAE,GAAG,IAAI,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACnD,oBAAE,GAAG,IAAI,iBAAiB,CAAC,YAAY,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;AACpD,mBAAC,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAC9C,oBAAE,GAAG,IAAI,iBAAiB,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -14,4 +14,5 @@ __exportStar(require("./Country"), exports);
|
|
|
14
14
|
__exportStar(require("./Currency"), exports);
|
|
15
15
|
__exportStar(require("./Environment"), exports);
|
|
16
16
|
__exportStar(require("./Locale"), exports);
|
|
17
|
+
__exportStar(require("./UnitOfMeasurement"), exports);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B;AAC3B,gDAA8B;AAC9B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B;AAC3B,gDAA8B;AAC9B,2CAAyB;AACzB,sDAAoC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Struct } from '../Struct';
|
|
2
|
+
import { UnitOfMeasurement } from '../enums';
|
|
3
|
+
export declare class Dimension extends Struct {
|
|
4
|
+
readonly length: number;
|
|
5
|
+
readonly lengthUOM: UnitOfMeasurement;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly widthUOM: UnitOfMeasurement;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
readonly heightUOM: UnitOfMeasurement;
|
|
10
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Dimension = void 0;
|
|
13
|
+
const Struct_1 = require("../Struct");
|
|
14
|
+
const validation_1 = require("../../validation");
|
|
15
|
+
const enums_1 = require("../enums");
|
|
16
|
+
class Dimension extends Struct_1.Struct {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.length = this.state.length;
|
|
20
|
+
this.lengthUOM = enums_1.UnitOfMeasurement.byId(this.state.lengthUOM, enums_1.UnitOfMeasurement.MM);
|
|
21
|
+
this.width = this.state.width;
|
|
22
|
+
this.widthUOM = enums_1.UnitOfMeasurement.byId(this.state.widthUOM, enums_1.UnitOfMeasurement.MM);
|
|
23
|
+
this.height = this.state.height;
|
|
24
|
+
this.heightUOM = enums_1.UnitOfMeasurement.byId(this.state.heightUOM, enums_1.UnitOfMeasurement.MM);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, validation_1.required)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], Dimension.prototype, "length", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, validation_1.required)(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], Dimension.prototype, "width", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, validation_1.required)(),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], Dimension.prototype, "height", void 0);
|
|
39
|
+
exports.Dimension = Dimension;
|
|
40
|
+
//# sourceMappingURL=Dimension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dimension.js","sourceRoot":"","sources":["../../../src/domain/structs/Dimension.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAmC;AACnC,iDAA4C;AAC5C,oCAA6C;AAE7C,MAAa,SAAU,SAAQ,eAAM;IAArC;;QACuB,WAAM,GAAW,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC/C,cAAS,GAAsB,yBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,yBAAiB,CAAC,EAAE,CAAC,CAAC;QACtF,UAAK,GAAW,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAC7C,aAAQ,GAAsB,yBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,yBAAiB,CAAC,EAAE,CAAC,CAAC;QACpF,WAAM,GAAW,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC/C,cAAS,GAAsB,yBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,yBAAiB,CAAC,EAAE,CAAC,CAAC;IAE7G,CAAC;CAAA;AAPa;IAAX,IAAA,qBAAQ,GAAE;;yCAA6C;AAE5C;IAAX,IAAA,qBAAQ,GAAE;;wCAA2C;AAE1C;IAAX,IAAA,qBAAQ,GAAE;;yCAA6C;AAL1D,8BAQC"}
|
|
@@ -11,5 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Address"), exports);
|
|
14
|
+
__exportStar(require("./Dimension"), exports);
|
|
14
15
|
__exportStar(require("./Money"), exports);
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/structs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/structs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,0CAAwB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@thisisagile/easy-test": "8.
|
|
34
|
+
"@thisisagile/easy-test": "8.11.0",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.6",
|
|
37
37
|
"@types/validator": "^13.7.0"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Enum } from '../../types';
|
|
2
|
+
|
|
3
|
+
export class UnitOfMeasurement extends Enum {
|
|
4
|
+
static readonly MM = new UnitOfMeasurement('Millimeter', 'mm', 1);
|
|
5
|
+
static readonly CM = new UnitOfMeasurement('Centimeter', 'cm', 10);
|
|
6
|
+
static readonly DM = new UnitOfMeasurement('Centimeter', 'cm', 100);
|
|
7
|
+
static readonly M = new UnitOfMeasurement('Meter', 'm', 1000);
|
|
8
|
+
static readonly KM = new UnitOfMeasurement('Kilometer', 'km', 1000000);
|
|
9
|
+
|
|
10
|
+
constructor(name: string, id: string, readonly mmMultiplier: number) {
|
|
11
|
+
super(name, id);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Struct } from '../Struct';
|
|
2
|
+
import { required } from '../../validation';
|
|
3
|
+
import { UnitOfMeasurement } from '../enums';
|
|
4
|
+
|
|
5
|
+
export class Dimension extends Struct {
|
|
6
|
+
@required() readonly length: number = this.state.length;
|
|
7
|
+
readonly lengthUOM: UnitOfMeasurement = UnitOfMeasurement.byId(this.state.lengthUOM, UnitOfMeasurement.MM);
|
|
8
|
+
@required() readonly width: number = this.state.width;
|
|
9
|
+
readonly widthUOM: UnitOfMeasurement = UnitOfMeasurement.byId(this.state.widthUOM, UnitOfMeasurement.MM);
|
|
10
|
+
@required() readonly height: number = this.state.height;
|
|
11
|
+
readonly heightUOM: UnitOfMeasurement = UnitOfMeasurement.byId(this.state.heightUOM, UnitOfMeasurement.MM);
|
|
12
|
+
|
|
13
|
+
}
|