@carlonicora/nestjs-neo4jsonapi 8.12.1 → 8.14.0
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/foundations/account-deletion/repositories/account-deletion.wipe.repository.d.ts +2 -1
- package/dist/foundations/account-deletion/repositories/account-deletion.wipe.repository.d.ts.map +1 -1
- package/dist/foundations/account-deletion/repositories/account-deletion.wipe.repository.js +8 -1
- package/dist/foundations/account-deletion/repositories/account-deletion.wipe.repository.js.map +1 -1
- package/dist/foundations/chunker/services/chunker.service.d.ts +32 -0
- package/dist/foundations/chunker/services/chunker.service.d.ts.map +1 -1
- package/dist/foundations/chunker/services/chunker.service.js +129 -0
- package/dist/foundations/chunker/services/chunker.service.js.map +1 -1
- package/dist/foundations/chunker/utils/zip-limits.d.ts +9 -0
- package/dist/foundations/chunker/utils/zip-limits.d.ts.map +1 -1
- package/dist/foundations/chunker/utils/zip-limits.js +5 -2
- package/dist/foundations/chunker/utils/zip-limits.js.map +1 -1
- package/dist/foundations/company/repositories/company.repository.d.ts +2 -2
- package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
- package/dist/foundations/company/repositories/company.repository.js +10 -2
- package/dist/foundations/company/repositories/company.repository.js.map +1 -1
- package/dist/foundations/referral/controllers/index.d.ts +2 -0
- package/dist/foundations/referral/controllers/index.d.ts.map +1 -1
- package/dist/foundations/referral/controllers/index.js +2 -0
- package/dist/foundations/referral/controllers/index.js.map +1 -1
- package/dist/foundations/referral/controllers/referral.admin.controller.d.ts +24 -0
- package/dist/foundations/referral/controllers/referral.admin.controller.d.ts.map +1 -0
- package/dist/foundations/referral/controllers/referral.admin.controller.js +100 -0
- package/dist/foundations/referral/controllers/referral.admin.controller.js.map +1 -0
- package/dist/foundations/referral/controllers/referral.public.controller.d.ts +19 -0
- package/dist/foundations/referral/controllers/referral.public.controller.d.ts.map +1 -0
- package/dist/foundations/referral/controllers/referral.public.controller.js +57 -0
- package/dist/foundations/referral/controllers/referral.public.controller.js.map +1 -0
- package/dist/foundations/referral/dtos/index.d.ts +1 -0
- package/dist/foundations/referral/dtos/index.d.ts.map +1 -1
- package/dist/foundations/referral/dtos/index.js +1 -0
- package/dist/foundations/referral/dtos/index.js.map +1 -1
- package/dist/foundations/referral/dtos/referral-visit.post.dto.d.ts +11 -0
- package/dist/foundations/referral/dtos/referral-visit.post.dto.d.ts.map +1 -0
- package/dist/foundations/referral/dtos/referral-visit.post.dto.js +48 -0
- package/dist/foundations/referral/dtos/referral-visit.post.dto.js.map +1 -0
- package/dist/foundations/referral/entities/index.d.ts +11 -0
- package/dist/foundations/referral/entities/index.d.ts.map +1 -1
- package/dist/foundations/referral/entities/index.js +11 -0
- package/dist/foundations/referral/entities/index.js.map +1 -1
- package/dist/foundations/referral/entities/referral-admin-referral.d.ts +23 -0
- package/dist/foundations/referral/entities/referral-admin-referral.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referral.js +23 -0
- package/dist/foundations/referral/entities/referral-admin-referral.js.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referral.meta.d.ts +3 -0
- package/dist/foundations/referral/entities/referral-admin-referral.meta.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referral.meta.js +10 -0
- package/dist/foundations/referral/entities/referral-admin-referral.meta.js.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.d.ts +22 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.js +23 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.js.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.meta.d.ts +3 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.meta.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.meta.js +10 -0
- package/dist/foundations/referral/entities/referral-admin-referrer.meta.js.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-summary.d.ts +23 -0
- package/dist/foundations/referral/entities/referral-admin-summary.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-summary.js +22 -0
- package/dist/foundations/referral/entities/referral-admin-summary.js.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-summary.meta.d.ts +3 -0
- package/dist/foundations/referral/entities/referral-admin-summary.meta.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-admin-summary.meta.js +10 -0
- package/dist/foundations/referral/entities/referral-admin-summary.meta.js.map +1 -0
- package/dist/foundations/referral/entities/referral-invite.d.ts +27 -0
- package/dist/foundations/referral/entities/referral-invite.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-invite.js +28 -0
- package/dist/foundations/referral/entities/referral-invite.js.map +1 -0
- package/dist/foundations/referral/entities/referral-invite.meta.d.ts +3 -0
- package/dist/foundations/referral/entities/referral-invite.meta.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-invite.meta.js +10 -0
- package/dist/foundations/referral/entities/referral-invite.meta.js.map +1 -0
- package/dist/foundations/referral/entities/referral-source.d.ts +10 -0
- package/dist/foundations/referral/entities/referral-source.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-source.js +9 -0
- package/dist/foundations/referral/entities/referral-source.js.map +1 -0
- package/dist/foundations/referral/entities/referral-visit.d.ts +19 -0
- package/dist/foundations/referral/entities/referral-visit.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-visit.js +21 -0
- package/dist/foundations/referral/entities/referral-visit.js.map +1 -0
- package/dist/foundations/referral/entities/referral-visit.meta.d.ts +7 -0
- package/dist/foundations/referral/entities/referral-visit.meta.d.ts.map +1 -0
- package/dist/foundations/referral/entities/referral-visit.meta.js +14 -0
- package/dist/foundations/referral/entities/referral-visit.meta.js.map +1 -0
- package/dist/foundations/referral/entities/referral.d.ts +3 -0
- package/dist/foundations/referral/entities/referral.d.ts.map +1 -1
- package/dist/foundations/referral/entities/referral.js +1 -0
- package/dist/foundations/referral/entities/referral.js.map +1 -1
- package/dist/foundations/referral/index.d.ts +1 -0
- package/dist/foundations/referral/index.d.ts.map +1 -1
- package/dist/foundations/referral/index.js +1 -0
- package/dist/foundations/referral/index.js.map +1 -1
- package/dist/foundations/referral/referral.module.d.ts.map +1 -1
- package/dist/foundations/referral/referral.module.js +20 -1
- package/dist/foundations/referral/referral.module.js.map +1 -1
- package/dist/foundations/referral/repositories/index.d.ts +1 -0
- package/dist/foundations/referral/repositories/index.d.ts.map +1 -1
- package/dist/foundations/referral/repositories/index.js +1 -0
- package/dist/foundations/referral/repositories/index.js.map +1 -1
- package/dist/foundations/referral/repositories/referral.admin.repository.d.ts +106 -0
- package/dist/foundations/referral/repositories/referral.admin.repository.d.ts.map +1 -0
- package/dist/foundations/referral/repositories/referral.admin.repository.js +380 -0
- package/dist/foundations/referral/repositories/referral.admin.repository.js.map +1 -0
- package/dist/foundations/referral/repositories/referral.repository.d.ts +34 -0
- package/dist/foundations/referral/repositories/referral.repository.d.ts.map +1 -1
- package/dist/foundations/referral/repositories/referral.repository.js +82 -0
- package/dist/foundations/referral/repositories/referral.repository.js.map +1 -1
- package/dist/foundations/referral/services/index.d.ts +1 -0
- package/dist/foundations/referral/services/index.d.ts.map +1 -1
- package/dist/foundations/referral/services/index.js +1 -0
- package/dist/foundations/referral/services/index.js.map +1 -1
- package/dist/foundations/referral/services/referral.admin.service.d.ts +53 -0
- package/dist/foundations/referral/services/referral.admin.service.d.ts.map +1 -0
- package/dist/foundations/referral/services/referral.admin.service.js +94 -0
- package/dist/foundations/referral/services/referral.admin.service.js.map +1 -0
- package/dist/foundations/referral/services/referral.service.d.ts +10 -2
- package/dist/foundations/referral/services/referral.service.d.ts.map +1 -1
- package/dist/foundations/referral/services/referral.service.js +34 -4
- package/dist/foundations/referral/services/referral.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-referrer.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-referrer.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,iFAA2E;AAqB9D,QAAA,+BAA+B,GAAG,IAAA,qBAAY,GAA+B,CAAC;IACzF,GAAG,wDAAyB;IAE5B,eAAe,EAAE,KAAK;IACtB,OAAO,EAAE,UAAU;IAEnB,MAAM,EAAE;QACN,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACjD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACjD,YAAY,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;KACnC;IAED,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-referrer.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-referrer.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,eAAO,MAAM,yBAAyB,EAAE,QAKvC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.referralAdminReferrerMeta = void 0;
|
|
4
|
+
exports.referralAdminReferrerMeta = {
|
|
5
|
+
type: "referral-admin-referrers",
|
|
6
|
+
endpoint: "referrals/administration/referrers",
|
|
7
|
+
nodeName: "referralAdminReferrer",
|
|
8
|
+
labelName: "ReferralAdminReferrer",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=referral-admin-referrer.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-referrer.meta.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-referrer.meta.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAa;IACjD,IAAI,EAAE,0BAA0B;IAChC,QAAQ,EAAE,oCAAoC;IAC9C,QAAQ,EAAE,uBAAuB;IACjC,SAAS,EAAE,uBAAuB;CACnC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Entity } from "../../../common";
|
|
2
|
+
/**
|
|
3
|
+
* One window of the administrator referral report: "current" (the selected
|
|
4
|
+
* period) or "previous" (the equal-length span before it, absent for "all").
|
|
5
|
+
* `window` is also the id.
|
|
6
|
+
*
|
|
7
|
+
* NOT a Neo4j node: a serialisation shape only, like AnalyticsSummaryDescriptor.
|
|
8
|
+
* The report columns are fields, not computed properties, because the
|
|
9
|
+
* serialiser emits computed values into meta, not attributes.
|
|
10
|
+
*/
|
|
11
|
+
export type ReferralAdminSummaryEntity = Entity & {
|
|
12
|
+
window: string;
|
|
13
|
+
visits: number;
|
|
14
|
+
invitesSent: number;
|
|
15
|
+
signups: number;
|
|
16
|
+
paying: number;
|
|
17
|
+
creditsGiven: number;
|
|
18
|
+
sharingCompanies: number;
|
|
19
|
+
eligibleCompanies: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const ReferralAdminSummaryDescriptor: import("../../../common").EntityDescriptor<ReferralAdminSummaryEntity, {}>;
|
|
22
|
+
export type ReferralAdminSummaryDescriptorType = typeof ReferralAdminSummaryDescriptor;
|
|
23
|
+
//# sourceMappingURL=referral-admin-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-summary.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG5D;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,8BAA8B,4EAkBzC,CAAC;AAEH,MAAM,MAAM,kCAAkC,GAAG,OAAO,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferralAdminSummaryDescriptor = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const referral_admin_summary_meta_1 = require("./referral-admin-summary.meta");
|
|
6
|
+
exports.ReferralAdminSummaryDescriptor = (0, common_1.defineEntity)()({
|
|
7
|
+
...referral_admin_summary_meta_1.referralAdminSummaryMeta,
|
|
8
|
+
isCompanyScoped: false,
|
|
9
|
+
tenancy: "internal",
|
|
10
|
+
fields: {
|
|
11
|
+
window: { type: "string", required: true },
|
|
12
|
+
visits: { type: "number", required: true },
|
|
13
|
+
invitesSent: { type: "number", required: true },
|
|
14
|
+
signups: { type: "number", required: true },
|
|
15
|
+
paying: { type: "number", required: true },
|
|
16
|
+
creditsGiven: { type: "number", required: true },
|
|
17
|
+
sharingCompanies: { type: "number", required: true },
|
|
18
|
+
eligibleCompanies: { type: "number", required: true },
|
|
19
|
+
},
|
|
20
|
+
relationships: {},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=referral-admin-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-summary.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-summary.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,+EAAyE;AAsB5D,QAAA,8BAA8B,GAAG,IAAA,qBAAY,GAA8B,CAAC;IACvF,GAAG,sDAAwB;IAE3B,eAAe,EAAE,KAAK;IACtB,OAAO,EAAE,UAAU;IAEnB,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpD,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;KACtD;IAED,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-summary.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-summary.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,QAKtC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.referralAdminSummaryMeta = void 0;
|
|
4
|
+
exports.referralAdminSummaryMeta = {
|
|
5
|
+
type: "referral-admin-summaries",
|
|
6
|
+
endpoint: "referrals/administration/summary",
|
|
7
|
+
nodeName: "referralAdminSummary",
|
|
8
|
+
labelName: "ReferralAdminSummary",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=referral-admin-summary.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-admin-summary.meta.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-admin-summary.meta.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAa;IAChD,IAAI,EAAE,0BAA0B;IAChC,QAAQ,EAAE,kCAAkC;IAC5C,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,sBAAsB;CAClC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Entity } from "../../../common";
|
|
2
|
+
import type { Company } from "../../company/entities/company";
|
|
3
|
+
import type { User } from "../../user/entities/user";
|
|
4
|
+
/**
|
|
5
|
+
* One referral invite email sent by a user of a company. The invitee address is
|
|
6
|
+
* never stored.
|
|
7
|
+
*/
|
|
8
|
+
export type ReferralInvite = Entity & {
|
|
9
|
+
company?: Company;
|
|
10
|
+
sender?: User;
|
|
11
|
+
};
|
|
12
|
+
export declare const ReferralInviteDescriptor: import("../../../common").EntityDescriptor<ReferralInvite, {
|
|
13
|
+
company: {
|
|
14
|
+
model: import("../../../common").DataMeta;
|
|
15
|
+
direction: "out";
|
|
16
|
+
relationship: string;
|
|
17
|
+
cardinality: "one";
|
|
18
|
+
};
|
|
19
|
+
sender: {
|
|
20
|
+
model: import("../../../common").DataMeta;
|
|
21
|
+
direction: "out";
|
|
22
|
+
relationship: string;
|
|
23
|
+
cardinality: "one";
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
export type ReferralInviteDescriptorType = typeof ReferralInviteDescriptor;
|
|
27
|
+
//# sourceMappingURL=referral-invite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-invite.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-invite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIrD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;EAmBnC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,OAAO,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferralInviteDescriptor = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const company_meta_1 = require("../../company/entities/company.meta");
|
|
6
|
+
const user_meta_1 = require("../../user/entities/user.meta");
|
|
7
|
+
const referral_invite_meta_1 = require("./referral-invite.meta");
|
|
8
|
+
exports.ReferralInviteDescriptor = (0, common_1.defineEntity)()({
|
|
9
|
+
...referral_invite_meta_1.referralInviteMeta,
|
|
10
|
+
isCompanyScoped: false,
|
|
11
|
+
tenancy: "internal",
|
|
12
|
+
fields: {},
|
|
13
|
+
relationships: {
|
|
14
|
+
company: {
|
|
15
|
+
model: company_meta_1.companyMeta,
|
|
16
|
+
direction: "out",
|
|
17
|
+
relationship: "SENT_BY",
|
|
18
|
+
cardinality: "one",
|
|
19
|
+
},
|
|
20
|
+
sender: {
|
|
21
|
+
model: user_meta_1.userMeta,
|
|
22
|
+
direction: "out",
|
|
23
|
+
relationship: "SENT_BY_USER",
|
|
24
|
+
cardinality: "one",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=referral-invite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-invite.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-invite.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,sEAAkE;AAElE,6DAAyD;AACzD,iEAA4D;AAW/C,QAAA,wBAAwB,GAAG,IAAA,qBAAY,GAAkB,CAAC;IACrE,GAAG,yCAAkB;IACrB,eAAe,EAAE,KAAK;IACtB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,EAAE;IACV,aAAa,EAAE;QACb,OAAO,EAAE;YACP,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,SAAS;YACvB,WAAW,EAAE,KAAK;SACnB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,oBAAQ;YACf,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-invite.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-invite.meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,kBAAkB,EAAE,QAKhC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.referralInviteMeta = void 0;
|
|
4
|
+
exports.referralInviteMeta = {
|
|
5
|
+
type: "referral-invites",
|
|
6
|
+
endpoint: "referral-invites",
|
|
7
|
+
nodeName: "referralInvite",
|
|
8
|
+
labelName: "ReferralInvite",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=referral-invite.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-invite.meta.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-invite.meta.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAa;IAC1C,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,gBAAgB;CAC5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a Referral came about: through the referrer's invite link, or recorded
|
|
3
|
+
* directly by the app (e.g. a player who later became a GM).
|
|
4
|
+
*/
|
|
5
|
+
export declare const REFERRAL_SOURCE: {
|
|
6
|
+
readonly link: "link";
|
|
7
|
+
readonly direct: "direct";
|
|
8
|
+
};
|
|
9
|
+
export type ReferralSource = (typeof REFERRAL_SOURCE)[keyof typeof REFERRAL_SOURCE];
|
|
10
|
+
//# sourceMappingURL=referral-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-source.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-source.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;;;CAA8C,CAAC;AAC3E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REFERRAL_SOURCE = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* How a Referral came about: through the referrer's invite link, or recorded
|
|
6
|
+
* directly by the app (e.g. a player who later became a GM).
|
|
7
|
+
*/
|
|
8
|
+
exports.REFERRAL_SOURCE = { link: "link", direct: "direct" };
|
|
9
|
+
//# sourceMappingURL=referral-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-source.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-source.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Entity } from "../../../common";
|
|
2
|
+
import type { Company } from "../../company/entities/company";
|
|
3
|
+
/**
|
|
4
|
+
* One visit to a company's referral link (counted once per browser by the web).
|
|
5
|
+
* Never feeds a reward.
|
|
6
|
+
*/
|
|
7
|
+
export type ReferralVisit = Entity & {
|
|
8
|
+
company?: Company;
|
|
9
|
+
};
|
|
10
|
+
export declare const ReferralVisitDescriptor: import("../../../common").EntityDescriptor<ReferralVisit, {
|
|
11
|
+
company: {
|
|
12
|
+
model: import("../../../common").DataMeta;
|
|
13
|
+
direction: "out";
|
|
14
|
+
relationship: string;
|
|
15
|
+
cardinality: "one";
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
export type ReferralVisitDescriptorType = typeof ReferralVisitDescriptor;
|
|
19
|
+
//# sourceMappingURL=referral-visit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-visit.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-visit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAI9D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;EAalC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,OAAO,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReferralVisitDescriptor = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const company_meta_1 = require("../../company/entities/company.meta");
|
|
6
|
+
const referral_visit_meta_1 = require("./referral-visit.meta");
|
|
7
|
+
exports.ReferralVisitDescriptor = (0, common_1.defineEntity)()({
|
|
8
|
+
...referral_visit_meta_1.referralVisitMeta,
|
|
9
|
+
isCompanyScoped: false,
|
|
10
|
+
tenancy: "internal",
|
|
11
|
+
fields: {},
|
|
12
|
+
relationships: {
|
|
13
|
+
company: {
|
|
14
|
+
model: company_meta_1.companyMeta,
|
|
15
|
+
direction: "out",
|
|
16
|
+
relationship: "VISITED",
|
|
17
|
+
cardinality: "one",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=referral-visit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-visit.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-visit.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,sEAAkE;AAClE,+DAA0D;AAU7C,QAAA,uBAAuB,GAAG,IAAA,qBAAY,GAAiB,CAAC;IACnE,GAAG,uCAAiB;IACpB,eAAe,EAAE,KAAK;IACtB,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,EAAE;IACV,aAAa,EAAE;QACb,OAAO,EAAE;YACP,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,SAAS;YACvB,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-visit.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-visit.meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAK/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.referralVisitMeta = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `endpoint` is the route of the public visit POST; a ReferralVisit is never
|
|
6
|
+
* served as a resource.
|
|
7
|
+
*/
|
|
8
|
+
exports.referralVisitMeta = {
|
|
9
|
+
type: "referral-visits",
|
|
10
|
+
endpoint: "referrals/visits",
|
|
11
|
+
nodeName: "referralVisit",
|
|
12
|
+
labelName: "ReferralVisit",
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=referral-visit.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-visit.meta.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral-visit.meta.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,iBAAiB,GAAa;IACzC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,eAAe;IACzB,SAAS,EAAE,eAAe;CAC3B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Entity } from "../../../common";
|
|
2
2
|
import type { Company } from "../../company/entities/company";
|
|
3
|
+
import type { ReferralSource } from "./referral-source";
|
|
3
4
|
/**
|
|
4
5
|
* Referral Entity Type
|
|
5
6
|
*/
|
|
@@ -7,6 +8,8 @@ export type Referral = Entity & {
|
|
|
7
8
|
status: string;
|
|
8
9
|
completedAt?: Date;
|
|
9
10
|
tokensAwarded?: number;
|
|
11
|
+
/** Absent on referrals written before the source was recorded. */
|
|
12
|
+
source?: ReferralSource;
|
|
10
13
|
referrer?: Company;
|
|
11
14
|
referred?: Company;
|
|
12
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EA0B7B,CAAC;AAGH,MAAM,MAAM,sBAAsB,GAAG,OAAO,kBAAkB,CAAC"}
|
|
@@ -17,6 +17,7 @@ exports.ReferralDescriptor = (0, common_1.defineEntity)()({
|
|
|
17
17
|
status: { type: "string", required: true },
|
|
18
18
|
completedAt: { type: "datetime" },
|
|
19
19
|
tokensAwarded: { type: "number" },
|
|
20
|
+
source: { type: "string" },
|
|
20
21
|
},
|
|
21
22
|
// Relationship definitions
|
|
22
23
|
relationships: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,sEAAkE;
|
|
1
|
+
{"version":3,"file":"referral.js","sourceRoot":"","sources":["../../../../src/foundations/referral/entities/referral.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,sEAAkE;AAElE,mDAA+C;AAgB/C;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,IAAA,qBAAY,GAAY,CAAC;IACzD,GAAG,4BAAY;IAEf,oBAAoB;IACpB,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QACjC,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC3B;IAED,2BAA2B;IAC3B,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,0BAAW;YAClB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,WAAW;YACzB,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/referral/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/referral/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gBAAgB,CAAC;AAG/B,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC;AAG9B,cAAc,QAAQ,CAAC"}
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./referral.module"), exports);
|
|
|
20
20
|
__exportStar(require("./interfaces"), exports);
|
|
21
21
|
// Entities
|
|
22
22
|
__exportStar(require("./entities"), exports);
|
|
23
|
+
__exportStar(require("./entities/referral-source"), exports);
|
|
23
24
|
// Repositories
|
|
24
25
|
__exportStar(require("./repositories"), exports);
|
|
25
26
|
// Services
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/referral/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,oDAAkC;AAElC,aAAa;AACb,+CAA6B;AAE7B,WAAW;AACX,6CAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/referral/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,oDAAkC;AAElC,aAAa;AACb,+CAA6B;AAE7B,WAAW;AACX,6CAA2B;AAC3B,6DAA2C;AAE3C,eAAe;AACf,iDAA+B;AAE/B,WAAW;AACX,6CAA2B;AAE3B,cAAc;AACd,gDAA8B;AAE9B,OAAO;AACP,yCAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/referral/referral.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,YAAY,EAAY,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"referral.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/referral/referral.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAkB,YAAY,EAAY,MAAM,gBAAgB,CAAC;AAyBvF,OAAO,EAGL,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAEa,cAAe,YAAW,YAAY;IACjD,YAAY;IAWZ;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,aAAa;IAW5D;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,0BAA0B,GAAG,aAAa;IAavE;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAwC5B"}
|
|
@@ -16,11 +16,20 @@ const company_module_1 = require("../company/company.module");
|
|
|
16
16
|
const user_module_1 = require("../user/user.module");
|
|
17
17
|
const registration_hook_interface_1 = require("../auth/interfaces/registration-hook.interface");
|
|
18
18
|
const referral_completion_handler_interface_1 = require("../stripe-webhook/interfaces/referral-completion-handler.interface");
|
|
19
|
+
const referral_admin_controller_1 = require("./controllers/referral.admin.controller");
|
|
19
20
|
const referral_controller_1 = require("./controllers/referral.controller");
|
|
21
|
+
const referral_public_controller_1 = require("./controllers/referral.public.controller");
|
|
22
|
+
const referral_admin_referral_1 = require("./entities/referral-admin-referral");
|
|
23
|
+
const referral_admin_referrer_1 = require("./entities/referral-admin-referrer");
|
|
24
|
+
const referral_admin_summary_1 = require("./entities/referral-admin-summary");
|
|
20
25
|
const referral_code_1 = require("./entities/referral-code");
|
|
21
26
|
const referral_stats_1 = require("./entities/referral-stats");
|
|
22
27
|
const referral_1 = require("./entities/referral");
|
|
28
|
+
const referral_invite_1 = require("./entities/referral-invite");
|
|
29
|
+
const referral_visit_1 = require("./entities/referral-visit");
|
|
30
|
+
const referral_admin_repository_1 = require("./repositories/referral.admin.repository");
|
|
23
31
|
const referral_repository_1 = require("./repositories/referral.repository");
|
|
32
|
+
const referral_admin_service_1 = require("./services/referral.admin.service");
|
|
24
33
|
const referral_service_1 = require("./services/referral.service");
|
|
25
34
|
const registration_referral_hook_1 = require("./services/registration-referral.hook");
|
|
26
35
|
const referral_config_interface_1 = require("./interfaces/referral.config.interface");
|
|
@@ -63,6 +72,11 @@ let ReferralModule = ReferralModule_1 = class ReferralModule {
|
|
|
63
72
|
registry_1.modelRegistry.register(referral_1.ReferralDescriptor.model);
|
|
64
73
|
registry_1.modelRegistry.register(referral_code_1.ReferralCodeDescriptor.model);
|
|
65
74
|
registry_1.modelRegistry.register(referral_stats_1.ReferralStatsDescriptor.model);
|
|
75
|
+
registry_1.modelRegistry.register(referral_invite_1.ReferralInviteDescriptor.model);
|
|
76
|
+
registry_1.modelRegistry.register(referral_visit_1.ReferralVisitDescriptor.model);
|
|
77
|
+
registry_1.modelRegistry.register(referral_admin_summary_1.ReferralAdminSummaryDescriptor.model);
|
|
78
|
+
registry_1.modelRegistry.register(referral_admin_referrer_1.ReferralAdminReferrerDescriptor.model);
|
|
79
|
+
registry_1.modelRegistry.register(referral_admin_referral_1.ReferralAdminReferralDescriptor.model);
|
|
66
80
|
}
|
|
67
81
|
/**
|
|
68
82
|
* Configure the ReferralModule with synchronous options.
|
|
@@ -109,14 +123,19 @@ let ReferralModule = ReferralModule_1 = class ReferralModule {
|
|
|
109
123
|
return {
|
|
110
124
|
module: ReferralModule_1,
|
|
111
125
|
imports: [company_module_1.CompanyModule, user_module_1.UserModule, bullmq_1.BullModule.registerQueue({ name: queue_id_1.QueueId.EMAIL }), ...imports],
|
|
112
|
-
controllers: [referral_controller_1.ReferralController],
|
|
126
|
+
controllers: [referral_controller_1.ReferralController, referral_public_controller_1.ReferralPublicController, referral_admin_controller_1.ReferralAdminController],
|
|
113
127
|
providers: [
|
|
114
128
|
...providers,
|
|
115
129
|
referral_code_1.ReferralCodeDescriptor.model.serialiser,
|
|
116
130
|
referral_stats_1.ReferralStatsDescriptor.model.serialiser,
|
|
117
131
|
referral_1.ReferralDescriptor.model.serialiser,
|
|
132
|
+
referral_admin_summary_1.ReferralAdminSummaryDescriptor.model.serialiser,
|
|
133
|
+
referral_admin_referrer_1.ReferralAdminReferrerDescriptor.model.serialiser,
|
|
134
|
+
referral_admin_referral_1.ReferralAdminReferralDescriptor.model.serialiser,
|
|
118
135
|
referral_repository_1.ReferralRepository,
|
|
119
136
|
referral_service_1.ReferralService,
|
|
137
|
+
referral_admin_repository_1.ReferralAdminRepository,
|
|
138
|
+
referral_admin_service_1.ReferralAdminService,
|
|
120
139
|
registration_referral_hook_1.RegistrationReferralHook,
|
|
121
140
|
registrationHookProvider,
|
|
122
141
|
referralCompletionProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referral.module.js","sourceRoot":"","sources":["../../../src/foundations/referral/referral.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAuF;AAEvF,+DAAiE;AACjE,0DAAsD;AACtD,8DAA0D;AAC1D,qDAAiD;AACjD,gGAAmF;AACnF,8HAAiH;AAEjH,2EAAuE;AACvE,4DAAkE;AAClE,8DAAoE;AACpE,kDAAyD;AACzD,4EAAwE;AACxE,kEAA8D;AAC9D,sFAAiF;AACjF,sFAKgD;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGI,IAAM,cAAc,sBAApB,MAAM,cAAc;IACzB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,6BAAkB,CAAC,KAAK,CAAC,CAAC;QACjD,wBAAa,CAAC,QAAQ,CAAC,sCAAsB,CAAC,KAAK,CAAC,CAAC;QACrD,wBAAa,CAAC,QAAQ,CAAC,wCAAuB,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"referral.module.js","sourceRoot":"","sources":["../../../src/foundations/referral/referral.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAuF;AAEvF,+DAAiE;AACjE,0DAAsD;AACtD,8DAA0D;AAC1D,qDAAiD;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U;gBAChD,wCAAkB;gBAClB,kCAAe;gBACf,mDAAuB;gBACvB,6CAAoB;gBACpB,qDAAwB;gBACxB,wBAAwB;gBACxB,0BAA0B;aAC3B;YACD,OAAO,EAAE;gBACP,kCAAe;gBACf,wCAAkB;gBAClB,wBAAwB;gBACxB,0BAA0B;gBAC1B,2CAAe;aAChB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA1FY,wCAAc;yBAAd,cAAc;IAF1B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CA0F1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./referral.repository"), exports);
|
|
18
|
+
__exportStar(require("./referral.admin.repository"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundations/referral/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundations/referral/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,8DAA4C"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ClsService } from "nestjs-cls";
|
|
2
|
+
import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
|
|
3
|
+
import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
|
|
4
|
+
import { SecurityService } from "../../../core/security/services/security.service";
|
|
5
|
+
import { Referral, ReferralDescriptor } from "../entities/referral";
|
|
6
|
+
import { ReferralAdminReferralEntity } from "../entities/referral-admin-referral";
|
|
7
|
+
import { ReferralAdminReferrerEntity } from "../entities/referral-admin-referrer";
|
|
8
|
+
import { ReferralAdminSummaryEntity } from "../entities/referral-admin-summary";
|
|
9
|
+
/** The periods the admin endpoints accept, in days back from now (`all` has no start). */
|
|
10
|
+
export declare const REFERRAL_ADMIN_PERIODS: {
|
|
11
|
+
readonly "30d": 30;
|
|
12
|
+
readonly "90d": 90;
|
|
13
|
+
readonly all: any;
|
|
14
|
+
};
|
|
15
|
+
export type ReferralAdminPeriod = keyof typeof REFERRAL_ADMIN_PERIODS;
|
|
16
|
+
/**
|
|
17
|
+
* The ORDER BY clauses the referrers list may emit, keyed by the sort it accepts.
|
|
18
|
+
* A lookup rather than an interpolation of the caller's string: nothing that did
|
|
19
|
+
* not come from this table can ever reach the query text.
|
|
20
|
+
*/
|
|
21
|
+
export declare const REFERRAL_ADMIN_SORTS: {
|
|
22
|
+
readonly paying: "paying DESC, signups DESC";
|
|
23
|
+
readonly signups: "signups DESC, paying DESC";
|
|
24
|
+
readonly invites: "invitesSent DESC, paying DESC";
|
|
25
|
+
readonly conversion: "conversion DESC, paying DESC";
|
|
26
|
+
readonly credits: "creditsEarned DESC, paying DESC";
|
|
27
|
+
};
|
|
28
|
+
export type ReferralAdminSort = keyof typeof REFERRAL_ADMIN_SORTS;
|
|
29
|
+
/**
|
|
30
|
+
* Platform-wide reads behind /referrals/administration/*. The Referral
|
|
31
|
+
* descriptor is only there to satisfy the base class; nothing here goes through
|
|
32
|
+
* the inherited CRUD.
|
|
33
|
+
*
|
|
34
|
+
* Counting rules:
|
|
35
|
+
* - every window is [from, to): an inclusive start, so a record created exactly
|
|
36
|
+
* at the period start counts; `from = null` ("all") has no start;
|
|
37
|
+
* - visits and invites count by their createdAt; sign-ups are Referrals created
|
|
38
|
+
* in the window (both sources); paying are Referrals with status completed
|
|
39
|
+
* and completedAt in the window; credits given are twice the sum of their
|
|
40
|
+
* tokensAwarded (both sides are rewarded);
|
|
41
|
+
* - companies with a user in $excludeUserIds (platform administrators) are left
|
|
42
|
+
* out on both sides; demo companies (isDemo) are left out on the referred side.
|
|
43
|
+
*/
|
|
44
|
+
export declare class ReferralAdminRepository extends AbstractRepository<Referral, typeof ReferralDescriptor.relationships> {
|
|
45
|
+
protected readonly descriptor: import("../../..").EntityDescriptor<Referral, {
|
|
46
|
+
referrer: {
|
|
47
|
+
model: import("../../..").DataMeta;
|
|
48
|
+
direction: "out";
|
|
49
|
+
relationship: string;
|
|
50
|
+
cardinality: "one";
|
|
51
|
+
};
|
|
52
|
+
referred: {
|
|
53
|
+
model: import("../../..").DataMeta;
|
|
54
|
+
direction: "out";
|
|
55
|
+
relationship: string;
|
|
56
|
+
cardinality: "one";
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
|
|
60
|
+
/**
|
|
61
|
+
* One row per window: "current" = [from, to), plus "previous" =
|
|
62
|
+
* [previousFrom, from) when previousFrom is not null.
|
|
63
|
+
*/
|
|
64
|
+
findSummary(params: {
|
|
65
|
+
from: string | null;
|
|
66
|
+
previousFrom: string | null;
|
|
67
|
+
to: string;
|
|
68
|
+
excludeUserIds: string[];
|
|
69
|
+
}): Promise<ReferralAdminSummaryEntity[]>;
|
|
70
|
+
/**
|
|
71
|
+
* One row per referrer company with at least one visit, invite or referral in
|
|
72
|
+
* the period, so a company with only visits still appears with zeros
|
|
73
|
+
* elsewhere. lastInviteAt is the company's most recent invite, in or before
|
|
74
|
+
* the period.
|
|
75
|
+
*/
|
|
76
|
+
findReferrers(params: {
|
|
77
|
+
from: string | null;
|
|
78
|
+
sort: ReferralAdminSort;
|
|
79
|
+
excludeUserIds: string[];
|
|
80
|
+
}): Promise<ReferralAdminReferrerEntity[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Every Referral created in the period, newest first, unpaginated (like the
|
|
83
|
+
* library's other cross-tenant admin lists). Owners are each company's
|
|
84
|
+
* earliest-created user. A Referral written before sources existed has an
|
|
85
|
+
* unknown source and comes back as an empty string.
|
|
86
|
+
*/
|
|
87
|
+
findReferrals(params: {
|
|
88
|
+
from: string | null;
|
|
89
|
+
excludeUserIds: string[];
|
|
90
|
+
}): Promise<ReferralAdminReferralEntity[]>;
|
|
91
|
+
/** One window of the summary, [from, to). */
|
|
92
|
+
private _summaryWindow;
|
|
93
|
+
/** [from, to) on a datetime property; `$from = null` means no start. */
|
|
94
|
+
private _inWindow;
|
|
95
|
+
/** The company has no user among $excludeUserIds (platform administrators). */
|
|
96
|
+
private _notAdministrators;
|
|
97
|
+
/** A referred company counts unless it is a demo account or an administrator's. */
|
|
98
|
+
private _referredAllowed;
|
|
99
|
+
/**
|
|
100
|
+
* The seed every query starts from, in place of initQuery(). It binds only the
|
|
101
|
+
* report's parameters, never the caller's companyId; the source values come
|
|
102
|
+
* from REFERRAL_SOURCE.
|
|
103
|
+
*/
|
|
104
|
+
private _adminQuery;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=referral.admin.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral.admin.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/referral/repositories/referral.admin.repository.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAGnF,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,C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