@@ -224,20 +224,29 @@ pub struct UpdateAccountTierRequest {
224224 pub account_tier : AccountTier ,
225225}
226226
227- /// Response for the /user/me/usage backend endpoint
227+ /// Sub- Response for the /user/me/usage backend endpoint
228228#[ derive( Debug , Default , Deserialize , Serialize , Clone ) ]
229229#[ cfg_attr( feature = "utoipa" , derive( utoipa:: ToSchema ) ) ]
230230#[ typeshare:: typeshare]
231- pub struct UserUsageResponse {
231+ pub struct UserBillingCycle {
232232 /// Billing cycle start, or monthly from user creation
233233 /// depending on the account tier
234234 pub start : NaiveDate ,
235235
236236 /// Billing cycle end, or end of month from user creation
237237 /// depending on the account tier
238238 pub end : NaiveDate ,
239+ }
240+
241+ /// Response for the /user/me/usage backend endpoint
242+ #[ derive( Debug , Default , Deserialize , Serialize , Clone ) ]
243+ #[ cfg_attr( feature = "utoipa" , derive( utoipa:: ToSchema ) ) ]
244+ #[ typeshare:: typeshare]
245+ pub struct UserUsageResponse {
246+ /// Billing cycle for user, will be None if no usage data exists for user.
247+ pub billing_cycle : Option < UserBillingCycle > ,
239248
240- /// HashMap of project related metrics for this cycle
241- /// keyed by project_id
249+ /// HashMap of project related metrics for this cycle keyed by project_id. Will be empty
250+ /// if no project usage data exists for user.
242251 pub projects : HashMap < String , ProjectUsageResponse > ,
243252}
0 commit comments