{"version":3,"file":"GenericRecord.mjs","names":[],"sources":["../../../../src/modules/generic-records/repository/GenericRecord.ts"],"sourcesContent":["import type { TagsBase } from '../../../storage/BaseRecord'\n\nimport { BaseRecord } from '../../../storage/BaseRecord'\nimport { uuid } from '../../../utils/uuid'\n\nexport type GenericRecordTags = TagsBase\n\nexport interface GenericRecordStorageProps {\n  id?: string\n  createdAt?: Date\n  tags?: GenericRecordTags\n  content: Record<string, unknown>\n}\n\nexport interface SaveGenericRecordOption {\n  content: Record<string, unknown>\n  id?: string\n  tags?: GenericRecordTags\n}\n\nexport class GenericRecord extends BaseRecord<GenericRecordTags> {\n  public content!: Record<string, unknown>\n\n  public static readonly type = 'GenericRecord'\n  public readonly type = GenericRecord.type\n\n  public constructor(props: GenericRecordStorageProps) {\n    super()\n\n    if (props) {\n      this.id = props.id ?? uuid()\n      this.createdAt = props.createdAt ?? new Date()\n      this.content = props.content\n      this._tags = props.tags ?? {}\n    }\n  }\n\n  public getTags() {\n    return {\n      ...this._tags,\n    }\n  }\n}\n"],"mappings":";;;;;;AAoBA,IAAa,gBAAb,MAAa,sBAAsB,WAA8B;CAM/D,AAAO,YAAY,OAAkC;AACnD,SAAO;OAHO,OAAO,cAAc;AAKnC,MAAI,OAAO;AACT,QAAK,KAAK,MAAM,MAAM,MAAM;AAC5B,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;AAC9C,QAAK,UAAU,MAAM;AACrB,QAAK,QAAQ,MAAM,QAAQ,EAAE;;;CAIjC,AAAO,UAAU;AACf,SAAO,EACL,GAAG,KAAK,OACT;;;cAjBoB,OAAO"}