mockcup

package
v1.29.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Description: This package provides mock data for testing purposes. The mock data is designed to represent Fabriktor models as map[string]interface{} and can be imported across various services to facilitate testing and mocking.

Index

Constants

View Source
const (
	ProductNameKey    = "product_name"
	AppliedTaxesKey   = "applied_taxes"
	QuantityKey       = "quantity"
	QuantifierNameKey = "quantifier_name"
	UnitPriceKey      = "unit_price"
	SubTotalKey       = "sub_total"
	TaxTotalKey       = "tax_total"
	TotalKey          = "total"
	DetailsKey        = "details"

	TotalImplicitSubTotalKey   = "sub_total"
	TotalImplicitTaxDetailsKey = "tax_details"
	TotalImplicitTaxTotalKey   = "tax_total"
	TotalImplicitTotalKey      = "total"

	TaxDetailTaxIDKey    = "tax_id"
	TaxDetailTaxTotalKey = "tax_total"
	TaxDetailTaxNameKey  = "tax_name"

	TaxNameKey          = "name"
	TaxAuthorIDKey      = "author_id"
	TaxDescriptionKey   = "description"
	TaxRateKey          = "rate"
	TaxIDKey            = "tax_id"
	TaxSchemaVersionKey = "schema_version"
	TaxUpdatedAtKey     = "updated_at"
	TaxCreatedAtKey     = "created_at"

	BillIDKey                    = "_id"
	BillSchemaVersionKey         = "schema_version"
	BillUpdatedAtKey             = "updated_at"
	BillCreatedAtKey             = "created_at"
	BillNumberKey                = "number"
	BillStartPeriodKey           = "start_period"
	BillEndPeriodKey             = "end_period"
	BillYearKey                  = "year"
	BillSalaryEntriesKey         = "salary_entries"
	BillTransportationEntriesKey = "transportation_entries"
	BillChargeEntriesKey         = "charge_entries"
	BillSupInvoiceEntriesKey     = "sup_invoice_entries"
	BillSalaryTotalKey           = "salary_total"
	BillTransportationTotalKey   = "transportation_total"
	BillChargeTotalKey           = "charge_total"
	BillSupInvoiceTotalKey       = "sup_invoice_total"
	BillTotalKey                 = "total"
	BillUpfrontKey               = "upfront"
	BillBalanceKey               = "balance"
	BillTitleKey                 = "title"
	BillTypeKey                  = "bill_type"
	BillStartDateKey             = "start_date"
	BillEndDateKey               = "end_date"
	BillAuthorIDKey              = "author_id"
	BillClientIDKey              = "client_id"
	BillWorksiteIDKey            = "worksite_id"
	BillTimezoneKey              = "timezone"
	BillSalaryTaxesKey           = "salary_taxes"
	BillSupInvoiceTaxesKey       = "sup_invoice_taxes"
	BillChargeTaxesKey           = "charge_taxes"
	BillTopNoteKey               = "top_note"
	BillExcludeChargedKey        = "exclude_charged"
	BillIsEstimateKey            = "is_estimate"
	BillIsInternalKey            = "is_internal"
	BillIncludeTransportationKey = "include_transportation"
	BillIncludeSalaryKey         = "include_salary"
	BillIncludeSupInvoiceKey     = "include_sup_invoice"
	BillIncludeChargeKey         = "include_charge"
	BillIsInvoicedKey            = "is_invoiced"
	BillUpfrontRateKey           = "upfront_rate"
)

Define constants for all keys.

Variables

View Source
var BillMock = map[string]interface{}{
	BillIDKey:                    "5f6d4b9b9c6f9f0001b9c6f9",
	BillSchemaVersionKey:         "v1",
	BillUpdatedAtKey:             "2020-10-05T10:00:00Z",
	BillCreatedAtKey:             "2020-10-05T10:00:00Z",
	BillNumberKey:                json.Number("18342394"),
	BillStartPeriodKey:           json.Number("30"),
	BillEndPeriodKey:             json.Number("35"),
	BillYearKey:                  json.Number("2020"),
	BillSalaryEntriesKey:         []map[string]interface{}{SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock, SalaryEntryMock},
	BillTransportationEntriesKey: []map[string]interface{}{SalaryEntryMock, SalaryEntryMock, SalaryEntryMock},
	BillChargeEntriesKey:         []map[string]interface{}{CreditEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock, ChargeEntryMock},
	BillSupInvoiceEntriesKey:     []map[string]interface{}{SupInvoiceEntryMock, SupInvoiceEntryMock, SupInvoiceEntryMock, SupInvoiceEntryMock, SupInvoiceEntryMock},
	BillSalaryTotalKey:           TotalImplicitMock,
	BillTransportationTotalKey:   TotalImplicitMock,
	BillChargeTotalKey:           TotalImplicitMock,
	BillSupInvoiceTotalKey:       TotalImplicitMock,
	BillTotalKey:                 TotalImplicitMock,
	BillUpfrontKey:               json.Number("2000"),
	BillBalanceKey:               json.Number("6000"),
	BillTitleKey:                 "Construction d'un Poulailler de 200 Pieds & 2 Étages",
	BillTypeKey:                  "dynamic",
	BillStartDateKey:             "2020-10-05T14:00:00Z",
	BillEndDateKey:               "2020-10-05T14:00:00Z",
	BillAuthorIDKey:              "5f7b1b9b9b9b9b9b9b9b9b9b",
	BillClientIDKey:              "5f7b1b9b9b9b9b9b9b9b9b9b",
	BillWorksiteIDKey:            "5f7b1b9b9b9b9b9b9b9b9b9b",
	BillTimezoneKey:              "America/New_York",
	BillSalaryTaxesKey:           []map[string]interface{}{TaxMock},
	BillSupInvoiceTaxesKey:       []map[string]interface{}{TaxMock},
	BillChargeTaxesKey:           []map[string]interface{}{TaxMock},
	BillTopNoteKey:               "Ceci est une note.",
	BillExcludeChargedKey:        true,
	BillIsEstimateKey:            false,
	BillIsInternalKey:            true,
	BillIncludeTransportationKey: true,
	BillIncludeSalaryKey:         true,
	BillIncludeSupInvoiceKey:     true,
	BillIncludeChargeKey:         true,
	BillIsInvoicedKey:            true,
	BillUpfrontRateKey:           json.Number("2000"),
}

