@cravery/firebase 0.0.31 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repository/equipment.d.ts.map +1 -1
- package/dist/repository/equipment.js +10 -1
- package/dist/repository/equipment.js.map +1 -1
- package/dist/repository/ingredient.d.ts.map +1 -1
- package/dist/repository/ingredient.js +12 -2
- package/dist/repository/ingredient.js.map +1 -1
- package/package.json +1 -1
- package/src/repository/equipment.ts +13 -8
- package/src/repository/ingredient.ts +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equipment.d.ts","sourceRoot":"","sources":["../../src/repository/equipment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"equipment.d.ts","sourceRoot":"","sources":["../../src/repository/equipment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAGzB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAWrD,qBAAa,mBAAoB,SAAQ,cAAc,CACrD,eAAe,EACf,mBAAmB,EACnB,sBAAsB,CACvB;IACC,SAAS,CAAC,QAAQ,CAAC,cAAc,SAAyB;IAC1D,SAAS,CAAC,QAAQ,CAAC,UAAU,eAAe;IAC5C,SAAS,CAAC,QAAQ,CAAC,aAAa,gGAA0B;IAC1D,SAAS,CAAC,QAAQ,CAAC,gBAAgB,mGAA6B;gBAEpD,EAAE,EAAE,SAAS;IAIzB,SAAS,CAAC,KAAK,CACb,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,sBAAsB,GAC9B,eAAe;IAIlB,SAAS,CAAC,KAAK,CACb,SAAS,EAAE,eAAe,GACzB,WAAW,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;IA4BrD,aAAa,CACjB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,EACd,KAAK,SAAK,EACV,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,GAAE,mBAA+B,GACzC,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;CAQnD"}
|
|
@@ -4,6 +4,14 @@ exports.EquipmentRepository = void 0;
|
|
|
4
4
|
const core_1 = require("@cravery/core");
|
|
5
5
|
const converter_1 = require("../converter");
|
|
6
6
|
const base_1 = require("./base");
|
|
7
|
+
// All statuses except "deleted" - used for filtering
|
|
8
|
+
const ACTIVE_STATUSES = [
|
|
9
|
+
"active",
|
|
10
|
+
"archived",
|
|
11
|
+
"flagged",
|
|
12
|
+
"pending",
|
|
13
|
+
"suspended",
|
|
14
|
+
];
|
|
7
15
|
class EquipmentRepository extends base_1.BaseRepository {
|
|
8
16
|
constructor(db) {
|
|
9
17
|
super(db);
|
|
@@ -32,9 +40,10 @@ class EquipmentRepository extends base_1.BaseRepository {
|
|
|
32
40
|
};
|
|
33
41
|
}
|
|
34
42
|
async getByCategory(category, locale, limit = 20, cursor, direction = "forward") {
|
|
43
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
35
44
|
const baseQuery = this.metaCollection
|
|
36
45
|
.where("category", "==", category)
|
|
37
|
-
.where("status", "
|
|
46
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
38
47
|
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
39
48
|
}
|
|
40
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equipment.js","sourceRoot":"","sources":["../../src/repository/equipment.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"equipment.js","sourceRoot":"","sources":["../../src/repository/equipment.ts"],"names":[],"mappings":";;;AACA,wCAUuB;AACvB,4CAGsB;AACtB,iCAAqD;AAErD,qDAAqD;AACrD,MAAM,eAAe,GAAmB;IACtC,QAAQ;IACR,UAAU;IACV,SAAS;IACT,SAAS;IACT,WAAW;CACZ,CAAC;AAEF,MAAa,mBAAoB,SAAQ,qBAIxC;IAMC,YAAY,EAAa;QACvB,KAAK,CAAC,EAAE,CAAC,CAAC;QANO,mBAAc,GAAG,kBAAW,CAAC,SAAS,CAAC;QACvC,eAAU,GAAG,WAAW,CAAC;QACzB,kBAAa,GAAG,kCAAsB,CAAC;QACvC,qBAAgB,GAAG,qCAAyB,CAAC;IAIhE,CAAC;IAES,KAAK,CACb,IAAyB,EACzB,OAA+B;QAE/B,uCAAY,IAAI,GAAK,OAAO,EAAG;IACjC,CAAC;IAES,KAAK,CACb,SAA0B;QAE1B,MAAM,EACJ,EAAE,EAAE,GAAG,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,GACL,GAAG,SAAS,CAAC;QACd,OAAO;YACL,IAAI,EAAE;gBACJ,QAAQ;gBACR,QAAQ;gBACR,IAAI;gBACJ,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,SAAS;gBACT,SAAS;aACV;YACD,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;SACxB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,QAA2B,EAC3B,MAAc,EACd,KAAK,GAAG,EAAE,EACV,MAAe,EACf,YAAiC,SAAS;QAE1C,+DAA+D;QAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc;aAClC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC;aACjC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACjF,CAAC;CACF;AAjED,kDAiEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient.d.ts","sourceRoot":"","sources":["../../src/repository/ingredient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ingredient.d.ts","sourceRoot":"","sources":["../../src/repository/ingredient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAGzB,MAAM,eAAe,CAAC;AAcvB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErD,qBAAa,oBAAqB,SAAQ,cAAc,CACtD,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,CACxB;IACC,SAAS,CAAC,QAAQ,CAAC,cAAc,SAA2B;IAC5D,SAAS,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC7C,SAAS,CAAC,QAAQ,CAAC,aAAa,iGAA2B;IAC3D,SAAS,CAAC,QAAQ,CAAC,gBAAgB,oGAA8B;gBAErD,EAAE,EAAE,SAAS;IAIzB,SAAS,CAAC,KAAK,CACb,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,uBAAuB,GAC/B,gBAAgB;IAInB,SAAS,CAAC,KAAK,CACb,UAAU,EAAE,gBAAgB,GAC3B,WAAW,CAAC,oBAAoB,EAAE,uBAAuB,CAAC;IAgCvD,aAAa,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,SAAK,EACV,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,GAAE,mBAA+B,GACzC,OAAO,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAS7C,UAAU,CACd,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,SAAK,EACV,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,GAAE,mBAA+B,GACzC,OAAO,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAQpD"}
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IngredientRepository = void 0;
|
|
4
4
|
const core_1 = require("@cravery/core");
|
|
5
|
+
// All statuses except "deleted" - used for filtering
|
|
6
|
+
const ACTIVE_STATUSES = [
|
|
7
|
+
"active",
|
|
8
|
+
"archived",
|
|
9
|
+
"flagged",
|
|
10
|
+
"pending",
|
|
11
|
+
"suspended",
|
|
12
|
+
];
|
|
5
13
|
const converter_1 = require("../converter");
|
|
6
14
|
const base_1 = require("./base");
|
|
7
15
|
class IngredientRepository extends base_1.BaseRepository {
|
|
@@ -34,15 +42,17 @@ class IngredientRepository extends base_1.BaseRepository {
|
|
|
34
42
|
};
|
|
35
43
|
}
|
|
36
44
|
async getByCategory(category, locale, limit = 20, cursor, direction = "forward") {
|
|
45
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
37
46
|
const baseQuery = this.metaCollection
|
|
38
47
|
.where("category", "==", category)
|
|
39
|
-
.where("status", "
|
|
48
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
40
49
|
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
41
50
|
}
|
|
42
51
|
async getByGroup(group, locale, limit = 20, cursor, direction = "forward") {
|
|
52
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
43
53
|
const baseQuery = this.metaCollection
|
|
44
54
|
.where("group", "==", group)
|
|
45
|
-
.where("status", "
|
|
55
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
46
56
|
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
47
57
|
}
|
|
48
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient.js","sourceRoot":"","sources":["../../src/repository/ingredient.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"ingredient.js","sourceRoot":"","sources":["../../src/repository/ingredient.ts"],"names":[],"mappings":";;;AACA,wCAWuB;AAEvB,qDAAqD;AACrD,MAAM,eAAe,GAAmB;IACtC,QAAQ;IACR,UAAU;IACV,SAAS;IACT,SAAS;IACT,WAAW;CACZ,CAAC;AACF,4CAGsB;AACtB,iCAAqD;AAErD,MAAa,oBAAqB,SAAQ,qBAIzC;IAMC,YAAY,EAAa;QACvB,KAAK,CAAC,EAAE,CAAC,CAAC;QANO,mBAAc,GAAG,kBAAW,CAAC,WAAW,CAAC;QACzC,eAAU,GAAG,YAAY,CAAC;QAC1B,kBAAa,GAAG,mCAAuB,CAAC;QACxC,qBAAgB,GAAG,sCAA0B,CAAC;IAIjE,CAAC;IAES,KAAK,CACb,IAA0B,EAC1B,OAAgC;QAEhC,uCAAY,IAAI,GAAK,OAAO,EAAG;IACjC,CAAC;IAES,KAAK,CACb,UAA4B;QAE5B,MAAM,EACJ,EAAE,EAAE,GAAG,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,IAA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IONS,
|
|
11
12
|
} from "@cravery/core";
|
|
12
13
|
import {
|
|
@@ -15,6 +16,15 @@ import {
|
|
|
15
16
|
} from "../converter";
|
|
16
17
|
import { BaseRepository, SplitResult } from "./base";
|
|
17
18
|
|
|
19
|
+
// All statuses except "deleted" - used for filtering
|
|
20
|
+
const ACTIVE_STATUSES: EntityStatus[] = [
|
|
21
|
+
"active",
|
|
22
|
+
"archived",
|
|
23
|
+
"flagged",
|
|
24
|
+
"pending",
|
|
25
|
+
"suspended",
|
|
26
|
+
];
|
|
27
|
+
|
|
18
28
|
export class EquipmentRepository extends BaseRepository<
|
|
19
29
|
EquipmentEntity,
|
|
20
30
|
EquipmentEntityMeta,
|
|
@@ -73,16 +83,11 @@ export class EquipmentRepository extends BaseRepository<
|
|
|
73
83
|
cursor?: string,
|
|
74
84
|
direction: PaginationDirection = "forward",
|
|
75
85
|
): Promise<CursorPaginatedResult<EquipmentEntity>> {
|
|
86
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
76
87
|
const baseQuery = this.metaCollection
|
|
77
88
|
.where("category", "==", category)
|
|
78
|
-
.where("status", "
|
|
89
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
79
90
|
|
|
80
|
-
return this.executePaginatedQuery(
|
|
81
|
-
baseQuery,
|
|
82
|
-
locale,
|
|
83
|
-
limit,
|
|
84
|
-
cursor,
|
|
85
|
-
direction,
|
|
86
|
-
);
|
|
91
|
+
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
87
92
|
}
|
|
88
93
|
}
|
|
@@ -8,8 +8,18 @@ import {
|
|
|
8
8
|
type Locale,
|
|
9
9
|
type CursorPaginatedResult,
|
|
10
10
|
type PaginationDirection,
|
|
11
|
+
type EntityStatus,
|
|
11
12
|
COLLECTIONS,
|
|
12
13
|
} from "@cravery/core";
|
|
14
|
+
|
|
15
|
+
// All statuses except "deleted" - used for filtering
|
|
16
|
+
const ACTIVE_STATUSES: EntityStatus[] = [
|
|
17
|
+
"active",
|
|
18
|
+
"archived",
|
|
19
|
+
"flagged",
|
|
20
|
+
"pending",
|
|
21
|
+
"suspended",
|
|
22
|
+
];
|
|
13
23
|
import {
|
|
14
24
|
ingredientMetaConverter,
|
|
15
25
|
ingredientContentConverter,
|
|
@@ -78,17 +88,12 @@ export class IngredientRepository extends BaseRepository<
|
|
|
78
88
|
cursor?: string,
|
|
79
89
|
direction: PaginationDirection = "forward",
|
|
80
90
|
): Promise<CursorPaginatedResult<IngredientEntity>> {
|
|
91
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
81
92
|
const baseQuery = this.metaCollection
|
|
82
93
|
.where("category", "==", category)
|
|
83
|
-
.where("status", "
|
|
94
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
84
95
|
|
|
85
|
-
return this.executePaginatedQuery(
|
|
86
|
-
baseQuery,
|
|
87
|
-
locale,
|
|
88
|
-
limit,
|
|
89
|
-
cursor,
|
|
90
|
-
direction,
|
|
91
|
-
);
|
|
96
|
+
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
async getByGroup(
|
|
@@ -98,16 +103,11 @@ export class IngredientRepository extends BaseRepository<
|
|
|
98
103
|
cursor?: string,
|
|
99
104
|
direction: PaginationDirection = "forward",
|
|
100
105
|
): Promise<CursorPaginatedResult<IngredientEntity>> {
|
|
106
|
+
// Use "in" instead of "!=" to avoid complex index requirements
|
|
101
107
|
const baseQuery = this.metaCollection
|
|
102
108
|
.where("group", "==", group)
|
|
103
|
-
.where("status", "
|
|
109
|
+
.where("status", "in", ACTIVE_STATUSES);
|
|
104
110
|
|
|
105
|
-
return this.executePaginatedQuery(
|
|
106
|
-
baseQuery,
|
|
107
|
-
locale,
|
|
108
|
-
limit,
|
|
109
|
-
cursor,
|
|
110
|
-
direction,
|
|
111
|
-
);
|
|
111
|
+
return this.executePaginatedQuery(baseQuery, locale, limit, cursor, direction);
|
|
112
112
|
}
|
|
113
113
|
}
|