@grouparoo/core
Version:
The Grouparoo Core
66 lines (55 loc) • 1.37 kB
text/typescript
import {
Table,
Column,
AllowNull,
ForeignKey,
BelongsTo,
Length,
BeforeSave,
} from "sequelize-typescript";
import { Op } from "sequelize";
import { Property } from "./Property";
import { Destination } from "./Destination";
import { Source } from "./Source";
import { APIData } from "../modules/apiData";
import { CommonModel } from "../classes/commonModel";
export class Mapping extends CommonModel<Mapping> {
idPrefix() {
return "map";
}
ownerId: string;
ownerType: string;
propertyId: string;
remoteKey: string;
destination: Destination;
source: Source;
property: Property;
uniqueIdentifier = ["ownerId", "ownerType", "remoteKey"];
async apiData() {
return {
id: this.id,
ownerId: this.ownerId,
ownerType: this.ownerType,
propertyId: this.propertyId,
remoteKey: this.remoteKey,
createdAt: APIData.formatDate(this.createdAt),
updatedAt: APIData.formatDate(this.updatedAt),
};
}
}