Wa alaikum assalam, we have here two conditions. First, there’s breastfeeding, which is temporary; then we have the ulcer illness (may Allah SWT cure all ill people), which requires a doctor’s opinion. So if a “trustworthy” doctor has already confirmed that she can’t fast due to her illness condition, then she is definitely exempted from fasting. The question now becomes whether this ulcer condition is curable or not. Once again, assuming that a trustworthy doctor has advised that the illness is temporary, and that inshaa Allah, she will be cured in the future, then in this case, she is “not” obliged to make an expiation. However, she “must” make up those missed fasting days whenever she has recovered from her illness and she’s allowed to fast. This is based on the following verse from the Quran:
So whoever is sick among you, or on a journey, then the same number in other days (2:184)
On the other hand, if the doctor has advised that her illness is terminal (Allah forbid), and as a result, she won’t be able to fast in the future, then in this case, she is only required to make expiation for those missed fasting days by feeding a poor person for every missed fasting day. This latter opinion is based on the second half of the verse where Allah SWT said:
And those who do not have the strength for it must give a redemption by feeding a needy person; so whoever increases the good of his own accord, it is better for him; and fasting is better for you, if only you realize (2:184)
Finally, scholars have also exempted needy people from making expiation if they can’t fast due to any of the reasons described in the first part of the verse above. In which case, the following Quranic rule applies to them:
Allah does not burden anyone, except with something within their capacity; beneficial for it is the virtue it earned, and harmful for it is the evil it earned (2:286)
May Allah SWT give every Muslim the strength to fast, the means to feed needy people, and the sincerity in both, Ameen.
And Allah knows best..