refactor: introduce a domain type for profile ID (#5687)

This commit is contained in:
Sanchith Hegde
2024-08-27 13:31:01 +05:30
committed by GitHub
parent fac8e7916f
commit b63d723b8b
118 changed files with 707 additions and 547 deletions

View File

@ -214,12 +214,23 @@ fn generate_ref_id_with_default_length<const MAX_LENGTH: u8, const MIN_LENGTH: u
/// Generate a customer id with default length, with prefix as `cus`
pub fn generate_customer_id_of_default_length() -> id_type::CustomerId {
id_type::CustomerId::default()
use id_type::GenerateId;
id_type::CustomerId::generate()
}
/// Generate a organization id with default length, with prefix as `org`
pub fn generate_organization_id_of_default_length() -> id_type::OrganizationId {
id_type::OrganizationId::default()
use id_type::GenerateId;
id_type::OrganizationId::generate()
}
/// Generate a profile id with default length, with prefix as `pro`
pub fn generate_profile_id_of_default_length() -> id_type::ProfileId {
use id_type::GenerateId;
id_type::ProfileId::generate()
}
/// Generate a nanoid with the given prefix and a default length