Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX [CADT] - When doing a PUT update on unit record, issuance appears to be required even though it is not when creating a unit #1064

Open
ccornick opened this issue May 9, 2024 · 0 comments

Comments

@ccornick
Copy link
Contributor

ccornick commented May 9, 2024

for copy pasting into an issue on Github:

The issuance field is not required when creating a unit as documented here https://github.com/Chia-Network/cadt/blob/develop/docs/cadt_rpc_api.md#create-a-new-unit-using-only-the-required-fields. If you don't supply a unit, your record will look like the following:

            "warehouseUnitId": "3b2ff4b5-0779-4cec-b794-3c4f79833b5c",
            "issuanceId": null,
            "projectLocationId": null,
            "orgUid": "fc90b2074b51491f19ceaf06b164620f712a15a1ff04f9ed6ed7150c02c14311",
            "unitOwner": "8",
            "countryJurisdictionOfOwner": "Argentina",
            "inCountryJurisdictionOfOwner": "Argentina",
            "serialNumberBlock": "8-9",
            "unitBlockStart": "8",
            "unitBlockEnd": "9",
            "unitCount": 1,
            "vintageYear": 2024,
            "unitType": "Reduction - nature",
            "marketplace": null,
            "marketplaceLink": null,
            "marketplaceIdentifier": null,
            "unitTags": null,
            "unitStatus": "Retired",
            "unitStatusReason": null,
            "unitRegistryLink": "https://chia.net",
            "correspondingAdjustmentDeclaration": "Unknown",
            "correspondingAdjustmentStatus": "Not Started",
            "timeStaged": "1715277490",
            "createdAt": "2024-05-09T18:01:51.714Z",
            "updatedAt": "2024-05-09T18:01:51.714Z",
            "labels": [],
            "issuance": null
        },```

Note `"issuance": null`.  If you take that exact record and issue a `PUT` to edit it, CADT will respond with `{"message":"Data Validation error","errors":["\"issuance\" must be of type object"],"success":false}`.  If it is not a required unit on initial insert, it should not be required upon editing the unit. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant