cyc-type-def 6.5.0 → 7.1.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/index.cjs CHANGED
@@ -53,6 +53,7 @@ __export(index_exports, {
53
53
  cgNum: () => cgNum,
54
54
  compareCG: () => compareCG,
55
55
  formatDateDDMMYY: () => formatDateDDMMYY,
56
+ generateId: () => generateId,
56
57
  getDayMonthSortKey: () => getDayMonthSortKey,
57
58
  isDateInRangeIgnoreYear: () => isDateInRangeIgnoreYear,
58
59
  monthStr: () => monthStr,
@@ -257,6 +258,18 @@ var AttSheep = class {
257
258
  }
258
259
  };
259
260
  var DisplayAttendance = class {
261
+ // Allows dynamic string keys
262
+ cntOM;
263
+ cntNB;
264
+ cntAC;
265
+ cntNF;
266
+ cntRNF;
267
+ desOM;
268
+ desNB;
269
+ desAC;
270
+ desNF;
271
+ desRNF;
272
+ total;
260
273
  calcTotal() {
261
274
  this.total = this.cntOM + this.cntNB + this.cntAC + this.cntNF + this.cntRNF;
262
275
  }
@@ -412,13 +425,15 @@ var Session = class {
412
425
 
413
426
  // src/classes/attendance/Title.ts
414
427
  var Title = class {
415
- getKey() {
416
- return "dddd";
417
- }
418
428
  };
419
429
 
420
430
  // src/classes/helper/DateEvent.ts
421
431
  var DateEvent = class {
432
+ datetime;
433
+ precision;
434
+ eventName;
435
+ invitedBy;
436
+ remark;
422
437
  constructor(datetime) {
423
438
  if (datetime) this.datetime = datetime;
424
439
  this.precision = "DAY" /* DAY */;
@@ -435,6 +450,55 @@ var DatePrecision = /* @__PURE__ */ ((DatePrecision2) => {
435
450
 
436
451
  // src/classes/pastoral-team/Sheep.ts
437
452
  var Sheep = class _Sheep {
453
+ // pastoral team info
454
+ st;
455
+ // small team id
456
+ cluster;
457
+ // cluster id
458
+ cg;
459
+ // cg id
460
+ status;
461
+ discipler;
462
+ // history record (spiritual journey/milestone)
463
+ /** first approach/contact (JieChu) */
464
+ firstApproach;
465
+ /** first CG/SERVICE */
466
+ firstAtt;
467
+ /** accept Christ */
468
+ acceptChrist;
469
+ // sheep info
470
+ name;
471
+ age;
472
+ birthday;
473
+ isBaptised;
474
+ dtBaptism;
475
+ contact;
476
+ gender;
477
+ nric;
478
+ address;
479
+ // in future might break to details like address line 1, state etc.
480
+ email;
481
+ // attendance
482
+ attCnt;
483
+ /** Attendance count in recent 15 weeks (tentatively) */
484
+ recentAttCnt;
485
+ hideAtt;
486
+ // hide in attendance list
487
+ // ???
488
+ show;
489
+ // show in msj-progress-tracker
490
+ // base attributes
491
+ id;
492
+ deleted;
493
+ createdAt;
494
+ createdBy;
495
+ updatedAt;
496
+ updatedBy;
497
+ remark;
498
+ // not submit attributes
499
+ arrFlwUpCnt;
500
+ msj;
501
+ msjRecords;
438
502
  constructor(id, name, status, cg, st, cluster, deleted, show, attCnt) {
439
503
  this.id = id;
440
504
  this.name = name;
@@ -456,6 +520,7 @@ var Sheep = class _Sheep {
456
520
 
457
521
  // src/classes/attendance-report/ReportSheep.ts
458
522
  var ReportSheep = class extends Sheep {
523
+ attMap;
459
524
  constructor(sheep) {
460
525
  super(
461
526
  sheep.id,
@@ -475,6 +540,9 @@ var ReportSheep = class extends Sheep {
475
540
 
476
541
  // src/classes/attendance-report/TitleAttendance.ts
477
542
  var TitleAttendance = class {
543
+ cgAtt;
544
+ serviceAtt;
545
+ title;
478
546
  constructor(cgAtt, serviceAtt, title) {
479
547
  this.cgAtt = cgAtt;
480
548
  this.serviceAtt = serviceAtt;
@@ -484,6 +552,22 @@ var TitleAttendance = class {
484
552
 
485
553
  // src/classes/flw-up/FollowUpStatus.ts
486
554
  var FollowUpStatus = class {
555
+ id;
556
+ method;
557
+ st;
558
+ // small team id
559
+ cluster;
560
+ // cluster id
561
+ cg;
562
+ // cg id
563
+ sheep;
564
+ // sheep name
565
+ in_list;
566
+ status;
567
+ timeStamp;
568
+ date;
569
+ discipler;
570
+ user;
487
571
  constructor() {
488
572
  this.id = "";
489
573
  this.method = "";
@@ -501,6 +585,25 @@ var FollowUpStatus = class {
501
585
 
502
586
  // src/classes/pastoral-team/CG.ts
503
587
  var CG = class {
588
+ name;
589
+ /** small team id */
590
+ st;
591
+ //
592
+ /** cluster id */
593
+ cluster;
594
+ cglCnt;
595
+ sglCnt;
596
+ cglName;
597
+ /** row index in attendance report (1-based) */
598
+ rptRowIdx;
599
+ // base attributes
600
+ id;
601
+ deleted;
602
+ createdAt;
603
+ createdBy;
604
+ updatedAt;
605
+ updatedBy;
606
+ remark;
504
607
  constructor(id, name, st, cluster, deleted) {
505
608
  this.id = id;
506
609
  this.name = name;
@@ -512,6 +615,14 @@ var CG = class {
512
615
 
513
616
  // src/classes/pastoral-team/Cluster.ts
514
617
  var Cluster = class {
618
+ id;
619
+ deleted;
620
+ name;
621
+ createdAt;
622
+ createdBy;
623
+ updatedAt;
624
+ updatedBy;
625
+ remark;
515
626
  constructor(id, name, deleted) {
516
627
  this.id = id;
517
628
  this.name = name;
@@ -521,6 +632,18 @@ var Cluster = class {
521
632
 
522
633
  // src/classes/pastoral-team/SmallTeam.ts
523
634
  var SmallTeam = class {
635
+ name;
636
+ /** cluster id */
637
+ cluster;
638
+ // cluster id
639
+ // base attributes
640
+ id;
641
+ deleted;
642
+ createdAt;
643
+ createdBy;
644
+ updatedAt;
645
+ updatedBy;
646
+ remark;
524
647
  constructor(id, name, cluster, deleted) {
525
648
  this.id = id;
526
649
  this.name = name;
@@ -531,25 +654,46 @@ var SmallTeam = class {
531
654
 
532
655
  // src/classes/user-management/AssignedCG.ts
533
656
  var AssignedCG = class {
657
+ cg;
534
658
  constructor(cg) {
535
659
  this.cg = cg;
536
660
  }
537
661
  };
538
662
 
663
+ // src/classes/history/History.ts
664
+ function generateId(history) {
665
+ history.id = history.idRef + "@" + history.idPeriod;
666
+ }
667
+
539
668
  // src/classes/helper/Click.ts
540
669
  var Click = class {
670
+ action;
671
+ timeStamp;
672
+ userId;
673
+ remark;
541
674
  };
542
675
 
543
676
  // src/classes/helper/Column.ts
544
677
  var Column = class {
678
+ visible = false;
679
+ name;
545
680
  constructor(name) {
546
- this.visible = false;
547
681
  this.name = name;
548
682
  }
549
683
  };
550
684
 
551
685
  // src/classes/AppUser.ts
552
686
  var AppUser = class {
687
+ id;
688
+ name;
689
+ /** Login id: phone number/email */
690
+ phoneNum;
691
+ permission;
692
+ pastoral_team;
693
+ permissions;
694
+ assigned_cg;
695
+ idSheep;
696
+ settings;
553
697
  constructor(id, name, phoneNum, permission) {
554
698
  this.id = id;
555
699
  this.name = name;
@@ -563,6 +707,15 @@ var Period = class {
563
707
  constructor(period) {
564
708
  Object.assign(this, period);
565
709
  }
710
+ generateId() {
711
+ if (!this.year) {
712
+ throw new Error("Cannot generate Period ID: year is required.");
713
+ }
714
+ if (!this.month) {
715
+ throw new Error("Cannot generate Period ID: month is required.");
716
+ }
717
+ this.id = this.year.toString() + "-" + this.month.toString().padStart(2, "0");
718
+ }
566
719
  /**
567
720
  * Calculates and sets the millisecond timestamps for the start and end of the period.
568
721
  * * Uses the instance's `year` and `month` (1-based) to compute:
@@ -577,10 +730,12 @@ var Period = class {
577
730
  this.endTimestamp = end.getTime();
578
731
  }
579
732
  get dtStart() {
580
- return new Date(this.startTimestamp);
733
+ if (this.startTimestamp) return new Date(this.startTimestamp);
734
+ else return void 0;
581
735
  }
582
736
  get dtEnd() {
583
- return new Date(this.endTimestamp);
737
+ if (this.endTimestamp) return new Date(this.endTimestamp);
738
+ else return void 0;
584
739
  }
585
740
  };
586
741
 
@@ -763,6 +918,7 @@ function compareCG(a, b) {
763
918
  cgNum,
764
919
  compareCG,
765
920
  formatDateDDMMYY,
921
+ generateId,
766
922
  getDayMonthSortKey,
767
923
  isDateInRangeIgnoreYear,
768
924
  monthStr,
package/dist/index.d.cts CHANGED
@@ -88,6 +88,7 @@ declare class Sheep implements Base {
88
88
  gender?: string;
89
89
  nric?: string;
90
90
  address?: string;
91
+ email?: string;
91
92
  attCnt: number;
92
93
  /** Attendance count in recent 15 weeks (tentatively) */
93
94
  recentAttCnt?: number;
@@ -197,6 +198,7 @@ declare class DisplayAttendance {
197
198
  }
198
199
 
199
200
  interface Title extends Base {
201
+ idPeriod: string;
200
202
  startDt: number;
201
203
  endDt: number;
202
204
  code: string;
@@ -204,7 +206,6 @@ interface Title extends Base {
204
206
  }
205
207
  /** represents a week */
206
208
  declare class Title implements Title {
207
- getKey(): string;
208
209
  }
209
210
 
210
211
  interface Attendance extends Title {
@@ -446,6 +447,14 @@ interface Claim extends Base {
446
447
  status: string;
447
448
  }
448
449
 
450
+ type History<T extends Base> = T & {
451
+ /** id of the current period */
452
+ idPeriod: string;
453
+ /** original id of the object */
454
+ idRef: string;
455
+ };
456
+ declare function generateId(history: History<Base>): void;
457
+
449
458
  declare enum ClickAction {
450
459
  P_WeeklyAttendance = 0,
451
460
  P_AttendanceReport = 1,
@@ -540,19 +549,15 @@ interface BaseDialogInput {
540
549
  action: DialogAction;
541
550
  }
542
551
 
543
- declare class Period implements Base {
544
- id: string;
545
- deleted: boolean;
546
- createdAt?: number | undefined;
547
- createdBy?: string | undefined;
548
- updatedAt?: number | undefined;
549
- updatedBy?: string | undefined;
550
- remark?: string | undefined;
552
+ interface Period extends Base {
551
553
  year: number;
552
554
  month: number;
553
555
  startTimestamp: number;
554
556
  endTimestamp: number;
557
+ }
558
+ declare class Period implements Period {
555
559
  constructor(period: Partial<Period>);
560
+ generateId(): void;
556
561
  /**
557
562
  * Calculates and sets the millisecond timestamps for the start and end of the period.
558
563
  * * Uses the instance's `year` and `month` (1-based) to compute:
@@ -561,8 +566,8 @@ declare class Period implements Base {
561
566
  * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
562
567
  */
563
568
  setBounds(): void;
564
- get dtStart(): Date;
565
- get dtEnd(): Date;
569
+ get dtStart(): Date | undefined;
570
+ get dtEnd(): Date | undefined;
566
571
  }
567
572
 
568
573
  declare const METHOD: {
@@ -614,4 +619,4 @@ declare function getDayMonthSortKey(timestamp: number): number;
614
619
 
615
620
  declare function compareCG(a: CG, b: CG): number;
616
621
 
617
- export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
622
+ export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, type History, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, generateId, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,7 @@ declare class Sheep implements Base {
88
88
  gender?: string;
89
89
  nric?: string;
90
90
  address?: string;
91
+ email?: string;
91
92
  attCnt: number;
92
93
  /** Attendance count in recent 15 weeks (tentatively) */
93
94
  recentAttCnt?: number;
@@ -197,6 +198,7 @@ declare class DisplayAttendance {
197
198
  }
198
199
 
199
200
  interface Title extends Base {
201
+ idPeriod: string;
200
202
  startDt: number;
201
203
  endDt: number;
202
204
  code: string;
@@ -204,7 +206,6 @@ interface Title extends Base {
204
206
  }
205
207
  /** represents a week */
206
208
  declare class Title implements Title {
207
- getKey(): string;
208
209
  }
209
210
 
210
211
  interface Attendance extends Title {
@@ -446,6 +447,14 @@ interface Claim extends Base {
446
447
  status: string;
447
448
  }
448
449
 
450
+ type History<T extends Base> = T & {
451
+ /** id of the current period */
452
+ idPeriod: string;
453
+ /** original id of the object */
454
+ idRef: string;
455
+ };
456
+ declare function generateId(history: History<Base>): void;
457
+
449
458
  declare enum ClickAction {
450
459
  P_WeeklyAttendance = 0,
451
460
  P_AttendanceReport = 1,
@@ -540,19 +549,15 @@ interface BaseDialogInput {
540
549
  action: DialogAction;
541
550
  }
542
551
 
543
- declare class Period implements Base {
544
- id: string;
545
- deleted: boolean;
546
- createdAt?: number | undefined;
547
- createdBy?: string | undefined;
548
- updatedAt?: number | undefined;
549
- updatedBy?: string | undefined;
550
- remark?: string | undefined;
552
+ interface Period extends Base {
551
553
  year: number;
552
554
  month: number;
553
555
  startTimestamp: number;
554
556
  endTimestamp: number;
557
+ }
558
+ declare class Period implements Period {
555
559
  constructor(period: Partial<Period>);
560
+ generateId(): void;
556
561
  /**
557
562
  * Calculates and sets the millisecond timestamps for the start and end of the period.
558
563
  * * Uses the instance's `year` and `month` (1-based) to compute:
@@ -561,8 +566,8 @@ declare class Period implements Base {
561
566
  * * @throws This method will produce invalid timestamps (`NaN`) if `year` or `month` are undefined.
562
567
  */
563
568
  setBounds(): void;
564
- get dtStart(): Date;
565
- get dtEnd(): Date;
569
+ get dtStart(): Date | undefined;
570
+ get dtEnd(): Date | undefined;
566
571
  }
567
572
 
568
573
  declare const METHOD: {
@@ -614,4 +619,4 @@ declare function getDayMonthSortKey(timestamp: number): number;
614
619
 
615
620
  declare function compareCG(a: CG, b: CG): number;
616
621
 
617
- export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
622
+ export { type AppPage, AppUser, AssignedCG, AttSheep, Attendance, BackupAttendance, type Base, type BaseDialog, type BaseDialogInput, CG, type Claim, ClaimStatus, ClaimType, Click, ClickAction, Cluster, Column, DateEvent, DatePrecision, type Device, DialogAction, DisplayAttendance, FollowUpStatus, type History, LIST_STATUS, METHOD, type MsjClassBatch, type MsjClassTime, type MsjClassType, MsjJoinStatus, MsjJoinStatusInfo, type MsjStudBatch, type MsjStudClass, PERMISSION, type PastoralTeam, Period, ReportSheep, Session, SessionAttendance, Sheep, SmallTeam, Title, TitleAttendance, cgNum, compareCG, formatDateDDMMYY, generateId, getDayMonthSortKey, isDateInRangeIgnoreYear, monthStr, parseYYMMDD, yearStr };
package/dist/index.js CHANGED
@@ -194,6 +194,18 @@ var AttSheep = class {
194
194
  }
195
195
  };
196
196
  var DisplayAttendance = class {
197
+ // Allows dynamic string keys
198
+ cntOM;
199
+ cntNB;
200
+ cntAC;
201
+ cntNF;
202
+ cntRNF;
203
+ desOM;
204
+ desNB;
205
+ desAC;
206
+ desNF;
207
+ desRNF;
208
+ total;
197
209
  calcTotal() {
198
210
  this.total = this.cntOM + this.cntNB + this.cntAC + this.cntNF + this.cntRNF;
199
211
  }
@@ -349,13 +361,15 @@ var Session = class {
349
361
 
350
362
  // src/classes/attendance/Title.ts
351
363
  var Title = class {
352
- getKey() {
353
- return "dddd";
354
- }
355
364
  };
356
365
 
357
366
  // src/classes/helper/DateEvent.ts
358
367
  var DateEvent = class {
368
+ datetime;
369
+ precision;
370
+ eventName;
371
+ invitedBy;
372
+ remark;
359
373
  constructor(datetime) {
360
374
  if (datetime) this.datetime = datetime;
361
375
  this.precision = "DAY" /* DAY */;
@@ -372,6 +386,55 @@ var DatePrecision = /* @__PURE__ */ ((DatePrecision2) => {
372
386
 
373
387
  // src/classes/pastoral-team/Sheep.ts
374
388
  var Sheep = class _Sheep {
389
+ // pastoral team info
390
+ st;
391
+ // small team id
392
+ cluster;
393
+ // cluster id
394
+ cg;
395
+ // cg id
396
+ status;
397
+ discipler;
398
+ // history record (spiritual journey/milestone)
399
+ /** first approach/contact (JieChu) */
400
+ firstApproach;
401
+ /** first CG/SERVICE */
402
+ firstAtt;
403
+ /** accept Christ */
404
+ acceptChrist;
405
+ // sheep info
406
+ name;
407
+ age;
408
+ birthday;
409
+ isBaptised;
410
+ dtBaptism;
411
+ contact;
412
+ gender;
413
+ nric;
414
+ address;
415
+ // in future might break to details like address line 1, state etc.
416
+ email;
417
+ // attendance
418
+ attCnt;
419
+ /** Attendance count in recent 15 weeks (tentatively) */
420
+ recentAttCnt;
421
+ hideAtt;
422
+ // hide in attendance list
423
+ // ???
424
+ show;
425
+ // show in msj-progress-tracker
426
+ // base attributes
427
+ id;
428
+ deleted;
429
+ createdAt;
430
+ createdBy;
431
+ updatedAt;
432
+ updatedBy;
433
+ remark;
434
+ // not submit attributes
435
+ arrFlwUpCnt;
436
+ msj;
437
+ msjRecords;
375
438
  constructor(id, name, status, cg, st, cluster, deleted, show, attCnt) {
376
439
  this.id = id;
377
440
  this.name = name;
@@ -393,6 +456,7 @@ var Sheep = class _Sheep {
393
456
 
394
457
  // src/classes/attendance-report/ReportSheep.ts
395
458
  var ReportSheep = class extends Sheep {
459
+ attMap;
396
460
  constructor(sheep) {
397
461
  super(
398
462
  sheep.id,
@@ -412,6 +476,9 @@ var ReportSheep = class extends Sheep {
412
476
 
413
477
  // src/classes/attendance-report/TitleAttendance.ts
414
478
  var TitleAttendance = class {
479
+ cgAtt;
480
+ serviceAtt;
481
+ title;
415
482
  constructor(cgAtt, serviceAtt, title) {
416
483
  this.cgAtt = cgAtt;
417
484
  this.serviceAtt = serviceAtt;
@@ -421,6 +488,22 @@ var TitleAttendance = class {
421
488
 
422
489
  // src/classes/flw-up/FollowUpStatus.ts
423
490
  var FollowUpStatus = class {
491
+ id;
492
+ method;
493
+ st;
494
+ // small team id
495
+ cluster;
496
+ // cluster id
497
+ cg;
498
+ // cg id
499
+ sheep;
500
+ // sheep name
501
+ in_list;
502
+ status;
503
+ timeStamp;
504
+ date;
505
+ discipler;
506
+ user;
424
507
  constructor() {
425
508
  this.id = "";
426
509
  this.method = "";
@@ -438,6 +521,25 @@ var FollowUpStatus = class {
438
521
 
439
522
  // src/classes/pastoral-team/CG.ts
440
523
  var CG = class {
524
+ name;
525
+ /** small team id */
526
+ st;
527
+ //
528
+ /** cluster id */
529
+ cluster;
530
+ cglCnt;
531
+ sglCnt;
532
+ cglName;
533
+ /** row index in attendance report (1-based) */
534
+ rptRowIdx;
535
+ // base attributes
536
+ id;
537
+ deleted;
538
+ createdAt;
539
+ createdBy;
540
+ updatedAt;
541
+ updatedBy;
542
+ remark;
441
543
  constructor(id, name, st, cluster, deleted) {
442
544
  this.id = id;
443
545
  this.name = name;
@@ -449,6 +551,14 @@ var CG = class {
449
551
 
450
552
  // src/classes/pastoral-team/Cluster.ts
451
553
  var Cluster = class {
554
+ id;
555
+ deleted;
556
+ name;
557
+ createdAt;
558
+ createdBy;
559
+ updatedAt;
560
+ updatedBy;
561
+ remark;
452
562
  constructor(id, name, deleted) {
453
563
  this.id = id;
454
564
  this.name = name;
@@ -458,6 +568,18 @@ var Cluster = class {
458
568
 
459
569
  // src/classes/pastoral-team/SmallTeam.ts
460
570
  var SmallTeam = class {
571
+ name;
572
+ /** cluster id */
573
+ cluster;
574
+ // cluster id
575
+ // base attributes
576
+ id;
577
+ deleted;
578
+ createdAt;
579
+ createdBy;
580
+ updatedAt;
581
+ updatedBy;
582
+ remark;
461
583
  constructor(id, name, cluster, deleted) {
462
584
  this.id = id;
463
585
  this.name = name;
@@ -468,25 +590,46 @@ var SmallTeam = class {
468
590
 
469
591
  // src/classes/user-management/AssignedCG.ts
470
592
  var AssignedCG = class {
593
+ cg;
471
594
  constructor(cg) {
472
595
  this.cg = cg;
473
596
  }
474
597
  };
475
598
 
599
+ // src/classes/history/History.ts
600
+ function generateId(history) {
601
+ history.id = history.idRef + "@" + history.idPeriod;
602
+ }
603
+
476
604
  // src/classes/helper/Click.ts
477
605
  var Click = class {
606
+ action;
607
+ timeStamp;
608
+ userId;
609
+ remark;
478
610
  };
479
611
 
480
612
  // src/classes/helper/Column.ts
481
613
  var Column = class {
614
+ visible = false;
615
+ name;
482
616
  constructor(name) {
483
- this.visible = false;
484
617
  this.name = name;
485
618
  }
486
619
  };
487
620
 
488
621
  // src/classes/AppUser.ts
489
622
  var AppUser = class {
623
+ id;
624
+ name;
625
+ /** Login id: phone number/email */
626
+ phoneNum;
627
+ permission;
628
+ pastoral_team;
629
+ permissions;
630
+ assigned_cg;
631
+ idSheep;
632
+ settings;
490
633
  constructor(id, name, phoneNum, permission) {
491
634
  this.id = id;
492
635
  this.name = name;
@@ -500,6 +643,15 @@ var Period = class {
500
643
  constructor(period) {
501
644
  Object.assign(this, period);
502
645
  }
646
+ generateId() {
647
+ if (!this.year) {
648
+ throw new Error("Cannot generate Period ID: year is required.");
649
+ }
650
+ if (!this.month) {
651
+ throw new Error("Cannot generate Period ID: month is required.");
652
+ }
653
+ this.id = this.year.toString() + "-" + this.month.toString().padStart(2, "0");
654
+ }
503
655
  /**
504
656
  * Calculates and sets the millisecond timestamps for the start and end of the period.
505
657
  * * Uses the instance's `year` and `month` (1-based) to compute:
@@ -514,10 +666,12 @@ var Period = class {
514
666
  this.endTimestamp = end.getTime();
515
667
  }
516
668
  get dtStart() {
517
- return new Date(this.startTimestamp);
669
+ if (this.startTimestamp) return new Date(this.startTimestamp);
670
+ else return void 0;
518
671
  }
519
672
  get dtEnd() {
520
- return new Date(this.endTimestamp);
673
+ if (this.endTimestamp) return new Date(this.endTimestamp);
674
+ else return void 0;
521
675
  }
522
676
  };
523
677
 
@@ -699,6 +853,7 @@ export {
699
853
  cgNum,
700
854
  compareCG,
701
855
  formatDateDDMMYY,
856
+ generateId,
702
857
  getDayMonthSortKey,
703
858
  isDateInRangeIgnoreYear,
704
859
  monthStr,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyc-type-def",
3
- "version": "6.5.0",
3
+ "version": "7.1.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",