.. _module-utility-commercials-v0-model-commercialagreement-92307: Utility.Commercials.V0.Model.CommercialAgreement ================================================ Templates used for payment of fees for using the Utility\. Templates --------- .. _type-utility-commercials-v0-model-commercialagreement-commercialagreement-9436: **template** `CommercialAgreement `_ A commercial agreement that describes the fees that the user will pay for using the Utility\. Signatory\: operator, user .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - operator - `Party `_ - App operator\. * - user - `Party `_ - App user\. * - feeReceiver - `Party `_ - The party that will receive the fee for using the Utility services\. * - lockedAmuletCids - \[`ContractId `_ `LockedAmulet `_\] - Coins locked to the operator which are used to pay fees\. * - currentLockedAmuletAmountCc - `Decimal `_ - Current amount of locked CC held as part of the commercial agreement\. * - utilityFees - :ref:`UtilityFees ` - The fee that the user will pay for using the Utility services\. * - dso - `Party `_ - Reference to the DSO party (Decentralized Synchronizer Operations)\. + **Choice** Archive Controller\: operator, user Returns\: () (no fields) + .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementbill-52343: **Choice** `CommercialAgreement_Bill `_ Trigger a payment of the agreed fee for performing a billing on behalf of the user\. Controller\: operator Returns\: `CommercialAgreement_Bill_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - transferContext - `AppTransferContext `_ - Context for CC transfers\. * - transferPreapprovalCid - `ContractId `_ TransferPreapproval - Preapproval from a party to receive the fee\. If the fee payment should be a featured transfer, ensure that the TransferPreapproval contains a featuredAppRight\. * - paymentTransferContext - `PaymentTransferContext `_ - Context for preapproved CC transfers\. + .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementlockcoin-10554: **Choice** `CommercialAgreement_LockCoin `_ Lock coins (for future fee payments) to the operator\. This increases (or decreases) the deposit to reach the specified target amount\. Controller\: user Returns\: `CommercialAgreement_LockCoin_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - targetAmount - `Decimal `_ - Lock coins so that the deposit reaches this target amount of totally locked coin\. * - coinCids - \[`ContractId `_ `Amulet `_\] - Coins to lock\. * - transferContext - `AppTransferContext `_ - Context for CC transfers\. + .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementmodify-85124: **Choice** `CommercialAgreement_Modify `_ Modify the commercial agreement\. It keeps the operator, user, dso and deposit unchanged\. Controller\: operator Returns\: `CommercialAgreement_Modify_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - feeReceiver - `Party `_ - The party that will receive the fee for using the Utility services\. * - utilityFees - :ref:`UtilityFees ` - The fee that the user will pay for using the Utility services\. + .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementrevoke-25868: **Choice** `CommercialAgreement_Revoke `_ Revoke the commercial agreement (and unlock the deposit)\. Controller\: actor Returns\: `CommercialAgreement_Revoke_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - transferContext - `AppTransferContext `_ - Reference data for unlocking the deposit\. * - actor - `Party `_ - Data Types ---------- .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementbillresult-53464: **data** `CommercialAgreement_Bill_Result `_ Result of ``CommercialAgreement_Bill``\. .. _constr-utility-commercials-v0-model-commercialagreement-commercialagreementbillresult-78545: `CommercialAgreement_Bill_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - commercialAgreementCid - `ContractId `_ `CommercialAgreement `_ - The updated commercial agreeement after billing\. .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementlockcoinresult-37799: **data** `CommercialAgreement_LockCoin_Result `_ Result of ``CommercialAgreement_LockCoin_Result``\. .. _constr-utility-commercials-v0-model-commercialagreement-commercialagreementlockcoinresult-73558: `CommercialAgreement_LockCoin_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - commercialAgreementCid - `ContractId `_ `CommercialAgreement `_ - The updated commercial agreeement after locking coin\. .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementmodifyresult-7257: **data** `CommercialAgreement_Modify_Result `_ Result of ``CommercialAgreement_Modify``\. .. _constr-utility-commercials-v0-model-commercialagreement-commercialagreementmodifyresult-60456: `CommercialAgreement_Modify_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - commercialAgreementCid - `ContractId `_ `CommercialAgreement `_ - The modified commercial agreeement\. .. _type-utility-commercials-v0-model-commercialagreement-commercialagreementrevokeresult-30241: **data** `CommercialAgreement_Revoke_Result `_ Result of ``CommercialAgreement_Revoke``\. .. _constr-utility-commercials-v0-model-commercialagreement-commercialagreementrevokeresult-97528: `CommercialAgreement_Revoke_Result `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - unlockedDeposit - \[`ContractId `_ `Amulet `_\] - The unlocked deposit\. Functions --------- .. _function-utility-commercials-v0-model-commercialagreement-unlockcoins-81708: `unlockCoins `_ \: `AppTransferContext `_ \-\> `ContractId `_ `LockedAmulet `_ \-\> `Update `_ (`ContractId `_ `Amulet `_) Unlock an existing deposit and return the unlocked coins\. .. _function-utility-commercials-v0-model-commercialagreement-unlockdeposit-40814: `unlockDeposit `_ \: `AppTransferContext `_ \-\> `ContractId `_ `LockedAmulet `_ \-\> `Update `_ `TransferInput `_ Unlock an existing deposit and return the coin as InputAmulet for a transfer\. .. _function-utility-commercials-v0-model-commercialagreement-minutestoreltime-23915: `minutesToRelTime `_ \: `Int `_ \-\> `RelTime `_ Convert a number of minutes to a ``RelTime``\. .. _function-utility-commercials-v0-model-commercialagreement-verifyamulet-55292: `verifyAmulet `_ \: `Party `_ \-\> `ContractId `_ `Amulet `_ \-\> `Update `_ `Decimal `_ Verify the DSO party of a given Amulet and return the amount\. .. _function-utility-commercials-v0-model-commercialagreement-verifyamulets-23956: `verifyAmulets `_ \: `Party `_ \-\> \[`ContractId `_ `Amulet `_\] \-\> `Update `_ `Decimal `_ Verify a list of Amulets and return the total amount\. .. _function-utility-commercials-v0-model-commercialagreement-fetchandvalidatebillingcontext-90212: `fetchAndValidateBillingContext `_ \: `Party `_ \-\> `Party `_ \-\> `AppTransferContext `_ \-\> `Update `_ :ref:`BillingContext ` Fetch the billing context components from the ledger and validate them\.