implemented bill update

This commit is contained in:
2024-01-04 16:25:22 +01:00
parent 76ddedf652
commit 79dbe04245
4 changed files with 155 additions and 35 deletions

View File

@@ -1,16 +1,40 @@
import { ObjectId } from "mongodb";
export interface Location {
_id: string;
/** Bill basic data */
export interface LocationBase {
name: string;
bills: Bill[];
/** the value is encoded as yyyymm (i.e. 202301) */
yearMonth: number;
};
export interface Bill {
/** 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;
};