@wisemen/address 0.2.9 → 0.3.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/.env.test +1 -1
- package/.turbo/turbo-build.log +8 -9
- package/CHANGELOG.md +6 -0
- package/dist/address-command.builder.d.ts +1 -0
- package/dist/address-command.builder.js +5 -0
- package/dist/address-command.builder.js.map +1 -1
- package/dist/address-command.d.ts +1 -0
- package/dist/address-command.js +10 -1
- package/dist/address-command.js.map +1 -1
- package/dist/address-response.d.ts +1 -0
- package/dist/address-response.js +6 -0
- package/dist/address-response.js.map +1 -1
- package/dist/address.builder.d.ts +1 -0
- package/dist/address.builder.js +5 -0
- package/dist/address.builder.js.map +1 -1
- package/dist/address.d.ts +1 -0
- package/dist/address.js +1 -0
- package/dist/address.js.map +1 -1
- package/dist/is-address.validator.d.ts +1 -0
- package/dist/is-address.validator.js +2 -0
- package/dist/is-address.validator.js.map +1 -1
- package/dist/tests/address-column.integration.test.js +7 -7
- package/dist/tests/address-column.integration.test.js.map +1 -1
- package/dist/tests/is-address.validator.unit.test.js +7 -0
- package/dist/tests/is-address.validator.unit.test.js.map +1 -1
- package/dist/tests/sql/datasource.js +1 -1
- package/dist/tests/sql/datasource.js.map +1 -1
- package/lib/address-command.builder.ts +7 -0
- package/lib/address-command.ts +8 -1
- package/lib/address-response.ts +4 -0
- package/lib/address.builder.ts +7 -0
- package/lib/address.ts +1 -0
- package/lib/is-address.validator.ts +4 -0
- package/lib/tests/address-column.integration.test.ts +7 -7
- package/lib/tests/is-address.validator.unit.test.ts +7 -0
- package/lib/tests/sql/datasource.ts +1 -1
- package/package.json +3 -2
- package/.eslintcache +0 -1
- package/.turbo/turbo-lint.log +0 -5
package/.env.test
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
DATABASE_URI='postgresql://postgres:password@localhost:5432/test_db'
|
|
1
|
+
DATABASE_URI='postgresql://postgres:password@localhost:5432/test_db'
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
|
|
2
|
+
> @wisemen/address@0.3.0 prebuild /home/runner/work/wisemen-core/wisemen-core/packages/address
|
|
3
|
+
> rm -rf ./dist
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @wisemen/address@0.3.0 build /home/runner/work/wisemen-core/wisemen-core/packages/address
|
|
7
|
+
> tsc
|
|
8
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,7 @@ export declare class AddressCommandBuilder {
|
|
|
6
6
|
withPlaceId(placeId: string | null): this;
|
|
7
7
|
withPlaceName(placeName: string | null): this;
|
|
8
8
|
withCountry(country: string | null): this;
|
|
9
|
+
withCountryCode(countryCode: string | null): this;
|
|
9
10
|
withCity(city: string | null): this;
|
|
10
11
|
withPostalCode(postalCode: string | null): this;
|
|
11
12
|
withStreetName(streetName: string | null): this;
|
|
@@ -6,6 +6,7 @@ export class AddressCommandBuilder {
|
|
|
6
6
|
this.command.placeId = null;
|
|
7
7
|
this.command.placeName = null;
|
|
8
8
|
this.command.country = null;
|
|
9
|
+
this.command.countryCode = null;
|
|
9
10
|
this.command.city = null;
|
|
10
11
|
this.command.postalCode = null;
|
|
11
12
|
this.command.streetName = null;
|
|
@@ -25,6 +26,10 @@ export class AddressCommandBuilder {
|
|
|
25
26
|
this.command.country = country;
|
|
26
27
|
return this;
|
|
27
28
|
}
|
|
29
|
+
withCountryCode(countryCode) {
|
|
30
|
+
this.command.countryCode = countryCode;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
28
33
|
withCity(city) {
|
|
29
34
|
this.command.city = city;
|
|
30
35
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-command.builder.js","sourceRoot":"","sources":["../lib/address-command.builder.ts"],"names":[],"mappings":"AAC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AC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
|
package/dist/address-command.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsNotEmpty, IsObject, IsString, ValidateNested } from 'class-validator';
|
|
10
|
+
import { IsISO31661Alpha2, IsNotEmpty, IsObject, IsString, ValidateNested } from 'class-validator';
|
|
11
11
|
import { ApiProperty } from '@nestjs/swagger';
|
|
12
12
|
import { Type } from 'class-transformer';
|
|
13
13
|
import { IsNullable } from '@wisemen/validators';
|
|
@@ -17,6 +17,7 @@ export class AddressCommand {
|
|
|
17
17
|
placeName;
|
|
18
18
|
placeId;
|
|
19
19
|
country;
|
|
20
|
+
countryCode;
|
|
20
21
|
city;
|
|
21
22
|
postalCode;
|
|
22
23
|
streetName;
|
|
@@ -28,6 +29,7 @@ export class AddressCommand {
|
|
|
28
29
|
.withPlaceId(this.placeId)
|
|
29
30
|
.withPlaceName(this.placeName)
|
|
30
31
|
.withCountry(this.country)
|
|
32
|
+
.withCountryCode(this.countryCode)
|
|
31
33
|
.withCity(this.city)
|
|
32
34
|
.withPostalCode(this.postalCode)
|
|
33
35
|
.withStreetName(this.streetName)
|
|
@@ -58,6 +60,13 @@ __decorate([
|
|
|
58
60
|
IsNotEmpty(),
|
|
59
61
|
__metadata("design:type", Object)
|
|
60
62
|
], AddressCommand.prototype, "country", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
ApiProperty({ type: 'string', nullable: true, example: 'US', description: 'The ISO 3166-1 alpha-2 country code' }),
|
|
65
|
+
IsNullable(),
|
|
66
|
+
IsISO31661Alpha2(),
|
|
67
|
+
IsNotEmpty(),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], AddressCommand.prototype, "countryCode", void 0);
|
|
61
70
|
__decorate([
|
|
62
71
|
ApiProperty({ type: 'string', nullable: true }),
|
|
63
72
|
IsNullable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-command.js","sourceRoot":"","sources":["../lib/address-command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"address-command.js","sourceRoot":"","sources":["../lib/address-command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD,MAAM,OAAO,cAAc;IAKzB,SAAS,CAAe;IAMxB,OAAO,CAAe;IAMtB,OAAO,CAAe;IAMtB,WAAW,CAAe;IAM1B,IAAI,CAAe;IAMnB,UAAU,CAAe;IAMzB,UAAU,CAAe;IAMzB,YAAY,CAAe;IAM3B,IAAI,CAAe;IAOnB,WAAW,CAA2B;IAEtC,KAAK;QACH,OAAO,IAAI,cAAc,EAAE;aACxB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;aACzB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC;aAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;aACzB,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;aACjC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;aACnB,cA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,EAAE;IACZ,QAAQ,EAAE;IACV,UAAU,EAAE;;kDACY;AAMzB;IAJC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,UAAU,EAAE;IACZ,QAAQ,EAAE;IACV,UAAU,EAAE;;kDACY;AAMzB;IAJC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,UAAU,EAAE;IACZ,QAAQ,EAAE;IACV,UAAU,EAAE;;oDACc;AAM3B;IAJC,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,UAAU,EAAE;IACZ,QAAQ,EAAE;IACV,UAAU,EAAE;;4CACM;AAOnB;IALC,WAAW,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzD,UAAU,EAAE;IACZ,QAAQ,EAAE;IACV,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;IAC9B,cAAc,EAAE;;mDACqB"}
|
package/dist/address-response.js
CHANGED
|
@@ -13,6 +13,7 @@ export class AddressResponse {
|
|
|
13
13
|
placeName;
|
|
14
14
|
placeId;
|
|
15
15
|
country;
|
|
16
|
+
countryCode;
|
|
16
17
|
city;
|
|
17
18
|
postalCode;
|
|
18
19
|
streetName;
|
|
@@ -23,6 +24,7 @@ export class AddressResponse {
|
|
|
23
24
|
this.placeName = address.placeName ?? null;
|
|
24
25
|
this.placeId = address.placeId ?? null;
|
|
25
26
|
this.country = address.country ?? null;
|
|
27
|
+
this.countryCode = address.countryCode ?? null;
|
|
26
28
|
this.city = address.city ?? null;
|
|
27
29
|
this.postalCode = address.postalCode ?? null;
|
|
28
30
|
this.streetName = address.streetName ?? null;
|
|
@@ -45,6 +47,10 @@ __decorate([
|
|
|
45
47
|
ApiProperty({ type: 'string', nullable: true }),
|
|
46
48
|
__metadata("design:type", Object)
|
|
47
49
|
], AddressResponse.prototype, "country", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
ApiProperty({ type: 'string', nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], AddressResponse.prototype, "countryCode", void 0);
|
|
48
54
|
__decorate([
|
|
49
55
|
ApiProperty({ type: 'string', nullable: true }),
|
|
50
56
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-response.js","sourceRoot":"","sources":["../lib/address-response.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG1D,MAAM,OAAO,eAAe;IAE1B,SAAS,CAAe;IAGxB,OAAO,CAAe;IAGtB,OAAO,CAAe;IAGtB,IAAI,CAAe;IAGnB,UAAU,CAAe;IAGzB,UAAU,CAAe;IAGzB,YAAY,CAAe;IAG3B,IAAI,CAAe;IAGnB,WAAW,CAA4B;IAEvC,YAAa,OAAgB;QAC3B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAA;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAA;QACtC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAA;QAChC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,CAAA;QAC5C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,CAAA;QAC5C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,CAAA;QAChD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAA;QA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;
|
|
9
|
+
withCountryCode(countryCode?: string | null): this;
|
|
9
10
|
withCity(city?: string | null): this;
|
|
10
11
|
withPostalCode(zipCode?: string | null): this;
|
|
11
12
|
withStreetName(streetName?: string | null): this;
|
package/dist/address.builder.js
CHANGED
|
@@ -6,6 +6,7 @@ export class AddressBuilder {
|
|
|
6
6
|
this.address.placeId = null;
|
|
7
7
|
this.address.placeName = null;
|
|
8
8
|
this.address.country = null;
|
|
9
|
+
this.address.countryCode = null;
|
|
9
10
|
this.address.city = null;
|
|
10
11
|
this.address.postalCode = null;
|
|
11
12
|
this.address.streetName = null;
|
|
@@ -25,6 +26,10 @@ export class AddressBuilder {
|
|
|
25
26
|
this.address.country = country ?? null;
|
|
26
27
|
return this;
|
|
27
28
|
}
|
|
29
|
+
withCountryCode(countryCode) {
|
|
30
|
+
this.address.countryCode = countryCode ?? null;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
28
33
|
withCity(city) {
|
|
29
34
|
this.address.city = city ?? null;
|
|
30
35
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.builder.js","sourceRoot":"","sources":["../lib/address.builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,OAAO,cAAc;IACR,OAAO,CAAS;IAEjC;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;QAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAA;QAC7B,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAA;QAC9B,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAA;QAC9B,IAAI,CAAC,O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AO,GAAG,OAAO,IAAI,IAAI,CAAA;QAEtC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe,CAAE,WAA2B;QAC1C,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,CAAA;QAE9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ,CAAE,IAAoB;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAA;QAEhC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,cAAc,CAAE,OAAuB;QACrC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,OAAO,IAAI,IAAI,CAAA;QAEzC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,cAAc,CAAE,UAA0B;QACxC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,IAAI,IAAI,CAAA;QAE5C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,gBAAgB,CAAE,YAA4B;QAC5C,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAA;QAEhD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ,CAAE,IAAoB;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAA;QAEhC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe,CAAE,WAAgC;QAC/C,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,CAAA;QAE9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
|
package/dist/address.d.ts
CHANGED
package/dist/address.js
CHANGED
package/dist/address.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../lib/address.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAClB,SAAS,CAAgB;IACzB,OAAO,CAAgB;IACvB,OAAO,CAAgB;IACvB,IAAI,CAAgB;IACpB,UAAU,CAAgB;IAC1B,UAAU,CAAgB;IAC1B,YAAY,CAAgB;IAC5B,IAAI,CAAgB;IACpB,WAAW,CAAqB;CACjC"}
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../lib/address.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAClB,SAAS,CAAgB;IACzB,OAAO,CAAgB;IACvB,OAAO,CAAgB;IACvB,WAAW,CAAgB;IAC3B,IAAI,CAAgB;IACpB,UAAU,CAAgB;IAC1B,UAAU,CAAgB;IAC1B,YAAY,CAAgB;IAC5B,IAAI,CAAgB;IACpB,WAAW,CAAqB;CACjC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ValidationOptions } from 'class-validator';
|
|
2
2
|
export interface IsAddressValidationOptions extends ValidationOptions {
|
|
3
3
|
countryRequired?: boolean;
|
|
4
|
+
countryCodeRequired?: boolean;
|
|
4
5
|
cityRequired?: boolean;
|
|
5
6
|
postalCodeRequired?: boolean;
|
|
6
7
|
streetNameRequired?: boolean;
|
|
@@ -11,6 +11,7 @@ import { AddressCommand } from './address-command.js';
|
|
|
11
11
|
export function IsAddress(validationOptions) {
|
|
12
12
|
return applyDecorators(ValidateNested(validationOptions), Type(() => AddressCommand), IsObject(validationOptions), Validate(IsAddressValidator, [{
|
|
13
13
|
countryRequired: validationOptions?.countryRequired ?? false,
|
|
14
|
+
countryCodeRequired: validationOptions?.countryCodeRequired ?? false,
|
|
14
15
|
cityRequired: validationOptions?.cityRequired ?? false,
|
|
15
16
|
postalCodeRequired: validationOptions?.postalCodeRequired ?? false,
|
|
16
17
|
streetNameRequired: validationOptions?.streetNameRequired ?? false,
|
|
@@ -31,6 +32,7 @@ let IsAddressValidator = class IsAddressValidator {
|
|
|
31
32
|
}
|
|
32
33
|
isAddressValid(address, constraints) {
|
|
33
34
|
return (!constraints.countryRequired || address.country != null)
|
|
35
|
+
&& (!constraints.countryCodeRequired || address.countryCode != null)
|
|
34
36
|
&& (!constraints.cityRequired || address.city != null)
|
|
35
37
|
&& (!constraints.postalCodeRequired || address.postalCode != null)
|
|
36
38
|
&& (!constraints.streetNameRequired || address.streetName != null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-address.validator.js","sourceRoot":"","sources":["../lib/is-address.validator.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAwE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/J,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"is-address.validator.js","sourceRoot":"","sources":["../lib/is-address.validator.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAwE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/J,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAerD,MAAM,UAAU,SAAS,CACvB,iBAA8C;IAE9C,OAAO,eAAe,CACpB,cAAc,CAAC,iBAAiB,CAAC,EACjC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,EAC1B,QAAQ,CAAC,iBAAiB,CAAC,EAC3B,QAAQ,CACN,kBAAkB,EAClB,CAAC;YACC,eAAe,EAAE,iBAAiB,EAAE,eAAe,IAAI,KAAK;YAC5D,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,IAAI,KAAK;YACpE,YAAY,EAAE,iBAAiB,EAAE,YAAY,IAAI,KAAK;YACtD,kBAAkB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,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC;eACnE,CAAC,CAAC,WAAW,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC;eACnD,CAAC,CAAC,WAAW,CAAC,eAAe,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;eACzD,CAAC,CAAC,WAAW,CAAC,iBAAiB,IAAI,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,cAAc,CAAE,IAAyB;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAyB,CAAA;QAC/D,MAAM,kBAAkB,GAAa,EAAE,CAAA;QAEvC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC3C,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC9B,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,QAAQ,aAAa,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;IACrE,CAAC;CACF,CAAA;AAnCK,kBAAkB;IADvB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;GACnD,kBAAkB,CAmCvB"}
|
|
@@ -51,10 +51,10 @@ describe('AddressColumn', () => {
|
|
|
51
51
|
expect(test.address?.country).toBe('Belgium');
|
|
52
52
|
expect(test.address?.city).toBe('Antwerp');
|
|
53
53
|
expect(test.address?.postalCode).toBe('2000');
|
|
54
|
-
expect(test.address?.streetName).
|
|
55
|
-
expect(test.address?.streetNumber).
|
|
56
|
-
expect(test.address?.unit).
|
|
57
|
-
expect(test.address?.coordinates).
|
|
54
|
+
expect(test.address?.streetName).toBeNull();
|
|
55
|
+
expect(test.address?.streetNumber).toBeNull();
|
|
56
|
+
expect(test.address?.unit).toBeNull();
|
|
57
|
+
expect(test.address?.coordinates).toBeNull();
|
|
58
58
|
});
|
|
59
59
|
it('stores and retrieves an address with coordinates only', async () => {
|
|
60
60
|
const address = new AddressBuilder()
|
|
@@ -65,8 +65,8 @@ describe('AddressColumn', () => {
|
|
|
65
65
|
expect(test.address).not.toBeNull();
|
|
66
66
|
expect(test.address?.coordinates?.latitude).toBe(51.2194);
|
|
67
67
|
expect(test.address?.coordinates?.longitude).toBe(4.4025);
|
|
68
|
-
expect(test.address?.country).
|
|
69
|
-
expect(test.address?.city).
|
|
68
|
+
expect(test.address?.country).toBeNull();
|
|
69
|
+
expect(test.address?.city).toBeNull();
|
|
70
70
|
});
|
|
71
71
|
it('stores and retrieves a null address', async () => {
|
|
72
72
|
await dataSource.manager.upsert(AddressTest, { id: 4, address: null }, { conflictPaths: { id: true } });
|
|
@@ -84,7 +84,7 @@ describe('AddressColumn', () => {
|
|
|
84
84
|
expect(test.address).not.toBeNull();
|
|
85
85
|
expect(test.address?.country).toBe('Netherlands');
|
|
86
86
|
expect(test.address?.city).toBe('Amsterdam');
|
|
87
|
-
expect(test.address?.coordinates).
|
|
87
|
+
expect(test.address?.coordinates).toBeNull();
|
|
88
88
|
});
|
|
89
89
|
it('updates an existing address', async () => {
|
|
90
90
|
const initialAddress = new AddressBuilder()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-column.integration.test.js","sourceRoot":"","sources":["../../lib/tests/address-column.integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,O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IAAI,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;YAE7E,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;YACnC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC5C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACvC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -55,6 +55,7 @@ describe('IsAddress decorator test', () => {
|
|
|
55
55
|
const testInstance = new TestClass();
|
|
56
56
|
const addressCommand = new AddressCommand();
|
|
57
57
|
addressCommand.country = 'Belgium';
|
|
58
|
+
addressCommand.countryCode = 'BE';
|
|
58
59
|
addressCommand.city = 'Brussels';
|
|
59
60
|
addressCommand.postalCode = '1000';
|
|
60
61
|
addressCommand.streetName = 'Main Street';
|
|
@@ -71,6 +72,7 @@ describe('IsAddress decorator test', () => {
|
|
|
71
72
|
const testInstance = new TestClass();
|
|
72
73
|
const addressCommand = new AddressCommand();
|
|
73
74
|
addressCommand.country = 'Belgium';
|
|
75
|
+
addressCommand.countryCode = null;
|
|
74
76
|
addressCommand.city = null;
|
|
75
77
|
addressCommand.postalCode = null;
|
|
76
78
|
addressCommand.streetName = null;
|
|
@@ -107,6 +109,7 @@ describe('IsAddress decorator test', () => {
|
|
|
107
109
|
const testInstance = new TestClassWithRequiredFields();
|
|
108
110
|
const addressCommand = new AddressCommand();
|
|
109
111
|
addressCommand.country = 'Belgium';
|
|
112
|
+
addressCommand.countryCode = null;
|
|
110
113
|
addressCommand.city = 'Brussels';
|
|
111
114
|
addressCommand.postalCode = '1000';
|
|
112
115
|
addressCommand.streetName = 'Main Street';
|
|
@@ -147,6 +150,7 @@ describe('IsAddress decorator test', () => {
|
|
|
147
150
|
const testInstance = new TestClassWithPlaceIdRequired();
|
|
148
151
|
const addressCommand = new AddressCommand();
|
|
149
152
|
addressCommand.country = 'Belgium';
|
|
153
|
+
addressCommand.countryCode = 'BE';
|
|
150
154
|
addressCommand.city = 'Brussels';
|
|
151
155
|
addressCommand.postalCode = '1000';
|
|
152
156
|
addressCommand.streetName = 'Main Street';
|
|
@@ -164,6 +168,7 @@ describe('IsAddress decorator test', () => {
|
|
|
164
168
|
const testInstance = new TestClassWithPlaceIdRequired();
|
|
165
169
|
const addressCommand = new AddressCommand();
|
|
166
170
|
addressCommand.country = 'Belgium';
|
|
171
|
+
addressCommand.countryCode = 'BE';
|
|
167
172
|
addressCommand.city = 'Brussels';
|
|
168
173
|
addressCommand.postalCode = '1000';
|
|
169
174
|
addressCommand.streetName = 'Main Street';
|
|
@@ -180,6 +185,7 @@ describe('IsAddress decorator test', () => {
|
|
|
180
185
|
const testInstance = new TestClassWithPlaceNameRequired();
|
|
181
186
|
const addressCommand = new AddressCommand();
|
|
182
187
|
addressCommand.country = 'Belgium';
|
|
188
|
+
addressCommand.countryCode = 'BE';
|
|
183
189
|
addressCommand.city = 'Brussels';
|
|
184
190
|
addressCommand.postalCode = '1000';
|
|
185
191
|
addressCommand.streetName = 'Main Street';
|
|
@@ -197,6 +203,7 @@ describe('IsAddress decorator test', () => {
|
|
|
197
203
|
const testInstance = new TestClassWithPlaceNameRequired();
|
|
198
204
|
const addressCommand = new AddressCommand();
|
|
199
205
|
addressCommand.country = 'Belgium';
|
|
206
|
+
addressCommand.countryCode = 'BE';
|
|
200
207
|
addressCommand.city = 'Brussels';
|
|
201
208
|
addressCommand.postalCode = '1000';
|
|
202
209
|
addressCommand.streetName = 'Main Street';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-address.validator.unit.test.js","sourceRoot":"","sources":["../../lib/tests/is-address.validator.unit.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,MAAM,SAAS;IAEb,OAAO,CAAgB;CACxB;AADC;IADC,SAAS,EAAE;8BACH,cAAc;0CAAA;AAGzB,MAAM,2BAA2B;IAO/B,OAAO,CAAgB;CACxB;AADC;IANC,SAAS,CAAC;QACT,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,kBAAkB,EAAE,IAAI;QACxB,kBAAkB,EAAE,IAAI;KACzB,CAAC;8BACO,cAAc;4DAAA;AAGzB,MAAM,4BAA4B;IAIhC,OAAO,CAAgB;CACxB;AADC;IAHC,SAAS,CAAC;QACT,eAAe,EAAE,IAAI;KACtB,CAAC;8BACO,cAAc;6DAAA;AAGzB,MAAM,8BAA8B;IAIlC,OAAO,CAAgB;CACxB;AADC;IAHC,SAAS,CAAC;QACT,iBAAiB,EAAE,IAAI;KACxB,CAAC;8BACO,cAAc;+DAAA;AAGzB,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,YAAY,GAAG,IAAI,SAAS,EAAE,CAAA;QACpC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAA;QAE3C,cAAc,CAAC,OAAO,GAAG,SAAS,CAAA;QAClC,cAAc,CAAC,IAAI,GAAG,UAAU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,SAAS,GAAG,SAAS,CAAA;QACpC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAA;QAC7B,cAAc,CAAC,WAAW,GAAG,IAAI,CAAA;QAEjC,YAAY,CAAC,OAAO,GAAG,cAAc,CAAA;QAErC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAA;QAE3C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"is-address.validator.unit.test.js","sourceRoot":"","sources":["../../lib/tests/is-address.validator.unit.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,MAAM,SAAS;IAEb,OAAO,CAAgB;CACxB;AADC;IADC,SAAS,EAAE;8BACH,cAAc;0CAAA;AAGzB,MAAM,2BAA2B;IAO/B,OAAO,CAAgB;CACxB;AADC;IANC,SAAS,CAAC;QACT,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,kBAAkB,EAAE,IAAI;QACxB,kBAAkB,EAAE,IAAI;KACzB,CAAC;8BACO,cAAc;4DAAA;AAGzB,MAAM,4BAA4B;IAIhC,OAAO,CAAgB;CACxB;AADC;IAHC,SAAS,CAAC;QACT,eAAe,EAAE,IAAI;KACtB,CAAC;8BACO,cAAc;6DAAA;AAGzB,MAAM,8BAA8B;IAIlC,OAAO,CAAgB;CACxB;A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AI,EAAE,UAAU;IAChB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;IAC7B,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IAClB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../../../lib/tests/sql/datasource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;IACvC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;IAC7B,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IAClB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,KAAK;IAClB,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE;QACR,qBAAqB;KACtB;CACF,CAAC,CAAA"}
|
|
@@ -9,6 +9,7 @@ export class AddressCommandBuilder {
|
|
|
9
9
|
this.command.placeId = null
|
|
10
10
|
this.command.placeName = null
|
|
11
11
|
this.command.country = null
|
|
12
|
+
this.command.countryCode = null
|
|
12
13
|
this.command.city = null
|
|
13
14
|
this.command.postalCode = null
|
|
14
15
|
this.command.streetName = null
|
|
@@ -35,6 +36,12 @@ export class AddressCommandBuilder {
|
|
|
35
36
|
return this
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
withCountryCode (countryCode: string | null): this {
|
|
40
|
+
this.command.countryCode = countryCode
|
|
41
|
+
|
|
42
|
+
return this
|
|
43
|
+
}
|
|
44
|
+
|
|
38
45
|
withCity (city: string | null): this {
|
|
39
46
|
this.command.city = city
|
|
40
47
|
|
package/lib/address-command.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsNotEmpty, IsObject, IsString, ValidateNested } from 'class-validator'
|
|
1
|
+
import { IsISO31661Alpha2, IsNotEmpty, IsObject, IsString, ValidateNested } from 'class-validator'
|
|
2
2
|
import { ApiProperty } from '@nestjs/swagger'
|
|
3
3
|
import { Type } from 'class-transformer'
|
|
4
4
|
import { IsNullable } from '@wisemen/validators'
|
|
@@ -25,6 +25,12 @@ export class AddressCommand {
|
|
|
25
25
|
@IsNotEmpty()
|
|
26
26
|
country: string | null
|
|
27
27
|
|
|
28
|
+
@ApiProperty({ type: 'string', nullable: true, example: 'US', description: 'The ISO 3166-1 alpha-2 country code' })
|
|
29
|
+
@IsNullable()
|
|
30
|
+
@IsISO31661Alpha2()
|
|
31
|
+
@IsNotEmpty()
|
|
32
|
+
countryCode: string | null
|
|
33
|
+
|
|
28
34
|
@ApiProperty({ type: 'string', nullable: true })
|
|
29
35
|
@IsNullable()
|
|
30
36
|
@IsString()
|
|
@@ -67,6 +73,7 @@ export class AddressCommand {
|
|
|
67
73
|
.withPlaceId(this.placeId)
|
|
68
74
|
.withPlaceName(this.placeName)
|
|
69
75
|
.withCountry(this.country)
|
|
76
|
+
.withCountryCode(this.countryCode)
|
|
70
77
|
.withCity(this.city)
|
|
71
78
|
.withPostalCode(this.postalCode)
|
|
72
79
|
.withStreetName(this.streetName)
|
package/lib/address-response.ts
CHANGED
|
@@ -12,6 +12,9 @@ export class AddressResponse {
|
|
|
12
12
|
@ApiProperty({ type: 'string', nullable: true })
|
|
13
13
|
country: string | null
|
|
14
14
|
|
|
15
|
+
@ApiProperty({ type: 'string', nullable: true })
|
|
16
|
+
countryCode: string | null
|
|
17
|
+
|
|
15
18
|
@ApiProperty({ type: 'string', nullable: true })
|
|
16
19
|
city: string | null
|
|
17
20
|
|
|
@@ -34,6 +37,7 @@ export class AddressResponse {
|
|
|
34
37
|
this.placeName = address.placeName ?? null
|
|
35
38
|
this.placeId = address.placeId ?? null
|
|
36
39
|
this.country = address.country ?? null
|
|
40
|
+
this.countryCode = address.countryCode ?? null
|
|
37
41
|
this.city = address.city ?? null
|
|
38
42
|
this.postalCode = address.postalCode ?? null
|
|
39
43
|
this.streetName = address.streetName ?? null
|
package/lib/address.builder.ts
CHANGED
|
@@ -9,6 +9,7 @@ export class AddressBuilder {
|
|
|
9
9
|
this.address.placeId = null
|
|
10
10
|
this.address.placeName = null
|
|
11
11
|
this.address.country = null
|
|
12
|
+
this.address.countryCode = null
|
|
12
13
|
this.address.city = null
|
|
13
14
|
this.address.postalCode = null
|
|
14
15
|
this.address.streetName = null
|
|
@@ -35,6 +36,12 @@ export class AddressBuilder {
|
|
|
35
36
|
return this
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
withCountryCode (countryCode?: string | null): this {
|
|
40
|
+
this.address.countryCode = countryCode ?? null
|
|
41
|
+
|
|
42
|
+
return this
|
|
43
|
+
}
|
|
44
|
+
|
|
38
45
|
withCity (city?: string | null): this {
|
|
39
46
|
this.address.city = city ?? null
|
|
40
47
|
|
package/lib/address.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { AddressCommand } from './address-command.js'
|
|
|
5
5
|
|
|
6
6
|
export interface IsAddressValidationOptions extends ValidationOptions {
|
|
7
7
|
countryRequired?: boolean
|
|
8
|
+
countryCodeRequired?: boolean
|
|
8
9
|
cityRequired?: boolean
|
|
9
10
|
postalCodeRequired?: boolean
|
|
10
11
|
streetNameRequired?: boolean
|
|
@@ -26,6 +27,7 @@ export function IsAddress (
|
|
|
26
27
|
IsAddressValidator,
|
|
27
28
|
[{
|
|
28
29
|
countryRequired: validationOptions?.countryRequired ?? false,
|
|
30
|
+
countryCodeRequired: validationOptions?.countryCodeRequired ?? false,
|
|
29
31
|
cityRequired: validationOptions?.cityRequired ?? false,
|
|
30
32
|
postalCodeRequired: validationOptions?.postalCodeRequired ?? false,
|
|
31
33
|
streetNameRequired: validationOptions?.streetNameRequired ?? false,
|
|
@@ -42,6 +44,7 @@ export function IsAddress (
|
|
|
42
44
|
|
|
43
45
|
interface ValidatorConstraints {
|
|
44
46
|
countryRequired: boolean
|
|
47
|
+
countryCodeRequired: boolean
|
|
45
48
|
cityRequired: boolean
|
|
46
49
|
postalCodeRequired: boolean
|
|
47
50
|
streetNameRequired: boolean
|
|
@@ -66,6 +69,7 @@ class IsAddressValidator implements ValidatorConstraintInterface {
|
|
|
66
69
|
|
|
67
70
|
private isAddressValid (address: AddressCommand, constraints: ValidatorConstraints): boolean {
|
|
68
71
|
return (!constraints.countryRequired || address.country != null)
|
|
72
|
+
&& (!constraints.countryCodeRequired || address.countryCode != null)
|
|
69
73
|
&& (!constraints.cityRequired || address.city != null)
|
|
70
74
|
&& (!constraints.postalCodeRequired || address.postalCode != null)
|
|
71
75
|
&& (!constraints.streetNameRequired || address.streetName != null)
|
|
@@ -69,10 +69,10 @@ describe('AddressColumn', () => {
|
|
|
69
69
|
expect(test.address?.country).toBe('Belgium')
|
|
70
70
|
expect(test.address?.city).toBe('Antwerp')
|
|
71
71
|
expect(test.address?.postalCode).toBe('2000')
|
|
72
|
-
expect(test.address?.streetName).
|
|
73
|
-
expect(test.address?.streetNumber).
|
|
74
|
-
expect(test.address?.unit).
|
|
75
|
-
expect(test.address?.coordinates).
|
|
72
|
+
expect(test.address?.streetName).toBeNull()
|
|
73
|
+
expect(test.address?.streetNumber).toBeNull()
|
|
74
|
+
expect(test.address?.unit).toBeNull()
|
|
75
|
+
expect(test.address?.coordinates).toBeNull()
|
|
76
76
|
})
|
|
77
77
|
|
|
78
78
|
it('stores and retrieves an address with coordinates only', async () => {
|
|
@@ -91,8 +91,8 @@ describe('AddressColumn', () => {
|
|
|
91
91
|
expect(test.address).not.toBeNull()
|
|
92
92
|
expect(test.address?.coordinates?.latitude).toBe(51.2194)
|
|
93
93
|
expect(test.address?.coordinates?.longitude).toBe(4.4025)
|
|
94
|
-
expect(test.address?.country).
|
|
95
|
-
expect(test.address?.city).
|
|
94
|
+
expect(test.address?.country).toBeNull()
|
|
95
|
+
expect(test.address?.city).toBeNull()
|
|
96
96
|
})
|
|
97
97
|
|
|
98
98
|
it('stores and retrieves a null address', async () => {
|
|
@@ -125,7 +125,7 @@ describe('AddressColumn', () => {
|
|
|
125
125
|
expect(test.address).not.toBeNull()
|
|
126
126
|
expect(test.address?.country).toBe('Netherlands')
|
|
127
127
|
expect(test.address?.city).toBe('Amsterdam')
|
|
128
|
-
expect(test.address?.coordinates).
|
|
128
|
+
expect(test.address?.coordinates).toBeNull()
|
|
129
129
|
})
|
|
130
130
|
|
|
131
131
|
it('updates an existing address', async () => {
|
|
@@ -40,6 +40,7 @@ describe('IsAddress decorator test', () => {
|
|
|
40
40
|
const addressCommand = new AddressCommand()
|
|
41
41
|
|
|
42
42
|
addressCommand.country = 'Belgium'
|
|
43
|
+
addressCommand.countryCode = 'BE'
|
|
43
44
|
addressCommand.city = 'Brussels'
|
|
44
45
|
addressCommand.postalCode = '1000'
|
|
45
46
|
addressCommand.streetName = 'Main Street'
|
|
@@ -61,6 +62,7 @@ describe('IsAddress decorator test', () => {
|
|
|
61
62
|
const addressCommand = new AddressCommand()
|
|
62
63
|
|
|
63
64
|
addressCommand.country = 'Belgium'
|
|
65
|
+
addressCommand.countryCode = null
|
|
64
66
|
addressCommand.city = null
|
|
65
67
|
addressCommand.postalCode = null
|
|
66
68
|
addressCommand.streetName = null
|
|
@@ -107,6 +109,7 @@ describe('IsAddress decorator test', () => {
|
|
|
107
109
|
const addressCommand = new AddressCommand()
|
|
108
110
|
|
|
109
111
|
addressCommand.country = 'Belgium'
|
|
112
|
+
addressCommand.countryCode = null
|
|
110
113
|
addressCommand.city = 'Brussels'
|
|
111
114
|
addressCommand.postalCode = '1000'
|
|
112
115
|
addressCommand.streetName = 'Main Street'
|
|
@@ -161,6 +164,7 @@ describe('IsAddress decorator test', () => {
|
|
|
161
164
|
const addressCommand = new AddressCommand()
|
|
162
165
|
|
|
163
166
|
addressCommand.country = 'Belgium'
|
|
167
|
+
addressCommand.countryCode = 'BE'
|
|
164
168
|
addressCommand.city = 'Brussels'
|
|
165
169
|
addressCommand.postalCode = '1000'
|
|
166
170
|
addressCommand.streetName = 'Main Street'
|
|
@@ -183,6 +187,7 @@ describe('IsAddress decorator test', () => {
|
|
|
183
187
|
const addressCommand = new AddressCommand()
|
|
184
188
|
|
|
185
189
|
addressCommand.country = 'Belgium'
|
|
190
|
+
addressCommand.countryCode = 'BE'
|
|
186
191
|
addressCommand.city = 'Brussels'
|
|
187
192
|
addressCommand.postalCode = '1000'
|
|
188
193
|
addressCommand.streetName = 'Main Street'
|
|
@@ -204,6 +209,7 @@ describe('IsAddress decorator test', () => {
|
|
|
204
209
|
const addressCommand = new AddressCommand()
|
|
205
210
|
|
|
206
211
|
addressCommand.country = 'Belgium'
|
|
212
|
+
addressCommand.countryCode = 'BE'
|
|
207
213
|
addressCommand.city = 'Brussels'
|
|
208
214
|
addressCommand.postalCode = '1000'
|
|
209
215
|
addressCommand.streetName = 'Main Street'
|
|
@@ -226,6 +232,7 @@ describe('IsAddress decorator test', () => {
|
|
|
226
232
|
const addressCommand = new AddressCommand()
|
|
227
233
|
|
|
228
234
|
addressCommand.country = 'Belgium'
|
|
235
|
+
addressCommand.countryCode = 'BE'
|
|
229
236
|
addressCommand.city = 'Brussels'
|
|
230
237
|
addressCommand.postalCode = '1000'
|
|
231
238
|
addressCommand.streetName = 'Main Street'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisemen/address",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"license": "GPL",
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "
|
|
36
|
+
"url": "https://github.com/wisemen-digital/wisemen-core",
|
|
37
|
+
"directory": "packages/address"
|
|
37
38
|
},
|
|
38
39
|
"scripts": {
|
|
39
40
|
"prebuild": "rm -rf ./dist",
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/eslint.config.js":"1","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-column.ts":"2","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.builder.ts":"3","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.ts":"4","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-response.ts":"5","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.builder.ts":"6","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.ts":"7","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/index.ts":"8","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/is-address.validator.ts":"9","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/address-column.integration.test.ts":"10","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/is-address.validator.unit.test.ts":"11","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/address-test.entity.ts":"12","/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/datasource.ts":"13","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/eslint.config.js":"14","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-column.ts":"15","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-command.builder.ts":"16","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-command.ts":"17","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-response.ts":"18","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address.builder.ts":"19","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address.ts":"20","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/index.ts":"21","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/is-address.validator.ts":"22","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/address-column.integration.test.ts":"23","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/is-address.validator.unit.test.ts":"24","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/sql/address-test.entity.ts":"25","/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/sql/datasource.ts":"26"},{"size":357,"mtime":1768820135069,"results":"27","hashOfConfig":"28"},{"size":887,"mtime":1768819954982,"results":"29","hashOfConfig":"30"},{"size":1035,"mtime":1768819954982,"results":"31","hashOfConfig":"30"},{"size":2013,"mtime":1768819804323,"results":"32","hashOfConfig":"30"},{"size":1420,"mtime":1768819804324,"results":"33","hashOfConfig":"30"},{"size":1352,"mtime":1768819954982,"results":"34","hashOfConfig":"30"},{"size":327,"mtime":1768819804324,"results":"35","hashOfConfig":"30"},{"size":411,"mtime":1768819804324,"results":"36","hashOfConfig":"30"},{"size":2949,"mtime":1768819954982,"results":"37","hashOfConfig":"30"},{"size":5341,"mtime":1768820137303,"results":"38","hashOfConfig":"39"},{"size":4618,"mtime":1768820202242,"results":"40","hashOfConfig":"39"},{"size":283,"mtime":1768820158704,"results":"41","hashOfConfig":"30"},{"size":370,"mtime":1768819804327,"results":"42","hashOfConfig":"30"},{"size":357,"mtime":1772437668794,"results":"43","hashOfConfig":"44"},{"size":887,"mtime":1772437668794,"results":"45","hashOfConfig":"46"},{"size":1599,"mtime":1772437668794,"results":"47","hashOfConfig":"46"},{"size":2013,"mtime":1772437668795,"results":"48","hashOfConfig":"46"},{"size":1420,"mtime":1772437668795,"results":"49","hashOfConfig":"46"},{"size":1606,"mtime":1772437668795,"results":"50","hashOfConfig":"46"},{"size":327,"mtime":1772437668796,"results":"51","hashOfConfig":"46"},{"size":411,"mtime":1772437668796,"results":"52","hashOfConfig":"46"},{"size":3345,"mtime":1772437668796,"results":"53","hashOfConfig":"46"},{"size":5341,"mtime":1772437668797,"results":"54","hashOfConfig":"55"},{"size":7651,"mtime":1772437668797,"results":"56","hashOfConfig":"55"},{"size":283,"mtime":1772437668797,"results":"57","hashOfConfig":"46"},{"size":298,"mtime":1772437668798,"results":"58","hashOfConfig":"46"},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"lwlkib",{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1o8juwo",{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"x22v1o",{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1iw8jzu",{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1e3n1c0",{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","suppressedMessages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"6lhz07",{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/eslint.config.js",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-column.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-command.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address-response.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/address.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/index.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/is-address.validator.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/address-column.integration.test.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/is-address.validator.unit.test.ts",["137","138"],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/address-test.entity.ts",[],[],"/Users/kobe/Documents/Projects/project-template/node-core/packages/address/lib/tests/sql/datasource.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/eslint.config.js",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-column.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-command.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-command.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address-response.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address.builder.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/address.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/index.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/is-address.validator.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/address-column.integration.test.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/is-address.validator.unit.test.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/sql/address-test.entity.ts",[],[],"/Users/kobe/Documents/Projects/project-template/wisemen-core/packages/address/lib/tests/sql/datasource.ts",[],[],{"ruleId":"139","severity":2,"message":"140","line":137,"column":5,"nodeType":"141","messageId":"142","endLine":137,"endColumn":57},{"ruleId":"143","severity":2,"message":"144","line":137,"column":54,"nodeType":"145","messageId":"146","endLine":137,"endColumn":57,"suggestions":"147"},"@typescript-eslint/no-unsafe-assignment","Unsafe assignment of an `any` value.","AssignmentExpression","anyAssignment","@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["148","149"],{"messageId":"150","fix":"151","desc":"152"},{"messageId":"153","fix":"154","desc":"155"},"suggestUnknown",{"range":"156","text":"157"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"158","text":"159"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",[4392,4395],"unknown",[4392,4395],"never"]
|