echadospalante-domain
Version:
This package contains the core of the echadospalante project, it contains the domain entities, helpers, and other utilities that are shared between the different services.
85 lines (68 loc) • 1.89 kB
text/typescript
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToMany,
ManyToOne,
OneToMany,
OneToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from "typeorm";
import { EventCategoryData } from "./event-category.data";
import { EventContactData } from "./event-contact.data";
import { EventDonationData } from "./event-donation.data";
import { EventLocationData } from "./event-location.data";
import { VentureData } from "./venture.data";
({ name: "venture_event" })
export class VentureEventData {
("uuid")
id: string;
()
title: string;
()
description: string;
()
coverPhoto: string;
({ default: 0 })
donationsCount: number;
({ default: 0 })
totalDonations: number;
({ type: "varchar", unique: true })
slug: string;
(() => VentureData, (venture) => venture.events)
({ name: "ventureId" })
venture?: VentureData;
({ name: "locationId" })
(() => EventLocationData, (eventLocation) => eventLocation.event, {
cascade: true,
eager: true,
})
location: EventLocationData;
({ name: "contactId" })
(() => EventContactData, (eventLocation) => eventLocation.event, {
cascade: true,
})
contact: EventContactData;
(
() => EventCategoryData,
(eventCategory) => eventCategory.events,
{ eager: true }
)
categories: EventCategoryData[];
(() => EventDonationData, (eventDonation) => eventDonation.event)
donations: EventDonationData[];
("jsonb", { nullable: true })
datesAndHours: {
date: string; // Format 'YYYY-MM-DD'
workingRanges: {
start: string; // Format 'HH:mm'
end: string; // Format 'HH:mm'
}[];
}[];
()
createdAt: Date;
()
updatedAt: Date;
}