Add required field result and ethereumHash on POST
This commit is contained in:
parent
0d9dccda47
commit
621e172e55
|
@ -42,7 +42,7 @@ class Proof(Thing):
|
||||||
"""
|
"""
|
||||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid4)
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid4)
|
||||||
type = Column(Unicode, nullable=False)
|
type = Column(Unicode, nullable=False)
|
||||||
ethereum_hashes = Column(CIText(), default='', nullable=False)
|
ethereum_hash = Column(CIText(), default='', nullable=False)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self) -> urlutils.URL:
|
def url(self) -> urlutils.URL:
|
||||||
|
|
|
@ -16,8 +16,8 @@ from ereuse_devicehub.resources.action import schemas as s_action
|
||||||
class Proof(Thing):
|
class Proof(Thing):
|
||||||
__doc__ = m.Proof.__doc__
|
__doc__ = m.Proof.__doc__
|
||||||
id = UUID(dump_only=True)
|
id = UUID(dump_only=True)
|
||||||
ethereum_hashes = SanitizedStr(default='', validate=Length(max=STR_BIG_SIZE),
|
ethereum_hash = SanitizedStr(default='', validate=Length(max=STR_BIG_SIZE),
|
||||||
data_key="ethereumHashes")
|
data_key="ethereumHash", required=True)
|
||||||
url = URL(dump_only=True, description=m.Proof.url.__doc__)
|
url = URL(dump_only=True, description=m.Proof.url.__doc__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ class ProofTransfer(Proof):
|
||||||
|
|
||||||
class ProofDataWipe(Proof):
|
class ProofDataWipe(Proof):
|
||||||
__doc__ = m.ProofDataWipe.__doc__
|
__doc__ = m.ProofDataWipe.__doc__
|
||||||
erasure_type = SanitizedStr(default='')
|
erasure_type = SanitizedStr(default='', data_key='erasureType')
|
||||||
date = DateTime('iso', required=True)
|
date = DateTime('iso', required=True)
|
||||||
result = Boolean(missing=False)
|
result = Boolean(required=True)
|
||||||
erasure = NestedOn(s_action.EraseBasic, only_query='id')
|
erasure = NestedOn(s_action.EraseBasic, only_query='id', data_key='erasureID')
|
||||||
|
|
||||||
|
|
||||||
class ProofFunction(Proof):
|
class ProofFunction(Proof):
|
||||||
|
|
Reference in New Issue