-
Notifications
You must be signed in to change notification settings - Fork 29
Add .activate
, .deactivate
, .offload
helpers to collection.tenants
#311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
![]() |
Infrastructure as Code | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
SAST | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Secrets | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Vulnerabilities | ![]() ![]() ![]() ![]() |
View in Orca |
Great to see you again! Thanks for the contribution. |
activate: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'ACTIVE', | ||
}); | ||
}, | ||
deactivate: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'INACTIVE', | ||
}); | ||
}, | ||
offload: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'OFFLOADED', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'll make sense to accept (string | TenantBC)[]
to match update signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By having it be TenantBase
, any of the TenantX
types are acceptable in this method since the activityStatus
is ignored by the methods; all that is relevant is the name
which is the only field of TenantBase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should've made it clearer in the original comment: I think these helper methods can accept an array of tenant names, so as to make it possible to, e.g., activate multiple tenants at once.
Just like it's possible to batch-update
them.
activate: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'ACTIVE', | ||
}); | ||
}, | ||
deactivate: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'INACTIVE', | ||
}); | ||
}, | ||
offload: (tenant: string | TenantBase) => { | ||
return update({ | ||
name: parseStringOrTenant(tenant), | ||
activityStatus: 'OFFLOADED', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should've made it clearer in the original comment: I think these helper methods can accept an array of tenant names, so as to make it possible to, e.g., activate multiple tenants at once.
Just like it's possible to batch-update
them.
* @returns {Promise<Tenant[]>} The activated tenant as a list of Tenant. | ||
*/ | ||
activate: (tenant: string | TenantBase) => Promise<Tenant[]>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: the activated tenant as a list of Tenant
looks a tad contrived, since we already know there will only be 1 result in that list.
I'd have these methods accept a (string | TenantBase)[]
as per the comment above (or below)
No description provided.