Transações para inserir no banco

 avatar
unknown
json5
3 years ago
5.6 kB
5
Indexable
db.companyrecipients.insertOne(
{
    "uuid" : "a8df5fcb-7040-426e-8649-e7794589b920",
    "enabled" : true,
    "trade_name" : "Primeira Loja de Teste",
    "document" : "1234567890",
    "external_info" : {
        "mundipagg_id" : "",
        "pagarme_id" : ""
    },
    "transfer_processor" : "WOLF",
    "payment_model": "1.0",
    "created_at" : ISODate("2021-03-09T16:54:05.543Z"),
    "updated_at" : ISODate("2021-03-09T16:54:05.543Z")
});

db.transactions.insertMany([
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'ONLINE_PAYMENT',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 9000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'ONLINE_COMMISSION_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'OFFLINE_COMMISSION_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'PROCESSING_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -350,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'ONLINE_COUPON',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'OFFLINE_COUPON',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type:'ONLINE_REFUND',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'OFFLINE_REFUND',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -500,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: 'a8df5fcb-7040-426e-8649-e7794589b920',
   type: 'REMAINING_DEBT',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -5000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 }
]);

db.companyrecipients.insertOne(
{
    "uuid" : "5d44e009-477e-42e3-8443-ea8c66ca858a",
    "enabled" : true,
    "trade_name" : "Segunda Loja de Teste",
    "document" : "0987654321",
    "external_info" : {
        "mundipagg_id" : "",
        "pagarme_id" : ""
    },
    "transfer_processor" : "WOLF",
    "payment_model": "2.0",
    "created_at" : ISODate("2021-03-09T16:54:05.543Z"),
    "updated_at" : ISODate("2021-03-09T16:54:05.543Z")
});

db.transactions.insertMany([
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'ONLINE_PAYMENT',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 9000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'ONLINE_COMMISSION_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'OFFLINE_COMMISSION_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'PROCESSING_FEE',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -350,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'ONLINE_COUPON',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'OFFLINE_COUPON',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: 1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type:'ONLINE_REFUND',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -1000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'OFFLINE_REFUND',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -500,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 },
 {
   company_uuid: '5d44e009-477e-42e3-8443-ea8c66ca858a',
   type: 'REMAINING_DEBT',
   reference: '5f8f3383c8fe89000f2ad028',
   amount: -5000,
   created_at: ISODate('2022-01-13T15:00:00.000Z'),
   settlement_date: ISODate('2022-01-13T15:00:00.000Z')
 }
]);
Editor is loading...