mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +08:00 
			
		
		
		
	feat: create additional columns in organization table (#5380)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
		| @ -129,6 +129,8 @@ pub async fn update_organization( | ||||
| ) -> RouterResponse<api::OrganizationResponse> { | ||||
|     let organization_update = diesel_models::organization::OrganizationUpdate::Update { | ||||
|         org_name: req.organization_name, | ||||
|         organization_details: req.organization_details, | ||||
|         metadata: req.metadata, | ||||
|     }; | ||||
|     state | ||||
|         .store | ||||
|  | ||||
| @ -83,6 +83,10 @@ impl OrganizationInterface for super::MockDb { | ||||
|         let org = storage::Organization { | ||||
|             org_id: organization.org_id.clone(), | ||||
|             org_name: organization.org_name, | ||||
|             organization_details: organization.organization_details, | ||||
|             metadata: organization.metadata, | ||||
|             created_at: common_utils::date_time::now(), | ||||
|             modified_at: common_utils::date_time::now(), | ||||
|         }; | ||||
|         organizations.push(org.clone()); | ||||
|         Ok(org) | ||||
| @ -118,8 +122,14 @@ impl OrganizationInterface for super::MockDb { | ||||
|             .iter_mut() | ||||
|             .find(|org| org.org_id == *org_id) | ||||
|             .map(|org| match &update { | ||||
|                 storage::OrganizationUpdate::Update { org_name } => storage::Organization { | ||||
|                 storage::OrganizationUpdate::Update { | ||||
|                     org_name, | ||||
|                     organization_details, | ||||
|                     metadata, | ||||
|                 } => storage::Organization { | ||||
|                     org_name: org_name.clone(), | ||||
|                     organization_details: organization_details.clone(), | ||||
|                     metadata: metadata.clone(), | ||||
|                     ..org.to_owned() | ||||
|                 }, | ||||
|             }) | ||||
|  | ||||
| @ -32,6 +32,10 @@ impl ForeignFrom<diesel_models::organization::Organization> for OrganizationResp | ||||
|         Self { | ||||
|             organization_id: org.org_id, | ||||
|             organization_name: org.org_name, | ||||
|             organization_details: org.organization_details, | ||||
|             metadata: org.metadata, | ||||
|             modified_at: org.modified_at, | ||||
|             created_at: org.created_at, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -304,6 +304,10 @@ impl From<UserMerchantCreateRequestWithToken> for NewUserOrganization { | ||||
|         Self(diesel_org::OrganizationNew { | ||||
|             org_id: value.2.org_id, | ||||
|             org_name: Some(value.1.company_name), | ||||
|             organization_details: None, | ||||
|             metadata: None, | ||||
|             created_at: common_utils::date_time::now(), | ||||
|             modified_at: common_utils::date_time::now(), | ||||
|         }) | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1281,6 +1281,10 @@ impl ForeignFrom<api_models::organization::OrganizationNew> | ||||
|         Self { | ||||
|             org_id: item.org_id, | ||||
|             org_name: item.org_name, | ||||
|             organization_details: None, | ||||
|             metadata: None, | ||||
|             created_at: common_utils::date_time::now(), | ||||
|             modified_at: common_utils::date_time::now(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1293,6 +1297,10 @@ impl ForeignFrom<api_models::organization::OrganizationRequest> | ||||
|         Self { | ||||
|             org_id: org_new.org_id, | ||||
|             org_name: item.organization_name, | ||||
|             organization_details: item.organization_details, | ||||
|             metadata: item.metadata, | ||||
|             created_at: common_utils::date_time::now(), | ||||
|             modified_at: common_utils::date_time::now(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Hrithikesh
					Hrithikesh