@glissandoo/lib 1.117.0 → 1.119.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.
Files changed (53) hide show
  1. package/functions/index.d.ts +2 -0
  2. package/functions/index.js +2 -0
  3. package/functions/partnershipPartner.d.ts +15 -1
  4. package/functions/partnershipSepaPaymentGroup.d.ts +4 -1
  5. package/functions/regions.js +2 -0
  6. package/helpers/errors.d.ts +3 -0
  7. package/helpers/errors.js +3 -0
  8. package/helpers/types.d.ts +1 -0
  9. package/helpers/types.js +13 -1
  10. package/models/Evento/Player/basic.d.ts +1 -0
  11. package/models/Evento/Player/basic.js +3 -0
  12. package/models/Evento/types.d.ts +1 -0
  13. package/models/Partnership/Communication/index.d.ts +13 -5
  14. package/models/Partnership/Communication/index.js +27 -20
  15. package/models/Partnership/Communication/supabase.d.ts +7 -0
  16. package/models/Partnership/Communication/supabase.js +24 -0
  17. package/models/Partnership/Communication/types.d.ts +5 -4
  18. package/models/Partnership/Group/index.d.ts +25 -7
  19. package/models/Partnership/Group/index.js +51 -13
  20. package/models/Partnership/Group/supabase.d.ts +13 -0
  21. package/models/Partnership/Group/supabase.js +25 -0
  22. package/models/Partnership/Group/types.d.ts +9 -3
  23. package/models/Partnership/Partner/index.d.ts +18 -7
  24. package/models/Partnership/Partner/index.js +47 -33
  25. package/models/Partnership/Partner/supabase.d.ts +7 -0
  26. package/models/Partnership/Partner/supabase.js +38 -0
  27. package/models/Partnership/Partner/types.d.ts +9 -8
  28. package/models/Partnership/Payment/index.d.ts +22 -5
  29. package/models/Partnership/Payment/index.js +44 -22
  30. package/models/Partnership/Payment/supabase.d.ts +15 -0
  31. package/models/Partnership/Payment/supabase.js +40 -0
  32. package/models/Partnership/Payment/types.d.ts +14 -6
  33. package/models/Partnership/Payment/types.js +1 -0
  34. package/models/Partnership/Plan/index.d.ts +14 -5
  35. package/models/Partnership/Plan/index.js +26 -18
  36. package/models/Partnership/Plan/supabase.d.ts +7 -0
  37. package/models/Partnership/Plan/supabase.js +22 -0
  38. package/models/Partnership/Plan/types.d.ts +5 -4
  39. package/models/Partnership/SepaPaymentGroup/index.d.ts +12 -4
  40. package/models/Partnership/SepaPaymentGroup/index.js +21 -14
  41. package/models/Partnership/SepaPaymentGroup/supabase.d.ts +7 -0
  42. package/models/Partnership/SepaPaymentGroup/supabase.js +18 -0
  43. package/models/Partnership/SepaPaymentGroup/types.d.ts +4 -3
  44. package/models/Partnership/Subscription/index.d.ts +15 -7
  45. package/models/Partnership/Subscription/index.js +27 -20
  46. package/models/Partnership/Subscription/supabase.d.ts +7 -0
  47. package/models/Partnership/Subscription/supabase.js +23 -0
  48. package/models/Partnership/Subscription/types.d.ts +7 -6
  49. package/models/Partnership/types.d.ts +5 -0
  50. package/package.json +1 -1
  51. package/types/supabase/generated.d.ts +487 -0
  52. package/types/supabase/generated.js +4 -0
  53. package/types/supabase/generated.ts +497 -0
