diff --git a/packages/at_commons/lib/src/verb/enroll_verb_builder.dart b/packages/at_commons/lib/src/verb/enroll_verb_builder.dart index 1d882ba5..e9895a1b 100644 --- a/packages/at_commons/lib/src/verb/enroll_verb_builder.dart +++ b/packages/at_commons/lib/src/verb/enroll_verb_builder.dart @@ -36,6 +36,9 @@ class EnrollVerbBuilder extends AbstractVerbBuilder { String? encryptedDefaultSelfEncryptionKey; String? encryptedAPKAMSymmetricKey; + /// Used to force revoke the enrollment request. + bool force = false; + /// Filters enrollment requests based on provided [EnrollmentStatus] criteria. /// /// Accepts a list of enrollment statuses. Defaults to all EnrollmentStatuses @@ -46,6 +49,9 @@ class EnrollVerbBuilder extends AbstractVerbBuilder { var sb = StringBuffer(); sb.write('enroll:'); sb.write(getEnrollOperation(operation)); + if (force) { + sb.write(':force'); + } EnrollParams enrollParams = EnrollParams() ..enrollmentId = enrollmentId diff --git a/packages/at_commons/test/enroll_verb_builder_test.dart b/packages/at_commons/test/enroll_verb_builder_test.dart index ce0fd361..d8f7fcde 100644 --- a/packages/at_commons/test/enroll_verb_builder_test.dart +++ b/packages/at_commons/test/enroll_verb_builder_test.dart @@ -53,6 +53,15 @@ void main() { expect(command, 'enroll:revoke:{"enrollmentId":"123"}\n'); }); + test('A test to verify enroll force revoke operation', () { + var enrollVerbBuilder = EnrollVerbBuilder() + ..operation = EnrollOperationEnum.revoke + ..enrollmentId = '123' + ..force = true; + var command = enrollVerbBuilder.buildCommand(); + expect(command, 'enroll:revoke:force:{"enrollmentId":"123"}\n'); + }); + test('A test to verify to override enroll list status', () { var enrollVerbBuilder = EnrollVerbBuilder() ..operation = EnrollOperationEnum.list