@things-factory/saas 10.1.236 → 10.1.238

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.
Files changed (54) hide show
  1. package/dist-client/components/saas-candidates.d.ts +33 -0
  2. package/dist-client/components/saas-candidates.js +157 -0
  3. package/dist-client/components/saas-candidates.js.map +1 -0
  4. package/dist-client/index.d.ts +1 -0
  5. package/dist-client/index.js +1 -0
  6. package/dist-client/index.js.map +1 -1
  7. package/dist-client/pages/saas-account-list.js +3 -0
  8. package/dist-client/pages/saas-account-list.js.map +1 -1
  9. package/dist-client/pages/saas-account-page.js +7 -2
  10. package/dist-client/pages/saas-account-page.js.map +1 -1
  11. package/dist-client/tsconfig.tsbuildinfo +1 -1
  12. package/dist-server/role-tasks.js +3 -1
  13. package/dist-server/role-tasks.js.map +1 -1
  14. package/dist-server/service/checks.d.ts +4 -1
  15. package/dist-server/service/checks.js +5 -2
  16. package/dist-server/service/checks.js.map +1 -1
  17. package/dist-server/service/index.d.ts +4 -1
  18. package/dist-server/service/index.js +5 -1
  19. package/dist-server/service/index.js.map +1 -1
  20. package/dist-server/service/saas-hidden-vendor.d.ts +19 -0
  21. package/dist-server/service/saas-hidden-vendor.js +53 -0
  22. package/dist-server/service/saas-hidden-vendor.js.map +1 -0
  23. package/dist-server/service/saas-mutation.d.ts +4 -1
  24. package/dist-server/service/saas-mutation.js +54 -0
  25. package/dist-server/service/saas-mutation.js.map +1 -1
  26. package/dist-server/service/saas-query.d.ts +2 -1
  27. package/dist-server/service/saas-query.js +16 -0
  28. package/dist-server/service/saas-query.js.map +1 -1
  29. package/dist-server/service/saas-rules.d.ts +41 -0
  30. package/dist-server/service/saas-rules.js +49 -1
  31. package/dist-server/service/saas-rules.js.map +1 -1
  32. package/dist-server/service/saas-seat.d.ts +1 -0
  33. package/dist-server/service/saas-seat.js +5 -0
  34. package/dist-server/service/saas-seat.js.map +1 -1
  35. package/dist-server/service/saas-service.d.ts +30 -7
  36. package/dist-server/service/saas-service.js +134 -17
  37. package/dist-server/service/saas-service.js.map +1 -1
  38. package/dist-server/service/saas-subscription.d.ts +2 -0
  39. package/dist-server/service/saas-subscription.js +10 -0
  40. package/dist-server/service/saas-subscription.js.map +1 -1
  41. package/dist-server/service/saas-sync.d.ts +34 -0
  42. package/dist-server/service/saas-sync.js +106 -0
  43. package/dist-server/service/saas-sync.js.map +1 -0
  44. package/dist-server/service/saas-type.d.ts +45 -0
  45. package/dist-server/service/saas-type.js +171 -1
  46. package/dist-server/service/saas-type.js.map +1 -1
  47. package/dist-server/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +4 -4
  49. package/translations/en.json +23 -0
  50. package/translations/es.json +23 -0
  51. package/translations/ja.json +23 -0
  52. package/translations/ko.json +23 -0
  53. package/translations/ms.json +23 -0
  54. package/translations/zh.json +23 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saas-sync.js","sourceRoot":"","sources":["../../server/service/saas-sync.ts"],"names":[],"mappings":";;AAmDA,4CA2EC;AA9HD,+DAAuD;AACvD,iDAAuD;AAGvD,iDAA4C;AAC5C,6CAAqF;AACrF,2CAAsC;AACtC,iDAAqE;AACrE,2DAAsD;AA4BtD,MAAM,KAAK,GAAG,CAAC,KAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;AAEjF,+GAA+G;AAC/G,KAAK,UAAU,eAAe,CAAC,EAAiB,EAAE,MAAc,EAAE,KAAmB;IACnF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5F,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC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AAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;YAC1J,MAAM,CAAC,MAAM,EAAE,CAAA;QACjB,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,IAAI;YACrB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAChC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;gBAC7G,MAAM,CAAC,MAAM,EAAE,CAAA;YACjB,CAAC;QACH,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,IAAA,4BAAa,EAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IACnF,CAAC;IACD,MAAM,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IACjD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { Employee } from '@things-factory/organization'\nimport { Domain, Refusal } from '@things-factory/shell'\nimport { EntityManager, In } from 'typeorm'\n\nimport { SaasAccount } from './saas-account'\nimport { SaasAccountStatus, SaasBilling, SaasSubscriptionStatus } from './saas-rules'\nimport { SaasSeat } from './saas-seat'\nimport { saveSaasSeats, saveSaasSubscriptions } from './saas-service'\nimport { SaasSubscription } from './saas-subscription'\n\n/*\n * Seats as a vendor's tenant says (ADR-0177 개정 2) - what a Microsoft 365 tenant bought and who holds each, read by a\n * scenario (integration-msgraph `msgraph-license-assignments`) and handed here. Only quantities, renewal days, trials and\n * seats change: a plan's name, billing, price and status are a person's.\n */\n\nexport interface LicenseFacts {\n tenantId?: string | null\n domains?: string[] | null\n skus: { skuId: string; name: string; enabled: number; consumed: number; renewalOn?: string | null; trial?: boolean | null }[]\n users: { login: string; mail?: string | null; name?: string | null; enabled?: boolean | null; skuIds: string[] }[]\n}\n\nexport interface LicenseSyncResult {\n accountId: string\n accountName: string\n subscriptions: number\n created: number\n opened: number\n closed: number\n /** Open seats held as names that took their employee. */\n linked: number\n /** Logins no employee's mail matched - held as names. */\n unmatched: string[]\n}\n\nconst lower = (value?: string | null) => String(value ?? '').trim().toLowerCase()\n\n/** The account the tenant is: the one whose identifier is the tenant id or a domain its users sign in with. */\nasync function accountOfTenant(tx: EntityManager, domain: Domain, facts: LicenseFacts): Promise<SaasAccount> {\n const names = new Set([facts.tenantId, ...(facts.domains ?? [])].map(lower).filter(Boolean))\n const accounts = (await tx.getRepository(SaasAccount).find({ where: { domain: { id: domain.id }, status: SaasAccountStatus.ACTIVE } as any })).filter(\n one => names.has(lower(one.identifier))\n )\n if (!accounts.length)\n throw new Refusal('saas-sync-account-not-found', { names: [...names].join(', ') }, 'No account has the tenant id or one of its domains as its identifier')\n if (accounts.length > 1)\n throw new Refusal('saas-sync-account-ambiguous', { names: accounts.map(one => one.name).join(', ') }, 'Two accounts have the tenant as their identifier')\n return accounts[0]\n}\n\nexport async function syncSaasLicenses(tx: EntityManager, domain: Domain, user: any, facts: LicenseFacts, today: string): Promise<LicenseSyncResult> {\n const account = await accountOfTenant(tx, domain, facts)\n if (account.parentId) throw new Refusal('saas-subscription-on-sub-account', {}, 'An account under another is billed by its parent - subscribe there')\n\n /* Whose mail a login is: an employee's - the mails on their contact card (organization keeps the work mail there), and their user account's. */\n const employees = await tx.getRepository(Employee).find({ where: { domain: { id: domain.id } } as any, relations: ['user', 'contact'] })\n const byMail = new Map<string, Employee>()\n for (const one of employees) {\n const mails = [one.user?.email, ...((one.contact?.items ?? []) as any[]).filter(item => item?.type === 'email').map(item => item.value)]\n for (const mail of mails) if (lower(mail)) byMail.set(lower(mail), one)\n }\n const employeeOf = (holder: LicenseFacts['users'][number]) => byMail.get(lower(holder.mail)) ?? byMail.get(lower(holder.login))\n\n const result: LicenseSyncResult = { accountId: account.id, accountName: account.name, subscriptions: 0, created: 0, opened: 0, closed: 0, linked: 0, unmatched: [] }\n const subs = await tx.getRepository(SaasSubscription).find({ where: { domain: { id: domain.id }, account: { id: account.id } } as any })\n for (const sku of facts.skus) {\n let sub = subs.find(one => one.vendorKey === sku.skuId)\n const holders = facts.users.filter(one => one.skuIds.includes(sku.skuId))\n if (!sub) {\n if (!sku.consumed && !holders.length) continue\n ;[sub] = await saveSaasSubscriptions(tx, domain, user, 'all', account.id, [\n {\n cuFlag: '+',\n name: sku.name,\n billing: SaasBilling.SEAT,\n vendorKey: sku.skuId,\n quantity: Math.max(sku.enabled, holders.length, 1),\n startOn: today,\n status: SaasSubscriptionStatus.ACTIVE,\n ...(sku.renewalOn ? { renewalOn: sku.renewalOn } : {}),\n trial: !!sku.trial\n }\n ])\n result.created++\n } else {\n /* The quantity, the renewal day and being a trial are the tenant's facts; the rest stays the person's. */\n const change: Record<string, any> = {}\n if (sku.enabled > 0 && Number(sub.quantity) !== sku.enabled) change.quantity = sku.enabled\n if (sku.renewalOn && sub.renewalOn !== sku.renewalOn) change.renewalOn = sku.renewalOn\n if (sku.trial !== undefined && sku.trial !== null && !!sub.trial !== !!sku.trial) change.trial = !!sku.trial\n if (Object.keys(change).length) await saveSaasSubscriptions(tx, domain, user, 'all', account.id, [{ id: sub.id, cuFlag: 'M', ...change }])\n }\n result.subscriptions++\n\n const seats = await tx.getRepository(SaasSeat).find({ where: { domain: { id: domain.id }, subscription: { id: sub.id } } as any })\n const synced = seats.filter(one => one.login)\n /* The first sync does not know since when a seat is held. */\n const since = synced.length ? today : null\n const open = synced.filter(one => !one.untilOn || one.untilOn > today)\n const now = new Set(holders.map(one => lower(one.login)))\n const patches: Record<string, any>[] = []\n for (const holder of holders) {\n const employee = employeeOf(holder)\n if (!employee) result.unmatched.push(holder.login)\n const held = open.find(one => lower(one.login) === lower(holder.login))\n if (held) {\n /* A seat held as a name takes its employee once their mail is known - every sync looks again. */\n if (employee && held.employeeId !== employee.id) {\n patches.push({ id: held.id, cuFlag: 'M', employeeId: employee.id, holder: null })\n result.linked++\n }\n continue\n }\n patches.push({ cuFlag: '+', login: holder.login, employeeId: employee?.id ?? null, holder: employee ? null : holder.name || holder.login, fromOn: since })\n result.opened++\n }\n for (const seat of open)\n if (!now.has(lower(seat.login))) {\n patches.push({ id: seat.id, cuFlag: 'M', untilOn: seat.fromOn && seat.fromOn > today ? seat.fromOn : today })\n result.closed++\n }\n if (patches.length) await saveSaasSeats(tx, domain, user, 'all', sub.id, patches)\n }\n result.unmatched = [...new Set(result.unmatched)]\n return result\n}\n"]}
