"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 });
exports.Coupon = void 0;
const ValidatedArgs_1 = __importDefault(require("../../../core/validation/ValidatedArgs"));
const SecurityDate_1 = require("../shared/SecurityDate");
const Bond_1 = require("./Bond");
class Coupon extends ValidatedArgs_1.default {
    recordTimeStamp;
    executionTimeStamp;
    rate;
    rateDecimals;
    startTimeStamp;
    endTimeStamp;
    fixingTimeStamp;
    rateStatus;
    snapshotId;
    isDisabled;
    constructor(recordTimeStamp, executionTimeStamp, rate, rateDecimals, startTimeStamp, endTimeStamp, fixingTimeStamp, rateStatus, snapshotId, isDisabled = false) {
        super({
            executionTimeStamp: (val) => {
                return SecurityDate_1.SecurityDate.checkDateTimestamp(val, this.recordTimeStamp);
            },
            rateStatus: (val) => {
                return Bond_1.Bond.checkRateStatus(val);
            },
        });
        this.recordTimeStamp = recordTimeStamp;
        this.executionTimeStamp = executionTimeStamp;
        this.rate = rate;
        this.rateDecimals = rateDecimals;
        this.startTimeStamp = startTimeStamp;
        this.endTimeStamp = endTimeStamp;
        this.fixingTimeStamp = fixingTimeStamp;
        this.rateStatus = rateStatus;
        this.snapshotId = snapshotId ? snapshotId : undefined;
        this.isDisabled = isDisabled;
        ValidatedArgs_1.default.handleValidation(Coupon.name, this);
    }
}
exports.Coupon = Coupon;
