🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@fiado/type-kit

Package Overview
Dependencies
Maintainers
1
Versions
1091
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fiado/type-kit - npm Package Compare versions

Comparing version
1.0.4
to
1.0.5
+21
bin/account/dtos/AccountResponse.d.ts
import { Provider } from '../../provider/enums/Provider';
import { Country } from '../../country/enums/Country';
import { AccountStatus } from '../enums/AccountStatus';
import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
export declare class AccountResponse {
id: string;
typeOfAccountId: string;
externalAccountId: string;
externalSubAccountId: string | null;
provider: Provider;
directoryId: string;
typeOfDirectoryId: TypeOfDirectoryId;
currentBalance: number;
balanceLock: number;
countryId: Country;
createDate: string;
lastUpdateDate: string;
accountNumber: string;
routingNumber: string;
status: AccountStatus;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountResponse = void 0;
const class_validator_1 = require("class-validator");
const Provider_1 = require("../../provider/enums/Provider");
const Country_1 = require("../../country/enums/Country");
const AccountStatus_1 = require("../enums/AccountStatus");
const TypeOfDirectoryId_1 = require("../../directory/enums/TypeOfDirectoryId");
class AccountResponse {
}
exports.AccountResponse = AccountResponse;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "id", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "typeOfAccountId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "externalAccountId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "externalSubAccountId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(Provider_1.Provider),
__metadata("design:type", String)
], AccountResponse.prototype, "provider", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "directoryId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
__metadata("design:type", String)
], AccountResponse.prototype, "typeOfDirectoryId", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], AccountResponse.prototype, "currentBalance", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], AccountResponse.prototype, "balanceLock", void 0);
__decorate([
(0, class_validator_1.IsEnum)(Country_1.Country),
__metadata("design:type", String)
], AccountResponse.prototype, "countryId", void 0);
__decorate([
(0, class_validator_1.IsDateString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "createDate", void 0);
__decorate([
(0, class_validator_1.IsDateString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "lastUpdateDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "accountNumber", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AccountResponse.prototype, "routingNumber", void 0);
__decorate([
(0, class_validator_1.IsEnum)(AccountStatus_1.AccountStatus),
__metadata("design:type", String)
], AccountResponse.prototype, "status", void 0);
import { AddressResponse } from "../../address/dtos/AddressResponse";
import { Country } from "../../country/enums/Country";
export declare class CreateAccountRequest {
directoryId: string;
typeOfDirectoryId: string;
firstName: string;
lastName: string;
phoneNumber: string;
address: AddressResponse;
email: string;
dob: string;
documentNumber: string;
countryId: Country;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateAccountRequest = void 0;
const class_validator_1 = require("class-validator");
const AddressResponse_1 = require("../../address/dtos/AddressResponse");
const Country_1 = require("../../country/enums/Country");
const regex_1 = require("../../helpers/constans/regex");
const TypeOfDirectoryId_1 = require("../../directory/enums/TypeOfDirectoryId");
const IsPhoneNumberConstraint_1 = require("../../card/validations/IsPhoneNumberConstraint");
class CreateAccountRequest {
}
exports.CreateAccountRequest = CreateAccountRequest;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'directoryId must be a valid UUID v4',
}),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "directoryId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "typeOfDirectoryId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "firstName", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "lastName", void 0);
__decorate([
(0, IsPhoneNumberConstraint_1.IsPhoneNumberFiado)(),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "phoneNumber", void 0);
__decorate([
(0, class_validator_1.ValidateNested)(),
__metadata("design:type", AddressResponse_1.AddressResponse)
], CreateAccountRequest.prototype, "address", void 0);
__decorate([
(0, class_validator_1.IsEmail)(),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "email", void 0);
__decorate([
(0, class_validator_1.IsDateString)(),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "dob", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 30),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "documentNumber", void 0);
__decorate([
(0, class_validator_1.IsEnum)(Country_1.Country),
__metadata("design:type", String)
], CreateAccountRequest.prototype, "countryId", void 0);
export declare class CreatePocketRequest {
beneficiaryDirectoryId?: string;
accountId: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreatePocketRequest = void 0;
const class_validator_1 = require("class-validator");
const regex_1 = require("../../helpers/constans/regex");
class CreatePocketRequest {
}
exports.CreatePocketRequest = CreatePocketRequest;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'beneficiaryDirectoryId must be a valid UUID v4',
}),
__metadata("design:type", String)
], CreatePocketRequest.prototype, "beneficiaryDirectoryId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'accountId must be a valid UUID v4',
}),
__metadata("design:type", String)
], CreatePocketRequest.prototype, "accountId", void 0);
export declare enum AccountStatus {
ACTIVE = "ACTIVE",
INACTIVE = "INACTIVE",
BLOCKED = "BLOCKED"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountStatus = void 0;
var AccountStatus;
(function (AccountStatus) {
AccountStatus["ACTIVE"] = "ACTIVE";
AccountStatus["INACTIVE"] = "INACTIVE";
AccountStatus["BLOCKED"] = "BLOCKED";
})(AccountStatus || (exports.AccountStatus = AccountStatus = {}));
import { TypeOfDirectoryId } from "../../directory/enums/TypeOfDirectoryId";
import { AddressProvider } from "../enums/AddressProvider";
import { AddressStatus } from "../enums/AddressStatus";
import { Place } from "./Place";
import { CountryId } from '../../country/enums/CountryId';
export declare class AddressBase {
id?: string;
distance?: number;
createdBy: TypeOfDirectoryId;
directoryId: string;
isPrincipal: boolean;
tag?: string;
tenantId: string;
typeOfAddressId: string;
typeOfDirectoryId: TypeOfDirectoryId;
provider: AddressProvider;
place: Place;
validFrom: string;
validUntil?: string;
addressStatus: AddressStatus;
additionalInformation?: string;
helpNeeded: boolean;
internalNumber?: string;
countryId: CountryId;
street?: string;
addressNumber?: string;
municipality?: string;
subMunicipality?: string;
neighborhood?: string;
subRegion?: string;
region?: string;
postalCode?: string;
country: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressBase = void 0;
const class_validator_1 = require("class-validator");
const TypeOfDirectoryId_1 = require("../../directory/enums/TypeOfDirectoryId");
const AddressProvider_1 = require("../enums/AddressProvider");
const AddressStatus_1 = require("../enums/AddressStatus");
const Place_1 = require("./Place");
const CountryId_1 = require("../../country/enums/CountryId");
const regex_1 = require("../../helpers/constans/regex");
class AddressBase {
}
exports.AddressBase = AddressBase;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'id must be a valid UUID v4',
}),
__metadata("design:type", String)
], AddressBase.prototype, "id", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", Number)
], AddressBase.prototype, "distance", void 0);
__decorate([
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
__metadata("design:type", String)
], AddressBase.prototype, "createdBy", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'directoryId must be a valid UUID v4',
}),
__metadata("design:type", String)
], AddressBase.prototype, "directoryId", void 0);
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], AddressBase.prototype, "isPrincipal", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], AddressBase.prototype, "tag", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], AddressBase.prototype, "tenantId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AddressBase.prototype, "typeOfAddressId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
__metadata("design:type", String)
], AddressBase.prototype, "typeOfDirectoryId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(AddressProvider_1.AddressProvider),
__metadata("design:type", String)
], AddressBase.prototype, "provider", void 0);
__decorate([
(0, class_validator_1.ValidateNested)(),
__metadata("design:type", Place_1.Place)
], AddressBase.prototype, "place", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexIso8601, {
message: 'validFrom must be a valid ISO 8601 date string',
}),
__metadata("design:type", String)
], AddressBase.prototype, "validFrom", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexIso8601, {
message: 'validUntil must be a valid ISO 8601 date string',
}),
__metadata("design:type", String)
], AddressBase.prototype, "validUntil", void 0);
__decorate([
(0, class_validator_1.IsEnum)(AddressStatus_1.AddressStatus),
__metadata("design:type", String)
], AddressBase.prototype, "addressStatus", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 200),
__metadata("design:type", String)
], AddressBase.prototype, "additionalInformation", void 0);
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], AddressBase.prototype, "helpNeeded", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 10),
__metadata("design:type", String)
], AddressBase.prototype, "internalNumber", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
__metadata("design:type", String)
], AddressBase.prototype, "countryId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], AddressBase.prototype, "street", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 10),
__metadata("design:type", String)
], AddressBase.prototype, "addressNumber", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], AddressBase.prototype, "municipality", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AddressBase.prototype, "subMunicipality", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], AddressBase.prototype, "neighborhood", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], AddressBase.prototype, "subRegion", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 10),
__metadata("design:type", String)
], AddressBase.prototype, "region", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 10),
__metadata("design:type", String)
], AddressBase.prototype, "postalCode", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
__metadata("design:type", String)
], AddressBase.prototype, "country", void 0);
import { AddressBase } from './AddressBase';
export declare class AddressResponse extends AddressBase {
id: string;
createDate: string;
updateDate?: string;
updatedBy?: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressResponse = void 0;
const class_validator_1 = require("class-validator");
const regex_1 = require("../../helpers/constans/regex");
const AddressBase_1 = require("./AddressBase");
class AddressResponse extends AddressBase_1.AddressBase {
}
exports.AddressResponse = AddressResponse;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'id must be a valid UUID v4',
}),
__metadata("design:type", String)
], AddressResponse.prototype, "id", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexIso8601, {
message: 'createDate must be a valid ISO 8601 date string',
}),
__metadata("design:type", String)
], AddressResponse.prototype, "createDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexIso8601, {
message: 'updateDate must be a valid ISO 8601 date string',
}),
__metadata("design:type", String)
], AddressResponse.prototype, "updateDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], AddressResponse.prototype, "updatedBy", void 0);
import { AddressBase } from "./AddressBase";
export declare class CreateAddressRequest extends AddressBase {
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateAddressRequest = void 0;
const AddressBase_1 = require("./AddressBase");
class CreateAddressRequest extends AddressBase_1.AddressBase {
}
exports.CreateAddressRequest = CreateAddressRequest;
export type Geometry = {
point: [number, number];
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
import { Geometry } from "./Geometry";
import { Timezone } from "./Timezone";
export declare class Place {
geometry: Geometry;
addressNumber?: string;
categories?: string[];
country?: string;
interpolated: boolean;
label?: string;
municipality?: string;
neighborhood?: string;
postalCode?: string;
region?: string;
street?: string;
subMunicipality?: string;
subRegion?: string;
supplementalCategories?: string[];
timezone?: Timezone;
unitNumber?: string;
unitType?: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Place = void 0;
const class_validator_1 = require("class-validator");
const Country_1 = require("../../country/enums/Country");
class Place {
}
exports.Place = Place;
__decorate([
(0, class_validator_1.ValidateNested)(),
__metadata("design:type", Object)
], Place.prototype, "geometry", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], Place.prototype, "addressNumber", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], Place.prototype, "categories", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(Country_1.Country),
__metadata("design:type", String)
], Place.prototype, "country", void 0);
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], Place.prototype, "interpolated", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 300),
__metadata("design:type", String)
], Place.prototype, "label", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 60),
__metadata("design:type", String)
], Place.prototype, "municipality", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Place.prototype, "neighborhood", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 10),
__metadata("design:type", String)
], Place.prototype, "postalCode", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 10),
__metadata("design:type", String)
], Place.prototype, "region", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], Place.prototype, "street", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Place.prototype, "subMunicipality", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Place.prototype, "subRegion", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], Place.prototype, "supplementalCategories", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
__metadata("design:type", Object)
], Place.prototype, "timezone", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 10),
__metadata("design:type", String)
], Place.prototype, "unitNumber", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 10),
__metadata("design:type", String)
], Place.prototype, "unitType", void 0);
import { CountryId } from '../../country/enums/CountryId';
export declare class Shipping {
municipality: string;
neighborhood: string;
postalCode: string;
street: string;
subRegion: string;
addressNumber: string;
internalNumber?: string;
countryId: CountryId;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Shipping = void 0;
const class_validator_1 = require("class-validator");
const CountryId_1 = require("../../country/enums/CountryId");
class Shipping {
}
exports.Shipping = Shipping;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Shipping.prototype, "municipality", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Shipping.prototype, "neighborhood", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 10),
__metadata("design:type", String)
], Shipping.prototype, "postalCode", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 100),
__metadata("design:type", String)
], Shipping.prototype, "street", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 60),
__metadata("design:type", String)
], Shipping.prototype, "subRegion", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 10),
__metadata("design:type", String)
], Shipping.prototype, "addressNumber", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 200),
__metadata("design:type", String)
], Shipping.prototype, "internalNumber", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], Shipping.prototype, "countryId", void 0);
export type Timezone = {
name: string;
offset: string;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* AddressProvider enum
* @description AddressProvider enum is used to define the address provider
* @enum {string} AddressProvider
*/
export declare enum AddressProvider {
AWS = "AWS",
MANUAL = "MANUAL"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressProvider = void 0;
/**
* AddressProvider enum
* @description AddressProvider enum is used to define the address provider
* @enum {string} AddressProvider
*/
var AddressProvider;
(function (AddressProvider) {
AddressProvider["AWS"] = "AWS";
AddressProvider["MANUAL"] = "MANUAL";
})(AddressProvider || (exports.AddressProvider = AddressProvider = {}));
/**
* AddressProvider Status
* @description AddressProvider Status is used to define the address provider status
* @enum {string} AddressStatus
*/
export declare enum AddressStatus {
VISIBLE = "VISIBLE",
NOT_VISIBLE = "NOT_VISIBLE"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressStatus = void 0;
/**
* AddressProvider Status
* @description AddressProvider Status is used to define the address provider status
* @enum {string} AddressStatus
*/
var AddressStatus;
(function (AddressStatus) {
AddressStatus["VISIBLE"] = "VISIBLE";
AddressStatus["NOT_VISIBLE"] = "NOT_VISIBLE";
})(AddressStatus || (exports.AddressStatus = AddressStatus = {}));
export declare class CardActivateRequest {
countryId: number;
panOrCode: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardActivateRequest = void 0;
const class_validator_1 = require("class-validator");
const CountryId_1 = require("../../country/enums/CountryId");
class CardActivateRequest {
}
exports.CardActivateRequest = CardActivateRequest;
__decorate([
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
__metadata("design:type", Number)
], CardActivateRequest.prototype, "countryId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(/^\d{16}$/),
__metadata("design:type", String)
], CardActivateRequest.prototype, "panOrCode", void 0);
import { Shipping } from '../../address/dtos/Shipping';
export declare class CardApplicationRequest {
countryId: number;
type: string;
address: Shipping;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardApplicationRequest = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const CountryId_1 = require("../../country/enums/CountryId");
const CardType_1 = require("../enums/CardType");
const Shipping_1 = require("../../address/dtos/Shipping");
class CardApplicationRequest {
}
exports.CardApplicationRequest = CardApplicationRequest;
__decorate([
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
__metadata("design:type", Number)
], CardApplicationRequest.prototype, "countryId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CardType_1.CardType),
__metadata("design:type", String)
], CardApplicationRequest.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => Shipping_1.Shipping),
__metadata("design:type", Shipping_1.Shipping)
], CardApplicationRequest.prototype, "address", void 0);
import { UpdateKey } from "../enums/UpdateKey";
export declare class CardUpdateRequest {
type: UpdateKey;
value: string;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardUpdateRequest = void 0;
const IsEnum_1 = require("class-validator/types/decorator/typechecker/IsEnum");
const UpdateKey_1 = require("../enums/UpdateKey");
const class_validator_1 = require("class-validator");
const CardUpdateKeyConstraint_1 = require("../validations/CardUpdateKeyConstraint");
class CardUpdateRequest {
}
exports.CardUpdateRequest = CardUpdateRequest;
__decorate([
(0, IsEnum_1.IsEnum)(UpdateKey_1.UpdateKey),
__metadata("design:type", String)
], CardUpdateRequest.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, CardUpdateKeyConstraint_1.IsValueValid)(),
__metadata("design:type", String)
], CardUpdateRequest.prototype, "value", void 0);
import { CountryId } from '../../country/enums/CountryId';
import { CardType } from '../enums/CardType';
import { Brand } from '../enums/Brand';
import { OwnershipType } from '../enums/OwnershipType';
import { Status } from '../enums/Status';
import { Shipping } from '../../address';
export declare class CreateCardRequest {
id?: string;
accountId?: string;
activationDate?: string;
countryId: CountryId;
type: CardType;
directoryId?: string;
externalCardId: string;
externalUserId: string;
externalShipmentId: string;
shipmentProvider: string;
externalShipmentTrackingId: string;
externalShipmentTrackingUrl: string;
holderName: string;
holderLastName: string;
imageUrl?: string;
brand: Brand;
ownershipType: OwnershipType;
lastFour: string;
providerName?: string;
status: Status;
statusUpdateDate?: string;
tenantId?: string;
spendLimitByTransaction?: number;
spendLimitByDay?: number;
spendLimitByMonth?: number;
shippedAddress?: Shipping;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateCardRequest = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const CountryId_1 = require("../../country/enums/CountryId");
const CardType_1 = require("../enums/CardType");
const Brand_1 = require("../enums/Brand");
const OwnershipType_1 = require("../enums/OwnershipType");
const Status_1 = require("../enums/Status");
const regex_1 = require("../../helpers/constans/regex");
const address_1 = require("../../address");
class CreateCardRequest {
}
exports.CreateCardRequest = CreateCardRequest;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'id must be a valid UUID v4',
}),
__metadata("design:type", String)
], CreateCardRequest.prototype, "id", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'accountId must be a valid UUID v4 or null',
}),
__metadata("design:type", String)
], CreateCardRequest.prototype, "accountId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexIso8601, {
message: 'activationDate must be a valid ISO 8601 date string',
}),
__metadata("design:type", String)
], CreateCardRequest.prototype, "activationDate", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CountryId_1.CountryId),
__metadata("design:type", String)
], CreateCardRequest.prototype, "countryId", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CardType_1.CardType),
__metadata("design:type", String)
], CreateCardRequest.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
message: 'directoryId must be a valid UUID v4',
}),
__metadata("design:type", String)
], CreateCardRequest.prototype, "directoryId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], CreateCardRequest.prototype, "externalCardId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], CreateCardRequest.prototype, "externalUserId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 100),
__metadata("design:type", String)
], CreateCardRequest.prototype, "externalShipmentId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "shipmentProvider", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "externalShipmentTrackingId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 200),
__metadata("design:type", String)
], CreateCardRequest.prototype, "externalShipmentTrackingUrl", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "holderName", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "holderLastName", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 200),
__metadata("design:type", String)
], CreateCardRequest.prototype, "imageUrl", void 0);
__decorate([
(0, class_validator_1.IsEnum)(Brand_1.Brand),
__metadata("design:type", String)
], CreateCardRequest.prototype, "brand", void 0);
__decorate([
(0, class_validator_1.IsEnum)(OwnershipType_1.OwnershipType),
__metadata("design:type", String)
], CreateCardRequest.prototype, "ownershipType", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(4, 4),
__metadata("design:type", String)
], CreateCardRequest.prototype, "lastFour", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "providerName", void 0);
__decorate([
(0, class_validator_1.IsEnum)(Status_1.Status),
__metadata("design:type", String)
], CreateCardRequest.prototype, "status", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCardRequest.prototype, "statusUpdateDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(1, 50),
__metadata("design:type", String)
], CreateCardRequest.prototype, "tenantId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(1),
(0, class_validator_1.Max)(9999999999),
__metadata("design:type", Number)
], CreateCardRequest.prototype, "spendLimitByTransaction", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(1),
(0, class_validator_1.Max)(9999999999),
__metadata("design:type", Number)
], CreateCardRequest.prototype, "spendLimitByDay", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(1),
(0, class_validator_1.Max)(9999999999),
__metadata("design:type", Number)
], CreateCardRequest.prototype, "spendLimitByMonth", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.ValidateNested)(),
(0, class_transformer_1.Type)(() => address_1.Shipping),
__metadata("design:type", address_1.Shipping)
], CreateCardRequest.prototype, "shippedAddress", void 0);
import { ValidatorConstraintInterface, ValidationArguments, ValidationOptions } from 'class-validator';
export declare class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
validate(phoneNumber: string, args: ValidationArguments): boolean;
defaultMessage(args: ValidationArguments): string;
}
export declare function IsPhoneNumberFiado(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsPhoneNumberFiado = exports.IsPhoneNumberConstraint = void 0;
const class_validator_1 = require("class-validator");
const regex_1 = require("../../helpers/constans/regex");
let IsPhoneNumberConstraint = class IsPhoneNumberConstraint {
validate(phoneNumber, args) {
return regex_1.regexPhoneNumber.test(phoneNumber);
}
defaultMessage(args) {
return "The phone number is not valid. The expected format is +############.";
}
};
exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint;
exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint = __decorate([
(0, class_validator_1.ValidatorConstraint)({ async: true })
], IsPhoneNumberConstraint);
// Decorador que usaremos en nuestras clases DTO
function IsPhoneNumberFiado(validationOptions) {
return function (object, propertyName) {
(0, class_validator_1.registerDecorator)({
target: object.constructor,
propertyName: propertyName,
options: validationOptions,
constraints: [],
validator: IsPhoneNumberConstraint,
});
};
}
exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
export declare enum Country {
MEX = "MEX",
USA = "USA"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Country = void 0;
var Country;
(function (Country) {
Country["MEX"] = "MEX";
Country["USA"] = "USA";
})(Country || (exports.Country = Country = {}));
export declare enum TypeOfDirectoryId {
USER = "USER",
BACKOFFICE = "BACKOFFICE",
AGENT = "AGENT"
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeOfDirectoryId = void 0;
var TypeOfDirectoryId;
(function (TypeOfDirectoryId) {
TypeOfDirectoryId["USER"] = "USER";
TypeOfDirectoryId["BACKOFFICE"] = "BACKOFFICE";
TypeOfDirectoryId["AGENT"] = "AGENT";
})(TypeOfDirectoryId || (exports.TypeOfDirectoryId = TypeOfDirectoryId = {}));
import { IsEnum, IsNumber, IsOptional, IsString, IsDateString } from 'class-validator';
import { Provider } from '../../provider/enums/Provider';
import { Country } from '../../country/enums/Country';
import { AccountStatus } from '../enums/AccountStatus';
import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
export class AccountResponse {
@IsString()
id: string;
@IsOptional()
@IsString()
typeOfAccountId: string;
@IsOptional()
@IsString()
externalAccountId: string;
@IsOptional()
@IsString()
externalSubAccountId: string | null;
@IsEnum(Provider)
provider: Provider;
@IsString()
directoryId: string;
@IsEnum(TypeOfDirectoryId)
typeOfDirectoryId: TypeOfDirectoryId;
@IsNumber()
currentBalance: number;
@IsNumber()
balanceLock: number;
@IsEnum(Country)
countryId: Country;
@IsDateString()
createDate: string;
@IsDateString()
lastUpdateDate: string;
@IsOptional()
@IsString()
accountNumber: string
@IsOptional()
@IsString()
routingNumber: string;
@IsEnum(AccountStatus)
status: AccountStatus;
}
import { IsEmail, IsEnum, IsString, ValidateNested, IsDateString, Matches, Length } from 'class-validator';
import { AddressResponse } from "../../address/dtos/AddressResponse";
import { Country } from "../../country/enums/Country";
import { regexUuidV4 } from '../../helpers/constans/regex';
import { TypeOfDirectoryId } from '../../directory/enums/TypeOfDirectoryId';
import { IsPhoneNumberFiado } from '../../card/validations/IsPhoneNumberConstraint';
export class CreateAccountRequest {
@IsString()
@Matches(regexUuidV4,
{
message: 'directoryId must be a valid UUID v4',
})
directoryId: string;
@IsEnum(TypeOfDirectoryId)
typeOfDirectoryId: string;
@IsString()
firstName: string;
@IsString()
lastName: string;
@IsPhoneNumberFiado()
phoneNumber: string;
@ValidateNested()
address: AddressResponse;
@IsEmail()
email: string;
@IsDateString()
dob: string;
@IsString()
@Length(1, 30)
documentNumber: string;
@IsEnum(Country)
countryId: Country;
}
import { IsString, Matches } from "class-validator";
import { regexUuidV4 } from "../../helpers/constans/regex";
export class CreatePocketRequest {
@IsString()
@Matches(regexUuidV4,
{
message: 'beneficiaryDirectoryId must be a valid UUID v4',
})
beneficiaryDirectoryId?: string;
@IsString()
@Matches(regexUuidV4,
{
message: 'accountId must be a valid UUID v4',
})
accountId: string;
}
export enum AccountStatus {
ACTIVE = "ACTIVE",
INACTIVE = "INACTIVE",
BLOCKED = "BLOCKED"
}
import { IsBoolean, IsEnum, IsNumber, IsOptional, IsString, Length, Matches, ValidateNested } from 'class-validator';
import { TypeOfDirectoryId } from "../../directory/enums/TypeOfDirectoryId";
import { AddressProvider } from "../enums/AddressProvider";
import { AddressStatus } from "../enums/AddressStatus";
import { Place } from "./Place";
import { CountryId } from '../../country/enums/CountryId';
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
export class AddressBase {
@IsOptional()
@IsString()
@Matches(regexUuidV4,
{
message: 'id must be a valid UUID v4',
})
id?: string;
@IsNumber()
@IsOptional()
distance?: number;
@IsEnum(TypeOfDirectoryId)
createdBy: TypeOfDirectoryId;
@IsString()
@Matches(regexUuidV4,
{
message: 'directoryId must be a valid UUID v4',
})
directoryId: string;
@IsBoolean()
isPrincipal: boolean;
@IsOptional()
@IsString()
@Length(1, 100)
tag?: string;
@IsString()
@Length(1, 100)
tenantId: string;
@IsString()
typeOfAddressId: string;
@IsEnum(TypeOfDirectoryId)
typeOfDirectoryId: TypeOfDirectoryId;
@IsEnum(AddressProvider)
provider: AddressProvider;
@ValidateNested()
place: Place;
@IsString()
@Matches(regexIso8601,
{
message: 'validFrom must be a valid ISO 8601 date string',
})
validFrom: string;
@IsOptional()
@IsString()
@Matches(regexIso8601,
{
message: 'validUntil must be a valid ISO 8601 date string',
})
validUntil?: string;
@IsEnum(AddressStatus)
addressStatus: AddressStatus;
@IsOptional()
@IsString()
@Length(1, 200)
additionalInformation?: string;
@IsBoolean()
helpNeeded: boolean;
@IsOptional()
@IsString()
@Length(1, 10)
internalNumber?: string;
@IsEnum(CountryId)
countryId: CountryId;
@IsString()
@Length(1, 100)
street?: string;
@IsString()
@Length(1, 10)
addressNumber?: string;
@IsOptional()
@IsString()
@Length(2, 60)
municipality?: string;
@IsOptional()
@IsString()
subMunicipality?: string;
@IsOptional()
@IsString()
@Length(2, 60)
neighborhood?: string;
@IsOptional()
@IsString()
@Length(2, 60)
subRegion?: string;
@IsString()
@Length(5, 10)
region?: string;
@IsString()
@Length(5, 10)
postalCode?: string;
@IsEnum(CountryId)
country: string;
}
import { IsOptional, IsString, Length, Matches } from 'class-validator';
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
import { AddressBase } from './AddressBase';
export class AddressResponse extends AddressBase {
@IsString()
@Matches(regexUuidV4,
{
message: 'id must be a valid UUID v4',
})
id: string
@IsOptional()
@IsString()
@Matches(regexIso8601,
{
message: 'createDate must be a valid ISO 8601 date string',
})
createDate: string;
@IsOptional()
@IsString()
@Matches(regexIso8601,
{
message: 'updateDate must be a valid ISO 8601 date string',
})
updateDate?: string;
@IsOptional()
@IsString()
@Length(1, 100)
updatedBy?: string;
}
import { AddressBase } from "./AddressBase";
export class CreateAddressRequest extends AddressBase {
}
export type Geometry = {
point: [number, number];
}
import { IsArray, IsBoolean, IsEnum, IsOptional, IsString, Length, ValidateNested } from 'class-validator';
import { Geometry } from "./Geometry";
import { Timezone } from "./Timezone";
import { Country } from '../../country/enums/Country';
export class Place {
@ValidateNested()
geometry: Geometry;
@IsOptional()
@IsString()
addressNumber?: string;
@IsOptional()
@IsArray()
@IsString({ each: true })
categories?: string[];
@IsOptional()
@IsEnum(Country)
country?: string;
@IsBoolean()
interpolated: boolean;
@IsOptional()
@IsString()
@Length(1, 300)
label?: string;
@IsOptional()
@IsString()
@Length(1, 60)
municipality?: string;
@IsOptional()
@IsString()
@Length(2, 60)
neighborhood?: string;
@IsOptional()
@IsString()
@Length(5, 10)
postalCode?: string;
@IsOptional()
@IsString()
@Length(5, 10)
region?: string;
@IsOptional()
@IsString()
@Length(1, 100)
street?: string;
@IsOptional()
@IsString()
@Length(2, 60)
subMunicipality?: string;
@IsOptional()
@IsString()
@Length(2, 60)
subRegion?: string;
@IsOptional()
@IsArray()
@IsString({ each: true })
supplementalCategories?: string[];
@IsOptional()
@ValidateNested()
timezone?: Timezone;
@IsOptional()
@IsString()
@Length(1, 10)
unitNumber?: string;
@IsOptional()
@IsString()
@Length(1, 10)
unitType?: string;
}
import { IsString, Length, IsOptional } from 'class-validator';
import { CountryId } from '../../country/enums/CountryId';
export class Shipping {
@IsString()
@Length(2, 60)
municipality: string;
@IsString()
@Length(2, 60)
neighborhood: string;
@IsString()
@Length(5, 10)
postalCode: string;
@IsString()
@Length(2, 100)
street: string;
@IsString()
@Length(2, 60)
subRegion: string;
@IsString()
@Length(1, 10)
addressNumber: string;
@IsOptional()
@IsString()
@Length(1, 200)
internalNumber?: string;
@IsString()
countryId: CountryId;
}
export type Timezone = {
name: string;
offset: string;
}
/**
* AddressProvider enum
* @description AddressProvider enum is used to define the address provider
* @enum {string} AddressProvider
*/
export enum AddressProvider {
AWS = "AWS",
MANUAL = "MANUAL"
}
/**
* AddressProvider Status
* @description AddressProvider Status is used to define the address provider status
* @enum {string} AddressStatus
*/
export enum AddressStatus {
VISIBLE = "VISIBLE",
NOT_VISIBLE = "NOT_VISIBLE"
}
import { IsEnum, IsString, Matches } from 'class-validator';
import { CountryId } from '../../country/enums/CountryId';
export class CardActivateRequest {
@IsEnum(CountryId)
countryId: number;
@IsString()
@Matches(/^\d{16}$/)
panOrCode: string;
}
import { IsEnum, IsNotEmpty, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { CountryId } from '../../country/enums/CountryId';
import { CardType } from '../enums/CardType';
import { Shipping } from '../../address/dtos/Shipping';
export class CardApplicationRequest {
@IsEnum(CountryId)
countryId: number;
@IsEnum(CardType)
type: string;
@IsNotEmpty()
@ValidateNested()
@Type(() => Shipping)
address: Shipping;
}
import { IsEnum } from "class-validator/types/decorator/typechecker/IsEnum";
import { UpdateKey } from "../enums/UpdateKey";
import { IsString } from "class-validator";
import { IsValueValid } from "../validations/CardUpdateKeyConstraint";
export class CardUpdateRequest {
@IsEnum(UpdateKey)
type: UpdateKey;
@IsString()
@IsValueValid()
value: string;
}
import { IsString, IsOptional, IsEnum, ValidateNested, IsNumber, Min, Max, Length, Matches } from 'class-validator';
import { Type } from 'class-transformer';
import { CountryId } from '../../country/enums/CountryId';
import { CardType } from '../enums/CardType';
import { Brand } from '../enums/Brand';
import { OwnershipType } from '../enums/OwnershipType';
import { Status } from '../enums/Status';
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
import { Shipping } from '../../address';
export class CreateCardRequest {
@IsOptional()
@IsString()
@Matches(regexUuidV4,
{
message: 'id must be a valid UUID v4',
})
id?: string;
@IsOptional()
@IsString()
@Matches(regexUuidV4,
{
message: 'accountId must be a valid UUID v4 or null',
})
accountId?: string;
@IsOptional()
@IsString()
@Matches(regexIso8601, {
message: 'activationDate must be a valid ISO 8601 date string',
})
activationDate?: string;
@IsEnum(CountryId)
countryId: CountryId;
@IsEnum(CardType)
type: CardType;
@IsString()
@Matches(regexUuidV4,
{
message: 'directoryId must be a valid UUID v4',
})
directoryId?: string;
@IsString()
@Length(1, 100)
externalCardId: string;
@IsString()
@Length(1, 100)
externalUserId: string;
@IsOptional()
@IsString()
@Length(1, 100)
externalShipmentId: string;
@IsOptional()
@IsString()
@Length(1, 50)
shipmentProvider: string;
@IsOptional()
@IsString()
@Length(1, 50)
externalShipmentTrackingId: string;
@IsOptional()
@IsString()
@Length(1, 200)
externalShipmentTrackingUrl: string;
@IsOptional()
@IsString()
@Length(1, 50)
holderName: string;
@IsOptional()
@IsString()
@Length(1, 50)
holderLastName: string;
@IsOptional()
@IsString()
@Length(1, 200)
imageUrl?: string;
@IsEnum(Brand)
brand: Brand;
@IsEnum(OwnershipType)
ownershipType: OwnershipType;
@IsString()
@Length(4, 4)
lastFour: string;
@IsOptional()
@IsString()
@Length(1, 50)
providerName?: string;
@IsEnum(Status)
status: Status;
@IsOptional()
@IsString()
statusUpdateDate?: string;
@IsOptional()
@IsString()
@Length(1, 50)
tenantId?: string;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByTransaction?: number;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByDay?: number;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByMonth?: number;
@IsOptional()
@ValidateNested()
@Type(() => Shipping)
shippedAddress?: Shipping;
}
import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments, registerDecorator, ValidationOptions } from 'class-validator';
import { regexPhoneNumber } from '../../helpers/constans/regex';
@ValidatorConstraint({ async: true })
export class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
validate(phoneNumber: string, args: ValidationArguments) {
return regexPhoneNumber.test(phoneNumber);
}
defaultMessage(args: ValidationArguments) {
return "The phone number is not valid. The expected format is +############.";
}
}
// Decorador que usaremos en nuestras clases DTO
export function IsPhoneNumberFiado(validationOptions?: ValidationOptions) {
return function (object: Object, propertyName: string) {
registerDecorator({
target: object.constructor,
propertyName: propertyName,
options: validationOptions,
constraints: [],
validator: IsPhoneNumberConstraint,
});
};
}
export enum Country {
MEX = "MEX",
USA = "USA"
}
export enum TypeOfDirectoryId {
USER = "USER",
BACKOFFICE = "BACKOFFICE",
AGENT = "AGENT"
}
+1
-1

@@ -1,1 +0,1 @@

export * from './dtos/AddressShippingDto';
export * from './dtos/Shipping';

@@ -17,2 +17,2 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./dtos/AddressShippingDto"), exports);
__exportStar(require("./dtos/Shipping"), exports);

@@ -39,4 +39,3 @@ "use strict";

defaultMessage(args) {
// Se4 puede usar args para personalizar aún más el mensaje de error basado en el valor o las propiedades.
return "El valor no es adecuado para el tipo de actualización.";
return "The value is not valid for the update type.";
}

@@ -43,0 +42,0 @@ };

"use strict";
//*
Object.defineProperty(exports, "__esModule", { value: true });

@@ -3,0 +4,0 @@ exports.CountryId = void 0;

export declare const regexUuidV4: RegExp;
export declare const regexIso8601: RegExp;
export declare const regexPhoneNumber: RegExp;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.regexIso8601 = exports.regexUuidV4 = void 0;
exports.regexPhoneNumber = exports.regexIso8601 = exports.regexUuidV4 = void 0;
// Expresión regular para validar UUID v4

@@ -8,1 +8,3 @@ 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;

exports.regexIso8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
// Expresión regular para validar un número de teléfono
exports.regexPhoneNumber = /^\+\d{12}$/;

@@ -1,5 +0,5 @@

export * from './card/dtos/CardActivateRequestDto';
export * from './card/dtos/CardApplicationRequestDto';
export * from './card/dtos/CreateCardRequestDto';
export * from './card/dtos/CardUpdateRequestDto';
export * from './card/dtos/CardActivateRequest';
export * from './card/dtos/CardApplicationRequest';
export * from './card/dtos/CreateCardRequest';
export * from './card/dtos/CardUpdateRequest';
export * from './card/enums/CardType';

@@ -6,0 +6,0 @@ export * from './card/enums/CardUpdateKey';

@@ -17,6 +17,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./card/dtos/CardActivateRequestDto"), exports);
__exportStar(require("./card/dtos/CardApplicationRequestDto"), exports);
__exportStar(require("./card/dtos/CreateCardRequestDto"), exports);
__exportStar(require("./card/dtos/CardUpdateRequestDto"), exports);
__exportStar(require("./card/dtos/CardActivateRequest"), exports);
__exportStar(require("./card/dtos/CardApplicationRequest"), exports);
__exportStar(require("./card/dtos/CreateCardRequest"), exports);
__exportStar(require("./card/dtos/CardUpdateRequest"), exports);
__exportStar(require("./card/enums/CardType"), exports);

@@ -23,0 +23,0 @@ __exportStar(require("./card/enums/CardUpdateKey"), exports);

{
"name": "@fiado/type-kit",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "bin/index.js",

@@ -1,1 +0,1 @@

export * from './dtos/AddressShippingDto';
export * from './dtos/Shipping';
import { ValidationArguments, ValidationOptions, ValidatorConstraint, registerDecorator } from "class-validator";
import { CardUpdateRequestDto } from "../dtos/CardUpdateRequestDto";
import { CardUpdateRequest } from "../dtos/CardUpdateRequest";
import { Status } from "../enums/Status";

@@ -12,3 +12,3 @@ import { UpdateKey } from "../enums/UpdateKey";

const cardUpdateRequest = arg.object as CardUpdateRequestDto;
const cardUpdateRequest = arg.object as CardUpdateRequest;

@@ -41,6 +41,4 @@ // Validar si el valor es uno de los status válidos

defaultMessage(args: ValidationArguments) {
// Se4 puede usar args para personalizar aún más el mensaje de error basado en el valor o las propiedades.
return "El valor no es adecuado para el tipo de actualización.";
return "The value is not valid for the update type.";
}
}

@@ -47,0 +45,0 @@

@@ -0,1 +1,4 @@

//*
export enum CountryId {

@@ -2,0 +5,0 @@ MEX = "484",

@@ -7,2 +7,4 @@

export const regexIso8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
// Expresión regular para validar un número de teléfono
export const regexPhoneNumber = /^\+\d{12}$/;

@@ -9,0 +11,0 @@

@@ -1,5 +0,5 @@

export * from './card/dtos/CardActivateRequestDto';
export * from './card/dtos/CardApplicationRequestDto';
export * from './card/dtos/CreateCardRequestDto';
export * from './card/dtos/CardUpdateRequestDto';
export * from './card/dtos/CardActivateRequest';
export * from './card/dtos/CardApplicationRequest';
export * from './card/dtos/CreateCardRequest';
export * from './card/dtos/CardUpdateRequest';

@@ -6,0 +6,0 @@

import { IsString, Length, IsOptional } from 'class-validator';
import { CountryId } from '../../country/enums/CountryId';
export class ShippingAddressDto {
@IsString()
@Length(2, 60)
municipality: string;
@IsString()
@Length(2, 60)
neighborhood: string;
@IsString()
@Length(5, 10)
postalCode: string;
@IsString()
@Length(2, 100)
street: string;
@IsString()
@Length(2, 60)
subRegion: string;
@IsString()
@Length(1, 10)
addressNumber: string;
@IsOptional()
@IsString()
@Length(1, 200)
internalNumber?: string;
@IsString()
countryId: CountryId;
}
import { IsEnum, IsString, Matches } from 'class-validator';
import { CountryId } from '../../country/enums/CountryId';
export class CardActivateRequestDto {
@IsEnum(CountryId)
countryId: number;
@IsString()
@Matches(/^\d{16}$/)
panOrCode: string;
}
import { IsEnum, IsNotEmpty, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { CountryId } from '../../country/enums/CountryId';
import { CardType } from '../enums/CardType';
import { ShippingAddressDto } from '../../address/dtos/AddressShippingDto';
export class CardApplicationRequestDto {
@IsEnum(CountryId)
countryId: number;
@IsEnum(CardType)
type: string;
@IsNotEmpty()
@ValidateNested()
@Type(() => ShippingAddressDto)
address: ShippingAddressDto;
}
import { IsEnum } from "class-validator/types/decorator/typechecker/IsEnum";
import { UpdateKey } from "../enums/UpdateKey";
import { IsString } from "class-validator";
import { IsValueValid } from "../validations/CardUpdateKeyConstraint";
export class CardUpdateRequestDto {
@IsEnum(UpdateKey)
type: UpdateKey;
@IsString()
@IsValueValid()
value: string;
}
import { IsString, IsOptional, IsEnum, ValidateNested, IsNumber, Min, Max, Length, Matches } from 'class-validator';
import { Type } from 'class-transformer';
import { CountryId } from '../../country/enums/CountryId';
import { ShippingAddressDto } from '../../address/dtos/AddressShippingDto';
import { CardType } from '../enums/CardType';
import { Brand } from '../enums/Brand';
import { OwnershipType } from '../enums/OwnershipType';
import { Status } from '../enums/Status';
import { regexIso8601, regexUuidV4 } from '../../helpers/constans/regex';
export class CreateCardRequestDto {
@IsOptional()
@IsString()
@Matches(regexUuidV4,
{
message: 'id must be a valid UUID v4',
})
id?: string;
@IsOptional()
@IsString()
@Matches(regexUuidV4,
{
message: 'accountId must be a valid UUID v4 or null',
})
accountId?: string;
@IsOptional()
@IsString()
@Matches(regexIso8601, {
message: 'activationDate must be a valid ISO 8601 date string',
})
activationDate?: string;
@IsEnum(CountryId)
countryId: CountryId;
@IsEnum(CardType)
type: CardType;
@IsString()
@Matches(regexUuidV4,
{
message: 'directoryId must be a valid UUID v4',
})
directoryId?: string;
@IsString()
@Length(1, 100)
externalCardId: string;
@IsString()
@Length(1, 100)
externalUserId: string;
@IsOptional()
@IsString()
@Length(1, 100)
externalShipmentId: string;
@IsOptional()
@IsString()
@Length(1, 50)
shipmentProvider: string;
@IsOptional()
@IsString()
@Length(1, 50)
externalShipmentTrackingId: string;
@IsOptional()
@IsString()
@Length(1, 200)
externalShipmentTrackingUrl: string;
@IsOptional()
@IsString()
@Length(1, 50)
holderName: string;
@IsOptional()
@IsString()
@Length(1, 50)
holderLastName: string;
@IsOptional()
@IsString()
@Length(1, 200)
imageUrl?: string;
@IsEnum(Brand)
brand: Brand;
@IsEnum(OwnershipType)
ownershipType: OwnershipType;
@IsString()
@Length(4, 4)
lastFour: string;
@IsOptional()
@IsString()
@Length(1, 50)
providerName?: string;
@IsEnum(Status)
status: Status;
@IsOptional()
@IsString()
statusUpdateDate?: string;
@IsOptional()
@IsString()
@Length(1, 50)
tenantId?: string;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByTransaction?: number;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByDay?: number;
@IsOptional()
@IsNumber()
@Min(1)
@Max(9999999999)
spendLimitByMonth?: number;
@IsOptional()
@ValidateNested()
@Type(() => ShippingAddressDto)
shippedAddress?: ShippingAddressDto;
}