@@ -111,3 +111,48 @@ export declare class SaasChange {
111
111
  at: Date;
112
112
  changedBy?: string;
113
113
  }
114
+ export declare class SaasCandidate {
115
+ key: string;
116
+ counterpartyId?: string;
117
+ counterpartyName: string;
118
+ months: number;
119
+ average: number;
120
+ firstDate: string;
121
+ lastDate: string;
122
+ lastAmount: number;
123
+ currency: string;
124
+ paymentAccountId?: string;
125
+ billingDay?: number;
126
+ hidden: boolean;
127
+ }
128
+ export declare class SaasLicenseSkuInput {
129
+ skuId: string;
130
+ name: string;
131
+ enabled: number;
132
+ consumed: number;
133
+ renewalOn?: string;
134
+ trial?: boolean;
135
+ }
136
+ export declare class SaasLicenseUserInput {
137
+ login: string;
138
+ mail?: string;
139
+ name?: string;
140
+ enabled?: boolean;
141
+ skuIds: string[];
142
+ }
143
+ export declare class SaasLicensesInput {
144
+ tenantId?: string;
145
+ domains?: string[];
146
+ skus: SaasLicenseSkuInput[];
147
+ users: SaasLicenseUserInput[];
148
+ }
149
+ export declare class SaasLicenseSync {
150
+ accountId: string;
151
+ accountName: string;
152
+ subscriptions: number;
153
+ created: number;
154
+ opened: number;
155
+ closed: number;
156
+ linked: number;
157
+ unmatched: string[];
158
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SaasChange = exports.SaasCostTrend = exports.SaasAlert = exports.SaasDepartmentSeries = exports.SaasTrendSeries = exports.SaasAccountList = exports.SaasBillInput = exports.SaasBillLineInput = exports.SaasSeatPatch = exports.SaasSubscriptionPatch = exports.SaasAccountPatch = void 0;
3
+ exports.SaasLicenseSync = exports.SaasLicensesInput = exports.SaasLicenseUserInput = exports.SaasLicenseSkuInput = exports.SaasCandidate = exports.SaasChange = exports.SaasCostTrend = exports.SaasAlert = exports.SaasDepartmentSeries = exports.SaasTrendSeries = exports.SaasAccountList = exports.SaasBillInput = exports.SaasBillLineInput = exports.SaasSeatPatch = exports.SaasSubscriptionPatch = exports.SaasAccountPatch = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const saas_account_1 = require("./saas-account");
@@ -427,4 +427,174 @@ tslib_1.__decorate([
427
427
  exports.SaasChange = SaasChange = tslib_1.__decorate([
428
428
  (0, type_graphql_1.ObjectType)({ description: 'What moved on an account or one of its subscriptions' })
429
429
  ], SaasChange);
430
+ let SaasCandidate = class SaasCandidate {
431
+ };
432
+ exports.SaasCandidate = SaasCandidate;
433
+ tslib_1.__decorate([
434
+ (0, type_graphql_1.Field)({ description: 'Whom it is - the counterparty id, or name: and the written name for lines no counterparty is linked to' }),
435
+ tslib_1.__metadata("design:type", String)
436
+ ], SaasCandidate.prototype, "key", void 0);
437
+ tslib_1.__decorate([
438
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The vendor - a counterparty id; empty when the lines only name it' }),
439
+ tslib_1.__metadata("design:type", String)
440
+ ], SaasCandidate.prototype, "counterpartyId", void 0);
441
+ tslib_1.__decorate([
442
+ (0, type_graphql_1.Field)({ description: "The vendor's name - the counterparty's, or the one written on the lines" }),
443
+ tslib_1.__metadata("design:type", String)
444
+ ], SaasCandidate.prototype, "counterpartyName", void 0);
445
+ tslib_1.__decorate([
446
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The months of the last twelve money went out to it in' }),
447
+ tslib_1.__metadata("design:type", Number)
448
+ ], SaasCandidate.prototype, "months", void 0);
449
+ tslib_1.__decorate([
450
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'What went out a month, on average over those months' }),
451
+ tslib_1.__metadata("design:type", Number)
452
+ ], SaasCandidate.prototype, "average", void 0);
453
+ tslib_1.__decorate([
454
+ (0, type_graphql_1.Field)({ description: 'The first day money went out to it in the window - YYYY-MM-DD' }),
455
+ tslib_1.__metadata("design:type", String)
456
+ ], SaasCandidate.prototype, "firstDate", void 0);
457
+ tslib_1.__decorate([
458
+ (0, type_graphql_1.Field)({ description: 'The last day money went out to it - YYYY-MM-DD' }),
459
+ tslib_1.__metadata("design:type", String)
460
+ ], SaasCandidate.prototype, "lastDate", void 0);
461
+ tslib_1.__decorate([
462
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'How much went out that day' }),
463
+ tslib_1.__metadata("design:type", Number)
464
+ ], SaasCandidate.prototype, "lastAmount", void 0);
465
+ tslib_1.__decorate([
466
+ (0, type_graphql_1.Field)({ description: 'The currency' }),
467
+ tslib_1.__metadata("design:type", String)
468
+ ], SaasCandidate.prototype, "currency", void 0);
469
+ tslib_1.__decorate([
470
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The bank account or card it went out of most - an id' }),
471
+ tslib_1.__metadata("design:type", String)
472
+ ], SaasCandidate.prototype, "paymentAccountId", void 0);
473
+ tslib_1.__decorate([
474
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The day of the month it went out on most; 31 for the last day' }),
475
+ tslib_1.__metadata("design:type", Number)
476
+ ], SaasCandidate.prototype, "billingDay", void 0);
477
+ tslib_1.__decorate([
478
+ (0, type_graphql_1.Field)({ description: 'Whether a keeper hid it from the candidates' }),
479
+ tslib_1.__metadata("design:type", Boolean)
480
+ ], SaasCandidate.prototype, "hidden", void 0);
481
+ exports.SaasCandidate = SaasCandidate = tslib_1.__decorate([
482
+ (0, type_graphql_1.ObjectType)({ description: 'A vendor the books show paid month after month that is no account yet (ADR-0177 amendment 1)' })
483
+ ], SaasCandidate);
484
+ let SaasLicenseSkuInput = class SaasLicenseSkuInput {
485
+ };
486
+ exports.SaasLicenseSkuInput = SaasLicenseSkuInput;
487
+ tslib_1.__decorate([
488
+ (0, type_graphql_1.Field)({ description: "The vendor's id for the plan - a Microsoft 365 SKU id" }),
489
+ tslib_1.__metadata("design:type", String)
490
+ ], SaasLicenseSkuInput.prototype, "skuId", void 0);
491
+ tslib_1.__decorate([
492
+ (0, type_graphql_1.Field)({ description: "The vendor's name for the plan" }),
493
+ tslib_1.__metadata("design:type", String)
494
+ ], SaasLicenseSkuInput.prototype, "name", void 0);
495
+ tslib_1.__decorate([
496
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'How many were bought' }),
497
+ tslib_1.__metadata("design:type", Number)
498
+ ], SaasLicenseSkuInput.prototype, "enabled", void 0);
499
+ tslib_1.__decorate([
500
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'How many are assigned' }),
501
+ tslib_1.__metadata("design:type", Number)
502
+ ], SaasLicenseSkuInput.prototype, "consumed", void 0);
503
+ tslib_1.__decorate([
504
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day it renews, or a trial ends - YYYY-MM-DD' }),
505
+ tslib_1.__metadata("design:type", String)
506
+ ], SaasLicenseSkuInput.prototype, "renewalOn", void 0);
507
+ tslib_1.__decorate([
508
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Whether it is a trial' }),
509
+ tslib_1.__metadata("design:type", Boolean)
510
+ ], SaasLicenseSkuInput.prototype, "trial", void 0);
511
+ exports.SaasLicenseSkuInput = SaasLicenseSkuInput = tslib_1.__decorate([
512
+ (0, type_graphql_1.InputType)({ description: 'A plan a vendor tenant bought (ADR-0177 amendment 2)' })
513
+ ], SaasLicenseSkuInput);
514
+ let SaasLicenseUserInput = class SaasLicenseUserInput {
515
+ };
516
+ exports.SaasLicenseUserInput = SaasLicenseUserInput;
517
+ tslib_1.__decorate([
518
+ (0, type_graphql_1.Field)({ description: 'The login - a Microsoft 365 user name' }),
519
+ tslib_1.__metadata("design:type", String)
520
+ ], SaasLicenseUserInput.prototype, "login", void 0);
521
+ tslib_1.__decorate([
522
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The mail' }),
523
+ tslib_1.__metadata("design:type", String)
524
+ ], SaasLicenseUserInput.prototype, "mail", void 0);
525
+ tslib_1.__decorate([
526
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The name shown' }),
527
+ tslib_1.__metadata("design:type", String)
528
+ ], SaasLicenseUserInput.prototype, "name", void 0);
529
+ tslib_1.__decorate([
530
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Whether the login can sign in' }),
531
+ tslib_1.__metadata("design:type", Boolean)
532
+ ], SaasLicenseUserInput.prototype, "enabled", void 0);
533
+ tslib_1.__decorate([
534
+ (0, type_graphql_1.Field)(type => [String], { description: 'The plans held - SKU ids' }),
535
+ tslib_1.__metadata("design:type", Array)
536
+ ], SaasLicenseUserInput.prototype, "skuIds", void 0);
537
+ exports.SaasLicenseUserInput = SaasLicenseUserInput = tslib_1.__decorate([
538
+ (0, type_graphql_1.InputType)({ description: 'Who holds licenses at a vendor tenant' })
539
+ ], SaasLicenseUserInput);
540
+ let SaasLicensesInput = class SaasLicensesInput {
541
+ };
542
+ exports.SaasLicensesInput = SaasLicensesInput;
543
+ tslib_1.__decorate([
544
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The tenant id' }),
545
+ tslib_1.__metadata("design:type", String)
546
+ ], SaasLicensesInput.prototype, "tenantId", void 0);
547
+ tslib_1.__decorate([
548
+ (0, type_graphql_1.Field)(type => [String], { nullable: true, description: 'The domains its users sign in with' }),
549
+ tslib_1.__metadata("design:type", Array)
550
+ ], SaasLicensesInput.prototype, "domains", void 0);
551
+ tslib_1.__decorate([
552
+ (0, type_graphql_1.Field)(type => [SaasLicenseSkuInput], { description: 'The plans bought' }),
553
+ tslib_1.__metadata("design:type", Array)
554
+ ], SaasLicensesInput.prototype, "skus", void 0);
555
+ tslib_1.__decorate([
556
+ (0, type_graphql_1.Field)(type => [SaasLicenseUserInput], { description: 'Who holds them' }),
557
+ tslib_1.__metadata("design:type", Array)
558
+ ], SaasLicensesInput.prototype, "users", void 0);
559
+ exports.SaasLicensesInput = SaasLicensesInput = tslib_1.__decorate([
560
+ (0, type_graphql_1.InputType)({ description: 'What a vendor tenant bought and who holds each, as a scenario read it' })
561
+ ], SaasLicensesInput);
562
+ let SaasLicenseSync = class SaasLicenseSync {
563
+ };
564
+ exports.SaasLicenseSync = SaasLicenseSync;
565
+ tslib_1.__decorate([
566
+ (0, type_graphql_1.Field)({ description: 'The account the tenant is' }),
567
+ tslib_1.__metadata("design:type", String)
568
+ ], SaasLicenseSync.prototype, "accountId", void 0);
569
+ tslib_1.__decorate([
570
+ (0, type_graphql_1.Field)({ description: "The account's name" }),
571
+ tslib_1.__metadata("design:type", String)
572
+ ], SaasLicenseSync.prototype, "accountName", void 0);
573
+ tslib_1.__decorate([
574
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Plans kept in step' }),
575
+ tslib_1.__metadata("design:type", Number)
576
+ ], SaasLicenseSync.prototype, "subscriptions", void 0);
577
+ tslib_1.__decorate([
578
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Plans added as subscriptions' }),
579
+ tslib_1.__metadata("design:type", Number)
580
+ ], SaasLicenseSync.prototype, "created", void 0);
581
+ tslib_1.__decorate([
582
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Seats opened' }),
583
+ tslib_1.__metadata("design:type", Number)
584
+ ], SaasLicenseSync.prototype, "opened", void 0);
585
+ tslib_1.__decorate([
586
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Seats closed' }),
587
+ tslib_1.__metadata("design:type", Number)
588
+ ], SaasLicenseSync.prototype, "closed", void 0);
589
+ tslib_1.__decorate([
590
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Open seats held as names that took their employee' }),
591
+ tslib_1.__metadata("design:type", Number)
592
+ ], SaasLicenseSync.prototype, "linked", void 0);
593
+ tslib_1.__decorate([
594
+ (0, type_graphql_1.Field)(type => [String], { description: 'Logins no employee mail matched - held as names' }),
595
+ tslib_1.__metadata("design:type", Array)
596
+ ], SaasLicenseSync.prototype, "unmatched", void 0);
597
+ exports.SaasLicenseSync = SaasLicenseSync = tslib_1.__decorate([
598
+ (0, type_graphql_1.ObjectType)({ description: 'What a sync of a vendor tenant changed' })
599
+ ], SaasLicenseSync);
430
600
  //# sourceMappingURL=saas-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"saas-type.js","sourceRoot":"","sources":["../../server/service/saas-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,iDAA4C;AAC5C,6CAAqF;AAG9E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAkB5B,CAAA;AAlBY,4CAAgB;AAC6D;IAAvF,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;4CAAY;AACjB;IAAjF,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;;gDAAgB;AAC1C;IAAtD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;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oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;2CAAiB;AAC3C;IAAxC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;sCAAK,IAAI;sCAAA;AACO;IAAvD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;6CAAmB;qBAP/D,UAAU;IADtB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;GACvE,UAAU,CAQtB","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { SaasAccount } from './saas-account'\nimport { SaasAccountStatus, SaasBilling, SaasSubscriptionStatus } from './saas-rules'\n\n@InputType({ description: 'A row of the accounts grid (cuFlag + for new, M for changed, - for deleted)' })\nexport class SaasAccountPatch {\n @Field(type => ID, { nullable: true, description: 'The account; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The service' }) name?: string\n @Field({ nullable: true, description: 'The vendor - a counterparty id' }) counterpartyId?: string\n @Field({ nullable: true, description: \"The vendor's name for the account\" }) identifier?: string\n @Field({ nullable: true, description: 'The account it is under - an account id' }) parentId?: string\n @Field({ nullable: true, description: 'What it is used for' }) purpose?: string\n @Field(type => [String], { nullable: true, description: 'Who administers it - employee ids' }) adminIds?: string[]\n @Field({ nullable: true, description: 'Where the vendor sends the bills' }) billingEmail?: string\n @Field({ nullable: true, description: 'What it is paid from - a bank account or card id' }) paymentAccountId?: string\n @Field({ nullable: true, description: 'The currency it is billed in' }) currency?: string\n @Field(type => Int, { nullable: true, description: 'The day of the month the bill is paid' }) billingDay?: number\n @Field({ nullable: true, description: 'Where its secrets are kept' }) secretLocation?: string\n @Field(type => Float, { nullable: true, description: 'A rise over the month before told above this part' }) increaseAlertRate?: number\n @Field(type => SaasAccountStatus, { nullable: true, description: 'In use or closed' }) status?: SaasAccountStatus\n @Field({ nullable: true, description: 'The day it was closed - YYYY-MM-DD' }) closedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A row of the subscriptions grid of an account' })\nexport class SaasSubscriptionPatch {\n @Field(type => ID, { nullable: true, description: 'The subscription; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The product and plan' }) name?: string\n @Field(type => SaasBilling, { nullable: true, description: 'How it is paid for' }) billing?: SaasBilling\n @Field(type => Float, { nullable: true, description: 'Seats or units' }) quantity?: number\n @Field(type => Float, { nullable: true, description: 'The price of one seat for one billing' }) unitPrice?: number\n @Field(type => Float, { nullable: true, description: 'What one billing costs' }) amount?: number\n @Field(type => Float, { nullable: true, description: 'What a month of usage may cost' }) budget?: number\n @Field(type => Int, { nullable: true, description: 'Billed every so many months' }) everyMonths?: number\n @Field({ nullable: true, description: 'The day it started - YYYY-MM-DD' }) startOn?: string\n @Field({ nullable: true, description: 'The day it renews - YYYY-MM-DD' }) renewalOn?: string\n @Field({ nullable: true, description: 'Whether the vendor renews it unless cancelled' }) autoRenew?: boolean\n @Field(type => Int, { nullable: true, description: 'Days before renewal it must be cancelled' }) noticeDays?: number\n @Field({ nullable: true, description: 'The department it is for - a department id' }) departmentId?: string\n @Field({ nullable: true, description: 'For a license owned: its asset - an asset id' }) assetId?: string\n @Field(type => SaasSubscriptionStatus, { nullable: true, description: 'In use, not to be renewed, or ended' }) status?: SaasSubscriptionStatus\n @Field({ nullable: true, description: 'The day it ended - YYYY-MM-DD' }) endedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A row of the seats grid of a subscription' })\nexport class SaasSeatPatch {\n @Field(type => ID, { nullable: true, description: 'The seat; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The employee who holds it - an employee id' }) employeeId?: string\n @Field({ nullable: true, description: 'Who holds it when it is no employee' }) holder?: string\n @Field({ nullable: true, description: 'The day it was given - YYYY-MM-DD' }) fromOn?: string\n @Field({ nullable: true, description: 'The day it was taken back - YYYY-MM-DD' }) untilOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A line of a bill' })\nexport class SaasBillLineInput {\n @Field({ nullable: true, description: 'The subscription it is for; empty for tax and credits' }) subscriptionId?: string\n @Field({ nullable: true, description: 'What the bill calls it' }) label?: string\n @Field(type => Float, { description: 'What it cost; a credit below zero' }) amount: number\n}\n\n@InputType({ description: 'A bill of an account for a month, its lines whole' })\nexport class SaasBillInput {\n @Field(type => ID, { nullable: true, description: 'The bill; empty for a new one' }) id?: string\n @Field({ description: 'The month it bills - YYYY-MM' }) month: string\n @Field({ nullable: true, description: 'The day the vendor billed it - YYYY-MM-DD' }) billedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n @Field(type => [SaasBillLineInput], { description: 'Its lines' }) lines: SaasBillLineInput[]\n}\n\n@ObjectType({ description: 'A page of accounts' })\nexport class SaasAccountList {\n @Field(type => [SaasAccount], { description: 'Accounts on the page' }) items: SaasAccount[]\n @Field(type => Int, { description: 'Number of accounts matching the list parameters' }) total: number\n}\n\n@ObjectType({ description: 'A series of the cost trend - all, an account or a subscription, in one currency' })\nexport class SaasTrendSeries {\n @Field({ description: 'What the series is of' }) key: string\n @Field({ nullable: true, description: 'The account' }) accountId?: string\n @Field({ nullable: true, description: \"The account's name\" }) accountName?: string\n @Field({ nullable: true, description: 'The subscription; empty for the lines on none' }) subscriptionId?: string\n @Field({ nullable: true, description: 'The account or subscription name' }) name?: string\n @Field({ description: 'The currency the amounts are in' }) currency: string\n @Field(type => [Float], { description: 'One amount a month, in the order of the months' }) amounts: number[]\n @Field(type => Float, { description: 'The months together' }) total: number\n @Field(type => Float, { nullable: true, description: 'The last month over the one before, as a part' }) monthOverMonth?: number\n @Field(type => Float, { nullable: true, description: 'The last month over the same month a year before, as a part' }) yearOverYear?: number\n}\n\n@ObjectType({ description: 'A department’s part of the cost, in one currency' })\nexport class SaasDepartmentSeries {\n @Field({ description: 'What the series is of' }) key: string\n @Field({ nullable: true, description: 'The department; empty for cost no department is named for' }) departmentId?: string\n @Field({ nullable: true, description: \"The department's name\" }) name?: string\n @Field({ description: 'The currency the amounts are in' }) currency: string\n @Field(type => [Float], { description: 'One amount a month' }) amounts: number[]\n @Field(type => Float, { description: 'The months together' }) total: number\n}\n\n@ObjectType({ description: 'Something in the latest bills worth telling' })\nexport class SaasAlert {\n @Field({ description: 'usage-over-budget, bill-increased or seat-bill-differs' }) kind: string\n @Field({ description: 'The account' }) accountId: string\n @Field({ nullable: true, description: \"The account's name\" }) accountName?: string\n @Field({ nullable: true, description: 'The subscription' }) subscriptionId?: string\n @Field({ nullable: true, description: \"The subscription's name\" }) subscriptionName?: string\n @Field({ description: 'The month of the bill' }) month: string\n @Field(type => Float, { description: 'What was billed' }) amount: number\n @Field(type => Float, { description: 'What it was told against - the budget, the rise allowed, seats times price' }) limit: number\n}\n\n@ObjectType({ description: 'The cost trend of the subscriptions from their bills' })\nexport class SaasCostTrend {\n @Field(type => [String], { description: 'The months, YYYY-MM' }) months: string[]\n @Field(type => [SaasTrendSeries], { description: 'Everything, one series a currency' }) all: SaasTrendSeries[]\n @Field(type => [SaasTrendSeries], { description: 'One series an account' }) accounts: SaasTrendSeries[]\n @Field(type => [SaasTrendSeries], { description: 'One series a subscription' }) subscriptions: SaasTrendSeries[]\n @Field(type => [SaasDepartmentSeries], { description: 'One series a department' }) departments: SaasDepartmentSeries[]\n @Field(type => [SaasAlert], { description: 'What the latest month’s bills are worth telling' }) alerts: SaasAlert[]\n}\n\n@ObjectType({ description: 'What moved on an account or one of its subscriptions' })\nexport class SaasChange {\n @Field({ description: 'What it moved on - the account or the subscription, by name' }) subject: string\n @Field({ description: 'saas-account or saas-subscription' }) factKind: string\n @Field({ description: 'Which field moved' }) field: string\n @Field({ nullable: true, description: 'The value before, as text' }) fromValue?: string\n @Field({ nullable: true, description: 'The value after, as text' }) toValue?: string\n @Field({ description: 'When it moved' }) at: Date\n @Field({ nullable: true, description: 'Who moved it' }) changedBy?: string\n}\n"]}
