# Notes
- The source of program ID and promo ID are the same - user_defined_1 field in VFF.
- Q for MLS-BR-013: In XML Post, there is ProgramId field but no user_defined_1 field based on xml specification - https://eonx.atlassian.net/wiki/spaces/MLS/pages/2037711105/API+Documentation
- Should we raise that we reuse programId as promoId to be consistent with VFF?
- MLS-BR-011 - is it still necessary for VFF/XML post to contain "email template identifier"? Isn't the promoId as programCode sufficient since promotions are configured with communication profiles already?
# MLS Promotions Backend Tasks
### Manage Promotions - 1 sprint
- Create new role for new Portal
- Setup vendor config for `EONXG`
- Create Promotion entity
- fields: title, promoId, program, startDate, endDate, status
- unique promoId
- Create PromotionProductSku
- fields: productSkuId, quantity
- Create Program entity
- fields: programId, name, fromAddress, fromName, subject, cancelledSubject, cancelledTemplate, template, logoUrl, iconUrl, featuredImageUrl, templatePrimaryColor, templatePrimaryColor100, redemptionDisplayTemplate, subDomain, replyToAddress
- API Endpoints - Promotions
- API Platform sub resource collection of PromotionSku on create, update and show.
- List endpoint should not include PromotionSkus
- Default status on create is "Awaiting Funds"
- SHOW endpoint should include "remaining promotion value" and "promotion emails sent"
- promotion emails sent -
- EDIT endpoint should only allow start and end date to be updated.
- DELETE endpoint - can only delete "Awaiting Funds" status?
- Endpoint to cancel promotion
- `POST promotions/{id}/cancel` -
- Add LIST endpoint for ProductSku for the new portal
- Easy Admin
- Add EA pages for eonx to list and view promotions
- Add EA page to allow finance team to mark promotion as "funds received"
- accepts amount (MLS Cost) to validate against calculated amount
- Add EA pages to be able to manage Programs - permissions
- Create a scheduled command to update Funds Received status to active based on start date.
- Create a scheduled command to update active promotions to complete based on end date.
- Create new ProgramProviderInterface implementation - DatabaseProgramProvider
- New service to calculate the MLS Cost of a promotion
### Order Process Update - 1 sprint
- Update Order to have promotionId
- Update Redemption to have promotionId
- Set both in RedemptionFactory
- Update Order creation process to check if `programId` value is supported by the current list of programs. If not, use programId to determine the promo id . If promotion found set it against the order
- Add validation in `OrderCreatedMessageHandler` before checking for `fraud` to validate if order exceeded the quantity of the promotion
- Notification/email to finance when
- Promotion ended based on end date
- Mastercard extended promotion using portal screens
- on update of end date - old end date < new end date
- Promotion ended based on exceeding quantity