import { Keys, Extends, PropSelector, Status, Strings, Info, Nullable, } from "@onebro/oba-common"; import { Model, ModelSignature, ModelBaseTypeSig, Stages, ModelMiscReference, StageGuard, IsObjectId, } from "@onebro/oba-mongoose"; import {DocStatuses} from "./00-common"; import { UserProfileAsProp } from "./01-user-profile"; //import {MessageAsProp} from "./05-message"; export type ServiceRequestItem = {feature:string;desc:string;saved:boolean;completed:Nullable;}; export type ServiceRequestNote = {user:string;msg:string;time:Date;} & Info; export type ServiceRequestProps = { _type_:"service-request"; domain:string; type:"contact-us"|"user-access"|"support-ticket"|"admn-task"; category:string; title:string; client:{ id?:IsObjectId; name:string; email:string; phn?:string; }; desc:string; slug:string; dueDate:Date; activity:Status>[]; score:number; parent:ModelMiscReference; admin:UserProfileAsProp[t]; notes:ServiceRequestNote[];//MessageAsProp[t]; items:ServiceRequestItem[]; published:Date; itemCt:number; }; export type ServiceRequestConfigKeys = |"domain"|"type"|"category"|"client"|"desc"|"dueDate"; export type ServiceRequestConfigOptKeys = |"slug"|"admin"|"notes"|"items"|"activity"|"score"|"title"|"parent"; export type ServiceRequestInstanceKeys = ServiceRequestConfigKeys|ServiceRequestConfigOptKeys; export type ServiceRequestJsonKeys = ServiceRequestInstanceKeys|"_type_"|"published"; export type ServiceRequestPreviewKeys = |"domain"|"type"|"category"|"client"|"admin"|"parent"|"title"|"published"|"itemCt"; export type ServiceRequestSelfRefs = {}; export type ServiceRequestMethods = {}; export type ServiceRequestPropKeys = Keys>; export type ServiceRequestPropSelector< t extends Stages, k extends ServiceRequestPropKeys = undefined, j extends ServiceRequestPropKeys = undefined> = PropSelector,k,j>; export type ServiceRequestSignature = ModelSignature< ServiceRequestPropSelector<"C",ServiceRequestConfigKeys,ServiceRequestConfigOptKeys>, ServiceRequestPropSelector<"I",ServiceRequestInstanceKeys> & ServiceRequestMethods, ServiceRequestPropSelector<"J",ServiceRequestJsonKeys>, ServiceRequestPropSelector<"J",ServiceRequestPreviewKeys>, DocStatuses, ServiceRequestSelfRefs>; export type ServiceRequest = Model; export type ServiceRequestAsProp = ModelBaseTypeSig< Extends<[IsArr],[true|1],string[],string>, Extends<[IsArr],[true|1],ServiceRequest["instance"][],ServiceRequest["instance"]>, Extends<[IsArr],[true|1],ServiceRequest["json"][],ServiceRequest["json"]>>;