UNPKG

@aptly-as/types

Version:
59 lines (58 loc) 2.08 kB
import { AptlyInquiryParticipantRole, AptlyInquiryStatus, AptlyInquiryType } from '../enums/index.js'; import { AptlySchemaFile } from '../core/index.js'; import { AptlyBaseSchema } from './extends.js'; import { AptlyProductSchema } from './product.js'; import { AptlyUnitSchema } from './unit.js'; import { AptlyOrganizationSchema } from './organization.js'; import { AptlyProjectSchema } from './project.js'; import { AptlyUserSchema } from './user.js'; export type AptlyInquiry = AptlyInquirySchema<string, string>; export interface AptlyInquirySchema<ID, DATE> extends Pick<AptlyBaseSchema<ID, DATE>, '_id' | 'archived'> { _type: AptlyInquiryType; title: string; project: ID | AptlyProjectSchema<ID, DATE>; organization: ID | AptlyOrganizationSchema<ID, DATE>; unit: ID | AptlyUnitSchema<ID, DATE>; order?: ID | null; product?: ID | AptlyProductSchema<ID, DATE>; variant?: ID; producer?: ID; category?: ID; section?: ID; lastMessageSent: DATE; lastMessage: string; lastParticipant?: ID | AptlyUserSchema<ID, DATE>; lastMessageID?: string; lastMessageEmail?: string; status: AptlyInquiryStatus; caseNumber?: string; participants: AptlyInquiryParticipantSchema<ID, DATE>[]; messages: AptlyInquiryMessageSchema<ID, DATE>[]; references?: string; readAdmin?: boolean; readUnit?: boolean; } export type AptlyInquiryParticipant = AptlyInquiryParticipantSchema<string, string>; export interface AptlyInquiryParticipantSchema<ID, DATE> { _id: ID; user?: ID | AptlyUserSchema<ID, DATE>; email?: string; role: AptlyInquiryParticipantRole; readAll: boolean; } export type AptlyInquiryMessage = AptlyInquiryMessageSchema<string, string>; export interface AptlyInquiryMessageSchema<ID, DATE> { _id: ID; message: string; bodyHtml?: string; images?: string[]; files: AptlySchemaFile<ID>[]; author?: ID | AptlyUserSchema<ID, DATE>; email?: string; sentTime: DATE; read: { user: ID; readTime: DATE; }[]; messageId?: string; }