1
+ {"version":3,"file":"saas-type.js","sourceRoot":"","sources":["../../server/service/saas-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAE3E,iDAA4C;AAC5C,6CAAqF;AAG9E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAkB5B,CAAA;AAlBY,4CAAgB;AAC6D;IAAvF,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;4CAAY;AACjB;IAAjF,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;;gDAAgB;AAC1C;IAAtD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;;8CAAc;AACM;IAAzE,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;wDAAwB;AACpB;IAA5E,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;oDAAoB;AACb;IAAlF,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;kDAAkB;AACrC;IAA9D,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;iDAAiB;AACgB;IAA9F,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC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,EAAE,oBAAoB,EAAE,CAAC;;sDAAsB;AACX;IAApE,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;gDAAgB;AAC/B;IAApD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;+CAAe;AACd;IAApD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;+CAAe;AACuB;IAAzF,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,mDAAmD,EAAE,CAAC;;+CAAe;AACX;IAA5F,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;kDAAoB;0BARrG,eAAe;IAD3B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;GACzD,eAAe,CAS3B","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { SaasAccount } from './saas-account'\nimport { SaasAccountStatus, SaasBilling, SaasSubscriptionStatus } from './saas-rules'\n\n@InputType({ description: 'A row of the accounts grid (cuFlag + for new, M for changed, - for deleted)' })\nexport class SaasAccountPatch {\n @Field(type => ID, { nullable: true, description: 'The account; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The service' }) name?: string\n @Field({ nullable: true, description: 'The vendor - a counterparty id' }) counterpartyId?: string\n @Field({ nullable: true, description: \"The vendor's name for the account\" }) identifier?: string\n @Field({ nullable: true, description: 'The account it is under - an account id' }) parentId?: string\n @Field({ nullable: true, description: 'What it is used for' }) purpose?: string\n @Field(type => [String], { nullable: true, description: 'Who administers it - employee ids' }) adminIds?: string[]\n @Field({ nullable: true, description: 'Where the vendor sends the bills' }) billingEmail?: string\n @Field({ nullable: true, description: 'What it is paid from - a bank account or card id' }) paymentAccountId?: string\n @Field({ nullable: true, description: 'The currency it is billed in' }) currency?: string\n @Field(type => Int, { nullable: true, description: 'The day of the month the bill is paid' }) billingDay?: number\n @Field({ nullable: true, description: 'Where its secrets are kept' }) secretLocation?: string\n @Field(type => Float, { nullable: true, description: 'A rise over the month before told above this part' }) increaseAlertRate?: number\n @Field(type => SaasAccountStatus, { nullable: true, description: 'In use or closed' }) status?: SaasAccountStatus\n @Field({ nullable: true, description: 'The day it was closed - YYYY-MM-DD' }) closedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A row of the subscriptions grid of an account' })\nexport class SaasSubscriptionPatch {\n @Field(type => ID, { nullable: true, description: 'The subscription; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The product and plan' }) name?: string\n @Field(type => SaasBilling, { nullable: true, description: 'How it is paid for' }) billing?: SaasBilling\n @Field(type => Float, { nullable: true, description: 'Seats or units' }) quantity?: number\n @Field(type => Float, { nullable: true, description: 'The price of one seat for one billing' }) unitPrice?: number\n @Field(type => Float, { nullable: true, description: 'What one billing costs' }) amount?: number\n @Field(type => Float, { nullable: true, description: 'What a month of usage may cost' }) budget?: number\n @Field(type => Int, { nullable: true, description: 'Billed every so many months' }) everyMonths?: number\n @Field({ nullable: true, description: 'The day it started - YYYY-MM-DD' }) startOn?: string\n @Field({ nullable: true, description: 'The day it renews - YYYY-MM-DD' }) renewalOn?: string\n @Field({ nullable: true, description: 'Whether the vendor renews it unless cancelled' }) autoRenew?: boolean\n @Field(type => Int, { nullable: true, description: 'Days before renewal it must be cancelled' }) noticeDays?: number\n @Field({ nullable: true, description: 'The department it is for - a department id' }) departmentId?: string\n @Field({ nullable: true, description: 'For a license owned: its asset - an asset id' }) assetId?: string\n @Field(type => SaasSubscriptionStatus, { nullable: true, description: 'In use, not to be renewed, or ended' }) status?: SaasSubscriptionStatus\n @Field({ nullable: true, description: 'The day it ended - YYYY-MM-DD' }) endedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A row of the seats grid of a subscription' })\nexport class SaasSeatPatch {\n @Field(type => ID, { nullable: true, description: 'The seat; empty for a new one' }) id?: string\n @Field({ nullable: true, description: 'Grid flag: + new, M changed, - deleted' }) cuFlag?: string\n @Field({ nullable: true, description: 'The employee who holds it - an employee id' }) employeeId?: string\n @Field({ nullable: true, description: 'Who holds it when it is no employee' }) holder?: string\n @Field({ nullable: true, description: 'The day it was given - YYYY-MM-DD' }) fromOn?: string\n @Field({ nullable: true, description: 'The day it was taken back - YYYY-MM-DD' }) untilOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n}\n\n@InputType({ description: 'A line of a bill' })\nexport class SaasBillLineInput {\n @Field({ nullable: true, description: 'The subscription it is for; empty for tax and credits' }) subscriptionId?: string\n @Field({ nullable: true, description: 'What the bill calls it' }) label?: string\n @Field(type => Float, { description: 'What it cost; a credit below zero' }) amount: number\n}\n\n@InputType({ description: 'A bill of an account for a month, its lines whole' })\nexport class SaasBillInput {\n @Field(type => ID, { nullable: true, description: 'The bill; empty for a new one' }) id?: string\n @Field({ description: 'The month it bills - YYYY-MM' }) month: string\n @Field({ nullable: true, description: 'The day the vendor billed it - YYYY-MM-DD' }) billedOn?: string\n @Field({ nullable: true, description: 'Notes' }) description?: string\n @Field(type => [SaasBillLineInput], { description: 'Its lines' }) lines: SaasBillLineInput[]\n}\n\n@ObjectType({ description: 'A page of accounts' })\nexport class SaasAccountList {\n @Field(type => [SaasAccount], { description: 'Accounts on the page' }) items: SaasAccount[]\n @Field(type => Int, { description: 'Number of accounts matching the list parameters' }) total: number\n}\n\n@ObjectType({ description: 'A series of the cost trend - all, an account or a subscription, in one currency' })\nexport class SaasTrendSeries {\n @Field({ description: 'What the series is of' }) key: string\n @Field({ nullable: true, description: 'The account' }) accountId?: string\n @Field({ nullable: true, description: \"The account's name\" }) accountName?: string\n @Field({ nullable: true, description: 'The subscription; empty for the lines on none' }) subscriptionId?: string\n @Field({ nullable: true, description: 'The account or subscription name' }) name?: string\n @Field({ description: 'The currency the amounts are in' }) currency: string\n @Field(type => [Float], { description: 'One amount a month, in the order of the months' }) amounts: number[]\n @Field(type => Float, { description: 'The months together' }) total: number\n @Field(type => Float, { nullable: true, description: 'The last month over the one before, as a part' }) monthOverMonth?: number\n @Field(type => Float, { nullable: true, description: 'The last month over the same month a year before, as a part' }) yearOverYear?: number\n}\n\n@ObjectType({ description: 'A department’s part of the cost, in one currency' })\nexport class SaasDepartmentSeries {\n @Field({ description: 'What the series is of' }) key: string\n @Field({ nullable: true, description: 'The department; empty for cost no department is named for' }) departmentId?: string\n @Field({ nullable: true, description: \"The department's name\" }) name?: string\n @Field({ description: 'The currency the amounts are in' }) currency: string\n @Field(type => [Float], { description: 'One amount a month' }) amounts: number[]\n @Field(type => Float, { description: 'The months together' }) total: number\n}\n\n@ObjectType({ description: 'Something in the latest bills worth telling' })\nexport class SaasAlert {\n @Field({ description: 'usage-over-budget, bill-increased or seat-bill-differs' }) kind: string\n @Field({ description: 'The account' }) accountId: string\n @Field({ nullable: true, description: \"The account's name\" }) accountName?: string\n @Field({ nullable: true, description: 'The subscription' }) subscriptionId?: string\n @Field({ nullable: true, description: \"The subscription's name\" }) subscriptionName?: string\n @Field({ description: 'The month of the bill' }) month: string\n @Field(type => Float, { description: 'What was billed' }) amount: number\n @Field(type => Float, { description: 'What it was told against - the budget, the rise allowed, seats times price' }) limit: number\n}\n\n@ObjectType({ description: 'The cost trend of the subscriptions from their bills' })\nexport class SaasCostTrend {\n @Field(type => [String], { description: 'The months, YYYY-MM' }) months: string[]\n @Field(type => [SaasTrendSeries], { description: 'Everything, one series a currency' }) all: SaasTrendSeries[]\n @Field(type => [SaasTrendSeries], { description: 'One series an account' }) accounts: SaasTrendSeries[]\n @Field(type => [SaasTrendSeries], { description: 'One series a subscription' }) subscriptions: SaasTrendSeries[]\n @Field(type => [SaasDepartmentSeries], { description: 'One series a department' }) departments: SaasDepartmentSeries[]\n @Field(type => [SaasAlert], { description: 'What the latest month’s bills are worth telling' }) alerts: SaasAlert[]\n}\n\n@ObjectType({ description: 'What moved on an account or one of its subscriptions' })\nexport class SaasChange {\n @Field({ description: 'What it moved on - the account or the subscription, by name' }) subject: string\n @Field({ description: 'saas-account or saas-subscription' }) factKind: string\n @Field({ description: 'Which field moved' }) field: string\n @Field({ nullable: true, description: 'The value before, as text' }) fromValue?: string\n @Field({ nullable: true, description: 'The value after, as text' }) toValue?: string\n @Field({ description: 'When it moved' }) at: Date\n @Field({ nullable: true, description: 'Who moved it' }) changedBy?: string\n}\n\n@ObjectType({ description: 'A vendor the books show paid month after month that is no account yet (ADR-0177 amendment 1)' })\nexport class SaasCandidate {\n @Field({ description: 'Whom it is - the counterparty id, or name: and the written name for lines no counterparty is linked to' }) key: string\n @Field({ nullable: true, description: 'The vendor - a counterparty id; empty when the lines only name it' }) counterpartyId?: string\n @Field({ description: \"The vendor's name - the counterparty's, or the one written on the lines\" }) counterpartyName: string\n @Field(type => Int, { description: 'The months of the last twelve money went out to it in' }) months: number\n @Field(type => Float, { description: 'What went out a month, on average over those months' }) average: number\n @Field({ description: 'The first day money went out to it in the window - YYYY-MM-DD' }) firstDate: string\n @Field({ description: 'The last day money went out to it - YYYY-MM-DD' }) lastDate: string\n @Field(type => Float, { description: 'How much went out that day' }) lastAmount: number\n @Field({ description: 'The currency' }) currency: string\n @Field({ nullable: true, description: 'The bank account or card it went out of most - an id' }) paymentAccountId?: string\n @Field(type => Int, { nullable: true, description: 'The day of the month it went out on most; 31 for the last day' }) billingDay?: number\n @Field({ description: 'Whether a keeper hid it from the candidates' }) hidden: boolean\n}\n\n@InputType({ description: 'A plan a vendor tenant bought (ADR-0177 amendment 2)' })\nexport class SaasLicenseSkuInput {\n @Field({ description: \"The vendor's id for the plan - a Microsoft 365 SKU id\" }) skuId: string\n @Field({ description: \"The vendor's name for the plan\" }) name: string\n @Field(type => Float, { description: 'How many were bought' }) enabled: number\n @Field(type => Float, { description: 'How many are assigned' }) consumed: number\n @Field({ nullable: true, description: 'The day it renews, or a trial ends - YYYY-MM-DD' }) renewalOn?: string\n @Field({ nullable: true, description: 'Whether it is a trial' }) trial?: boolean\n}\n\n@InputType({ description: 'Who holds licenses at a vendor tenant' })\nexport class SaasLicenseUserInput {\n @Field({ description: 'The login - a Microsoft 365 user name' }) login: string\n @Field({ nullable: true, description: 'The mail' }) mail?: string\n @Field({ nullable: true, description: 'The name shown' }) name?: string\n @Field({ nullable: true, description: 'Whether the login can sign in' }) enabled?: boolean\n @Field(type => [String], { description: 'The plans held - SKU ids' }) skuIds: string[]\n}\n\n@InputType({ description: 'What a vendor tenant bought and who holds each, as a scenario read it' })\nexport class SaasLicensesInput {\n @Field({ nullable: true, description: 'The tenant id' }) tenantId?: string\n @Field(type => [String], { nullable: true, description: 'The domains its users sign in with' }) domains?: string[]\n @Field(type => [SaasLicenseSkuInput], { description: 'The plans bought' }) skus: SaasLicenseSkuInput[]\n @Field(type => [SaasLicenseUserInput], { description: 'Who holds them' }) users: SaasLicenseUserInput[]\n}\n\n@ObjectType({ description: 'What a sync of a vendor tenant changed' })\nexport class SaasLicenseSync {\n @Field({ description: 'The account the tenant is' }) accountId: string\n @Field({ description: \"The account's name\" }) accountName: string\n @Field(type => Int, { description: 'Plans kept in step' }) subscriptions: number\n @Field(type => Int, { description: 'Plans added as subscriptions' }) created: number\n @Field(type => Int, { description: 'Seats opened' }) opened: number\n @Field(type => Int, { description: 'Seats closed' }) closed: number\n @Field(type => Int, { description: 'Open seats held as names that took their employee' }) linked: number\n @Field(type => [String], { description: 'Logins no employee mail matched - held as names' }) unmatched: string[]\n}\n"]}