Mock data for model.Bill.

View Source
var ChargeEntryMock = map[string]interface{}{
	ProductNameKey:    "Clous 2 Pouces",
	AppliedTaxesKey:   []string{"QST", "PST"},
	QuantityKey:       json.Number("1.25"),
	QuantifierNameKey: "Boite 50 Lbs",
	UnitPriceKey:      json.Number("4550"),
	SubTotalKey:       json.Number("10000"),
	TaxTotalKey:       json.Number("1400"),
	TotalKey:          json.Number("11400"),
	DetailsKey:        "",
}

Mock data for charge emb.Entry.

View Source
var CreditEntryMock = map[string]interface{}{
	ProductNameKey:    "Clous 3 Pouces",
	AppliedTaxesKey:   []string{"TPS", "TVQ"},
	QuantityKey:       json.Number("-3.50"),
	QuantifierNameKey: "Boite 50 Lbs",
	UnitPriceKey:      json.Number("4550"),
	SubTotalKey:       json.Number("-100000"),
	TaxTotalKey:       json.Number("-14000"),
	TotalKey:          json.Number("-114000"),
	DetailsKey:        "",
}

Mock data for credit emb.Entry.

View Source
var SalaryEntryMock = map[string]interface{}{
	ProductNameKey:    "Olivier Bernard",
	AppliedTaxesKey:   []string{"TPS", "TVQ"},
	QuantityKey:       json.Number("30.50"),
	QuantifierNameKey: "h",
	UnitPriceKey:      json.Number("6000"),
	SubTotalKey:       json.Number("10000"),
	TaxTotalKey:       json.Number("1400"),
	TotalKey:          json.Number("11400"),
	DetailsKey:        "2021-11-01 / 2021-11-07 (32)",
}

Mock data for the salary emb.Entry.

View Source
var SupInvoiceEntryMock = map[string]interface{}{
	ProductNameKey:    "Les Entreprises Bob Lafortune Inc.",
	AppliedTaxesKey:   []string{"TPS", "TVQ"},
	QuantityKey:       json.Number("1"),
	QuantifierNameKey: "",
	UnitPriceKey:      json.Number("4550"),
	SubTotalKey:       json.Number("10000"),
	TaxTotalKey:       json.Number("1400"),
	TotalKey:          json.Number("11400"),
	DetailsKey:        "",
}

Mock data for supinvoice emb.Entry.

View Source
var TaxDetailMockTPS = map[string]interface{}{
	TaxDetailTaxIDKey:    "5f7b1b9b9b9b9b9b9b9b9b9b",
	TaxDetailTaxTotalKey: json.Number("2450"),
	TaxDetailTaxNameKey:  "TPS",
}

Mock data for emb.TaxDetail.

View Source
var TaxDetailMockTVQ = map[string]interface{}{
	TaxDetailTaxIDKey:    "5f7b1b9b9b9b9b9b9b9b9b9b",
	TaxDetailTaxTotalKey: json.Number("2450"),
	TaxDetailTaxNameKey:  "TVQ",
}

Mock data for emb.TaxDetail.

View Source
var TaxMock = map[string]interface{}{
	TaxNameKey:          "TPS",
	TaxAuthorIDKey:      "5f7b1b9b9b9b9b9b9b9b9b9b",
	TaxDescriptionKey:   "Taxes sur les produits et services",
	TaxRateKey:          json.Number("5000"),
	TaxIDKey:            "5f7b1b9b9b9b9b9b9b9b9b9b",
	TaxSchemaVersionKey: "v1",
	TaxUpdatedAtKey:     "2020-10-05T10:00:00Z",
	TaxCreatedAtKey:     "2020-10-05T10:00:00Z",
}

Mock data for emb.Tax.

Mock data for emb.TotalImplicit.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL