@fiado/type-kit 1.0.4 → 1.0.6

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.
Files changed (88) hide show
  1. package/bin/account/dtos/AccountResponse.d.ts +21 -0
  2. package/bin/account/dtos/AccountResponse.js +85 -0
  3. package/bin/account/dtos/CreateAccountRequest.d.ts +14 -0
  4. package/bin/account/dtos/CreateAccountRequest.js +65 -0
  5. package/bin/account/dtos/CreatePockeRequest.d.ts +4 -0
  6. package/bin/account/dtos/CreatePockeRequest.js +31 -0
  7. package/bin/account/dtos/PocketResponse.d.ts +0 -0
  8. package/bin/account/dtos/PocketResponse.js +0 -0
  9. package/bin/account/enums/AccountStatus.d.ts +5 -0
  10. package/bin/account/enums/AccountStatus.js +9 -0
  11. package/bin/account/index.d.ts +4 -0
  12. package/bin/account/index.js +22 -0
  13. package/bin/address/dtos/AddressBase.d.ts +34 -0
  14. package/bin/address/dtos/AddressBase.js +163 -0
  15. package/bin/address/dtos/AddressResponse.d.ts +7 -0
  16. package/bin/address/dtos/AddressResponse.js +47 -0
  17. package/bin/address/dtos/CreateAddressRequest.d.ts +3 -0
  18. package/bin/address/dtos/CreateAddressRequest.js +7 -0
  19. package/bin/address/dtos/Geometry.d.ts +3 -0
  20. package/bin/address/dtos/Geometry.js +2 -0
  21. package/bin/address/dtos/Place.d.ts +21 -0
  22. package/bin/address/dtos/Place.js +112 -0
  23. package/bin/address/dtos/Shipping.d.ts +11 -0
  24. package/bin/address/dtos/Shipping.js +57 -0
  25. package/bin/address/dtos/Timezone.d.ts +4 -0
  26. package/bin/address/dtos/Timezone.js +2 -0
  27. package/bin/address/enums/AddressProvider.d.ts +9 -0
  28. package/bin/address/enums/AddressProvider.js +13 -0
  29. package/bin/address/enums/AddressStatus.d.ts +9 -0
  30. package/bin/address/enums/AddressStatus.js +13 -0
  31. package/bin/address/index.d.ts +8 -1
  32. package/bin/address/index.js +10 -1
  33. package/bin/card/dtos/CardActivateRequest.d.ts +4 -0
  34. package/bin/card/dtos/CardActivateRequest.js +26 -0
  35. package/bin/card/dtos/CardApplicationRequest.d.ts +6 -0
  36. package/bin/card/dtos/CardApplicationRequest.js +34 -0
  37. package/bin/card/dtos/CardUpdateRequest.d.ts +5 -0
  38. package/bin/card/dtos/CardUpdateRequest.js +28 -0
  39. package/bin/card/dtos/CreateCardRequest.d.ts +34 -0
  40. package/bin/card/dtos/CreateCardRequest.js +176 -0
  41. package/bin/card/index.d.ts +11 -0
  42. package/bin/card/index.js +8 -4
  43. package/bin/card/validations/CardUpdateKeyConstraint.js +1 -2
  44. package/bin/card/validations/IsPhoneNumberConstraint.d.ts +6 -0
  45. package/bin/card/validations/IsPhoneNumberConstraint.js +36 -0
  46. package/bin/country/enums/Country.d.ts +4 -0
  47. package/bin/country/enums/Country.js +8 -0
  48. package/bin/country/enums/CountryId.js +1 -0
  49. package/bin/country/index.d.ts +1 -0
  50. package/bin/country/index.js +3 -0
  51. package/bin/directory/enums/TypeOfDirectoryId.d.ts +5 -0
  52. package/bin/directory/enums/TypeOfDirectoryId.js +9 -0
  53. package/bin/directory/index.d.ts +1 -0
  54. package/bin/directory/index.js +19 -0
  55. package/bin/helpers/constans/regex.d.ts +1 -0
  56. package/bin/helpers/constans/regex.js +3 -1
  57. package/bin/index.d.ts +5 -15
  58. package/bin/index.js +17 -17
  59. package/package.json +1 -1
  60. package/src/account/dtos/AccountResponse.ts +60 -0
  61. package/src/account/dtos/CreateAccountRequest.ts +45 -0
  62. package/src/account/dtos/CreatePockeRequest.ts +19 -0
  63. package/src/account/enums/AccountStatus.ts +7 -0
  64. package/src/account/index.ts +11 -0
  65. package/src/address/dtos/AddressBase.ts +131 -0
  66. package/src/address/dtos/AddressResponse.ts +41 -0
  67. package/src/address/dtos/CreateAddressRequest.ts +7 -0
  68. package/src/address/dtos/Geometry.ts +5 -0
  69. package/src/address/dtos/Place.ts +84 -0
  70. package/src/address/dtos/{AddressShippingDto.ts → Shipping.ts} +1 -1
  71. package/src/address/dtos/Timezone.ts +6 -0
  72. package/src/address/enums/AddressProvider.ts +10 -0
  73. package/src/address/enums/AddressStatus.ts +10 -0
  74. package/src/address/index.ts +12 -1
  75. package/src/card/dtos/{CardActivateRequestDto.ts → CardActivateRequest.ts} +1 -1
  76. package/src/card/dtos/{CardApplicationRequestDto.ts → CardApplicationRequest.ts} +4 -4
  77. package/src/card/dtos/{CardUpdateRequestDto.ts → CardUpdateRequest.ts} +1 -1
  78. package/src/card/dtos/{CreateCardRequestDto.ts → CreateCardRequest.ts} +4 -4
  79. package/src/card/index.ts +15 -0
  80. package/src/card/validations/CardUpdateKeyConstraint.ts +3 -5
  81. package/src/card/validations/IsPhoneNumberConstraint.ts +26 -0
  82. package/src/country/enums/Country.ts +6 -0
  83. package/src/country/enums/CountryId.ts +3 -0
  84. package/src/country/index.ts +6 -1
  85. package/src/directory/enums/TypeOfDirectoryId.ts +7 -0
  86. package/src/directory/index.ts +7 -0
  87. package/src/helpers/constans/regex.ts +2 -0
  88. package/src/index.ts +5 -18
@@ -0,0 +1,36 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.IsPhoneNumberFiado = exports.IsPhoneNumberConstraint = void 0;
10
+ const class_validator_1 = require("class-validator");
11
+ const regex_1 = require("../../helpers/constans/regex");
12
+ let IsPhoneNumberConstraint = class IsPhoneNumberConstraint {
13
+ validate(phoneNumber, args) {
14
+ return regex_1.regexPhoneNumber.test(phoneNumber);
15
+ }
16
+ defaultMessage(args) {
17
+ return "The phone number is not valid. The expected format is +############.";
18
+ }
19
+ };
20
+ exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint;
21
+ exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint = __decorate([
22
+ (0, class_validator_1.ValidatorConstraint)({ async: true })
23
+ ], IsPhoneNumberConstraint);
24
+ // Decorador que usaremos en nuestras clases DTO
25
+ function IsPhoneNumberFiado(validationOptions) {
26
+ return function (object, propertyName) {
27
+ (0, class_validator_1.registerDecorator)({
28
+ target: object.constructor,
29
+ propertyName: propertyName,
30
+ options: validationOptions,
31
+ constraints: [],
32
+ validator: IsPhoneNumberConstraint,
33
+ });
34
+ };
35
+ }
36
+ exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
@@ -0,0 +1,4 @@
1
+ export declare enum Country {
2
+ MEX = "MEX",
3
+ USA = "USA"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Country = void 0;
4
+ var Country;
5
+ (function (Country) {
6
+ Country["MEX"] = "MEX";
7
+ Country["USA"] = "USA";
8
+ })(Country || (exports.Country = Country = {}));
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ //*
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.CountryId = void 0;
4
5
  var CountryId;
@@ -1 +1,2 @@
1
1
  export * from './enums/CountryId';
2
+ export * from './enums/Country';
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ //dto
2
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
4
  if (k2 === undefined) k2 = k;
4
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -14,4 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
16
  };
16
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ //enums
17
19
  __exportStar(require("./enums/CountryId"), exports);
20
+ __exportStar(require("./enums/Country"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum TypeOfDirectoryId {
2
+ USER = "USER",
3
+ BACKOFFICE = "BACKOFFICE",
4
+ AGENT = "AGENT"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeOfDirectoryId = void 0;
4
+ var TypeOfDirectoryId;
5
+ (function (TypeOfDirectoryId) {
6
+ TypeOfDirectoryId["USER"] = "USER";
7
+ TypeOfDirectoryId["BACKOFFICE"] = "BACKOFFICE";
8
+ TypeOfDirectoryId["AGENT"] = "AGENT";
9
+ })(TypeOfDirectoryId || (exports.TypeOfDirectoryId = TypeOfDirectoryId = {}));
@@ -0,0 +1 @@
1
+ export * from './enums/TypeOfDirectoryId';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ //dtos
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //enums
19
+ __exportStar(require("./enums/TypeOfDirectoryId"), exports);
@@ -1,2 +1,3 @@
1
1
  export declare const regexUuidV4: RegExp;
2
2
  export declare const regexIso8601: RegExp;
3
+ export declare const regexPhoneNumber: RegExp;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.regexIso8601 = exports.regexUuidV4 = void 0;
3
+ exports.regexPhoneNumber = exports.regexIso8601 = exports.regexUuidV4 = void 0;
4
4
  // Expresión regular para validar UUID v4
5
5
  exports.regexUuidV4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
6
6
  // Expresión regular para validar fecha ISO 8601
7
7
  exports.regexIso8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
8
+ // Expresión regular para validar un número de teléfono
9
+ exports.regexPhoneNumber = /^\+\d{12}$/;
package/bin/index.d.ts CHANGED
@@ -1,15 +1,5 @@
1
- export * from './card/dtos/CardActivateRequestDto';
2
- export * from './card/dtos/CardApplicationRequestDto';
3
- export * from './card/dtos/CreateCardRequestDto';
4
- export * from './card/dtos/CardUpdateRequestDto';
5
- export * from './card/enums/CardType';
6
- export * from './card/enums/CardUpdateKey';
7
- export * from './card/enums/IssuanceType';
8
- export * from './card/enums/Status';
9
- export * from './card/enums/IssuanceType';
10
- export * from './card/enums/OwnershipType';
11
- export * from './card/enums/Brand';
12
- export * from './card/enums/UpdateKey';
13
- export * from './card/enums/Status';
14
- export * from './card/enums/CardType';
15
- export * from './card/enums/OwnershipType';
1
+ export * as Account from './account';
2
+ export * as Address from './address';
3
+ export * as Card from './card';
4
+ export * as Country from './country';
5
+ export * as Directory from './directory';
package/bin/index.js CHANGED
@@ -10,22 +10,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
15
24
  };
16
25
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./card/dtos/CardActivateRequestDto"), exports);
18
- __exportStar(require("./card/dtos/CardApplicationRequestDto"), exports);
19
- __exportStar(require("./card/dtos/CreateCardRequestDto"), exports);
20
- __exportStar(require("./card/dtos/CardUpdateRequestDto"), exports);
21
- __exportStar(require("./card/enums/CardType"), exports);
22
- __exportStar(require("./card/enums/CardUpdateKey"), exports);
23
- __exportStar(require("./card/enums/IssuanceType"), exports);
24
- __exportStar(require("./card/enums/Status"), exports);
25
- __exportStar(require("./card/enums/IssuanceType"), exports);
26
- __exportStar(require("./card/enums/OwnershipType"), exports);
27
- __exportStar(require("./card/enums/Brand"), exports);
28
- __exportStar(require("./card/enums/UpdateKey"), exports);
29
- __exportStar(require("./card/enums/Status"), exports);
30
- __exportStar(require("./card/enums/CardType"), exports);
31
- __exportStar(require("./card/enums/OwnershipType"), exports);
26
+ exports.Directory = exports.Country = exports.Card = exports.Address = exports.Account = void 0;
27
+ exports.Account = __importStar(require("./account"));
28
+ exports.Address = __importStar(require("./address"));
29
+ exports.Card = __importStar(require("./card"));
30
+ exports.Country = __importStar(require("./country"));
31
+ exports.Directory = __importStar(require("./directory"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,60 @@
1
+
2
+
3
+ import { IsEnum, IsNumber, IsOptional, IsString, IsDateString } from 'class-validator';
4
+ import { Provider } from '../../provider/enums/Provider';
5
+ import { Country } from '../../country/enums/Country';
6
+ import { AccountStatus } from '../enums/AccountStatus';
7
+ import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
8
+
9
+
10
+ export class AccountResponse {
11
+ @IsString()
12
+ id: string;
13
+
14
+ @IsOptional()
15
+ @IsString()
16
+ typeOfAccountId: string;
17
+
18
+ @IsOptional()
19
+ @IsString()
20
+ externalAccountId: string;
21
+
22
+ @IsOptional()
23
+ @IsString()
24
+ externalSubAccountId: string | null;
25
+
26
+ @IsEnum(Provider)
27
+ provider: Provider;
28
+
29
+ @IsString()
30
+ directoryId: string;
31
+
32
+ @IsEnum(TypeOfDirectoryId)
33
+ typeOfDirectoryId: TypeOfDirectoryId;
34
+
35
+ @IsNumber()
36
+ currentBalance: number;
37
+
38
+ @IsNumber()
39
+ balanceLock: number;
40
+
41
+ @IsEnum(Country)
42
+ countryId: Country;
43
+
44
+ @IsDateString()
45
+ createDate: string;
46
+
47
+ @IsDateString()
48
+ lastUpdateDate: string;
49
+
50
+ @IsOptional()
51
+ @IsString()
52
+ accountNumber: string
53
+
54
+ @IsOptional()
55
+ @IsString()
56
+ routingNumber: string;
57
+
58
+ @IsEnum(AccountStatus)
59
+ status: AccountStatus;
60
+ }
@@ -0,0 +1,45 @@
1
+ import { IsEmail, IsEnum, IsString, ValidateNested, IsDateString, Matches, Length } from 'class-validator';
2
+ import { AddressResponse } from "../../address/dtos/AddressResponse";
3
+ import { Country } from "../../country/enums/Country";
4
+ import { regexUuidV4 } from '../../helpers/constans/regex';
5
+ import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
6
+ import { IsPhoneNumberFiado } from '../../card/validations/IsPhoneNumberConstraint';
7
+
8
+ export class CreateAccountRequest {
9
+
10
+ @IsString()
11
+ @Matches(regexUuidV4,
12
+ {
13
+ message: 'directoryId must be a valid UUID v4',
14
+ })
15
+ directoryId: string;
16
+
17
+ @IsEnum(TypeOfDirectoryId)
18
+ typeOfDirectoryId: string;
19
+
20
+ @IsString()
21
+ firstName: string;
22
+
23
+ @IsString()
24
+
25
+ lastName: string;
26
+
27
+ @IsPhoneNumberFiado()
28
+ phoneNumber: string;
29
+
30
+ @ValidateNested()
31
+ address: AddressResponse;
32
+
33
+ @IsEmail()
34
+ email: string;
35
+
36
+ @IsDateString()
37
+ dob: string;
38
+
39
+ @IsString()
40
+ @Length(1, 30)
41
+ documentNumber: string;
42
+
43
+ @IsEnum(Country)
44
+ countryId: Country;
45
+ }
@@ -0,0 +1,19 @@
1
+ import { IsString, Matches } from "class-validator";
2
+ import { regexUuidV4 } from "../../helpers/constans/regex";
3
+
4
+ export class CreatePocketRequest {
5
+
6
+ @IsString()
7
+ @Matches(regexUuidV4,
8
+ {
9
+ message: 'beneficiaryDirectoryId must be a valid UUID v4',
10
+ })
11
+ beneficiaryDirectoryId?: string;
12
+
13
+ @IsString()
14
+ @Matches(regexUuidV4,
15
+ {
16
+ message: 'accountId must be a valid UUID v4',
17
+ })
18
+ accountId: string;
19
+ }
@@ -0,0 +1,7 @@
1
+
2
+
3
+ export enum AccountStatus {
4
+ ACTIVE = "ACTIVE",
5
+ INACTIVE = "INACTIVE",
6
+ BLOCKED = "BLOCKED"
7
+ }
@@ -0,0 +1,11 @@
1
+
2
+ //dtos
3
+ export * from './dtos/AccountResponse';
4
+ export * from './dtos/CreateAccountRequest';
5
+ export * from './dtos/CreatePockeRequest';
6
+
7
+
8
+ //enums
9
+ export * from './enums/AccountStatus';
10
+
11
+
@@ -0,0 +1,131 @@
1
+
2
+
3
+
4
+ import { IsBoolean, IsEnum, IsNumber, IsOptional, IsString, Length, Matches, ValidateNested } from 'class-validator';
5
+ import { TypeOfDirectoryId } from "../../directory/enums/TypeOfDirectoryId";
6
+ import { AddressProvider } from "../enums/AddressProvider";
7
+ import { AddressStatus } from "../enums/AddressStatus";
8
+ import { Place } from "./Place";
9
+ import { CountryId } from '../../country/enums/CountryId';
10
+ import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
11
+
12
+ export class AddressBase {
13
+
14
+ @IsOptional()
15
+ @IsString()
16
+ @Matches(regexUuidV4,
17
+ {
18
+ message: 'id must be a valid UUID v4',
19
+ })
20
+ id?: string;
21
+
22
+ @IsNumber()
23
+ @IsOptional()
24
+ distance?: number;
25
+
26
+ @IsEnum(TypeOfDirectoryId)
27
+ createdBy: TypeOfDirectoryId;
28
+
29
+ @IsString()
30
+ @Matches(regexUuidV4,
31
+ {
32
+ message: 'directoryId must be a valid UUID v4',
33
+ })
34
+ directoryId: string;
35
+
36
+ @IsBoolean()
37
+ isPrincipal: boolean;
38
+
39
+ @IsOptional()
40
+ @IsString()
41
+ @Length(1, 100)
42
+ tag?: string;
43
+
44
+ @IsString()
45
+ @Length(1, 100)
46
+ tenantId: string;
47
+
48
+ @IsString()
49
+ typeOfAddressId: string;
50
+
51
+ @IsEnum(TypeOfDirectoryId)
52
+ typeOfDirectoryId: TypeOfDirectoryId;
53
+
54
+ @IsEnum(AddressProvider)
55
+ provider: AddressProvider;
56
+
57
+ @ValidateNested()
58
+ place: Place;
59
+
60
+ @IsString()
61
+ @Matches(regexIso8601,
62
+ {
63
+ message: 'validFrom must be a valid ISO 8601 date string',
64
+ })
65
+ validFrom: string;
66
+
67
+ @IsOptional()
68
+ @IsString()
69
+ @Matches(regexIso8601,
70
+ {
71
+ message: 'validUntil must be a valid ISO 8601 date string',
72
+ })
73
+ validUntil?: string;
74
+
75
+ @IsEnum(AddressStatus)
76
+ addressStatus: AddressStatus;
77
+
78
+ @IsOptional()
79
+ @IsString()
80
+ @Length(1, 200)
81
+ additionalInformation?: string;
82
+
83
+ @IsBoolean()
84
+ helpNeeded: boolean;
85
+
86
+ @IsOptional()
87
+ @IsString()
88
+ @Length(1, 10)
89
+ internalNumber?: string;
90
+
91
+ @IsEnum(CountryId)
92
+ countryId: CountryId;
93
+
94
+ @IsString()
95
+ @Length(1, 100)
96
+ street?: string;
97
+
98
+ @IsString()
99
+ @Length(1, 10)
100
+ addressNumber?: string;
101
+
102
+ @IsOptional()
103
+ @IsString()
104
+ @Length(2, 60)
105
+ municipality?: string;
106
+
107
+ @IsOptional()
108
+ @IsString()
109
+ subMunicipality?: string;
110
+
111
+ @IsOptional()
112
+ @IsString()
113
+ @Length(2, 60)
114
+ neighborhood?: string;
115
+
116
+ @IsOptional()
117
+ @IsString()
118
+ @Length(2, 60)
119
+ subRegion?: string;
120
+
121
+ @IsString()
122
+ @Length(5, 10)
123
+ region?: string;
124
+
125
+ @IsString()
126
+ @Length(5, 10)
127
+ postalCode?: string;
128
+
129
+ @IsEnum(CountryId)
130
+ country: string;
131
+ }
@@ -0,0 +1,41 @@
1
+
2
+
3
+
4
+ import { IsOptional, IsString, Length, Matches } from 'class-validator';
5
+
6
+ import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
7
+ import { AddressBase } from './AddressBase';
8
+
9
+ export class AddressResponse extends AddressBase {
10
+
11
+ @IsString()
12
+ @Matches(regexUuidV4,
13
+ {
14
+ message: 'id must be a valid UUID v4',
15
+ })
16
+ id: string
17
+
18
+ @IsOptional()
19
+ @IsString()
20
+ @Matches(regexIso8601,
21
+ {
22
+ message: 'createDate must be a valid ISO 8601 date string',
23
+ })
24
+ createDate: string;
25
+
26
+ @IsOptional()
27
+ @IsString()
28
+ @Matches(regexIso8601,
29
+ {
30
+ message: 'updateDate must be a valid ISO 8601 date string',
31
+ })
32
+ updateDate?: string;
33
+
34
+ @IsOptional()
35
+ @IsString()
36
+ @Length(1, 100)
37
+ updatedBy?: string;
38
+ }
39
+
40
+
41
+
@@ -0,0 +1,7 @@
1
+ import { AddressBase } from "./AddressBase";
2
+
3
+
4
+ export class CreateAddressRequest extends AddressBase {
5
+
6
+
7
+ }
@@ -0,0 +1,5 @@
1
+
2
+
3
+ export type Geometry = {
4
+ point: [number, number];
5
+ }
@@ -0,0 +1,84 @@
1
+ import { IsArray, IsBoolean, IsEnum, IsOptional, IsString, Length, ValidateNested } from 'class-validator';
2
+ import { Geometry } from "./Geometry";
3
+ import { Timezone } from "./Timezone";
4
+ import { Country } from '../../country/enums/Country';
5
+
6
+ export class Place {
7
+ @ValidateNested()
8
+ geometry: Geometry;
9
+
10
+ @IsOptional()
11
+ @IsString()
12
+ addressNumber?: string;
13
+
14
+ @IsOptional()
15
+ @IsArray()
16
+ @IsString({ each: true })
17
+ categories?: string[];
18
+
19
+ @IsOptional()
20
+ @IsEnum(Country)
21
+ country?: string;
22
+
23
+ @IsBoolean()
24
+ interpolated: boolean;
25
+
26
+ @IsOptional()
27
+ @IsString()
28
+ @Length(1, 300)
29
+ label?: string;
30
+
31
+ @IsOptional()
32
+ @IsString()
33
+ @Length(1, 60)
34
+ municipality?: string;
35
+
36
+ @IsOptional()
37
+ @IsString()
38
+ @Length(2, 60)
39
+ neighborhood?: string;
40
+
41
+ @IsOptional()
42
+ @IsString()
43
+ @Length(5, 10)
44
+ postalCode?: string;
45
+
46
+ @IsOptional()
47
+ @IsString()
48
+ @Length(5, 10)
49
+ region?: string;
50
+
51
+ @IsOptional()
52
+ @IsString()
53
+ @Length(1, 100)
54
+ street?: string;
55
+
56
+ @IsOptional()
57
+ @IsString()
58
+ @Length(2, 60)
59
+ subMunicipality?: string;
60
+
61
+ @IsOptional()
62
+ @IsString()
63
+ @Length(2, 60)
64
+ subRegion?: string;
65
+
66
+ @IsOptional()
67
+ @IsArray()
68
+ @IsString({ each: true })
69
+ supplementalCategories?: string[];
70
+
71
+ @IsOptional()
72
+ @ValidateNested()
73
+ timezone?: Timezone;
74
+
75
+ @IsOptional()
76
+ @IsString()
77
+ @Length(1, 10)
78
+ unitNumber?: string;
79
+
80
+ @IsOptional()
81
+ @IsString()
82
+ @Length(1, 10)
83
+ unitType?: string;
84
+ }
@@ -1,7 +1,7 @@
1
1
  import { IsString, Length, IsOptional } from 'class-validator';
2
2
  import { CountryId } from '../../country/enums/CountryId';
3
3
 
4
- export class ShippingAddressDto {
4
+ export class Shipping {
5
5
  @IsString()
6
6
  @Length(2, 60)
7
7
  municipality: string;
@@ -0,0 +1,6 @@
1
+
2
+
3
+ export type Timezone = {
4
+ name: string;
5
+ offset: string;
6
+ }
@@ -0,0 +1,10 @@
1
+
2
+ /**
3
+ * AddressProvider enum
4
+ * @description AddressProvider enum is used to define the address provider
5
+ * @enum {string} AddressProvider
6
+ */
7
+ export enum AddressProvider {
8
+ AWS = "AWS",
9
+ MANUAL = "MANUAL"
10
+ }
@@ -0,0 +1,10 @@
1
+
2
+ /**
3
+ * AddressProvider Status
4
+ * @description AddressProvider Status is used to define the address provider status
5
+ * @enum {string} AddressStatus
6
+ */
7
+ export enum AddressStatus {
8
+ VISIBLE = "VISIBLE",
9
+ NOT_VISIBLE = "NOT_VISIBLE"
10
+ }