← 返回 stripe 的题目列表Subscription Status Change Notification
类型:online_judge
Design a class for subscription status change notifications. The class should provide a configure method to set up notification messages (including messages for subscription start and expiration) and the number of days in advance to notify users of subscription expiration. The class should also have a method to accept a list of user information, where each user includes a name, subscription start time, expiration time, and account level. Finally, the class should generate a subscription message list sorted by time. Provide the complete code structure with test cases.
Example
Input
configure('Subscription starts for {}', '{} your subscription will expire', 5)
generate_notifications([{'name': 'Alice', 'start': '2023-10-01', 'end': '2023-12-01', 'level': 'premium'},
{name': 'Bob', 'start': '2023-09-15', 'end': '2023-11-20', 'level': 'standard'}])