"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 pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = require('../../../../DA/Internal/Template');

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


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



exports.ValuationOcfData = {
  decoder: damlTypes.lazyMemo(function () { return jtv.object({id: damlTypes.Text.decoder, effective_date: damlTypes.Time.decoder, price_per_share: Fairmint_OpenCapTable_Types_Monetary.OcfMonetary.decoder, stock_class_id: damlTypes.Text.decoder, valuation_type: exports.OcfValuationType.decoder, comments: damlTypes.List(damlTypes.Text).decoder, board_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), provider: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Text).decoder), stockholder_approval_date: jtv.Decoder.withDefault(null, damlTypes.Optional(damlTypes.Time).decoder), }); }),
  encode: function (__typed__) {
  return {
    id: damlTypes.Text.encode(__typed__.id),
    effective_date: damlTypes.Time.encode(__typed__.effective_date),
    price_per_share: Fairmint_OpenCapTable_Types_Monetary.OcfMonetary.encode(__typed__.price_per_share),
    stock_class_id: damlTypes.Text.encode(__typed__.stock_class_id),
    valuation_type: exports.OcfValuationType.encode(__typed__.valuation_type),
    comments: damlTypes.List(damlTypes.Text).encode(__typed__.comments),
    board_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.board_approval_date),
    provider: damlTypes.Optional(damlTypes.Text).encode(__typed__.provider),
    stockholder_approval_date: damlTypes.Optional(damlTypes.Time).encode(__typed__.stockholder_approval_date),
  };
}
,
};



exports.Valuation = damlTypes.assembleTemplate(
{
  templateId: '#OpenCapTable-v34:Fairmint.OpenCapTable.OCF.Valuation:Valuation',
  templateIdWithPackageId: '0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b:Fairmint.OpenCapTable.OCF.Valuation:Valuation',
  keyDecoder: damlTypes.lazyMemo(function () { return jtv.constant(undefined); }),
  keyEncode: function () { throw 'EncodeError'; },
  decoder: damlTypes.lazyMemo(function () { return jtv.object({context: Fairmint_OpenCapTable_Types_Core.Context.decoder, valuation_data: exports.ValuationOcfData.decoder, }); }),
  encode: function (__typed__) {
  return {
    context: Fairmint_OpenCapTable_Types_Core.Context.encode(__typed__.context),
    valuation_data: exports.ValuationOcfData.encode(__typed__.valuation_data),
  };
}
,
  Archive: {
    template: function () { return exports.Valuation; },
    choiceName: 'Archive',
    argumentDecoder: damlTypes.lazyMemo(function () { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.decoder; }),
    argumentEncode: function (__typed__) { return pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69.DA.Internal.Template.Archive.encode(__typed__); },
    resultDecoder: damlTypes.lazyMemo(function () { return damlTypes.Unit.decoder; }),
    resultEncode: function (__typed__) { return damlTypes.Unit.encode(__typed__); },
  },
}

);


damlTypes.registerTemplate(exports.Valuation, ['0eb2e2e43d1d241492077e84452c7ffb63dd34a9af49ddec0dba636351f6486b', '#OpenCapTable-v34']);

