"use strict";
/* eslint-disable-next-line no-unused-vars */
function __export(m) {
/* eslint-disable-next-line no-prototype-builtins */
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable-next-line no-unused-vars */
var jtv = require('@mojotech/json-type-validation');
/* eslint-disable-next-line no-unused-vars */
var damlTypes = require('@daml/types');

var Fairmint_OpenCapTable_Types_Monetary = require('../../../../Fairmint/OpenCapTable/Types/Monetary/module');


exports.OcfEquityCompensationIssuanceData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({compensation_type: exports.OcfCompensationType.decoder, quantity: damlTypes.Numeric(10).decoder, comments: damlTypes.List(damlTypes.Text).decoder, termination_exercise_windows: damlTypes.List(exports.OcfTerminationWindow).decoder, vestings: damlTypes.List(exports.OcfVesting).decoder, base_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), early_exercisable: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Bool).decoder), exercise_price: jtv.Decoder.withDefault(null, damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).decoder), expiration_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), }); }),
  encode: function (__typed__) {
  return {
    compensation_type: exports.OcfCompensationType.encode(__typed__.compensation_type),
    quantity: damlTypes.Numeric(10).encode(__typed__.quantity),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    termination_exercise_windows: damlTypes.List(exports.OcfTerminationWindow).encode(__typed__.termination_exercise_windows),
    vestings: damlTypes.List(exports.OcfVesting).encode(__typed__.vestings),
    base_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.base_price),
    early_exercisable: damlTypes.Optional(damlTypes.Bool).encode(__typed__.early_exercisable),
    exercise_price: damlTypes.Optional(Fairmint_OpenCapTable_Types_Monetary.OcfMonetary).encode(__typed__.exercise_price),
    expiration_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.expiration_date),
  };
}
,
};



exports.OcfCompensationType = {
  OcfCompensationTypeOptionNSO: 'OcfCompensationTypeOptionNSO',
  OcfCompensationTypeOptionISO: 'OcfCompensationTypeOptionISO',
  OcfCompensationTypeOption: 'OcfCompensationTypeOption',
  OcfCompensationTypeRSU: 'OcfCompensationTypeRSU',
  OcfCompensationTypeCSAR: 'OcfCompensationTypeCSAR',
  OcfCompensationTypeSSAR: 'OcfCompensationTypeSSAR',
  keys: ['OcfCompensationTypeOptionNSO','OcfCompensationTypeOptionISO','OcfCompensationTypeOption','OcfCompensationTypeRSU','OcfCompensationTypeCSAR','OcfCompensationTypeSSAR',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfCompensationType.OcfCompensationTypeOptionNSO), jtv.constant(exports.OcfCompensationType.OcfCompensationTypeOptionISO), jtv.constant(exports.OcfCompensationType.OcfCompensationTypeOption), jtv.constant(exports.OcfCompensationType.OcfCompensationTypeRSU), jtv.constant(exports.OcfCompensationType.OcfCompensationTypeCSAR), jtv.constant(exports.OcfCompensationType.OcfCompensationTypeSSAR)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfVesting = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({amount: damlTypes.Numeric(10).decoder, date: damlTypes.Time.decoder, }); }),
  encode: function (__typed__) {
  return {
    amount: damlTypes.Numeric(10).encode(__typed__.amount),
    date: damlTypes.Time.encode(__typed__.date),
  };
}
,
};



exports.OcfTerminationWindow = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({period: damlTypes.Int.decoder, period_type: exports.OcfPeriodType.decoder, reason: exports.OcfTerminationWindowType.decoder, }); }),
  encode: function (__typed__) {
  return {
    period: damlTypes.Int.encode(__typed__.period),
    period_type: exports.OcfPeriodType.encode(__typed__.period_type),
    reason: exports.OcfTerminationWindowType.encode(__typed__.reason),
  };
}
,
};



exports.OcfTerminationWindowType = {
  OcfTermVoluntaryOther: 'OcfTermVoluntaryOther',
  OcfTermVoluntaryGoodCause: 'OcfTermVoluntaryGoodCause',
  OcfTermVoluntaryRetirement: 'OcfTermVoluntaryRetirement',
  OcfTermInvoluntaryOther: 'OcfTermInvoluntaryOther',
  OcfTermInvoluntaryDeath: 'OcfTermInvoluntaryDeath',
  OcfTermInvoluntaryDisability: 'OcfTermInvoluntaryDisability',
  OcfTermInvoluntaryWithCause: 'OcfTermInvoluntaryWithCause',
  keys: ['OcfTermVoluntaryOther','OcfTermVoluntaryGoodCause','OcfTermVoluntaryRetirement','OcfTermInvoluntaryOther','OcfTermInvoluntaryDeath','OcfTermInvoluntaryDisability','OcfTermInvoluntaryWithCause',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfTerminationWindowType.OcfTermVoluntaryOther), jtv.constant(exports.OcfTerminationWindowType.OcfTermVoluntaryGoodCause), jtv.constant(exports.OcfTerminationWindowType.OcfTermVoluntaryRetirement), jtv.constant(exports.OcfTerminationWindowType.OcfTermInvoluntaryOther), jtv.constant(exports.OcfTerminationWindowType.OcfTermInvoluntaryDeath), jtv.constant(exports.OcfTerminationWindowType.OcfTermInvoluntaryDisability), jtv.constant(exports.OcfTerminationWindowType.OcfTermInvoluntaryWithCause)); }),
  encode: function (__typed__) { return __typed__; },
};



exports.OcfPeriodType = {
  OcfPeriodDays: 'OcfPeriodDays',
  OcfPeriodMonths: 'OcfPeriodMonths',
  OcfPeriodYears: 'OcfPeriodYears',
  keys: ['OcfPeriodDays','OcfPeriodMonths','OcfPeriodYears',],
  decoder: damlTypes.lazyMemo(function () { return jtv.oneOf(jtv.constant(exports.OcfPeriodType.OcfPeriodDays), jtv.constant(exports.OcfPeriodType.OcfPeriodMonths), jtv.constant(exports.OcfPeriodType.OcfPeriodYears)); }),
  encode: function (__typed__) { return __typed__; },
};

