use codec::{Encode, Decode};
use scale_info::TypeInfo;
use frame_support::{BoundedVec, traits::ConstU32};
pub const SIZE_OBJECT_VECTORS: u32 = 50;
pub const SIZE_STRINGS: u32 = 100;
#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq)]
pub struct Schema {
pub id: u32,
pub name: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
pub fields: BoundedVec<SchemaField, ConstU32<SIZE_OBJECT_VECTORS>>,
pub issuer: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
}
#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq)]
pub struct SchemaField {
pub name: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
pub data_type: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
pub value: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
}
#[derive(Encode, Decode, TypeInfo, Debug, Clone, PartialEq, Eq)]
pub struct Attestation {
pub id: u32,
pub schema_id: u32,
pub block_number: u32,
pub subject: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
pub issuer: BoundedVec<u8, ConstU32<SIZE_STRINGS>>,
pub data: BoundedVec<SchemaField, ConstU32<SIZE_OBJECT_VECTORS>>,
}