Skip to content

Commit

Permalink
fix: rename ID fields to id
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Dec 2, 2024
1 parent 5464da1 commit 0757882
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
16 changes: 8 additions & 8 deletions agent_api_rest/postman/ssi-agent.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const receivedOfferId = lastItem.received_offer_id;",
" const receivedOfferId = lastItem.id;",
"",
" if (receivedOfferId) {",
" pm.collectionVariables.set(\"RECEIVED_OFFER_ID\", receivedOfferId);",
Expand Down Expand Up @@ -920,7 +920,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const holderCredentialId = lastItem.holder_credential_id;",
" const holderCredentialId = lastItem.id;",
"",
" if (holderCredentialId) {",
" pm.collectionVariables.set(\"HOLDER_CREDENTIAL_ID\", holderCredentialId);",
Expand Down Expand Up @@ -991,7 +991,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const presentationId = lastItem.presentation_id;",
" const presentationId = lastItem.id;",
"",
" if (presentationId) {",
" pm.collectionVariables.set(\"PRESENTATION_ID\", presentationId);",
Expand Down Expand Up @@ -1144,7 +1144,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const connectionId = lastItem.connection_id;",
" const connectionId = lastItem.id;",
"",
" if (connectionId) {",
" pm.collectionVariables.set(\"CONNECTION_ID\", connectionId);",
Expand Down Expand Up @@ -1197,7 +1197,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const connectionId = lastItem.connection_id;",
" const connectionId = lastItem.id;",
"",
" if (connectionId) {",
" pm.collectionVariables.set(\"CONNECTION_ID\", connectionId);",
Expand Down Expand Up @@ -1245,7 +1245,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const connectionId = lastItem.connection_id;",
" const connectionId = lastItem.id;",
"",
" if (connectionId) {",
" pm.collectionVariables.set(\"CONNECTION_ID\", connectionId);",
Expand Down Expand Up @@ -1304,7 +1304,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const connectionId = lastItem.connection_id;",
" const connectionId = lastItem.id;",
"",
" if (connectionId) {",
" pm.collectionVariables.set(\"CONNECTION_ID\", connectionId);",
Expand Down Expand Up @@ -1445,7 +1445,7 @@
" const lastItem = jsonData[jsonData.length - 1];",
"",
" if (lastItem && typeof lastItem === 'object') {",
" const serviceId = lastItem.service_id;",
" const serviceId = lastItem.id;",
"",
" if (serviceId) {",
" pm.collectionVariables.set(\"SERVICE_ID\", serviceId);",
Expand Down
3 changes: 2 additions & 1 deletion agent_holder/src/credential/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Data {

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Credential {
#[serde(rename = "id")]
pub holder_credential_id: String,
pub received_offer_id: Option<String>,
pub signed: Option<Jwt>,
Expand All @@ -31,7 +32,7 @@ impl Aggregate for Credential {
type Services = Arc<HolderServices>;

fn aggregate_type() -> String {
"credential".to_string()
"holder_credential".to_string()
}

async fn handle(
Expand Down
3 changes: 2 additions & 1 deletion agent_holder/src/offer/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub struct OfferCredential {

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Offer {
#[serde(rename = "id")]
pub received_offer_id: String,
pub credential_offer: Option<CredentialOfferParameters>,
pub status: Status,
Expand All @@ -51,7 +52,7 @@ impl Aggregate for Offer {
type Services = Arc<HolderServices>;

fn aggregate_type() -> String {
"offer".to_string()
"received_offer".to_string()
}

async fn handle(&self, command: Self::Command, services: &Self::Services) -> Result<Vec<Self::Event>, Self::Error> {
Expand Down
1 change: 1 addition & 0 deletions agent_holder/src/presentation/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use tracing::info;

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Presentation {
#[serde(rename = "id")]
pub presentation_id: String,
pub signed: Option<Jwt>,
}
Expand Down
1 change: 1 addition & 0 deletions agent_identity/src/connection/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use super::{command::ConnectionCommand, error::ConnectionError, event::Connectio

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Connection {
#[serde(rename = "id")]
pub connection_id: String,
pub alias: Option<String>,
pub domain: Option<Url>,
Expand Down
2 changes: 1 addition & 1 deletion agent_identity/src/document/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Aggregate for Document {
type Services = Arc<IdentityServices>;

fn aggregate_type() -> String {
"credential".to_string()
"document".to_string()
}

async fn handle(&self, command: Self::Command, services: &Self::Services) -> Result<Vec<Self::Event>, Self::Error> {
Expand Down
1 change: 1 addition & 0 deletions agent_identity/src/service/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub enum ServiceResource {

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Service {
#[serde(rename = "id")]
pub service_id: String,
pub service: Option<DocumentService>,
pub resource: Option<ServiceResource>,
Expand Down
1 change: 1 addition & 0 deletions agent_issuance/src/credential/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub enum Status {
#[derive(Debug, Clone, Serialize, Deserialize, Default, Derivative)]
#[derivative(PartialEq)]
pub struct Credential {
#[serde(rename = "id")]
pub credential_id: String,
pub data: Option<Data>,
pub credential_configuration: CredentialConfigurationsSupportedObject,
Expand Down
1 change: 1 addition & 0 deletions agent_issuance/src/offer/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub enum Status {

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Offer {
#[serde(rename = "id")]
pub offer_id: String,
pub credential_offer: Option<CredentialOffer>,
pub subject_id: Option<String>,
Expand Down

0 comments on commit 0757882

Please sign in to comment.