41 lines
779 B
TypeScript
41 lines
779 B
TypeScript
import { ObjectId } from "mongodb";
|
|
|
|
/** Bill basic data */
|
|
export interface LocationBase {
|
|
name: string;
|
|
/** the value is encoded as yyyymm (i.e. 202301) */
|
|
yearMonth: number;
|
|
};
|
|
|
|
|
|
/** bill object in the form returned by MongoDB */
|
|
export interface MongoLocation {
|
|
_id: ObjectId;
|
|
bills: MongoBill[];
|
|
};
|
|
|
|
/** plain-object Location version */
|
|
export interface PlainLocation {
|
|
id: string;
|
|
bills: PlainBill[];
|
|
};
|
|
|
|
|
|
/** Bill basic data */
|
|
export interface BillBase {
|
|
name: string;
|
|
paid: boolean;
|
|
document?: string|null;
|
|
};
|
|
|
|
/** bill object in the form returned by MongoDB */
|
|
export interface MongoBill extends BillBase {
|
|
_id: ObjectId;
|
|
};
|
|
|
|
|
|
/** plain-object bill version */
|
|
export interface PlainBill extends BillBase {
|
|
id: string;
|
|
};
|