Skip to content

Commit 71e05f5

Browse files
committed
correct unit fields
1 parent 801c99b commit 71e05f5

File tree

7 files changed

+33
-30
lines changed

7 files changed

+33
-30
lines changed

modules/graphql-client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leosprograms/graphql-client-holochain",
3-
"version": "0.6.18",
3+
"version": "0.6.19",
44
"description": "ValueFlows GraphQLClient configurations, providing pluggable backend datasources for different distributed, federated and client/server infrastructure.",
55
"type": "module",
66
"main": "build/index.js",

modules/vf-graphql-holochain/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leosprograms/vf-graphql-holochain",
3-
"version": "0.6.18",
3+
"version": "0.6.19",
44
"type": "module",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",
@@ -42,7 +42,7 @@
4242
"@graphql-tools/schema": "^9.0.14",
4343
"@graphql-tools/utils": "^9.1.4",
4444
"@holochain/client": "^0.18.0-dev.13",
45-
"@leosprograms/vf-graphql": "0.9.0-alpha.11",
45+
"@leosprograms/vf-graphql": "0.9.0-alpha.12",
4646
"big.js": "^6.2.1",
4747
"buffer": "^6.0.3",
4848
"dataloader": "^1.4.0",

pnpm-lock.yaml

+13-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@babel/eslint-parser": "^7.18.2",
1515
"@holochain-playground/cli": "0.0.8",
1616
"@holochain/tryorama": "=0.17.0-dev.5",
17-
"@leosprograms/vf-graphql": "0.9.0-alpha.11",
17+
"@leosprograms/vf-graphql": "0.9.0-alpha.12",
1818
"@leosprograms/vf-graphql-holochain": "workspace:*",
1919
"@holochain/client": "^0.18.0-dev.13",
2020
"assert": "^2.0.0",

zomes/rea_unit/lib/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ fn construct_response<'a>(
101101
meta: read_revision_metadata_abbreviated(meta)?,
102102
label: e.label.to_owned(),
103103
symbol: e.symbol.to_owned(),
104-
override_label: e.override_label.to_owned(),
105-
override_symbol: e.override_symbol.to_owned(),
106104
om_unit_identifier: e.om_unit_identifier.to_owned(),
107-
classified_as: e.classifiedAs.to_owned(),
105+
classified_as: e.classified_as.to_owned(),
108106
}
109107
})
110108
}

zomes/rea_unit/rpc/src/lib.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub use vf_attributes_hdk::{
2222
UnitId,
2323
UnitInternalAddress as UnitAddress,
2424
ByRevision, RecordMeta, RevisionMeta,
25+
ExternalURL,
2526
};
2627

2728
pub use holo_hash::ActionHash;
@@ -36,10 +37,9 @@ pub struct Response {
3637
pub meta: RecordMeta,
3738
pub label: String,
3839
pub symbol: String,
39-
pub override_label: String,
40-
pub override_symbol: String,
4140
pub om_unit_identifier: String,
42-
pub classified_as: String,
41+
#[serde(skip_serializing_if = "Option::is_none")]
42+
pub classified_as: Option<Vec<ExternalURL>>,
4343
}
4444

4545
impl<'a> Response {
@@ -68,11 +68,10 @@ pub struct ResponseData {
6868
pub struct CreateRequest {
6969
pub label: String,
7070
pub symbol: String,
71-
pub override_label: String,
72-
pub override_symbol: String,
7371
pub om_unit_identifier: String,
74-
pub classified_as: String,
75-
}
72+
#[serde(default)]
73+
#[serde(skip_serializing_if = "MaybeUndefined::is_undefined")]
74+
pub classified_as: MaybeUndefined<Vec<ExternalURL>>,}
7675

7776
impl<'a> CreateRequest {
7877
pub fn get_symbol(&'a self) -> &str {
@@ -96,11 +95,10 @@ pub struct UpdateRequest {
9695
pub revision_id: ActionHash,
9796
pub label: MaybeUndefined<String>,
9897
pub symbol: MaybeUndefined<String>,
99-
pub override_label: MaybeUndefined<String>,
100-
pub override_symbol: MaybeUndefined<String>,
10198
pub om_unit_identifier: MaybeUndefined<String>,
102-
pub classified_as: MaybeUndefined<String>,
103-
}
99+
#[serde(default)]
100+
#[serde(skip_serializing_if = "MaybeUndefined::is_undefined")]
101+
pub classified_as: MaybeUndefined<Vec<ExternalURL>>,}
104102

105103
impl<'a> UpdateRequest {
106104
pub fn get_revision_id(&'a self) -> &ActionHash {

zomes/rea_unit/storage/src/lib.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ use hdk_records::{
1515
record_interface::{ Updateable },
1616
};
1717

18+
use vf_attributes_hdk::{
19+
ExternalURL,
20+
};
21+
1822
use hc_zome_rea_unit_rpc::{ CreateRequest, UpdateRequest };
1923

2024
pub use vf_attributes_hdk::{ UnitInternalAddress };
@@ -41,10 +45,8 @@ pub struct UnitZomeConfig {
4145
pub struct EntryData {
4246
pub label: String,
4347
pub symbol: String,
44-
pub override_label: String,
45-
pub override_symbol: String,
4648
pub om_unit_identifier: String,
47-
pub classified_as: String,
49+
pub classified_as: Option<Vec<ExternalURL>>,
4850
}
4951

5052
impl<'a> EntryData {
@@ -100,8 +102,6 @@ impl TryFrom<CreateRequest> for EntryData {
100102
Ok(EntryData {
101103
label: e.label.into(),
102104
symbol: e.symbol.into(),
103-
override_label: e.override_label.into(),
104-
override_symbol: e.override_symbol.into(),
105105
om_unit_identifier: e.om_unit_identifier.into(),
106106
classified_as: e.classified_as.into(),
107107
})
@@ -116,10 +116,8 @@ impl Updateable<UpdateRequest> for EntryData {
116116
Ok(EntryData {
117117
label: if !e.label.is_some() { self.label.to_owned() } else { e.label.to_owned().unwrap() },
118118
symbol: if !e.symbol.is_some() { self.symbol.to_owned() } else { e.symbol.to_owned().unwrap() },
119-
override_label: if !e.override_label.is_some() { self.override_label.to_owned() } else { e.override_label.to_owned().unwrap() },
120-
override_symbol: if !e.override_symbol.is_some() { self.override_symbol.to_owned() } else { e.override_symbol.to_owned().unwrap() },
121119
om_unit_identifier: if !e.om_unit_identifier.is_some() { self.om_unit_identifier.to_owned() } else { e.om_unit_identifier.to_owned().unwrap() },
122-
classified_as: if !e.classified_as.is_some() { self.classified_as.to_owned() } else { e.classified_as.to_owned().unwrap() },
120+
classified_as: if !e.classified_as.is_some() { self.classified_as.to_owned() } else { e.classified_as.to_owned().into() },
123121
})
124122
}
125123
}

0 commit comments

Comments
 (0)