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-0 name
  • logoUrl — kind-0 picture
  • bannerUrl — kind-0 banner
  • storeDescription — kind-30078 d=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 Details

    • MerchantBranding

      public MerchantBranding(String organizationName, String logoUrl, String bannerUrl, String storeDescription, String backgroundColor, String foregroundColor)
      Creates an instance of a MerchantBranding record class.
      Parameters:
      organizationName - the value for the organizationName record component
      logoUrl - the value for the logoUrl record component
      bannerUrl - the value for the bannerUrl record component
      storeDescription - the value for the storeDescription record component
      backgroundColor - the value for the backgroundColor record component
      foregroundColor - the value for the foregroundColor record component
  • Method Details

    • empty

      public static MerchantBranding empty()
      Branding with no values set. Equivalent to passing null to the mapper.
      Returns:
      a branding instance with every field null
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • organizationName

      public String organizationName()
      Returns the value of the organizationName record component.
      Returns:
      the value of the organizationName record component
    • logoUrl

      public String logoUrl()
      Returns the value of the logoUrl record component.
      Returns:
      the value of the logoUrl record component
    • bannerUrl

      public String bannerUrl()
      Returns the value of the bannerUrl record component.
      Returns:
      the value of the bannerUrl record component
    • storeDescription

      public String storeDescription()
      Returns the value of the storeDescription record component.
      Returns:
      the value of the storeDescription record component
    • backgroundColor

      public String backgroundColor()
      Returns the value of the backgroundColor record component.
      Returns:
      the value of the backgroundColor record component
    • foregroundColor

      public String foregroundColor()
      Returns the value of the foregroundColor record component.
      Returns:
      the value of the foregroundColor record component