@@ -158,6 +158,8 @@ export declare enum FbFunctionName {
158
158
  PartnershipPartnerEdit = "partnershipPartner-edit",
159
159
  PartnershipPartnerOnWrite = "partnershipPartner-onWrite",
160
160
  PartnershipPartnerRemove = "partnershipPartner-remove",
161
+ PartnershipPartnerRemovePermanently = "partnershipPartner-removePermanently",
162
+ PartnershipPartnerRestore = "partnershipPartner-restore",
161
163
  PartnershipPartnerRequest = "partnershipPartner-request",
162
164
  PartnershipPartnerAccept = "partnershipPartner-accept",
163
165
  PartnershipPartnerPortalGetData = "partnershipPartner-portalGetData",
@@ -162,6 +162,8 @@ var FbFunctionName;
162
162
  FbFunctionName["PartnershipPartnerEdit"] = "partnershipPartner-edit";
163
163
  FbFunctionName["PartnershipPartnerOnWrite"] = "partnershipPartner-onWrite";
164
164
  FbFunctionName["PartnershipPartnerRemove"] = "partnershipPartner-remove";
165
+ FbFunctionName["PartnershipPartnerRemovePermanently"] = "partnershipPartner-removePermanently";
166
+ FbFunctionName["PartnershipPartnerRestore"] = "partnershipPartner-restore";
165
167
  FbFunctionName["PartnershipPartnerRequest"] = "partnershipPartner-request";
166
168
  FbFunctionName["PartnershipPartnerAccept"] = "partnershipPartner-accept";
167
169
  FbFunctionName["PartnershipPartnerPortalGetData"] = "partnershipPartner-portalGetData";
@@ -1,5 +1,6 @@
1
1
  import { SetOptional } from 'type-fest';
2
2
  import { BasicAddressData, CreatedOn } from '../helpers/types';
3
+ import { GroupPlayerCustomFieldValue } from '../models/Group/Player/types';
3
4
  import { PartnershipPartnerSepaMandate } from '../models/Partnership/Partner/types';
4
5
  import { PaymentMethod } from '../models/Partnership/Payment/types';
5
6
  export declare namespace PartnershipPartnerFbFunctionsTypes {
@@ -12,6 +13,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
12
13
  birthdate: number | null;
13
14
  address: BasicAddressData | null;
14
15
  userId: string | null;
16
+ payerId?: string | null;
15
17
  paymentMethod: PaymentMethod | null;
16
18
  partnerNumber: number | null;
17
19
  acceptsCommunications: boolean;
@@ -26,8 +28,10 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
26
28
  }
27
29
  export type CreateResult = void;
28
30
  export interface EditData extends Partial<BaseCreateData> {
29
- sepaMandate: PartnershipPartnerSepaMandate | null;
31
+ sepaMandate?: PartnershipPartnerSepaMandate | null;
30
32
  paymentMethod?: PaymentMethod | null;
33
+ tagIds?: string[];
34
+ customFields?: Record<string, GroupPlayerCustomFieldValue>;
31
35
  }
32
36
  export interface EditParams extends EditData {
33
37
  partnershipId: string;
@@ -39,6 +43,16 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
39
43
  partnerId: string;
40
44
  }
41
45
  export type RemoveResult = void;
46
+ export interface RemovePermanentlyParams {
47
+ partnershipId: string;
48
+ partnerId: string;
49
+ }
50
+ export type RemovePermanentlyResult = void;
51
+ export interface RestoreParams {
52
+ partnershipId: string;
53
+ partnerId: string;
54
+ }
55
+ export type RestoreResult = void;
42
56
  export interface RequestParams extends CreateData {
43
57
  partnershipId: string;
44
58
  customFieldValues?: Record<string, string | number | null>;
@@ -7,7 +7,10 @@ export declare namespace PartnershipSepaPaymentGroupFbFunctionsTypes {
7
7
  partnershipId: string;
8
8
  sepaPaymentGroupId: string;
9
9
  }
10
- type CreateResult = void;
10
+ interface CreateResult {
11
+ id: string;
12
+ filePath: string | null;
13
+ }
11
14
  interface EditParams extends Partial<CreateData> {
12
15
  partnershipId: string;
13
16
  sepaPaymentGroupId: string;
@@ -167,6 +167,8 @@ const regionByFunctions = {
167
167
  [index_1.FbFunctionName.PartnershipPartnerEdit]: GCloudRegions.EuropeWest6,
168
168
  [index_1.FbFunctionName.PartnershipPartnerOnWrite]: GCloudRegions.EuropeWest6,
169
169
  [index_1.FbFunctionName.PartnershipPartnerRemove]: GCloudRegions.EuropeWest6,
170
+ [index_1.FbFunctionName.PartnershipPartnerRemovePermanently]: GCloudRegions.EuropeWest6,
171
+ [index_1.FbFunctionName.PartnershipPartnerRestore]: GCloudRegions.EuropeWest6,
170
172
  [index_1.FbFunctionName.PartnershipPartnerRequest]: GCloudRegions.EuropeWest6,
171
173
  [index_1.FbFunctionName.PartnershipPartnerAccept]: GCloudRegions.EuropeWest6,
172
174
  [index_1.FbFunctionName.PartnershipPartnerPortalGetData]: GCloudRegions.EuropeWest6,
@@ -34,6 +34,9 @@ export declare enum HttpsErrorMessages {
34
34
  PartnershipPartnerNotSelf = "error.partnershipPartner.notSelf",
35
35
  PartnershipPartnerSepaMandateMissing = "error.partnershipPartner.sepaMandateMissing",
36
36
  PartnershipPartnerNumberAlreadyExists = "error.partnershipPartner.numberAlreadyExists",
37
+ PartnershipPayerInvalid = "error.partnershipPartner.payerInvalid",
38
+ PartnershipPartnerIsPayer = "error.partnershipPartner.isPayer",
39
+ PartnershipPartnerNotInactive = "error.partnershipPartner.notInactive",
37
40
  InvalidPartnershipPlan = "error.partnershipPlan.noValid",
38
41
  PartnershipPlanFirstPaymentDateAfterEndDate = "error.partnershipPlan.firstPaymentDateAfterEndDate",
39
42
  PartnershipPlanWithSubscriptions = "error.partnershipPlan.withSubscriptions",
package/helpers/errors.js CHANGED
@@ -35,6 +35,9 @@ var HttpsErrorMessages;
35
35
  HttpsErrorMessages["PartnershipPartnerNotSelf"] = "error.partnershipPartner.notSelf";
36
36
  HttpsErrorMessages["PartnershipPartnerSepaMandateMissing"] = "error.partnershipPartner.sepaMandateMissing";
37
37
  HttpsErrorMessages["PartnershipPartnerNumberAlreadyExists"] = "error.partnershipPartner.numberAlreadyExists";
38
+ HttpsErrorMessages["PartnershipPayerInvalid"] = "error.partnershipPartner.payerInvalid";
39
+ HttpsErrorMessages["PartnershipPartnerIsPayer"] = "error.partnershipPartner.isPayer";
40
+ HttpsErrorMessages["PartnershipPartnerNotInactive"] = "error.partnershipPartner.notInactive";
38
41
  HttpsErrorMessages["InvalidPartnershipPlan"] = "error.partnershipPlan.noValid";
39
42
  HttpsErrorMessages["PartnershipPlanFirstPaymentDateAfterEndDate"] = "error.partnershipPlan.firstPaymentDateAfterEndDate";
40
43
  HttpsErrorMessages["PartnershipPlanWithSubscriptions"] = "error.partnershipPlan.withSubscriptions";
@@ -40,3 +40,4 @@ export interface BasicAddressData {
40
40
  country?: string;
41
41
  }
42
42
  export declare function displayBasicAddress<T extends BasicAddressData | null | undefined>(address: T): T extends BasicAddressData ? string : null;
43
+ export declare function isSpain(country?: string | null): boolean;
package/helpers/types.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.displayBasicAddress = exports.CreatedBy = exports.CreatedOn = exports.AdminItemStatus = void 0;
6
+ exports.isSpain = exports.displayBasicAddress = exports.CreatedBy = exports.CreatedOn = exports.AdminItemStatus = void 0;
7
7
  const isString_1 = __importDefault(require("lodash/isString"));
8
8
  var AdminItemStatus;
9
9
  (function (AdminItemStatus) {
@@ -31,3 +31,15 @@ function displayBasicAddress(address) {
31
31
  .join(', ');
32
32
  }
33
33
  exports.displayBasicAddress = displayBasicAddress;
34
+ const SPAIN_COUNTRY_TOKENS = new Set(['es', 'esp', 'spain', 'espana', 'espanya']);
35
+ function isSpain(country) {
36
+ if (!country)
37
+ return false;
38
+ const normalized = country
39
+ .normalize('NFD')
40
+ .replace(/[\u0300-\u036f]/g, '')
41
+ .trim()
42
+ .toLowerCase();
43
+ return SPAIN_COUNTRY_TOKENS.has(normalized);
44
+ }
45
+ exports.isSpain = isSpain;
@@ -34,4 +34,5 @@ export default class EventoPlayerBasic {
34
34
  get isRollCallConfirmed(): boolean;
35
35
  get isRollCallDeclined(): boolean;
36
36
  get questions(): import("./types").EventPlayerAnswers[];
37
+ get paymentId(): string | null;
37
38
  }
@@ -91,5 +91,8 @@ class EventoPlayerBasic {
91
91
  get questions() {
92
92
  return this.data.questions || [];
93
93
  }
94
+ get paymentId() {
95
+ return this.data.paymentId || null;
96
+ }
94
97
  }
95
98
  exports.default = EventoPlayerBasic;
@@ -118,6 +118,7 @@ export interface EventPlayerBasicData extends PlayerBasicData {
118
118
  reason?: EventPlayerReason | null;
119
119
  /** @deprecated use status */
120
120
  interested: true | null;
121
+ paymentId?: string | null;
121
122
  }
122
123
  export interface AEventPlayerBasicData extends EventPlayerBasicData {
123
124
  id: string;
@@ -1,6 +1,14 @@
1
- import ModelWithLang from '../../Model/lang';
2
1
  import { PartnershipCommunicationData } from './types';
3
- export default class PartnershipCommunication extends ModelWithLang<PartnershipCommunicationData> {
2
+ /**
3
+ * Modelo plain-object para una fila de `partnership_communication`.
4
+ * Las fechas son ISO (string).
5
+ */
6
+ export default class PartnershipCommunication {
7
+ id: string;
8
+ exists: boolean;
9
+ private _data;
10
+ constructor(data: PartnershipCommunicationData);
11
+ get data(): PartnershipCommunicationData;
4
12
  get partnershipId(): string;
5
13
  get title(): string;
6
14
  get message(): import("../../../helpers/slate").Descendant[];
@@ -12,11 +20,11 @@ export default class PartnershipCommunication extends ModelWithLang<PartnershipC
12
20
  get recipients(): string[];
13
21
  get recipientsCount(): number;
14
22
  get imagesPath(): string[];
15
- get createdAt(): FirebaseFirestore.Timestamp;
23
+ get createdAt(): string;
16
24
  get status(): "sent" | "scheduled";
17
- get scheduledAt(): FirebaseFirestore.Timestamp | null;
25
+ get scheduledAt(): string | null;
18
26
  get isScheduled(): boolean;
19
- get deletedAt(): FirebaseFirestore.Timestamp | null;
27
+ get deletedAt(): string | null;
20
28
  get isDeleted(): boolean;
21
29
  get isActive(): boolean;
22
30
  }
@@ -1,59 +1,66 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const slate_1 = require("../../../helpers/slate");
7
- const utils_1 = require("../../../helpers/utils");
8
- const lang_1 = __importDefault(require("../../Model/lang"));
9
- class PartnershipCommunication extends lang_1.default {
4
+ /**
5
+ * Modelo plain-object para una fila de `partnership_communication`.
6
+ * Las fechas son ISO (string).
7
+ */
8
+ class PartnershipCommunication {
9
+ constructor(data) {
10
+ this.id = data.id;
11
+ this._data = data;
12
+ this.exists = true;
13
+ }
14
+ get data() {
15
+ return this._data;
16
+ }
10
17
  get partnershipId() {
11
- return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
18
+ return this._data.partnershipId;
12
19
  }
13
20
  get title() {
14
- return this.data.title;
21
+ return this._data.title;
15
22
  }
16
23
  get message() {
17
- return this.data.message;
24
+ return this._data.message;
18
25
  }
19
26
  get messageHtml() {
20
- return this.data.messageHtml;
27
+ return this._data.messageHtml;
21
28
  }
22
29
  get imageURL() {
23
- return this.data.imageURL || null;
30
+ return this._data.imageURL || null;
24
31
  }
25
32
  get messagePlainText() {
26
33
  return (0, slate_1.serializeSlateBlock)(this.message);
27
34
  }
28
35
  get ownerName() {
29
- return this.data.ownerName;
36
+ return this._data.ownerName;
30
37
  }
31
38
  get ownerId() {
32
- return this.data.ownerId;
39
+ return this._data.ownerId;
33
40
  }
34
41
  get recipients() {
35
- return this.data.recipients || [];
42
+ return this._data.recipients || [];
36
43
  }
37
44
  get recipientsCount() {
38
- return this.data.recipientsCount || 0;
45
+ return this._data.recipientsCount || 0;
39
46
  }
40
47
  get imagesPath() {
41
- return this.data.imagesPath || [];
48
+ return this._data.imagesPath || [];
42
49
  }
43
50
  get createdAt() {
44
- return this.data.createdAt;
51
+ return this._data.createdAt;
45
52
  }
46
53
  get status() {
47
- return this.data.status || 'sent';
54
+ return this._data.status || 'sent';
48
55
  }
49
56
  get scheduledAt() {
50
- return this.data.scheduledAt || null;
57
+ return this._data.scheduledAt || null;
51
58
  }
52
59
  get isScheduled() {
53
60
  return this.status === 'scheduled';
54
61
  }
55
62
  get deletedAt() {
56
- return this.data.deletedAt || null;
63
+ return this._data.deletedAt || null;
57
64
  }
58
65
  get isDeleted() {
59
66
  return !!this.deletedAt;
@@ -0,0 +1,7 @@
1
+ import { Database } from '../../../types/supabase';
2
+ import { PartnershipCommunicationData } from './types';
3
+ export type PartnershipCommunicationRow = Database['public']['Tables']['partnership_communication']['Row'];
4
+ export type PartnershipCommunicationInsert = Database['public']['Tables']['partnership_communication']['Insert'];
5
+ export type PartnershipCommunicationUpdate = Database['public']['Tables']['partnership_communication']['Update'];
6
+ export declare const PARTNERSHIP_COMMUNICATION_TABLE: "partnership_communication";
7
+ export declare function rowToPartnershipCommunicationData(row: PartnershipCommunicationRow): PartnershipCommunicationData;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rowToPartnershipCommunicationData = exports.PARTNERSHIP_COMMUNICATION_TABLE = void 0;
4
+ exports.PARTNERSHIP_COMMUNICATION_TABLE = 'partnership_communication';
5
+ function rowToPartnershipCommunicationData(row) {
6
+ return {
7
+ id: row.id,
8
+ partnershipId: row.partnershipId,
9
+ title: row.title,
10
+ message: row.message ?? [],
11
+ messageHtml: row.messageHtml,
12
+ imageURL: row.imageURL,
13
+ ownerName: row.ownerName,
14
+ ownerId: row.ownerId,
15
+ recipients: row.recipients ?? [],
16
+ recipientsCount: row.recipientsCount,
17
+ imagesPath: row.imagesPath ?? [],
18
+ status: row.status,
19
+ scheduledAt: row.scheduledAt,
20
+ createdAt: row.createdAt,
21
+ deletedAt: row.deletedAt,
22
+ };
23
+ }
24
+ exports.rowToPartnershipCommunicationData = rowToPartnershipCommunicationData;
@@ -1,6 +1,7 @@
1
- import { Timestamp } from '@google-cloud/firestore';
2
1
  import { Descendant } from '../../../helpers/slate';
3
2
  export interface PartnershipCommunicationData {
3
+ id: string;
4
+ partnershipId: string;
4
5
  title: string;
5
6
  message: Descendant[];
6
7
  messageHtml: string;
@@ -11,7 +12,7 @@ export interface PartnershipCommunicationData {
11
12
  recipientsCount: number;
12
13
  imagesPath: string[];
13
14
  status: 'sent' | 'scheduled';
14
- scheduledAt: Timestamp | null;
15
- createdAt: Timestamp;
16
- deletedAt: Timestamp | null;
15
+ scheduledAt: string | null;
16
+ createdAt: string;
17
+ deletedAt: string | null;
17
18
  }
@@ -1,10 +1,28 @@
1
- import { LanguagesTypes } from '../../../lang';
2
- import GroupBasic from '../../Group/basic';
3
- import { DocumentModel } from '../../Model';
1
+ import { GroupBasicData } from '../../Group/types';
4
2
  import { PartnershipGroupData } from './types';
5
- export default class PartnershipGroup extends GroupBasic<PartnershipGroupData> {
6
- constructor(doc: DocumentModel, lang?: LanguagesTypes);
7
- get linkedAt(): FirebaseFirestore.Timestamp;
8
- get linkedBy(): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>;
3
+ /**
4
+ * Modelo plain-object para un enlace partnership↔group. Los datos básicos del
5
+ * grupo provienen del JOIN a `group` (ver `./supabase.ts`); este modelo solo
6
+ * añade los metadatos del enlace (`linkedAt`/`linkedBy`).
7
+ */
8
+ export default class PartnershipGroup {
9
+ id: string;
10
+ exists: boolean;
11
+ private _data;
12
+ constructor(data: PartnershipGroupData);
13
+ get data(): PartnershipGroupData;
9
14
  get partnershipId(): string;
15
+ get linkedAt(): string;
16
+ get linkedBy(): string | null;
17
+ get displayName(): string;
18
+ get photoURL(): string;
19
+ get username(): string;
20
+ get locality(): string;
21
+ get location(): FirebaseFirestore.GeoPoint;
22
+ get musicStyle(): string;
23
+ get tinyInfo(): {
24
+ displayName: string;
25
+ photoURL: string;
26
+ };
27
+ get basicInfo(): GroupBasicData;
10
28
  }
@@ -1,23 +1,61 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../helpers/utils");
7
- const lang_1 = require("../../../lang");
8
- const basic_1 = __importDefault(require("../../Group/basic"));
9
- class PartnershipGroup extends basic_1.default {
10
- constructor(doc, lang = lang_1.defaultLocale) {
11
- super(doc, lang);
3
+ /**
4
+ * Modelo plain-object para un enlace partnership↔group. Los datos básicos del
5
+ * grupo provienen del JOIN a `group` (ver `./supabase.ts`); este modelo solo
6
+ * añade los metadatos del enlace (`linkedAt`/`linkedBy`).
7
+ */
8
+ class PartnershipGroup {
9
+ constructor(data) {
10
+ this.id = data.id;
11
+ this._data = data;
12
+ this.exists = true;
13
+ }
14
+ get data() {
15
+ return this._data;
16
+ }
17
+ get partnershipId() {
18
+ return this._data.partnershipId;
12
19
  }
13
20
  get linkedAt() {
14
- return this.data.linkedAt;
21
+ return this._data.linkedAt;
15
22
  }
16
23
  get linkedBy() {
17
- return this.data.linkedBy;
24
+ return this._data.linkedBy;
18
25
  }
19
- get partnershipId() {
20
- return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
26
+ get displayName() {
27
+ return this._data.displayName;
28
+ }
29
+ get photoURL() {
30
+ return this._data.photoURL;
31
+ }
32
+ get username() {
33
+ return this._data.username;
34
+ }
35
+ get locality() {
36
+ return this._data.locality;
37
+ }
38
+ get location() {
39
+ return this._data.location;
40
+ }
41
+ get musicStyle() {
42
+ return this._data.musicStyle;
43
+ }
44
+ get tinyInfo() {
45
+ return {
46
+ displayName: this.displayName,
47
+ photoURL: this.photoURL,
48
+ };
49
+ }
50
+ get basicInfo() {
51
+ return {
52
+ displayName: this.displayName,
53
+ photoURL: this.photoURL,
54
+ username: this.username,
55
+ locality: this.locality,
56
+ location: this.location,
57
+ musicStyle: this.musicStyle,
58
+ };
21
59
  }
22
60
  }
23
61
  exports.default = PartnershipGroup;
@@ -0,0 +1,13 @@
1
+ import { Database } from '../../../types/supabase';
2
+ import { PartnershipGroupData } from './types';
3
+ export type PartnershipGroupRow = Database['public']['Tables']['partnership_group']['Row'];
4
+ export type PartnershipGroupInsert = Database['public']['Tables']['partnership_group']['Insert'];
5
+ export type GroupRow = Database['public']['Tables']['group']['Row'];
6
+ export declare const PARTNERSHIP_GROUP_TABLE: "partnership_group";
7
+ /**
8
+ * Combina la fila de enlace `partnership_group` con la fila del grupo
9
+ * (obtenida por JOIN a `group`) para producir `PartnershipGroupData`. Esto
10
+ * sustituye a la copia denormalizada de `GroupBasicData` que existía en la
11
+ * antigua subcolección.
12
+ */
13
+ export declare function rowToPartnershipGroupData(link: PartnershipGroupRow, group: Pick<GroupRow, 'displayName' | 'photoURL' | 'username' | 'locality' | 'location' | 'musicStyle'>): PartnershipGroupData;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rowToPartnershipGroupData = exports.PARTNERSHIP_GROUP_TABLE = void 0;
4
+ exports.PARTNERSHIP_GROUP_TABLE = 'partnership_group';
5
+ /**
6
+ * Combina la fila de enlace `partnership_group` con la fila del grupo
7
+ * (obtenida por JOIN a `group`) para producir `PartnershipGroupData`. Esto
8
+ * sustituye a la copia denormalizada de `GroupBasicData` que existía en la
9
+ * antigua subcolección.
10
+ */
11
+ function rowToPartnershipGroupData(link, group) {
12
+ return {
13
+ id: link.groupId,
14
+ partnershipId: link.partnershipId,
15
+ linkedBy: link.linkedBy,
16
+ linkedAt: link.linkedAt,
17
+ displayName: group.displayName,
18
+ photoURL: group.photoURL,
19
+ username: group.username,
20
+ locality: group.locality,
21
+ location: group.location,
22
+ musicStyle: group.musicStyle,
23
+ };
24
+ }
25
+ exports.rowToPartnershipGroupData = rowToPartnershipGroupData;
@@ -1,6 +1,12 @@
1
- import { DocumentReference, Timestamp } from '@google-cloud/firestore';
2
1
  import { GroupBasicData } from '../../Group/types';
2
+ /**
3
+ * Enlace partnership↔group. Ya NO denormaliza los datos del grupo: los básicos
4
+ * (`GroupBasicData`) se hidratan vía JOIN a la tabla `group` en Supabase. La
5
+ * fila propia de `partnership_group` solo aporta `linkedBy`/`linkedAt`.
6
+ */
3
7
  export interface PartnershipGroupData extends GroupBasicData {
4
- readonly linkedBy: DocumentReference;
5
- readonly linkedAt: Timestamp;
8
+ id: string;
9
+ partnershipId: string;
10
+ linkedBy: string | null;
11
+ linkedAt: string;
6
12
  }
@@ -1,6 +1,15 @@
1
- import ModelWithLang from '../../Model/lang';
2
1
  import { PartnershipPartnerData, PartnerStatus } from './types';
3
- export default class PartnershipPartner extends ModelWithLang<PartnershipPartnerData> {
2
+ /**
3
+ * Modelo plain-object para una fila de `partnership_partner`. Conserva la API
4
+ * de getters del antiguo modelo Firestore. `status` se deriva del estado
5
+ * (borrado/pendiente/activo); las fechas son ISO (string).
6
+ */
7
+ export default class PartnershipPartner {
8
+ id: string;
9
+ exists: boolean;
10
+ private _data;
11
+ constructor(data: PartnershipPartnerData);
12
+ get data(): PartnershipPartnerData;
4
13
  get tinyInfo(): {
5
14
  displayName: string;
6
15
  photoURL: string;
@@ -14,7 +23,7 @@ export default class PartnershipPartner extends ModelWithLang<PartnershipPartner
14
23
  get NIF(): string | null;
15
24
  get email(): string | null;
16
25
  get phone(): string | null;
17
- get birthdate(): FirebaseFirestore.Timestamp | null;
26
+ get birthdate(): string | null;
18
27
  get sepaMandate(): {
19
28
  holderDisplayAddress: string | null;
20
29
  mandateId: string;
@@ -26,17 +35,19 @@ export default class PartnershipPartner extends ModelWithLang<PartnershipPartner
26
35
  get address(): import("../../../helpers/types").BasicAddressData | null;
27
36
  get paymentMethod(): import("../Payment/types").PaymentMethod | null;
28
37
  get displayAddress(): string | null;
29
- get createdAt(): FirebaseFirestore.Timestamp;
30
- get createdBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
31
- get editedAt(): FirebaseFirestore.Timestamp | null;
38
+ get createdAt(): string;
39
+ get createdBy(): string;
40
+ get editedAt(): string | null;
32
41
  get editedBy(): string | null;
33
42
  get isDeleted(): boolean;
34
43
  get isActive(): boolean;
35
44
  get isPending(): boolean;
36
- get acceptedAt(): FirebaseFirestore.Timestamp | null;
45
+ get acceptedAt(): string | null;
37
46
  get acceptedBy(): string | null;
38
47
  get status(): PartnerStatus;
39
48
  get userId(): string | null;
49
+ get payerId(): string | null;
50
+ get hasPayer(): boolean;
40
51
  get groupIds(): string[];
41
52
  get tagIds(): string[];
42
53
  get subscriptionIds(): string[];