@sourceloop/ctrl-plane-subscription-service
Version:
Subscription management microservice for SaaS control plane.
80 lines (67 loc) • 1.39 kB
text/typescript
import {model, property, belongsTo} from '@loopback/repository';
import {UserModifiableEntity} from '@sourceloop/core';
import {BillingCycle} from './billing-cycle.model';
import {Currency} from './currency.model';
({
name: 'plans',
})
export class Plan extends UserModifiableEntity {
({
type: 'string',
id: true,
generated: true,
})
id: string;
({
type: 'string',
description: 'name of the plan',
required: true,
})
name: string;
({
type: 'string',
description: 'description of the plan',
})
description?: string;
({
type: 'string',
required: true,
description: 'Tier of the plan.',
})
tier: string;
({
type: 'string',
description: 'Size of the plan.',
})
size?: string;
({
type: 'number',
required: true,
})
price: number;
({
type: 'object',
name: 'meta_data',
description: 'Meta data of the plan',
})
metaData?: object;
(
() => BillingCycle,
{
keyTo: 'id',
},
{
name: 'billing_cycle_id',
},
)
billingCycleId: string;
(() => Currency, undefined, {
name: 'currency_id',
})
currencyId: string;
constructor(data?: Partial<Plan>) {
super(data);
}
}
export interface PlanRelations {}
export type PlanWithRelations = Plan;