diff options
Diffstat (limited to 'src/models/contractor')
-rw-r--r-- | src/models/contractor/contractor.model.ts | 4 | ||||
-rw-r--r-- | src/models/contractor/contractor.schema.ts | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/models/contractor/contractor.model.ts b/src/models/contractor/contractor.model.ts new file mode 100644 index 0000000..32c14f4 --- /dev/null +++ b/src/models/contractor/contractor.model.ts @@ -0,0 +1,4 @@ +import { Model, model } from 'mongoose'; +import { ContractorSchema, contractorSchema } from './contractor.schema'; + +export default model<ContractorSchema, Model<ContractorSchema>>('Contractor', contractorSchema); diff --git a/src/models/contractor/contractor.schema.ts b/src/models/contractor/contractor.schema.ts new file mode 100644 index 0000000..e3f7de6 --- /dev/null +++ b/src/models/contractor/contractor.schema.ts @@ -0,0 +1,18 @@ +import { Document, Schema, Types } from 'mongoose'; + +export interface ContractorSchema extends Document { + name: string; + fullName: string; + vatId: string; + type: string; + debt: number; +} + +export const contractorSchema = new Schema({ + name: String, + fullName: String, + vatId: String, + type: String, + debt: Number +}, { timestamps: true }); + |