# Incomplete Contract Payload

**URL:** <https://forum.canton.network/t/incomplete-contract-payload/2332>\
**Category:** App Development\
**Created:** [March 24, 2021, 1:59pm UTC](https://forum.canton.network/t/incomplete-contract-payload/2332 "2021-03-24T13:59:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![krmmalik](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/krmmalik/32/1410_2.png) [@krmmalik](https://forum.canton.network/u/krmmalik)\
**Post date:** [March 24, 2021, 1:59pm UTC](https://forum.canton.network/t/incomplete-contract-payload/2332/1 "2021-03-24T13:59:47Z")

</div>

Is having an incomplete Contract Payload valid in DAML? Not sure if I am using the right terminology here, but basically, I have a `proposal` contract template. An `agent` issues a `proposal` (marked as `issuer`) and investors invest in the proposal. So I have `investors` setup as a party. (as below)

```haskell
template Proposal with
    issuer: Party
    investor: Party
    projectdescription: Text
    unitsrequired: Int
  

```

Now my test script with this works absolutely fine in which I supply a party for the `investor` however, in reality when running the app, the proposal will be first offered by an issuer and then afterwards investors will agree to invest in the proposal and there will be multiple investors up to a specified total amount.

So my question is, can I leave it this way, or do I need to go down the proposal-accept pattern route where investors agree to invest?

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephen/32/102_2.png) [@Stephen](https://forum.canton.network/u/Stephen)\
**Post date:** [March 24, 2021, 3:34pm UTC](https://forum.canton.network/t/incomplete-contract-payload/2332/2 "2021-03-24T15:34:42Z")

</div>

> [@krmmalik](#):
>
> Is having an incomplete Contract Payload valid in DAML?

You are using the right terminology, and no, it is not valid.

The meaning of the declaration above is that all four fields are available in values of type `Proposal`; that is, if `x: Proposal`, then `x.investor: Party`, without exception, every time. Retrieving a contract of template `Proposal` yields a value of record type `Proposal`, which has all four of these fields. All four fields are in scope for every choice’s definition, as well as metadata like signatory, observer, key.

Daml itself will simply not let you create a `Proposal` without all fields, even at the record level, never mind actually creating the contract.

```haskell
 let proposal = Proposal with
                   issuer = alice
                   projectdescription = "foo"
                   unitsrequired = 42

Main.daml:59:18: error:
    • Constructor ‘Proposal’ does not have the required strict field(s): investor
    • In the expression:
        Proposal
          {issuer = alice, projectdescription = "foo", unitsrequired = 42}

```

If you write `investor: Optional Party` in your declaration, then you may pass `investor = None` when creating a `Proposal`. However, **this will make your contracts more error-prone** : it will be possible to accept proposals that have already been accepted (forgetting who has accepted them previously), and also to act as if a proposal that has not already been accepted, has been.

`Optional` is best used if a value is _semantically optional_, which does not describe your use case: a proposal _does not_ have an investor, and an accepted proposal _does_, and these are different semantic entities. You will have a much better time if you follow the propose-accept pattern than if you try to fit an `Optional` square peg into an acceptance round hole. Much heartbreak awaits you if you try to force `Optional` into your use case.

---

<div class="post-metadata">

**Author:** ![krmmalik](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/krmmalik/32/1410_2.png) [@krmmalik](https://forum.canton.network/u/krmmalik)\
**Post date:** [March 24, 2021, 3:37pm UTC](https://forum.canton.network/t/incomplete-contract-payload/2332/3 "2021-03-24T15:37:57Z")

</div>

OK thank you @Stephen . This confirms some of what I was thinking and more. Thanks again.

I shall try to go down the proposal-accept pattern route.

---

<div class="post-metadata">

**Author:** ![anthony](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/anthony/32/419_2.png) [@anthony](https://forum.canton.network/u/anthony)\
**Post date:** [March 25, 2021, 2:41pm UTC](https://forum.canton.network/t/incomplete-contract-payload/2332/4 "2021-03-25T14:41:39Z")

</div>

> [@Stephen](#):
>
> Much heartbreak awaits you if you try to force `Optional` into your use case.

Quote of the year
