import { ICustomer } from './customer.types'; import { IPlansResponseSchema } from './plans.types'; import { IFeatures, IProductPricingResponseSchema, IProductResponseSchema } from './products.types'; import { ITag } from './tags.types'; export declare enum ERenewalPolicyV2 { defaultContract = "renew_with_default_contract", existing = "renew_with_existing", do_not_renew = "do_not_renew" } export declare enum EContractV2FilterStatus { DRAFT = "draft", ACTIVE = "active", EXPIRED = "expired" } export declare enum EContractV2Status { DRAFT = "draft", ACTIVE = "active", PAUSED = "paused", EXPIRED = "expired", DISPUTED = "disputed" } export declare enum EPhaseParent { CONTRACT = "contract", PLAN = "plan" } export declare enum EUnpauseExtensionPolicy { OVERLAP = "overlap", EXTEND = "extend" } export declare enum EPhaseType { Active = "active", Paused = "pause", Trial = "trial" } export type IContractV2Base = { name: string; description?: string; tags?: string[]; status: EContractV2Status; customer_id: string; plan_id?: string; start_date: string; end_date?: string; currency: string; invoice_generation_offset?: number; anchor_date: string; renewal_policy?: ERenewalPolicyV2; contract_link: string | null; bill_parent_customer?: boolean; source?: object; }; export type IPhaseBase = { name?: string; description?: string; start_date: string; end_date?: string; source_plan_phase_id?: string; features: IFeatures | null; phase_type: EPhaseType; }; export type IPricingBase = { start_date: string; end_date?: string; pricing_id: string; product_id: string; }; export type IContractV2Request = { phases?: IPhaseRequest[]; } & IContractV2Base; export type IPhaseRequest = { pricings?: IPricingRequest[]; } & IPhaseBase; export type IPricingRequest = { product?: IProductResponseSchema; pricing?: IProductPricingResponseSchema; } & IPricingBase; export type IContractV2ForList = { customer: ICustomer; id: string; created_at: string; updated_at: string; } & IContractV2Base; export type IContractV2List = { next?: string; previous?: string; total_count: number; results: IContractV2ForList[]; }; export type IContractV2Response = { current_phase?: ICurrentPhase; phases?: IPhaseResponse[]; } & IContractV2ForList; export type IPhaseResponse = { id: string; contract_id: string; created_at: string; updated_at: string; pricings?: IPricingResponse[]; phase_metadata: null | IPhaseMetadata; } & IPhaseBase; export type IPricingResponse = { phase_id: string; created_at: string; updated_at: string; product: IProductResponseSchema; pricing: IProductPricingResponseSchema; } & IPricingBase; export type ICreateContractV2Form = { name: string; description?: string; tags?: string[]; contract_tags?: ITag | null; status: EContractV2Status; customer: ICustomer; plan?: IPlansResponseSchema | null; start_date: string; end_date?: string; currency: string; invoice_generation_offset?: number; anchor_date: string; renewal_policy?: ERenewalPolicyV2; contract_link?: string | null; bill_parent_customer?: boolean; phases: [ { name: string; start_date: string; end_date?: string; } ]; source?: object; custom_attributes: Record; }; export type IContractV2Form = { phases?: Partial[]; plan_id?: string; customer_id?: string; id?: string; current_phase?: ICurrentPhase; } & Omit; export type IPauseContract = { pause_date: string; resume_date: string | null; unpause_extension_policy: EUnpauseExtensionPolicy; pause_phase_id?: string; }; export type IPausePhaseRequest = { start_date: string; end_date: string; unpause_extension_policy: EUnpauseExtensionPolicy; pause_phase_id?: string; }; export type ICurrentPhase = { name: string; start_date: string; end_date: string; id: string; phase_type: EPhaseType; phase_metadata: null | IPhaseMetadata; }; export type IPhaseMetadata = { paused_phase_id: string; unpause_extension_policy: EUnpauseExtensionPolicy; }; export type IContractAmendment = { id: string; created_at: string; contract_id: string; organization_id: string; diff: IContractAmendmentDiff; }; export declare enum EAmendmentDiff { ADDITIONS = "additions", UPDATES = "updates", DELETIONS = "deletions" } export type IContractAmendmentDiff = { id: string; type: EAmendmentEntity; [EAmendmentDiff.UPDATES]: IContractAmendmentUpdate[]; [EAmendmentDiff.ADDITIONS]: IContractAmendmentAddition[]; [EAmendmentDiff.DELETIONS]: IContractAmendmentDeletion[]; }; export declare enum EAmendmentEntity { PLAN = "Plan", CONTRACT = "Contract", PLAN_PHASE = "PlanPhase", CONTRACT_PHASE = "ContractPhase", PLAN_PHASE_PRICING_ASSOCIATION = "PlanPhasePricingAssociation", CONTRACT_PHASE_PRICING_ASSOCIATION = "ContractPhasePricingAssociation" } export type TContractAmendmentDiffs = IContractAmendmentAddition | IContractAmendmentDeletion | IContractAmendmentUpdate; export type IContractAmendmentAddition = { entity: EAmendmentEntity; id: string; value: any; }; export type IContractAmendmentDeletion = { entity: EAmendmentEntity; id: string; }; export type IContractAmendmentUpdate = { entity: EAmendmentEntity; id: string; field: string; old_value: any; new_value: any; };