Skip to content

Custom user address #541

@D0gmaDev

Description

@D0gmaDev

We may want (now or in the future) to emit invoices to users whose addresses don't match the following pattern :

  def display_address
    address = room.present? ? "Appartement #{room}\n" : ''
    "#{address}Résidence Léonard de Vinci\nAvenue Paul Langevin\n59650 Villeneuve-d'Ascq"
  end

either because they don't have a room and still buy a subscription, or because the invoice should be addressed to a legal entity having another address (for instance the alumni association)

I suggest adding a new address (or custom_address to avoid confusion) nullable attribute to users, and do the following logic :

display_address =
  IF custom_address IS NOT NULL THEN custom_address
  ELSE IF room IS NOT NULL THEN "Appartement......Villeneuve-d'Ascq"
  ELSE "Résidence......Villeneuve-d'Ascq"

Reminder : Once emitted, an invoice (the pdf as well as all the parameters used to generate it) are fixed and independently stored, so there is no problem for a user changing display_ address afterwards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions