fix: package model fixed

This commit is contained in:
hatskier
2022-07-05 01:08:53 +02:00
parent b562e167c5
commit 8d1f601e04
2 changed files with 21 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
name: Deploy to ECR
name: Deploy lambda docker image to AWS ECR Public
on:
push:
@@ -19,7 +19,7 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
aws-region: eu-north-1
- name: Login to Amazon ECR
id: login-ecr

View File

@@ -1,16 +1,31 @@
import mongoose from "mongoose";
import { Price, PriceSchema } from "./price";
import mongoose, { mongo } from "mongoose";
const Schema = mongoose.Schema;
export interface IDataPoint {
symbol: string;
value: any;
}
export interface Package {
timestamp: number;
signature?: string;
liteSignature?: string;
provider: string;
signer: string;
prices: Price[];
prices: IDataPoint[];
}
const DataPointSchema = new Schema<IDataPoint>({
symbol: {
type: String,
required: true,
},
value: {
type: Schema.Types.Mixed,
required: true,
},
});
const PackageSchema = new Schema<Package>({
timestamp: {
type: Number,
@@ -33,7 +48,7 @@ const PackageSchema = new Schema<Package>({
required: false,
},
prices: {
type: [PriceSchema],
type: [DataPointSchema],
required: true,
},
});