"use strict";
// SPDX-License-Identifier: Apache-2.0
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ValidatedArgs_1 = __importDefault(require("../../../../core/validation/ValidatedArgs"));
const FormatValidation_1 = __importDefault(require("../FormatValidation"));
const SecurityDate_1 = require("../../../../domain/context/shared/SecurityDate");
class SetDividendRequest extends ValidatedArgs_1.default {
    securityId;
    amountPerUnitOfSecurity;
    recordTimestamp;
    executionTimestamp;
    constructor({ securityId, amountPerUnitOfSecurity, recordTimestamp, executionTimestamp, }) {
        super({
            amountPerUnitOfSecurity: FormatValidation_1.default.checkAmount(),
            recordTimestamp: (val) => {
                return SecurityDate_1.SecurityDate.checkDateTimestamp(parseInt(val), Math.ceil(new Date().getTime() / 1000), parseInt(this.executionTimestamp));
            },
            executionTimestamp: (val) => {
                return SecurityDate_1.SecurityDate.checkDateTimestamp(parseInt(val), parseInt(this.recordTimestamp), undefined);
            },
            securityId: FormatValidation_1.default.checkHederaIdFormatOrEvmAddress(),
        });
        this.securityId = securityId;
        this.amountPerUnitOfSecurity = amountPerUnitOfSecurity;
        this.recordTimestamp = recordTimestamp;
        this.executionTimestamp = executionTimestamp;
    }
}
exports.default = SetDividendRequest;
