// SPDX-License-Identifier: Apache-2.0
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);
};
import { OptionalField } from "../../../../core/decorator/OptionalDecorator";
import { Equity } from "../../../../domain/context/equity/Equity";
import { Security } from "../../../../domain/context/security/Security";
import ValidatedRequest from "../../../../core/validation/ValidatedArgs";
import FormatValidation from "../FormatValidation";
import { Factory } from "../../../../domain/context/factory/Factories";
export default class CreateEquityRequest extends ValidatedRequest {
    name;
    symbol;
    isin;
    _decimals;
    get decimals() {
        return this._decimals;
    }
    set decimals(value) {
        this._decimals = typeof value === "number" ? value : parseFloat(value);
    }
    isWhiteList;
    erc20VotesActivated;
    isControllable;
    arePartitionsProtected;
    isMultiPartition;
    clearingActive;
    internalKycActivated;
    externalPausesIds;
    externalControlListsIds;
    externalKycListsIds;
    diamondOwnerAccount;
    complianceId;
    identityRegistryId;
    votingRight;
    informationRight;
    liquidationRight;
    subscriptionRight;
    conversionRight;
    redemptionRight;
    putRight;
    dividendRight;
    currency;
    numberOfShares;
    nominalValue;
    nominalValueDecimals;
    regulationType;
    regulationSubType;
    isCountryControlListWhiteList;
    countries;
    info;
    configId;
    configVersion;
    constructor({ name, symbol, isin, decimals, isWhiteList, erc20VotesActivated, isControllable, arePartitionsProtected, isMultiPartition, clearingActive, internalKycActivated, externalPausesIds, externalControlListsIds, externalKycListsIds, diamondOwnerAccount, votingRight, informationRight, liquidationRight, subscriptionRight, conversionRight, redemptionRight, putRight, dividendRight, currency, numberOfShares, nominalValue, nominalValueDecimals, regulationType, regulationSubType, isCountryControlListWhiteList, countries, info, configId, configVersion, complianceId, identityRegistryId, }) {
        super({
            name: (val) => {
                return Security.checkName(val);
            },
            symbol: (val) => {
                return Security.checkSymbol(val);
            },
            isin: (val) => {
                return Security.checkISIN(val);
            },
            decimals: (val) => {
                return Security.checkInteger(val);
            },
            diamondOwnerAccount: FormatValidation.checkHederaIdFormatOrEvmAddress(false),
            dividendRight: (val) => {
                return Equity.checkDividend(val);
            },
            currency: FormatValidation.checkBytes3Format(),
            numberOfShares: FormatValidation.checkNumber(),
            nominalValue: FormatValidation.checkNumber(),
            regulationType: (val) => {
                return Factory.checkRegulationType(val);
            },
            regulationSubType: (val) => {
                return Factory.checkRegulationSubType(val, this.regulationType);
            },
            configId: FormatValidation.checkBytes32Format(),
            externalPausesIds: (val) => {
                return FormatValidation.checkHederaIdOrEvmAddressArray(val ?? [], "externalPausesIds", true);
            },
            externalControlListsIds: (val) => {
                return FormatValidation.checkHederaIdOrEvmAddressArray(val ?? [], "externalControlListsIds", true);
            },
            externalKycListsIds: (val) => {
                return FormatValidation.checkHederaIdOrEvmAddressArray(val ?? [], "externalKycListsIds", true);
            },
            complianceId: FormatValidation.checkHederaIdFormatOrEvmAddress(true),
            identityRegistryId: FormatValidation.checkHederaIdFormatOrEvmAddress(true),
        });
        this.name = name;
        this.symbol = symbol;
        this.isin = isin;
        this.decimals = typeof decimals === "number" ? decimals : parseInt(decimals);
        this.isWhiteList = isWhiteList;
        this.erc20VotesActivated = erc20VotesActivated;
        this.isControllable = isControllable;
        this.arePartitionsProtected = arePartitionsProtected;
        this.isMultiPartition = isMultiPartition;
        this.clearingActive = clearingActive;
        this.internalKycActivated = internalKycActivated;
        this.externalPausesIds = externalPausesIds;
        this.diamondOwnerAccount = diamondOwnerAccount;
        this.externalControlListsIds = externalControlListsIds;
        this.externalKycListsIds = externalKycListsIds;
        this.votingRight = votingRight;
        this.informationRight = informationRight;
        this.liquidationRight = liquidationRight;
        this.subscriptionRight = subscriptionRight;
        this.conversionRight = conversionRight;
        this.redemptionRight = redemptionRight;
        this.putRight = putRight;
        this.dividendRight = dividendRight;
        this.currency = currency;
        this.numberOfShares = numberOfShares;
        this.nominalValue = nominalValue;
        this.nominalValueDecimals = nominalValueDecimals;
        this.regulationType = regulationType;
        this.regulationSubType = regulationSubType;
        this.isCountryControlListWhiteList = isCountryControlListWhiteList;
        this.countries = countries;
        this.info = info;
        this.configId = configId;
        this.configVersion = configVersion;
        this.complianceId = complianceId;
        this.identityRegistryId = identityRegistryId;
    }
}
__decorate([
    OptionalField(),
    __metadata("design:type", Array)
], CreateEquityRequest.prototype, "externalPausesIds", void 0);
__decorate([
    OptionalField(),
    __metadata("design:type", Array)
], CreateEquityRequest.prototype, "externalControlListsIds", void 0);
__decorate([
    OptionalField(),
    __metadata("design:type", Array)
], CreateEquityRequest.prototype, "externalKycListsIds", void 0);
__decorate([
    OptionalField(),
    __metadata("design:type", String)
], CreateEquityRequest.prototype, "diamondOwnerAccount", void 0);
__decorate([
    OptionalField(),
    __metadata("design:type", String)
], CreateEquityRequest.prototype, "complianceId", void 0);
__decorate([
    OptionalField(),
    __metadata("design:type", String)
], CreateEquityRequest.prototype, "identityRegistryId", void 0);
