Skip to content

Commit 3d892f0

Browse files
chore: notInType -> typeNotIn
1 parent 24e533a commit 3d892f0

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/database/dao/documents_v2_dao.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ abstract interface class DocumentsV2Dao {
2323
DocumentRef? refTo,
2424
});
2525

26-
/// Deletes documents from the database, preserving those with types in [notInType].
26+
/// Deletes documents from the database, preserving those with types in [typeNotIn].
2727
///
28-
/// If [notInType] is null or empty, this may delete *all* documents (implementation dependent).
28+
/// If [typeNotIn] is null or empty, this may delete *all* documents (implementation dependent).
2929
/// Typically used for cache invalidation or cleaning up old data while keeping
3030
/// certain important types (e.g. keeping local drafts or templates).
3131
///
3232
/// Returns the number of deleted rows.
3333
Future<int> deleteWhere({
34-
List<DocumentType>? notInType,
34+
List<DocumentType>? typeNotIn,
3535
});
3636

3737
/// Checks if a document exists in the database.
@@ -160,12 +160,12 @@ class DriftDocumentsV2Dao extends DatabaseAccessor<DriftCatalystDatabase>
160160

161161
@override
162162
Future<int> deleteWhere({
163-
List<DocumentType>? notInType,
163+
List<DocumentType>? typeNotIn,
164164
}) {
165165
final query = delete(documentsV2);
166166

167-
if (notInType != null) {
168-
query.where((tbl) => tbl.type.isNotInValues(notInType));
167+
if (typeNotIn != null) {
168+
query.where((tbl) => tbl.type.isNotInValues(typeNotIn));
169169
}
170170

171171
return query.go();

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/database/dao/local_draft_documents_v2_dao.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class DriftLocalDraftDocumentsV2Dao extends DatabaseAccessor<DriftCatalystDataba
2828
@override
2929
Future<int> deleteWhere({
3030
DocumentRef? ref,
31-
List<DocumentType>? notInType,
31+
List<DocumentType>? typeNotIn,
3232
}) {
3333
final query = delete(localDocumentsDrafts);
3434

35-
if (notInType != null) {
36-
query.where((tbl) => tbl.type.isNotInValues(notInType));
35+
if (typeNotIn != null) {
36+
query.where((tbl) => tbl.type.isNotInValues(typeNotIn));
3737
}
3838

3939
return query.go();
@@ -338,7 +338,7 @@ abstract interface class LocalDraftDocumentsV2Dao {
338338

339339
Future<int> deleteWhere({
340340
DocumentRef? ref,
341-
List<DocumentType>? notInType,
341+
List<DocumentType>? typeNotIn,
342342
});
343343

344344
Future<bool> exists(DocumentRef ref);

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/document/document_repository.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ final class DocumentRepositoryImpl implements DocumentRepository {
410410
bool keepLocalDrafts = false,
411411
}) async {
412412
final deletedDrafts = keepLocalDrafts ? 0 : await _drafts.delete();
413-
final notInType = keepLocalDrafts ? [DocumentType.proposalTemplate] : null;
414-
final deletedDocuments = await _localDocuments.delete(notInType: notInType);
413+
final typeNotIn = keepLocalDrafts ? [DocumentType.proposalTemplate] : null;
414+
final deletedDocuments = await _localDocuments.delete(typeNotIn: typeNotIn);
415415

416416
return deletedDrafts + deletedDocuments;
417417
}

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/document/source/database_documents_data_source.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ final class DatabaseDocumentsDataSource
3434

3535
@override
3636
Future<int> delete({
37-
List<DocumentType>? notInType,
37+
List<DocumentType>? typeNotIn,
3838
}) {
39-
return _database.documentsV2Dao.deleteWhere(notInType: notInType);
39+
return _database.documentsV2Dao.deleteWhere(typeNotIn: typeNotIn);
4040
}
4141

4242
@override

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/document/source/database_drafts_data_source.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ final class DatabaseDraftsDataSource implements DraftDataSource {
2424
@override
2525
Future<int> delete({
2626
DocumentRef? ref,
27-
List<DocumentType>? notInType,
27+
List<DocumentType>? typeNotIn,
2828
}) {
29-
return _database.localDocumentsV2Dao.deleteWhere(ref: ref, notInType: notInType);
29+
return _database.localDocumentsV2Dao.deleteWhere(ref: ref, typeNotIn: typeNotIn);
3030
}
3131

3232
@override

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/document/source/document_data_local_source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ abstract interface class DocumentDataLocalSource implements DocumentDataSource {
1010
});
1111

1212
Future<int> delete({
13-
List<DocumentType>? notInType,
13+
List<DocumentType>? typeNotIn,
1414
});
1515

1616
Future<bool> exists({required DocumentRef ref});

catalyst_voices/packages/internal/catalyst_voices_repositories/lib/src/document/source/local_document_data_local_source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ abstract interface class DraftDataSource implements DocumentDataLocalSource {
66
@override
77
Future<int> delete({
88
DocumentRef? ref,
9-
List<DocumentType>? notInType,
9+
List<DocumentType>? typeNotIn,
1010
});
1111

1212
Future<void> update({

catalyst_voices/packages/internal/catalyst_voices_repositories/test/src/database/dao/documents_v2_dao_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ void main() {
16991699

17001700
// When
17011701
final result = await dao.deleteWhere(
1702-
notInType: [DocumentType.proposalDocument],
1702+
typeNotIn: [DocumentType.proposalDocument],
17031703
);
17041704

17051705
// Then
@@ -1739,7 +1739,7 @@ void main() {
17391739

17401740
// When
17411741
final result = await dao.deleteWhere(
1742-
notInType: [
1742+
typeNotIn: [
17431743
DocumentType.proposalDocument,
17441744
DocumentType.proposalTemplate,
17451745
],
@@ -1785,7 +1785,7 @@ void main() {
17851785
await dao.saveAll(entities);
17861786

17871787
// When
1788-
final result = await dao.deleteWhere(notInType: []);
1788+
final result = await dao.deleteWhere(typeNotIn: []);
17891789

17901790
// Then
17911791
expect(result, 2);
@@ -1810,7 +1810,7 @@ void main() {
18101810

18111811
// When
18121812
final result = await dao.deleteWhere(
1813-
notInType: [DocumentType.proposalDocument],
1813+
typeNotIn: [DocumentType.proposalDocument],
18141814
);
18151815

18161816
// Then
@@ -1839,7 +1839,7 @@ void main() {
18391839

18401840
// When
18411841
final result = await dao.deleteWhere(
1842-
notInType: [DocumentType.proposalDocument],
1842+
typeNotIn: [DocumentType.proposalDocument],
18431843
);
18441844

18451845
// Then
@@ -1880,7 +1880,7 @@ void main() {
18801880

18811881
// When
18821882
final result = await dao.deleteWhere(
1883-
notInType: [
1883+
typeNotIn: [
18841884
DocumentType.proposalDocument,
18851885
DocumentType.proposalTemplate,
18861886
DocumentType.proposalActionDocument,
@@ -1906,7 +1906,7 @@ void main() {
19061906

19071907
// When
19081908
final result = await dao.deleteWhere(
1909-
notInType: [DocumentType.proposalDocument],
1909+
typeNotIn: [DocumentType.proposalDocument],
19101910
);
19111911

19121912
// Then

0 commit comments

Comments
 (0)