Rework Attachments as a bag (#193)

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov
2021-09-15 19:03:34 +02:00
committed by GitHub
parent 74d46558f1
commit bf9f479500
27 changed files with 923 additions and 833 deletions
+2 -1
View File
@@ -17,7 +17,7 @@ import { Builder } from '@anticrm/model'
import core from './component'
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core'
import { TSpace, TAccount, TState } from './security'
import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD } from './tx'
import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD, TTxPutBag } from './tx'
export * from './core'
export * from './security'
@@ -33,6 +33,7 @@ export function createModel (builder: Builder): void {
TTx,
TTxCUD,
TTxCreateDoc,
TTxPutBag,
TTxMixin,
TTxUpdateDoc,
TSpace,
+10 -1
View File
@@ -27,7 +27,9 @@ import type {
TxUpdateDoc,
TxMixin,
Mixin,
ExtendedAttributes
ExtendedAttributes,
PropertyType,
TxPutBag
} from '@anticrm/core'
import { DOMAIN_TX } from '@anticrm/core'
import { Model } from '@anticrm/model'
@@ -52,6 +54,13 @@ export class TTxCreateDoc<T extends Doc> extends TTxCUD<T> implements TxCreateDo
attributes!: Data<T>
}
@Model(core.class.TxPutBag, core.class.TxCUD)
export class TTxPutBag<T extends PropertyType> extends TTxCUD<Doc> implements TxPutBag<T> {
bag!: string
key!: string
value!: T
}
@Model(core.class.TxMixin, core.class.TxCUD)
export class TTxMixin<D extends Doc, M extends D> extends TTxCUD<D> implements TxMixin<D, M> {
mixin!: Ref<Mixin<M>>