Package xyz.tcheeric.cashu.voucher.pass
Record Class MerchantBranding
java.lang.Object
java.lang.Record
xyz.tcheeric.cashu.voucher.pass.MerchantBranding
public record MerchantBranding(String organizationName, String logoUrl, String bannerUrl, String storeDescription, String backgroundColor, String foregroundColor)
extends Record
Merchant branding resolved at render time and passed to
VoucherPassMapper.
Branding is deliberately not read from the voucher. Branding is mutable and a signed voucher is not, so a value baked into the signed secret at issuance would leave every outstanding voucher showing stale branding or needing re-issuance.
The caller populates this from the merchant's existing Nostr identity, served by
GET /api/v1/merchant/bootstrap:
organizationName— kind-0namelogoUrl— kind-0picturebannerUrl— kind-0bannerstoreDescription— kind-30078d=imani:merchant
Do not use businessName from the merchant profile — possa-merchant is
removing it. kind-0 name is the live field.
Every field is nullable; VoucherPassMapper defaults each one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebackgroundColorrecord component.Returns the value of thebannerUrlrecord component.static MerchantBrandingempty()Branding with no values set.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theforegroundColorrecord component.final inthashCode()Returns a hash code value for this object.logoUrl()Returns the value of thelogoUrlrecord component.Returns the value of theorganizationNamerecord component.Returns the value of thestoreDescriptionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MerchantBranding
public MerchantBranding(String organizationName, String logoUrl, String bannerUrl, String storeDescription, String backgroundColor, String foregroundColor) Creates an instance of aMerchantBrandingrecord class.- Parameters:
organizationName- the value for theorganizationNamerecord componentlogoUrl- the value for thelogoUrlrecord componentbannerUrl- the value for thebannerUrlrecord componentstoreDescription- the value for thestoreDescriptionrecord componentbackgroundColor- the value for thebackgroundColorrecord componentforegroundColor- the value for theforegroundColorrecord component
-
-
Method Details
-
empty
Branding with no values set. Equivalent to passingnullto the mapper.- Returns:
- a branding instance with every field null
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
organizationName
Returns the value of theorganizationNamerecord component.- Returns:
- the value of the
organizationNamerecord component
-
logoUrl
Returns the value of thelogoUrlrecord component.- Returns:
- the value of the
logoUrlrecord component
-
bannerUrl
Returns the value of thebannerUrlrecord component.- Returns:
- the value of the
bannerUrlrecord component
-
storeDescription
Returns the value of thestoreDescriptionrecord component.- Returns:
- the value of the
storeDescriptionrecord component
-
backgroundColor
Returns the value of thebackgroundColorrecord component.- Returns:
- the value of the
backgroundColorrecord component
-
foregroundColor
Returns the value of theforegroundColorrecord component.- Returns:
- the value of the
foregroundColorrecord component
-