Sell a unit
the following presents the global process when a unit is sold.
References
Information about attributes, technical implementation...are available here : Attributes Dictionary
Diagram
note : in grey = for information (background process of creating a part)
Process
a unit may have been created in the context of a building being whether a monoproperty or a condo :
- if building is mono : 2 underlying owner contracts are created : one for the building (only once), and one for the unit attached to this building
- if building is a condo : only owner contract for the part is created
the selling of a part triggers several actions :
Owner Contract level => case building in monoproperty :
the 2 owner contracts are ended (endDate) with the date given by endUser in UI
the status of the 2 owner contracts becomes : SOLD
the attribute "buyer" of each owner contract is filled with the person chosen by endUser in UI
the attribute "isCondo" goes from "false" to "true" (this is the effect of selling 1 part in a monoproperty : it creates a condo)
Owner Contract level => case building in condo :
the unique owner contract is ended (endDate) with the date given by endUser in UI
the status of the owner contract becomes : SOLD
the attribute "buyer" of the owner contract is filled with the person chosen by endUser in UI.
note : in most of the case, the sold part belongs to a building which is or become a condo, meaning the buyer is actually a co-owner
Rental contract (RC) level : check if the unit sold is :
not included in an ACTIVE RC = nothing to do
included in an ACTIVE RC :
if the unit sold is unique in this contract =>
- end the RC by adding an end date
- change state to : "HANDED OVER"
if the unit sold is amongst several other units =>
- end the RC by adding an end date
- change state to : "HANDED OVER"
- terminate all owner contracts belonging to all other units beside the sold part of the related RC (see above)